file
stringlengths 13
16
| year
int64 2.02k
2.02k
| label
int64 0
2
| text
stringlengths 33
437k
| page_no
int64 0
152
| bbox
list |
|---|---|---|---|---|---|
sNuFKTMktcY.pdf
| 2,022
| 0
|
LINEBREAK active hierarchical exploration with stable subgoal representation learning LINEBREAK siyuan li†, jin zhang†, jianhao wang†, yang yu‡, chongjie zhang† †tsinghua university, ‡nanjing university {sy-li17,jin-zhan20,wjh19}@mails.tsinghua.edu.cn {yuy}@lamda.nju.edu.cn, [email protected] LINEBREAK abstract LINEBREAK goal-conditioned hierarchical learning (gchrl) provides a reinforcement promising approach to solving long-horizon tasks. recently, its success has been extended to more general settings by concurrently learning hierarchical policies and subgoal representations. although gchrl possesses superior exploration ability by decomposing tasks via subgoals, existing gchrl methods struggle in temporally extended tasks with sparse external rewards, since the high-level policy learning relies on external rewards. as the high-level policy selects subgoals in an online learned representation space, the dynamic change of the subgoal space severely hinders effective high-level exploration. in this paper, we propose a novel regularization that contributes to both stable and efficient subgoal representation learning. building upon the stable representation, we design measures of novelty and potential for subgoals, and develop an active hierarchical exploration strategy that seeks out new promising subgoals and states without intrinsic rewards. experimental results show that our approach significantly outperforms state-of-the-art baselines in continuous control tasks with sparse rewards. LINEBREAK introduction LINEBREAK goal-conditioned hierarchical reinforcement learning (gchrl) has long demonstrated great potential to solve temporally extended tasks (dayan & hinton, 1993; schmidhuber & wahnsiedler, 1993; vezhnevets et al., 2017; p´er´e et al., 2018; nair & finn, 2019), where a high-level policy periodically sets subgoals to a low-level policy, and the low-level policy is intrinsically rewarded for reaching those subgoals. early gchrl studies used a hand-designed subgoal space, such as positions of robots (nachum et al., 2018; levy et al., 2019) or objects in images (kulkarni et al., 2016a). to alleviate the dependency on domain-specific knowledge, recent works investigate learning subgoal representations along with hierarchical policies (nachum et al., 2019a; dilokthanakul et al., 2019; li et al., 2021), which have shown promise in a more general setting. although the exploration ability of hrl is boosted via decomposing tasks and reusing low-level policies, existing gchrl methods struggle in long-horizon tasks with sparse external rewards. the high-level policy learning in gchrl relies on external rewards, and those tasks are hard to solve with naive high-level exploration strategies. furthermore, as the high-level policy makes decisions in a latent subgoal space learned simultaneously with the hierarchical policy, the instability of the online-learned subgoal space results in severe non-stationarity of the high-level state transition function and hinders effective high-level exploration. LINEBREAK to address these challenges, we develop an active hierarchical exploration approach with stable subgoal representation learning (hess). our approach adopts a contrastive objective for subgoal representation learning inspired by li et al. (2021). to learn a subgoal space that could effectively guide hierarchical exploration, we propose a novel state-specific regularization that contributes to both stable and efficient subgoal representation learning. the proposed regularization constrains the changes for those embeddings that have already well satisfied the representation learning objective. as the hierarchical agent gradually expands its exploration to new state regions, the regularization allows for updates of the embeddings that underfit the learning objective. benefiting from the proposed regularization, we could improve the representation learning efficiency without hurting its LINEBREAK stability via the prioritized sampling technique (hinton, 2007), which prioritizes training samples with larger losses. LINEBREAK building upon our stable subgoal representation learning, we design an active exploration strategy for high-level policy learning. as shown in previous work (strehl & littman, 2008; bellemare et al., 2016; ostrovski et al., 2017), the visit count provides a simple and effective novelty measure for exploration. however, with online subgoal representation learning, the visit count for subgoals is defined in a changing space. therefore, such a novelty measure alone is not sufficient for efficient high-level exploration, although the stability regularization could improve its accuracy. our insight is that desirable novel subgoals should be reachable and effectively guide the agent to unexplored areas. thus we design a novel potential measure to regularize the novelty measure, which indicates the reachability to the neighbor regions of the visited state embeddings. with the regularized novelty measure, our proposed active exploration strategy directly selects state embeddings with high potential and novelty as subgoals without introducing intrinsic rewards. it is more efficient than the reactive exploration methods that need to learn how to maximize the intrinsic rewards before performing exploratory behaviors (tang et al., 2017; pathak et al., 2017; burda et al., 2018), since in the active exploration approach, the subgoal measures have direct effects on the behavior policy. furthermore, the active exploration strategy naturally avoid introducing additional non-stationarity (i.e., induced by dynamically changing intrinsic rewards) into hrl. LINEBREAK we compare the proposed method hess with state-of-the-art baselines in a number of difficult control tasks with sparse rewards. note that the environment setting in this paper is much more challenging to exploration than the multi-task and deceptive dense-reward ones in the baselines. experimental results demonstrate that hess significantly outperforms existing baselines. in addition, we perform multiple ablations illustrating the importance of the various components of hess. LINEBREAK background LINEBREAK we consider a markov decision process (mdp) defined as a tuple (s, a, p, r, γ), where s is a state space, a is an action space, p (s(cid:48)|s, a) is an unknown transition function, r : s × a → r is a reward function, and γ ∈ [0, 1) is a discount factor. let π(a|s) denote a stochastic policy over actions given states. the objective of reinforcement learning (rl) is to learn a policy that maximizes the expected cumulative discounted rewards: maxπ ep,π[(cid:80)t t=0 γtr(st, at)], where t denotes the horizon length. LINEBREAK figure 1: the hierarchical framework of gchrl. LINEBREAK in gchrl, a two-level hierarchical policy πhier is composed of a high-level policy πh(gt|st) and a low-level policy πl(at|sl t, gt), as illustrated in figure 1. a latent subgoal space g is abstracted by a representation function φ(s) : s → rd. the high-level policy πh samples a subgoal gt from a neighborhood ∆(φ(st)) of the current latent state φ(st) every c steps, i.e., when t ≡ 0 (mod c): ∆(φ(st)) = {gt ∈ g(cid:12) (cid:12)d(gt, φ(st)) ≤ rg}, where c is a fixed constant, d is a distance function, and rg is a radius of the neighborhood. the sampled subgoal is repeated, gt = gt−1, when t (cid:54)≡ 0 (mod c). πh is trained to optimize the expected extrinsic rewards. the low-level controller takes a primitive action at ∈ a every step, and is intrinsically rewarded to reach subgoals set by the high level, rl t = −d(gt, φ(st)). to provide dense non-zero rewards for low-level policy learning, we employ l2 distance as d. furthermore, to keep the low-level reward function rl stationary while learning φ, we concatenate states and state embeddings together as the low-level states, sl = s||φ(s). previous work (li et al., 2021) minimizes a contrastive triplet loss ltri to learn φ(s), where positive LINEBREAK pairs are adjacent states in trajectories, and negative pairs are states c steps apart. LINEBREAK ltri(st, st+1, st+c) = ||φ(st) − φ(st+1)||2 + max(0, δ − ||φ(st) − φ(st+c)||2), LINEBREAK where δ is a margin parameter. in this work, we also adopt the contrastive loss in equation 1. LINEBREAK method LINEBREAK in gchrl, the low-level policy is optimized with intrinsic rewards generated by subgoals, but external rewards for the high level are still sparse and hard to explore. furthermore, the changing subgoal space makes it even more challenging for high-level exploration. in this section, we first present a novel regularization that contributes to stable and efficient subgoal representation learning, and then introduce two measures for subgoals, novelty and potential. finally, we design an active hierarchical exploration strategy based on these two measures. LINEBREAK stable subgoal representation learning LINEBREAK both stability and efficiency are crucial to subgoal representation learning. the stability of subgoal representation contributes to the stationarity of both the high-level transition function and the low-level reward function. meanwhile, a fast learned subgoal representation could provide effective guidance to exploration. however, stability seems at odds with efficiency, e.g., training neural networks with smaller learning rates leads to better stability but is slower (goodfellow et al., 2016). in this subsection, we develop a novel state-specific regularization that resolves the stability-efficiency dilemma in subgoal representation learning. LINEBREAK to achieve stable representation learning, we propose a regularization ls which restricts the representation change during each update. ls works by anchoring the current representation φ(s) to the old subgoal representation φold(s) before the update as follows: LINEBREAK ls = es∼b[λ(s)||φ(s) − φold(s)||2], LINEBREAK where b is a replay buffer, and λ(s) is a function that controls the weight of regularization for different states. states with smaller representation losses fit the learning objective well, so λ(s) should be larger for those states. in practice, before each representation update, we rank the triplets in the buffer with ltri(st, st+1, st+c). for the top k% of the triplets with the minimum representation losses, we set λ(s) = λ0 > 0 for the anchor states (st) in these triplets, and for the other states, λ(s) = 0. LINEBREAK the stability regularization enables us to use prioritized sampling (hinton, 2007) to improve representation learning efficiency without hurting its stability. the overall loss for subgoal representation learning is: LINEBREAK lφ = e(st,st+1,st+c)∼bp [ltri(st, st+1, st+c)] + ls, (3) where bp is a prioritized replay buffer, and states with larger ltri have higher probabilities of being sampled for training. LINEBREAK measures for subgoals LINEBREAK novelty measure: inspired by count-based exploration methods (strehl & littman, 2008; bellemare et al., 2016; ostrovski et al., 2017; tang et al., 2017), we formulate the novelty of subgoals with visit counts. as desirable subgoals should incentivize the agent to explore faraway novel states, we consider both immediate counts n(φ(si)) and expected cumulative counts of future states, and the novelty measure n (φ(si)) is defined as follows: LINEBREAK n (φ(si)) = eπhier [ LINEBREAK γjn(φ(si+jc))]. LINEBREAK in practice, we partition the low-dimensional continuous latent space into discrete cells, i.e., the state embeddings are mapped into cells containing them. by maintaining how many times each cell is visited, we could estimate the visit count n(φ(s)). in practice, the novelty measure is approximated with the data from the replay buffer, and the implementation detail is described in appendix b. LINEBREAK potential measure: with online representation learning, the novelty measure is a mixture of counts in the past and current representation spaces, so it might mislead the exploration, as demonstrated in figure 3. our insight is that desirable novel subgoals should be reachable and effectively guide the agent to unexplored areas. therefore, we design a potential measure for subgoals to regularize the novelty measure. in the following, we first introduce a subgoal generation mechanism, which is involved in the definition of the potential measure. LINEBREAK to guide the low-level controller to reach unexplored states, the subgoals pursued by the low level had better be in unexplored areas as well. therefore, we propose to add some perturbations to the subgoal gt selected from the replay buffer and obtain an imagined subgoal ge, and then pass ge to the low-level policy. to enable ge in an unexplored or less explored area, the perturbation is conducted as extending gt in the direction of gt − φ(st), as illustrated in figure 2. LINEBREAK figure 2: a schematic illustration of the subgoal selection and perturbation. LINEBREAK the imagined subgoal is ge = gt + de(gt − φ(st))/||gt − φ(st)||2, where de denotes an extended distance. as ge is imagined, and may have not been visited before, it could be inherently unreachable due to the transition function of the mdp or online representation learning, e.g., there may be obstacles in navigation tasks. to encourage the agent to explore in promising and reachable directions, we define a measure of potential u (gt) for the selected subgoal gt as the expected negative distance between the ending state φ(st+c) and ge: LINEBREAK u (gt) = est,at,...,st+c[−d(φ(st+c), ge)], where LINEBREAK st ∼ ρh, at ∼ πl(at|sl LINEBREAK t, ge), st+1 ∼ p (st+1|st, at). LINEBREAK ρh is the high-level state distribution under the hierarchical policy πhier. building on (li et al., 2021), the representation learned with the contrastive objective preserves temporal coherence, and the distances between nearby features approximately represent the number of transitions between them (oord et al., 2018). hence, with higher potential u (gt), ge is more reachable, and thus exploring the direction of gt is more promising to expand the explored areas. the potential u (gt) in equation 5 is estimated from the data in buffer as well. to calculate the novelty, we partition the continuous representation space into discrete cells. similarly, we maintain the potential of a cell by averaging the potential of features in that cell, and use the potential of the cell to represent that of the states inside it. LINEBREAK figure 3: visualization of visitation density and potential in the ant maze task. (a) visitation density in the x, y coordinate space of the ant robot. (b) visitation density in the subgoal representation space. (c) feature changes between 0.15m and 0.2m steps for the same batch of states. (d) potential for the sampled state embeddings. (e) combination of novelty and potential in section 3.3. our method selects state embeddings with darker colors as subgoals. LINEBREAK illustrative example: in figure 3(a) and 3(b), we visualize the visitation density at 0.2m steps in the ant maze task in figure 5. the visitation density is the counts normalized by the total number of transitions in the buffer. comparing figure 3(a) to 3(b), we found a mismatch between the density in the x, y coordinate space and the representation space, especially in the red box, since the updated LINEBREAK representation at 0.2m steps has projected the state embeddings to somewhere new, and the feature changes are noted by the black arrows in figure 3(c). furthermore, the counts in frontiers of the latent explored areas would not increase with more exploration, as the online learned representation keeps changing. with the potential measure, we could distinguish the promising novel areas from the unpromising ones, illustrated in figure 3(d). LINEBREAK active exploration strategy LINEBREAK in the reactive exploration methods with intrinsic rewards, the agent needs to learn how to maximize cumulative intrinsic rewards before performing exploratory behaviors. therefore, the effects of intrinsic rewards on behavior policy is indirect. furthermore, the changing intrinsic rewards would introduce additional non-stationarity into hrl. to make the proposed measures directly influence the behavior policy and avoid the non-stationary issue, we develop an active exploration strategy without intrinsic rewards for high-level policy learning. based on the two measures in section 3.2, the proposed exploration strategy selects and explores a novel subgoal gt with high potential, specified as follows: LINEBREAK gt = arg min LINEBREAK φ(s) LINEBREAK subject to LINEBREAK (cid:26) d(φ(s), φ(st)) ≤ rg LINEBREAK s ∈ b, LINEBREAK where st is the current state and α is a scaling factor. to balance these two measures more easily, we normalize future count n (φ(s)) by the total number of transitions in the buffer, and denote it with (cid:101)n (φ(s)). we visualize the proposed exploration incentive in figure 3(e). taking the state embeddings with darker colors as subgoals could lead the agent to expand the explored areas. LINEBREAK algorithm 1 provides the full procedure of the proposed approach, hess. to balance exploration and exploitation, hess probabilistically utilizes the exploration strategy in equation 6 or explores with the learned policy πh (line:5-6), and the probability p is decayed over the course of learning. the representation φ is updated every i episodes (line:13-15) so that φ is stable during the update interval, and the proposed regularization is to maintain the stability before and after the update. LINEBREAK if t ≡ 0 (mod c) then LINEBREAK algorithm 1 hess algorithm 1: initialize: πh(g|s), πl(a|sl, g) and φ(s). 2: for i = 1..num episodes do for t = 0..t − 1 do 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: end if 15: 16: end for 17: return: πh, πl and φ. LINEBREAK end if rt, st+1 ← execute at ∼ πl(·|sl LINEBREAK end for if i ≡ 0 (mod i) then LINEBREAK gt = gt−1 LINEBREAK else LINEBREAK update φ with eq. 3 using m minibatches. LINEBREAK with a probability of p, explore with the strategy in eq. 6. with a probability of 1 − p, sample subgoal gt with learned policy πh. update πh with an off-policy rl method. LINEBREAK t, gt), and update πl with an off-policy rl method. LINEBREAK related work LINEBREAK learning effective subgoal representations has been an important and challenging problem in gchrl (dwiel et al., 2019). previous works have proposed to learn the subgoal representation in an end-to-end manner with policies (vezhnevets et al., 2017; dilokthanakul et al., 2019), or by bounding the sub-optimality of the hierarchical policy (nachum et al., 2019a), or with a learning objective of slow dynamics (li et al., 2021). nevertheless, those methods have not considered the stability of the subgoal representation learning, which results in a non-stationary high-level learning LINEBREAK environment. other prior methods utilize a predefined or pretrained subgoal space (p´er´e et al., 2018; nair & finn, 2019; zhang et al., 2020; ghosh et al., 2018) to keep the stability of the subgoal representation. however, those methods require task-specific human knowledge or extra training data. in this work, we propose a novel regularization to stabilize the subgoal representation learning. specifically, the subgoal representation is learned with a contrastive triplet loss. the contrastive objective is used as an auxiliary representation loss in other rl literature as well (oord et al., 2018; laskin et al., 2020; fortunato et al., 2019). LINEBREAK benefiting from temporally extended exploration, hrl methods have shown better exploration abilities (nachum et al., 2019b). bottom-up hrl works learn a set of diverse skills or options in a self-supervised manner, and use those semantically meaningful low-level skills to explore in downstream tasks (jinnai et al., 2020; co-reyes et al., 2018; eysenbach et al., 2018; sharma et al., 2019; li et al., 2019). nevertheless, the skills produced by those methods may not be required by the downstream tasks, since when learning the skills, the agent knows nothing about the downstream task rewards. in gchrl, zhang et al. (2020) restricted the high-level action space to a k-step adjacent region of the current state to achieve better sample efficiency. r¨oder et al. (2020) aimed at improving high-level exploration via curiosity-driven intrinsic rewards. however, those methods require oracle subgoal spaces designed with prior knowledge. in contrast, hess learns subgoal representations online. li et al. (2021) proposed an hrl approach, lesson, with online subgoal representation learning, and provided theoretical analysis that the learned representation could support efficient exploration. however, without intrinsic rewards at the high level, lesson could hardly solve long-horizon tasks with extremely sparse rewards. this paper improves exploration from an orthogonal perspective from lesson, and develops an active exploration strategy for high-level policy learning. LINEBREAK we propose two measures for subgoals: novelty and potential. the cumulative count in the novelty measure is related to successor features (kulkarni et al., 2016b). previous exploration methods use successor features to propagate the uncertainty of value function (janz et al., 2019) or whether the features occur (machado et al., 2020). in contrast, our method propagates an explicit estimation of the number of feature occurrence through trajectories, which is conducted without function approximation. the potential measure of reachability shares some similarities with empowerment (salge et al., 2014), which is defined as the agent’s control over its environment. by maximizing empowerment (campos et al., 2020; gregor et al., 2016; mohamed & rezende, 2015), an agent could reach more diverse states. unlike empowerment measured by mutual information, the potential measure is formalized with the distances between desired subgoals and achieved latent states. in appendix c, we discuss how hess is related to goal selection strategies in the multi-goal rl domain (schaul et al., 2015). LINEBREAK experiments LINEBREAK we evaluate hess on a set of challenging sparse-reward environments that require a combination of locomotion and object manipulation skills, aiming at answering the following questions: (1) can hess outperform state-of-the-art exploration strategies in sample efficiency and overall performance? (2) can hess learn a stable subgoal representation space efficiently? (3) how important are the various components of the hess agent? (4) what do the subgoals selected by hess look like? (5) how much would the choice of hyper-parameters influence the experimental performance? for better sample efficiency, we utilize an off-policy algorithm, soft actor-critic (sac) (haarnoja et al., 2018), to learn both-level policies. to mitigate the influence of the entropy term of sac on hess, we use sac with automatic entropy tuning. LINEBREAK environment setup LINEBREAK we evaluate on a suite of mujoco (todorov et al., 2012) tasks that are widely used in the hrl community, including ant (or point) maze, ant push, ant fourrooms, cheetah hurdle, cheetah ascending, and two variants with low-resolution image observations. the experiments with image input are labeled ‘images’. to demonstrate the exploration ability of hess, we adapt those tasks to make them more challenging. different from the settings of random start or random goal with dense external rewards (nachum et al., 2018; 2019a; li et al., 2021; zhang et al., 2020), in the tasks used in this work, a simulated robot starts from a fixed position and needs to reach a faraway target position LINEBREAK figure 4: learning curves of the proposed method and baselines on all the tasks. the y axis shows the average success rate in 10 episodes. each line is the mean of 5 runs with shaded regions corresponding to a confidence interval of 95%. all the curves have been smoothed equally for visual clarity. code is available at https://github.com/siyuanlee/hess. with sparse external rewards. furthermore, there is no predefined subgoal space provided. more details about the environments and implementation are available in appendix a and b, respectively. LINEBREAK comparative analysis LINEBREAK we conduct experiments comparing the proposed hierarchical exploration approach to the state-ofthe-art baselines: (1) h-icm (pathak et al., 2017): prediction error in the latent subgoal space as intrinsic rewards to the high level. (2) h-sr (machado et al., 2020): count-based exploration bonus in the high level, and the counts are estimated by the norm of the successor representation. (3) dads (sharma et al., 2019): an unsupervised skill discovery method via predicting dynamics. (4) lesson (li et al., 2021): an gchrl method learning the subgoal representation online using triplet loss, and no intrinsic rewards in the high level. (5) sac (haarnoja et al., 2018): the non-hierarchical base rl algorithm used in this work. LINEBREAK as shown in figure 4, the proposed method substantially outperforms the baselines in all the tasks. the outperformance in the ant fourrooms task is more significant since the maze scale of this task is larger, and the exploration problem is harder. both h-icm and h-sr underperform our method. the dynamic model of the simulated physics engine is relatively easy to fit by neural networks, so the intrinsic rewards of h-icm may vanish before the policies have been learned well. the hsr method estimates visit counts using the (cid:96)1-norm of the successor representation, which is the expected discounted future state occupancies in trajectories. this idea shares some similarities with the cumulative counts in the novelty measure. nevertheless, the successor representation estimates the expected future state occupancy starting from a given state (dayan, 1993), but not the visitation number of the given state, which is less helpful to promote exploration. LINEBREAK when predicting dynamics in the whole observation space, the intrinsic rewards of dads could hardly help the agent learn gait skills that make the robots move. the original paper (sharma et al., 2019) has also demonstrated that without x, y prior, the trajectories generated by a primitive skill have a large variance. we provide a visualization of those skills in appendix d. as a result, the success rates of dads on all the tasks are zero. hence, we omit them from figure 4. lesson uses no intrinsic reward to promote exploration in the high level. even with a good subgoal representation space, it still could not solve those tasks with sparse rewards. the non-hierarchical method sac performs poorly in all the tasks, demonstrating the strength of the hierarchical structures in solving long-horizon tasks with sparse rewards. LINEBREAK visualization of representation learning LINEBREAK we visualize state embeddings of 5 trajectories from the beginning to the end of the ⊃-shape corridor in the ant maze (images) task in figure 6, comparing the representations learned by hess and hess without stability regularization. those representations are all learned from top-down image observations. LINEBREAK hess is able to learn an effective subgoal representation at an early stage. by optimizing the contrastive objective, the euclidean distances in the latent space approximately cor LINEBREAK figure 5: ant maze LINEBREAK figure 6: subgoal representation learning process in the ant maze (images) task. each subfigure contains 2d state embeddings of 5 trajectories in the ⊃-shape maze (red for the start, blue for the end). for larger axis labels, see videos of the representation learning process at https://sites. google.com/view/hess-iclr. LINEBREAK respond to the number of transitions between states in local areas, which provides subgoal-reaching rewards for low-level policies. but globally, the distance could not represent the number of transitions. for example, it requires lots of transitions to move from the start to the goal in the ⊃-shaped maze, but they have not been pushed much away in the latent space, since there is no explicit constraint in the triplet loss for the distance between features more than c timesteps apart. comparing figure 6(a) to figure 6(b), we find that with the stability regularization, when the features have already fitted the learning objective well, their changes are minor afterward. there is almost no change for the red features from 0.25m steps to the end in figure 6(a). LINEBREAK without the stability regularization, all the features are changing dramatically. the non-stationary issue makes high-level policy learning very hard. in figure 6(b), at 0.25m steps (the second subfigure), the high-level agent at the red start should select a subgoal to move upwards. however, at 0.65m steps (the fourth subfigure), selecting a subgoal in the right of the start state is better. LINEBREAK ablative analysis of various components LINEBREAK to understand the importance of various design choices of hess, we conduct ablation studies on the subgoal representation learning and the proposed exploration strategy separately. in the ablation studies of representation learning, we compare hess, hess without stability regularization, and hess without both stability regularization and prioritized sampling, shown by the curves without markers in figure 7. in the tasks with image input, the advantage of stability regularization and prioritized sampling is more substantial, since the representation of image observations is harder to learn. in the tasks with vector input, the subgoal representation has a good generalization ability, so the effect of stability regularization and prioritized sampling becomes less significant. LINEBREAK figure 7: ablation studies of representation learning and the exploration strategy. in the ablation studies of the exploration strategy, we compare hess, hess without the potential measure, replacing cumulative counts n (φ(s)) with immediate counts n(φ(s)), and reactive exploration with high-level intrinsic rewards ri(s) = η1/(cid:112)n (φ(s)) + η2/(cid:112)−u (φ(s)), shown by the curves with markers in figure 7. the potential measure is extremely important, since without it, the subgoals are concentrated on the areas with low counts, but not extendable, like the areas near the corners in figure 8(b). therefore, the success rates without the potential measure are much lower. LINEBREAK with immediate counts n(φ(s)) as the novelty measure, the agent loses a long-term vision to seek out novel subgoals, and only focuses on novel states in its neighborhood. hence, the states near the walls are selected as subgoals more frequently in figure 8(c) than in figure 8(a), but those subgoals are still better for exploration than the subgoals selected without the potential measure. in the ablation study of active exploration, we can see that by actively selecting favorable subgoals, hess has achieved better sample efficiency than the reactive exploration method with intrinsic LINEBREAK figure 8: visualization of the selected subgoals during 10 episodes and their corresponding positions in the x, y space in the ant maze task at 0.25 million timesteps. LINEBREAK rewards, as the reactive method could not immediately seek the novel and promising subgoals even when it has detected them. LINEBREAK ablation studies on hyper-parameter selection LINEBREAK in this section, we set up a set of ablation tests on several hyper-parameters of hess in the ant push (images) task. from figure 9, we can see that most parameters work in a large range. furthermore, we use a single suite of parameters in all the tasks in this paper, which also indicates that the proposed approach is robust to hyper-parameter selection. LINEBREAK figure 9: ablation studies of hyper-parameter selection in the ant push (images) task. LINEBREAK scaling factor α balances novelty and potential. smaller α encourages hess to choose more novel state embeddings as subgoals. results in figure 9 (a) indicate that hess is robust against α, since the proposed method could work well, when the potential measure mitigates the negative influence of novelty inaccuracy on exploration. for all tasks in section 5.2, we set α = 0.03. LINEBREAK extended distance de is the distance between the subgoal selected from the replay buffer and the imagined subgoal ge. to keep ge still near the current latent state, de should be no larger than the radius rg of the neighborhood for selecting subgoals. the performance of hess is reasonable as long as de is not too large, as an excessively large de may cause the subgoal ge pursued by the low level too far away from the current latent state. for all tasks in section 5.2, we set de = 5.0. LINEBREAK stable ratio k%: the stability regularization constrains the changes of the embeddings for k% of the states with the minimum triplet loss in the buffer. when k% is too large, the representation learning efficiency may be slightly affected, which is harmful to the hierarchical policy learning, as indicated in figure 9 (c). for all tasks in section 5.2, we set k% = 0.3, i.e., the regularization is applied to 30% of the data in buffer. LINEBREAK low-level policy length c is an important and common hyper-parameter in hrl. with a larger c, the burden of high-level decision-making is lighter, but low-level policy learning becomes harder. the learning performance is better when c is 20 or 50 with an episode length of 500. among all the hyper-parameters, c seems to influence the performance most. for all tasks and baselines in section 5.2, we set c = 50. LINEBREAK conclusion LINEBREAK to solve long-horizon sparse-reward tasks with gchrl, we design novelty and potential measures for subgoals upon stable subgoal representation learning, and develop a hierarchical exploration strategy that actively seeks out new promising subgoals and states. as the dimension of the subgoal space in this work is low, we employ a naive count estimation method in the representation space. when the dimension of the subgoal space is higher, it would be better to learn a density model (papamakarios et al., 2019), or utilize more advanced count estimation methods, such as kernelbased methods (davis et al., 2011). for the future work, we believe that the idea of stability is general and could be used beyond hrl. for example, maybe many existing techniques in non-deep rl could be applied to representations learned with stability as well. LINEBREAK acknowledgement LINEBREAK this work is supported by science and technology innovation 2030 – “new generation artificial intelligence” major project (no. 2018aaa0100904) and national natural science foundation of china (no. 20211300509). LINEBREAK reproducibility statement LINEBREAK for reproducibility, we include an anonymous downloadable source code in the supplementary material. beyond that, we describe the details about the environments and the implementation in appendix a and b. LINEBREAK references LINEBREAK marc g bellemare, sriram srinivasan, georg ostrovski, tom schaul, david saxton, and arxiv preprint LINEBREAK remi munos. unifying count-based exploration and intrinsic motivation. arxiv:1606.01868, 2016. LINEBREAK yuri burda, harri edwards, deepak pathak, amos storkey, trevor darrell, and alexei a efros. LINEBREAK large-scale study of curiosity-driven learning. arxiv preprint arxiv:1808.04355, 2018. LINEBREAK v´ıctor campos, alexander trott, caiming xiong, richard socher, xavier giro-i nieto, and jordi torres. explore, discover and learn: unsupervised discovery of state-covering skills. in international conference on machine learning, pp. 1317–1327. pmlr, 2020. LINEBREAK john co-reyes, yuxuan liu, abhishek gupta, benjamin eysenbach, pieter abbeel, and sergey levine. self-consistent trajectory autoencoder: hierarchical reinforcement learning with trajecin international conference on machine learning, pp. 1009–1018. pmlr, tory embeddings. 2018. LINEBREAK richard a davis, keh-shin lii, and dimitris n politis. remarks on some nonparametric estimates LINEBREAK of a density function. in selected works of murray rosenblatt, pp. 95–100. springer, 2011. LINEBREAK peter dayan. improving generalization for temporal difference learning: the successor representa LINEBREAK peter dayan and geoffrey e hinton. feudal reinforcement learning. in advances in neural infor LINEBREAK mation processing systems, pp. 271–278, 1993. LINEBREAK nat dilokthanakul, christos kaplanis, nick pawlowski, and murray shanahan. feature control as ieee transactions on neural net LINEBREAK intrinsic motivation for hierarchical reinforcement learning. works and learning systems, 30(11):3409–3418, 2019. LINEBREAK zach dwiel, madhavun candadai, mariano phielipp, and arjun k bansal. hierarchical policy LINEBREAK learning is sensitive to goal space design. arxiv preprint arxiv:1905.01537, 2019. LINEBREAK benjamin eysenbach, abhishek gupta, julian ibarz, and sergey levine. diversity is all you need: LINEBREAK learning skills without a reward function. arxiv preprint arxiv:1802.06070, 2018. LINEBREAK carlos florensa, david held, xinyang geng, and pieter abbeel. automatic goal generation for reinforcement learning agents. in international conference on machine learning, pp. 1515–1528. pmlr, 2018. LINEBREAK meire fortunato, melissa tan, ryan faulkner, steven hansen, adri`a puigdom`enech badia, gavin buttimore, charlie deck, joel z leibo, and charles blundell. generalization of reinforcement learners with working and episodic memory. arxiv preprint arxiv:1910.13406, 2019. LINEBREAK dibya ghosh, abhishek gupta, and sergey levine. learning actionable representations with goal LINEBREAK conditioned policies. arxiv preprint arxiv:1811.07819, 2018. LINEBREAK ian goodfellow, yoshua bengio, and aaron courville. deep learning. mit press, 2016. LINEBREAK karol gregor, danilo jimenez rezende, and daan wierstra. variational intrinsic control. arxiv LINEBREAK tuomas haarnoja, aurick zhou, kristian hartikainen, george tucker, sehoon ha, jie tan, vikash kumar, henry zhu, abhishek gupta, pieter abbeel, et al. soft actor-critic algorithms and applications. arxiv preprint arxiv:1812.05905, 2018. LINEBREAK geoffrey e hinton. to recognize shapes, first learn to generate images. progress in brain research, LINEBREAK david janz, jiri hron, przemysław mazur, katja hofmann, jos´e miguel hern´andez-lobato, and sebastian tschiatschek. successor uncertainties: exploration and uncertainty in temporal difference learning. advances in neural information processing systems, 32:4507–4516, 2019.
| 10
|
[
108,
573.8250784,
504.0037874,
605.7556784
] |
f2OYVDyfIB.pdf
| 2,022
| 2
|
LINEBREAK scale efficiently: insights from pre-training and fine-tuning transformers LINEBREAK yi tay∗, mostafa dehghani∗, jinfeng rao, william fedus, samira abnar, hyung won chung, sharan narang, dani yogatama†, ashish vaswani, donald metzler google research & deepmind† {yitay,dehghani}@google.com LINEBREAK abstract LINEBREAK there remain many open questions pertaining to the scaling behaviour of transformer architectures. these scaling decisions and findings can be critical, as training runs often come with an associated computational cost which have both financial and/or environmental impact. the goal of this paper is to present scaling insights from pretraining and finetuning transformers. while kaplan et al. (2020) presents a comprehensive study of the scaling behaviour of transformer language models, the scope is only on the upstream (pretraining) loss. therefore, it is still unclear if these set of findings transfer to downstream task within the context of the pretrain-finetune paradigm. the key findings of this paper are as follows: (1) we show that aside from only the model size, model shape matters for downstream fine-tuning, (2) scaling protocols operate differently at different compute regions, (3) widely adopted t5-base and t5-large sizes are pareto-inefficient. to this end, we present improved scaling protocols whereby our redesigned models achieve similar downstream fine-tuning quality while having 50% fewer parameters and training 40% faster compared to the widely adopted t5-base model. we publicly release over 100 pretrained checkpoints of different t5 configurations to facilitate future research and analysis. LINEBREAK introduction LINEBREAK training transformers incurs both financial and environmental costs (schwartz et al., 2019; patterson et al., 2021). to this end, researchers and practitioners often have to work around fixed compute budgets and figure out the best ways to train their models. in lieu of the rising computation demand for training state-of-the-art transformer (vaswani et al., 2017; devlin et al., 2018; raffel et al., 2019; brown et al., 2020; fedus et al., 2021) models, the goal of this paper is to present insights and lessons from scaling transformers and making them efficient and effective for transfer learning on downstream tasks. LINEBREAK despite the insights offered in scaling laws research (kaplan et al., 2020; hernandez et al., 2021) there remain unresolved questions: should one follow fixed scaling ratios? if not, should one scale by depth? or by width? will scaling experiments on upstream pre-training generalize for downstream transfer? do scaling protocols for small models generalize to larger models? are scaling behaviours similar in all compute regions? we hope the insights presented in this paper can be useful to both practitioners and researchers in informing their scaling decisions. LINEBREAK neural scaling laws (kaplan et al., 2020) is a common resource that many look to for advice on scaling transformer architectures. however, this paper limited its scope to an exhaustive study of upstream cross entropy on language modeling tasks. it is furthermore unclear if findings from (kaplan et al., 2020) will transfer to downstream applications. specifically, kaplan et al. (2020) proposed that the performance of a transformer language model strongly depends on model size and only weakly on its shape. they also argue that many model configurations with the same number of parameters perform similarly regardless of architectural details. our work empirically confirms this on upstream training but finds a distinct discrepancy when considering practical downstream performance – a key insight that we believe is highly important. LINEBREAK ∗equal contribution LINEBREAK to this end, we conduct extensive experiments involving pre-training and fine-tuning over 200 transformer configurations ranging from 5m to 30b parameters. to the best of our knowledge, this is the largest empirical study of practical scaling of transformer to date that considers both upstream and practical downstream transfer. while there have been many proposed scaling protocols for convnets (tan and le, 2019; bello et al., 2021), there is still limited advice on scaling of transformer architectures, apart from (kaplan et al., 2020; li et al., 2020). hence, the key goal of this paper is to distill our experiences and insights with scaling transformer architectures and share them with the broader community. LINEBREAK contributions the overall findings and insights of the paper can be summarized as follows: LINEBREAK • we find that scaling laws may differ in upstream and downstream setups. specifically, contrary to kaplan et al. (2020), we find that downstream performance strongly depends on shape and not only on model size. hence, pretraining performance may not necessarily transfer to downstream applications. (figure 1). LINEBREAK • our findings show that pre-training perplexity can often be a deceiving indicator of downstream quality and therefore model building based on upstream perplexity can be challenging. scaling laws can differ substantially when considering metrics on actual downstream finetuning. (figure 1) LINEBREAK • given that empirical scaling laws differ when considering quality on the downstream, our work investigates the pareto-frontier of transformer configurations in this setup. we find that the canonical model configurations such as t5-base and t5-large sizes (raffel et al., 2019) are relatively inefficient (figure 2). note that these sizes are based off the canonical bert (devlin et al., 2018) base and large sizes. LINEBREAK • we find that scaling strategies differ at different compute regions, i.e., applying same strategies at different compute regions (small vs large) has a different effect on model quality. this has practical implications since finding strategies at small scale might not necessarily transfer or generalize to higher compute regions (section 4.2). LINEBREAK • after extensive empirical exploration of the pareto-frontier of transformer models, we propose a simple but effective scaling strategy which we call the deepnarrow strategy. we show that we are able to obtain model quality on par or better than canonical model sizes (e.g., base) with 50% less parameters and being 40% faster. while we highlight the limitations of this strategy, we also show that this deepnarrow strategy is applicable to all model sizes. (table 4). LINEBREAK • to consider how generalized these scaling strategies are, we conduct additional experiments on vision transformers (vit; dosovitskiy et al., 2020) to verify them in the vision domain. moreover, on top of the 17 glue (wang et al., 2018) / superglue (wang et al., 2019) and squad (rajpurkar et al., 2016) tasks we employed in our extensive study, we verify our findings via additional downstream experiments across 12 diverse language tasks (section .2). LINEBREAK • we release (1) the pre-trained checkpoints for our t5 models with improved scaling protocols and (2) all 100+ model checkpoints, including intermediate training checkpoints to the research community. we believe that this is a treasure trove of data to study the behaviour of large lm pretraining and finetuning especially pertaining to scaling laws. the checkpoints and code will be released at https://github.com/google-research/ google-research/tree/master/scaling_transformers. the checkpoints are now publicly available at our google cloud bucket gs://scenic-bucket/ scaling_explorer/scaling_explorer. more recently, these checkpoints are also now available on huggingface https://huggingface.co/models?other= deep-narrow. LINEBREAK related work LINEBREAK transformers (vaswani et al., 2017) have become ubiquitous in the modern deep learning stack and have seen widespread impact across not only language (devlin et al., 2018; raffel et al., 2019; brown et al., 2020) but also computer vision (dosovitskiy et al., 2020; arnab et al., 2021), reinforcement LINEBREAK table 1: table of model configurations. nl is the number of layers, df f is the size of the mlp, dmodel is the hidden size of the model. dkv is the size of each key-value vector. nh is the number of heads. p is the default model parallelism. LINEBREAK table 2: description of different knobs used in the paper to define scaling operations. LINEBREAK model LINEBREAK tiny mini small base large xl xxl xxxl LINEBREAK nl LINEBREAK df f LINEBREAK dmodel LINEBREAK dkv nh LINEBREAK #params LINEBREAK scaling op description LINEBREAK nl el dl dm kv nh ff sh skv LINEBREAK num. layers num enc. layers num. dec. layers dmodel dkv num. of heads df f shared heads tied key-values LINEBREAK learning (parisotto et al., 2020) and computational biology (senior et al., 2020). to this end, discovering empirical scaling laws of these models is a research area that has garnered considerable interest (kaplan et al., 2020; henighan et al., 2020; hernandez et al., 2021; bahri et al., 2021). LINEBREAK discovering empirical scaling laws that govern neural language model scaling has been a recent subject of keen interest (kaplan et al., 2020; hernandez et al., 2021; bahri et al., 2021). many of these works present scaling laws across a variety of axis such as model size, compute and/or dataset size. it is worth to note that many of these works evaluate on autoregressive language modeling and use cross entropy loss to measure performance (kaplan et al., 2020; hernandez et al., 2021). there are a multitude of interesting findings presented (kaplan et al., 2020) whereby the authors show that performance (loss) scales as a power-law with model size and dataset size. however, one notable claim is that architectural details (e.g., network depth and width) have minimal effects. subsequently, hernandez et al. (2021) builds upon the work of kaplan et al. (2020), evaluating scaling laws for ‘transfer’. to this end, the authors study the effect of dataset scaling on unsupervised transfer learning and finetuning. that said, the experiments of hernandez et al. (2021) are mainly targeted at dataset transfer between two different distributions (language and code) and make the same assumptions as kaplan et al. (2020) about model scaling. in a similar vein, henighan et al. (2020) studied empirical scaling laws for different domains for generative modeling in vision, video and multimodal setups. LINEBREAK there have been increasing demand for training and scaling transformers (shoeybi et al., 2019; raffel et al., 2019; fedus et al., 2021; conneau et al., 2019; lin et al., 2021). despite the benefits from improved performance, there are financial considerations and environmental costs (schwartz et al., 2019; patterson et al., 2021) to training these models. given that every moment spent on hardware accelerators is a cost incurring activity, we believe that research in distilling practical scaling insights and recommendations to be highly crucial (li et al., 2020; kaplan et al., 2020; bello et al., 2021). LINEBREAK notably, the research problem of making transformers efficient have also been tackled from an extensive number of angles such as (but not limited to) distillation (hinton et al., 2015), compression (zafrir et al., 2019), parameter sharing (lan et al., 2019; tay et al., 2019; zhang et al., 2021), efficient attention (tay et al., 2020c; kitaev et al., 2020; choromanski et al., 2020; tay et al., 2020b; ainslie et al., 2020; jaegle et al., 2021), architecture search (so et al., 2019), alternative non transformer-based architectures (tolstikhin et al., 2021; tay et al., 2021a; 2020a; lee-thorp et al., 2021). with so much extensive research into novel techniques to improving the efficiency of transformers, it is surprising that the standard configurations (e.g., base, large) of transformers in bert (devlin et al., 2018) or t5 (raffel et al., 2019) have not been rethought. LINEBREAK methods LINEBREAK this section describes our main experimental setup. LINEBREAK architecture we study a transformer encoder-decoder architecture that uses relative attention based of the t5 architecture (raffel et al., 2019). the choice of adopting seq2seq architec LINEBREAK tures (sutskever et al., 2014) is mainly due to their universality and ability to both subsume encoder (bert-like) and decoder (language) models within an identical framework. moreover, the universality of seq2seq architectures also allow us to fine-tune across a broad range of tasks. our implementation and experiments are performed in mesh tensorflow1 (shazeer et al., 2018) using the default t5 library2. LINEBREAK model configurations we first define eight transformer sizes, i.e., tiny, mini, small, base, large, xl, xxl and xxxl. the small, base, large, xl and xxl corresponds to the canonical t5 sizes that are released in raffel et al. (2019). we use three other sizes as starting points, e.g., tiny and mini since there is a lack of representation of transformers at lower compute regions. LINEBREAK pretraining we pretrain on the colossal cleaned common crawl corpus (c4; raffel et al., 2019). we pre-train encoder-decoder models using the span-based masked language modeling (mlm) objective (fedus et al., 2018; devlin et al., 2018). we pretrain all our models for 219 steps using 16 tpu-v3 chips. for larger models, we run our models with 64 tpu-v3 chips. we use 219 steps since majority of the experiments in (raffel et al., 2019) were conducted in the same fashion. we would also like to emphasize that the official released t5 checkpoints were pretrained on 1t tokens (1 million steps with a batch size of 2048). given that this extended long pretraining setup is infeasible given the number of experiments we would have to run, we opt to follow the standard ablation setup in (raffel et al., 2019) which pretrains on more manageable number of tokens. LINEBREAK downstream tasks we consider a myriad of downstream tasks. in total, we consider 17 tasks. we finetune on a mixture of glue (wang et al., 2018), superglue (wang et al., 2019), squad (rajpurkar et al., 2016) for the key downstream experiment results and report aggregate glue/superglue scores. we believe that an aggregate of 17 tasks in natural language understanding that conmprises of both high-resource and low-resource tasks gives us a good overview of a model’s downstream performance. finetuning is typically performed with 16 tpu-v3 chips. LINEBREAK notation for scaling operators for the remainder of the paper, we use a shortform code for each scaling operator applied on a standard transformer size. for example, nl32-sm refers to scaling small (sm) transformers to 32 layers (nl32). we use el,dl to represent scaling encoder and decoder layers independently, kv to represent scaling each key-value size, dm to represent scaling dmodel. nh to represent modifying the number of heads and ff to represent scaling df f . the initial/standard model sizes are tiny, mini, small, base, large, xl, xxl and xxxl. this is described in table 2. LINEBREAK convention with the exception of figure 1, all charts are plotted with flops as the main compute metric. we use number of params for figure 1 to align with kaplan et al. (2020). all of the downstream results are plot with superglue accuracy (wang et al., 2019) as the y-axis. due to the lack of space, we report charts/plots of other metrics (params of speed) and other tasks (glue or squad) in the supplementary material. all parameter counts also include the embedding parameters. we re-emphasize that it is critical to take into account multiple facets of efficiency and therefore report all three key metrics (flops, throughput/speed and parameter count) in the supplementary material. LINEBREAK model and data parallelism by default, our models are trained across multiple workers via data parallelism. as per convention in the t5 paper, our larger models use the default model parallelism. specifically, this is set to 2 for large models, 8 for xl models and 32 for xxl models. LINEBREAK analysis and results LINEBREAK this section presents our overall findings and key results. LINEBREAK 1https://github.com/tensorflow/mesh 2https://github.com/google-research/text-to-text-transfer-transformer LINEBREAK (a) pre-training scaling LINEBREAK (b) fine-tuning scaling LINEBREAK figure 1: the predictability and unpredictability of pre-training versus fine-tuning. while the upstream pre-training performance measured by negative log-perplexity scales with model size quite independently from the model shape, the downstream performance (superglue (avg) score) does not. this indicates that the shape of models plays an important role on how it performs on the target task and the performance is not merely a function of parameter size. LINEBREAK model shape matters LINEBREAK we extend the results of kaplan et al. (2020) to fine-tuning and present model shape dependence not highlighted in hernandez et al. (2021). kaplan et al. (2020) studies pre-training (upstream) and concludes that performance depends only weakly on model shape, but strongly on model size. hernandez et al. (2021) extends this work to measure an effective data transfer measure when pretraining and then fine-tuning on a python dataset. however, this work does not consider details of model shape, and instead focused on the relative predictability with model scale alone. our work stands in contrasts since we find that model shape matters considerably for downstream fine-tuned performance. LINEBREAK figure 1 shows compute-performance scatter plots for pre-training (left) and fine-tuning (right) over a dozen transformers. the models considered are sampled diversely within a two-order of magnitude band of model scales. we adjust the model shape primarily through depth variations, starting with configurations such as xxxl (33b), xxl (11b), xl (3b) and lg (750m) parameters but have their depths/lengths modified. from figure 1 reveals a strong correlation of the upstream performance with model size, corroborating the neural scaling laws of kaplan et al. (2020). but the strong pre-training correlation largely vanishes when fine-tuning these models on superglue (wang et al., 2019). while we confirm the findings of kaplan et al. (2020) that performance scales strongly dependent on model size but weakly on model shape, we find that model shape (such as depth-scaling) is highly important for downstream transfer – a dimension that is not considered in kaplan et al. (2020). LINEBREAK as a substantiating point and additional context to figure 1, we also show via a counter-example that pretraining perplexity is not indicative of transfer performance, i.e., we explicitly show that a case (in table 3) where a model can have outstanding pre-training perplexity but substantially undeliver when it comes to downstream performance. to the best of our knowledge, while this has been mentioned implicitly in several existing works (narang et al., 2021), this is the first work explicitly shows this point. LINEBREAK zooming in versus zooming out here, one may argue that a general trend (even on downstream) may still exist if we zoom out and cover a very wide range of model sizes (e.g., very tiny to very large). a tiny model is not likely to outperform a very large model no matter how well-configured it might be. our purpose here is not to contradict this general trend but to distinguish between both arguments. we argue that, in practical setups, comparisons between models and scaling decisions are often made when zooming-in and our pairwise comparisons above are not on largely different LINEBREAK table 3: upstream performance does not guarantee downstream performance. example points from figure 1. a model with improved upstream quality (as measured by validation perplexity) can do significantly worse on transfer if the shape setting is not right. hence, pre-training perplexity can be misleading. LINEBREAK name LINEBREAK nl LINEBREAK df f LINEBREAK dmodel LINEBREAK dkv nh LINEBREAK #params LINEBREAK ppl LINEBREAK downstream LINEBREAK (a) t5-small model LINEBREAK (b) t5-base model LINEBREAK (c) t5-large model LINEBREAK figure 2: downstream scaling properties is scale-dependent. the downstream performance on superglue has qualitatively different scaling properties across models sizes. from left to right, we fine-tune model configurations closely matched to t5-small, t5-base and t5-large. LINEBREAK models, rather those that are on the same neighborhood in the size (close in the x-axis). thus, what we claim is that when you zoom in, which is what happen in practice, it is not uncommon to see cases similar to the models in table 3 where taking the upstream perplexity into account may lead to a sub-optimal choice. it is also worth to mention that zoom-ing in on upstream returns very different trends compared to zoom-ing in on downstream results. LINEBREAK scaling behaviour at different compute regions is different
| 5
|
[
108.249,
313.9590784,
430.5163577,
323.9216784
] |
OjPmfr9GkVv.pdf
| 2,022
| 1
|
LINEBREAK enhancing cross-lingual transfer by manifold mixup LINEBREAK huiyun yang1, huadong chen1, hao zhou∗ 1, lei li2 1bytedance ai lab 2university of california, santa barbara {yanghuiyun.11,chenhuadong.howard, zhouhao.nlp}@bytedance.com [email protected] LINEBREAK abstract LINEBREAK based on large-scale pre-trained multilingual representations, recent cross-lingual transfer methods have achieved impressive transfer performances. however, the performance of target languages still lags far behind the source language. in this paper, our analyses indicate such a performance gap is strongly associated with the cross-lingual representation discrepancy. to achieve better cross-lingual transfer performance, we propose the cross-lingual manifold mixup (x-mixup) method, which adaptively calibrates the representation discrepancy and gives compromised representations for target languages. experiments on the xtreme benchmark show x-mixup achieves 1.8% performance gains on multiple text understanding tasks, compared with strong baselines, and reduces the cross-lingual representation discrepancy significantly. LINEBREAK introduction LINEBREAK many natural language processing tasks have shown exciting progress utilizing deep neural models. however, these deep models often heavily rely on sufficient annotation data, which is not the case in the multilingual setting. the fact is that most of the annotation data are collected for popular languages like english and spanish (ponti et al., 2019; joshi et al., 2020), while many long-tail languages could hardly obtain enough annotations for supervised training. as a result, cross-lingual transfer learning (prettenhofer & stein, 2011; wan et al., 2011; ruder et al., 2019) is crucial, transferring knowledge from the annotation-rich source language to low-resource or zero-resource target languages. in this paper, we focus on the zero-resource setting, where labeled data are only available in the source language. LINEBREAK recently, multilingual pre-trained models (conneau & lample, 2019; conneau et al., 2020a; xue et al., 2020) offer an effective way for cross-lingual transfer, which yield a universal embedding space across various languages. such universal representations make it possible to transfer knowledge from the source language to target languages through the embedding space, significantly improving the transfer learning performance (chen et al., 2019; zhou et al., 2019; keung et al., 2019; fang et al., 2020). besides, conneau et al. (2018) proposes translate-train, a simple yet effective crosslingual data augmentation method, which constructs pseudo-training data for each target language via machine translation. although these works have achieved impressive improvements in cross-lingual transfer (hu et al., 2020; ruder et al., 2021), significant performance gaps between the source language and target languages still remain (see table 1). hu et al. (2020) refers to the gap as the cross-lingual transfer gap, a difference between the performance on the source and target languages. LINEBREAK to investigate how the cross-lingual transfer gap emerges, we perform relevant analyses, demonstrating that transfer performance correlates well with the cross-lingual representation discrepancy (see section 3 for details). here the cross-lingual representation discrepancy means the degree of difference between the source and target language representations in the universal embedding space. as shown in figure 1(a), in translate-train, the representation distribution of spanish almost overlaps LINEBREAK ∗corresponding author. code is available at https://github.com/yhy1117/x-mixup. LINEBREAK (a) translate-train LINEBREAK (b) x-mixup LINEBREAK figure 1: representation visualization of four languages: english (en), spanish (es), arabic (ar) and swahili (sw) based on xlm-r. we plot the sentence representation of the xnli test set, which is parallel across 15 languages. we average hidden states of the last layer to get sentence representations and implement the dimensionality reduction by pca. obviously, the cross-lingual representation discrepancies are large in translate-train, but x-mixup reduces the discrepancy significantly. LINEBREAK with english, while arabic shows a certain representation discrepancy compared with english and swahili performs larger discrepancy, where translate-train achieves 88.6 accuracy on english, 85.7 on spanish, 82.2 on arabic and 77.0 on swahili. intuitively, a larger representation discrepancy could lead to a worse cross-lingual transfer performance. LINEBREAK in this paper, we propose the cross-lingual manifold mixup (x-mixup) approach to fill the crosslingual transfer gap. based on our analyses, reducing the cross-lingual representation discrepancy is a promising way to narrow the transfer gap. given the cross-lingual representation discrepancy is hard to remove, x-mixup directly faces the issue and explicitly accommodates the representation discrepancy in the neural networks, by mixing the representation of the source and target languages during training and inference. with x-mixup, the model itself can learn how to escape the discrepancy, which adaptively calibrates the representation discrepancy and gives compromised representations for target languages to achieve better cross-lingual transfer performance. x-mixup is motivated by robust deep learning (vincent et al., 2008), while x-mixup adopts the mixup (zhang et al., 2018) idea to handle the cross-lingual discrepancy. LINEBREAK specifically, x-mixup is designed upon the translate-train approach, faced with the exposure bias (ranzato et al., 2016) problem and data noise problem. during training, the source sequence is a real sentence and the target sequence is a translated one, while situations are opposite during inference. besides, the translated text often introduces some noises due to imperfect machine translation systems. to address them, we further impose the scheduled sampling (bengio et al., 2015) and mixup ratio in x-mixup to handle the distribution shift problem and data noise problem, respectively. LINEBREAK we verify x-mixup on the cross-lingual understanding benchmark xtreme (hu et al., 2020), which includes several understanding tasks and covers 40 languages from diverse language families. experimental results show x-mixup achieves 1.8% performance gains across different tasks and languages, comparing with strong baselines. it also reduces the cross-lingual representation discrepancy significantly, as figure 1(b) shows. LINEBREAK related work LINEBREAK multilingual representation learning recent studies have demonstrated the superiority of largescale pre-trained multilingual representations on downstream tasks. multilingual bert (mbert; devlin et al., 2019) is the first work to extend the monolingual pre-training to the multilingual setting. then, several extensions achieve better cross-lingual performances by introducing more monolingual or parallel data and new pre-training tasks, such as unicoder (huang et al., 2019), xlm-r (conneau et al., 2020a), alm (yang et al., 2020), mmte (siddhant et al., 2020), infoxlm (chi et al., 2020), hictl (wei et al., 2020), ernie-m (ouyang et al., 2020), mt5 (xue et al., 2020), nmt5 (kale LINEBREAK table 1: cross-lingual transfer performances of pos and ner tasks on languages with different data resources or different language families, where there are only labeled training data in english. the data resource refers to the resource of each language utilized in the pre-training process. for the language family, english belongs to the germanic languages, so we divide languages into two types: germanic one and others. results show high-resource languages outperform low-resource ones significantly and languages dissimilar to the source language tend to perform worse. LINEBREAK language type LINEBREAK source LINEBREAK language LINEBREAK mbert LINEBREAK xlm-r LINEBREAK pos ner pos ner LINEBREAK language resource LINEBREAK language family LINEBREAK et al., 2021), amber (hu et al., 2021) and veco (luo et al., 2021). they have been the standard backbones of current cross-lingual transfer methods. LINEBREAK cross-lingual transfer learning cross-lingual transfer learning (prettenhofer & stein, 2011; wan et al., 2011; ruder et al., 2019) aims to transfer knowledge learned from source languages to target languages. according to the type of transfer learning (pan & yang, 2010), previous crosslingual transfer methods can be divided into three categories: instance transfer, parameter transfer, and feature transfer. the cross-lingual transferability improves a lot when engaged with the instance transfer by translation (i.e. translate-train, translate-test) or other cross-lingual data augmentation methods (singh et al., 2019; bornea et al., 2020; qin et al., 2020; zheng et al., 2021). chen et al. (2019) and zhou et al. (2019) focus on the parameter transfer to learn a share-private model architecture. besides, other works implement the feature transfer to learn the language-invariant features by adversarial networks (keung et al., 2019; chen et al., 2019) or re-alignment (libovick´y et al., 2020; zhao et al., 2020). x-mixup utilizes both the instance transfer and feature transfer, which is based on the translate-train data augmentation approach and implements the feature transfer by cross-lingual manifold mixup. LINEBREAK mixup and its variants mixup (zhang et al., 2018) proposes to train models on the linear interpolation at both the input level and label level, which is effective to improve the model robustness and generalization. generally, the interpolated pair is selected randomly. manifold mixup (verma et al., 2019) performs the interpolation in the latent space by conducting the linear combinations of hidden states. previous mixup methods (chen et al., 2020; jindal et al., 2020) focus on the monolingual setting. however, x-mixup focuses on the cross-lingual setting and faces many new challenges (see section 4 for details). besides, in contrast to previous mixup methods, x-mixup mixes the parallel pairs, which share the same semantics across different languages. as a result, the choice of parallel pairs for interpolation can build a smart connection between the source and target languages. LINEBREAK analyses of the cross-lingual transfer performance LINEBREAK in this section1, we concentrate on the cross-lingual transfer performance and find it is strongly associated with the cross-lingual representation discrepancy. firstly, we observe the cross-lingual transfer performance on different target languages and propose an assumption. then we conduct qualitative and quantitative analyses to verify it. LINEBREAK although previous studies (hu et al., 2020; ruder et al., 2021) have shown impressive improvements on cross-lingual transfer, the cross-lingual transfer gap is still pretty large, more than 16 points in hu et al. (2020). furthermore, results in table 1 show the performance of low-resource languages and dissimilar languages fall far behind other languages in cross-lingual transfer tasks. LINEBREAK compared with english, the representations of other languages, especially low-resource languages, are not well-trained (lauscher et al., 2020; wu & dredze, 2020), because high-resource languages dominate the representation learning process, which results in the cross-lingual representation LINEBREAK 1in our analyses, we take english as the source language, and the dissimilar language is the language which LINEBREAK is dissimilar to english. LINEBREAK table 2: spearman’s rank correlation ρ between the cka score and cross-lingual transfer performance on two xtreme tasks, where † denotes training on the source language, and ‡ denotes the translatetrain approach. ∗ denotes the p-value is lower than 0.05. results indicate the correlation is solid. LINEBREAK discrepancy. besides, dissimilar languages often show differences in language characteristics (like vocabulary, word order), which also leads to the representation discrepancy. as a result, we assume that the cross-lingual transfer performance is closely related to the representation discrepancy between the source language and target languages. LINEBREAK following conneau et al. (2020b), we utilize the linear centered kernel alignment (cka; kornblith et al., 2019) score to indicate the cross-lingual representation discrepancy LINEBREAK cka(x, y ) = LINEBREAK where x and y are parallel sequences from the source and target languages, respectively. a higher cka score denotes a smaller cross-lingual representation discrepancy. LINEBREAK to verify our assumption, we perform qualitative and quantitative analyses on the relationship between the cka score and cross-lingual transfer performance. figure 3 in appendix b indicates a higher cka score tends to induce better cross-lingual transfer performance. we also calculate the spearman’s rank correlation between the cka score and the transfer performance in table 2, which shows a strong correlation between them. both the trend and correlation score confirm the crosslingual transfer performance is highly related to the cross-lingual representation discrepancy. LINEBREAK methodology: x-mixup LINEBREAK based on the aforementioned analyses, we believe that reducing the cross-lingual representation discrepancy is the key to filling the cross-lingual transfer gap. in this section, we propose x-mixup to explicitly reduce the representation discrepancy by implementing the manifold mixup between the source language and target language. with x-mixup, the model can adaptively calibrate the representation discrepancy and give compromised representations for target languages. this section will first introduce the overall architecture of x-mixup and its details. after that, the training objectives and inference process will be shown. LINEBREAK overall architecture LINEBREAK figure 2 illustrates the overall architecture of x-mixup. sequences from the source and target languages are first encoded separately. then within the encoder, x-mixup implements the manifold mixup between the paired sequences (original sequence and its translation) within a specific layer, where mixup ratio controls the degree of mixup and scheduled sampling schedules the data sampling process during training. notations we use s to denote the source language and t to denote the target language. hl denotes the hidden states of a sequence in layer l. d denotes the real text data collection and ˜d denotes the translation data collection. for downstream understanding tasks, there are annotation data in the source language dtrain t = (x test t = ( ˜x train ). similarly, through translate-test, we can get pseudo-test data in the source language t ˜dtest s = ( ˜x train s ) and translates train labels ( ˜y train ) from the official xtreme repository, which is in the same setting as baselines. LINEBREAK ) and raw test data in the target language dtest t ). through translate-train, we can get pseudo-training data in the target language ˜dtrain LINEBREAK s ). during training, the scheduled sampling process uses translation data2 ˜dtrain LINEBREAK ) from the source language. note that we use translation data ( ˜x train LINEBREAK , ˜y train t s = ( ˜x test LINEBREAK s = (x train LINEBREAK and ˜x test LINEBREAK , y train s LINEBREAK s LINEBREAK t LINEBREAK t LINEBREAK 2these data are acquired by forward translation (from s to t ) then backward translation (from t to s). LINEBREAK figure 2: the model architecture of x-mixup, where the cross-lingual manifold mixup process is in the green block. note that the manifold mixup process is implemented only in a certain layer (the same layer of both sides), and in other layers the process is omitted. LINEBREAK basic model we use mbert (devlin et al., 2019) or xlm-r (conneau et al., 2020a) as the backbone model. within each layer, there are two sub-layers: the multi-head attention layer and the feed-forward layer3, followed by the residual connection and layer norm. we use the same multi-head attention layer (see details in appendix a.1) as bert (devlin et al., 2019), where inputs are query, key, and value respectively. in layer l + 1, the hidden states of the source sequence xs and target sequence xt are acquired by the multi-head attention s), hl+1 hl+1 s = multihead(hl LINEBREAK t = multihead(hl LINEBREAK t , hl LINEBREAK t , hl LINEBREAK s, hl LINEBREAK s, hl LINEBREAK t ). LINEBREAK manifold mixup to reduce the cross-lingual representation discrepancy, a straightforward idea is to find compromised representations between the source and target languages. it’s difficult to find such representations because of varying degrees of differences across languages, like vocabulary and word order. however, manifold mixup provides an elegant way to get intermediate representations by conducting linear interpolation on hidden states. LINEBREAK to extract target-related information from the source hidden states, the target hidden states are used as the query, and the source hidden states are used as the key and value. this cross-attention process is computed as LINEBREAK t |s = multihead(hl+1 hl+1 LINEBREAK t , hl+1 LINEBREAK s , hl+1 LINEBREAK s ), LINEBREAK which shares parameters with the multi-head attention. the manifold mixup process mixes the target hidden states hl+1 LINEBREAK and the source-aware target hidden states hl+1 LINEBREAK t |s based on the mixup ratio λ LINEBREAK t LINEBREAK ˜hl+1 t = ln(λhl+1 LINEBREAK t |s + (1 − λ)hl+1 t ), LINEBREAK where λ is an instance-level parameter, ranging from 0 to 1, and indicates the degree of manifold mixup. ln denotes the layer norm operation. LINEBREAK mixup ratio the machine translation process may change the original semantics and introduce data noises in varying degrees (castilho et al., 2017; fomicheva et al., 2020). thus we introduce the LINEBREAK 3in this section, the feed-forward layer is omitted for simplification. LINEBREAK translation quality modeling in the mixup process to handle this problem. following fomicheva et al. (2020), we use the entropy of attention weights to measure the translation quality LINEBREAK h(a) = − LINEBREAK i LINEBREAK j LINEBREAK ajilogaji, where aij = softmax( LINEBREAK hti h(cid:62) sj√ n LINEBREAK i is the number of target tokens and j is the number of source tokens. lower entropy implies better cross-lingual alignment and higher translation quality. LINEBREAK to introduce the translation quality modeling into the manifold mixup process, we compute the mixup ratio as λ = λ0 · σ[(h(a) + h(a(cid:62)))w + b], where σ is the sigmoid function, and w , b are trainable parameters. λ0 is the max value of the mixup ratio, which is set to 0.5 in this paper. we consider two-way alignment in the translation quality modeling, i.e. h(a) and h(a(cid:62)). LINEBREAK scheduled sampling the source sequences utilized in training and inference are drawn from different distributions. during training, the source sequence is a real text from dtrain , while during inference, the source sequence is a translation from ˜dtest s . this discrepancy, commonly called the exposure bias, leads to a gap between training and inference. LINEBREAK s LINEBREAK motivated by the scheduled sampling approach (bengio et al., 2015) in nmt, we sample the source sequence dynamically during training. specifically, the source sequence fed into the manifold mixup is either a real text from dtrain LINEBREAK or translation from ˜dtrain LINEBREAK s with a certain probability p LINEBREAK s LINEBREAK p <= p∗, xs ∈ dtrain p > p∗, xs ∈ ˜dtrain where p∗ is decreasing during training to match the situation of inference. we utilize the inverse sigmoid decay (bengio et al., 2015), which decreases p∗ as a function of the index of mini-batch. LINEBREAK s LINEBREAK s LINEBREAK final training objective LINEBREAK the training loss is composed of two parts: the task loss and the consistency loss LINEBREAK + mse(rs, rt ) + kl(ps, pt ) (cid:123)(cid:122) (cid:125) consistency loss LINEBREAK where mse(·) is mean squared error and kl(·) is kullback-leibler divergence. r∗ is the sequence representation4 and p∗ is the predicted probability distribution of downstream tasks. the task loss ltask is the sum of the source language task loss ls weighted by the hyper-parameter α, which is utilized to balance the training process ltask = αls LINEBREAK task and target language one lt LINEBREAK task + (1 − α)lt LINEBREAK task. LINEBREAK task, LINEBREAK for classification, structured prediction, and span extraction tasks, the task loss is the cross-entropy loss (see details in appendix a.2). for structured prediction tasks, it is non-trivial to implement the token-level label mapping across different languages. thus we use the label probability distribution, predicted by the source language task model, as the pseudo-label for training, where tokens and labels are corresponding. LINEBREAK the consistency loss is composed of two parts: the representation consistency loss and the prediction consistency loss. the first loss is a regularization term and provides a way to align representations across different languages (ruder et al., 2019). the second loss is to make better use of the supervision of downstream tasks. it only exists in the classification task, as the translation process does not change the label of this task, while in other tasks, it does. LINEBREAK inference LINEBREAK during inference, the manifold mixup process is the same as training, except for the scheduled sampling process. concretely, for the source language, only translation data are available in the LINEBREAK 4we utilize the mean pooling of the last layer’s hidden states as the sequence representation, which is LINEBREAK independent of the sequence length. LINEBREAK table 3: main results on the xtreme benchmark. † denotes using other data augmentation strategy in addition to machine translation. ‡ denotes results from ruder et al. (2021), which is an updated version of hu et al. (2020). LINEBREAK model LINEBREAK metrics LINEBREAK pair sentence LINEBREAK structured prediction LINEBREAK xnli LINEBREAK paws-x pos LINEBREAK acc LINEBREAK acc LINEBREAK based on xlm-r-large xlm-r (hu et al., 2020) trans-train (wei et al., 2020) filter (fang et al., 2020) xtune (zheng et al., 2021) x-mixup LINEBREAK based on mbert mbert (hu et al., 2020) joint-align (zhao et al., 2020) trans-train (hu et al., 2020) x-mixup LINEBREAK ner LINEBREAK question answering mlqa LINEBREAK xquad LINEBREAK tydiqa LINEBREAK avg. LINEBREAK f1/em LINEBREAK f1/em LINEBREAK f1/em LINEBREAK inference stage, without real data, so we use xs ∈ ˜dtest s . for classification tasks, we synthesize the predictions of both the source and target sequences by taking the mean of the predicted probability distributions as the final prediction. for structured prediction and qa tasks, we only consider the prediction of the target sequence. LINEBREAK experiments
| 6
|
[
108.299,
428.3356768,
200.0834953,
440.2908768
] |
0-EYBhgw80y.pdf
| 2,021
| 1
|
LINEBREAK mopro: webly supervised learning with momentum prototypes LINEBREAK junnan li, caiming xiong, steven c.h. hoi salesforce research {junnan.li,cxiong,shoi}@salesforce.com LINEBREAK abstract LINEBREAK we propose a webly-supervised representation learning method that does not suffer from the annotation unscalability of supervised learning, nor the computation unscalability of self-supervised learning. most existing works on weblysupervised representation learning adopt a vanilla supervised learning method without accounting for the prevalent noise in the training data, whereas most prior methods in learning with label noise are less effective for real-world large-scale noisy data. we propose momentum prototypes (mopro), a simple contrastive learning method that achieves online label noise correction, out-of-distribution sample removal, and representation learning. mopro achieves state-of-the-art performance on webvision, a weakly-labeled noisy dataset. mopro also shows superior performance when the pretrained model is transferred to down-stream image classification and detection tasks. it outperforms the imagenet supervised pretrained model by +10.5 on 1-shot classification on voc, and outperforms the best self-supervised pretrained model by +17.3 when finetuned on 1% of imagenet labeled samples. furthermore, mopro is more robust to distribution shifts. code and pretrained models are available at https://github.com/ salesforce/mopro. LINEBREAK introduction LINEBREAK large-scale datasets with human-annotated labels have revolutionized computer vision. supervised pretraining on imagenet (deng et al., 2009) has been the de facto formula of success for almost all state-of-the-art visual perception models. however, it is extremely labor intensive to manually annotate millions of images, which makes it a non-scalable solution. one alternative to reduce annotation cost is self-supervised representation learning, which leverages unlabeled data. however, self-supervised learning methods (goyal et al., 2019; he et al., 2019; chen et al., 2020a; li et al., 2020b) have yet consistently shown superior performance compared to supervised learning, especially when transferred to downstream tasks with limited labels. LINEBREAK with the help of commercial search engines, photo-sharing websites, and social media platforms, there is near-infinite amount of weakly-labeled images available on the web. several works have exploited the scalable source of web images and demonstrated promising results with weblysupervised representation learning (mahajan et al., 2018; sun et al., 2017; li et al., 2017; kolesnikov et al., 2020). however, there exists two competing claims on whether weakly-labeled noisy datasets lead to worse generalization performance. one claim argues that the effect of noise can be overpowered by the scale of data, and simply applies standard supervised learning method on web datasets (mahajan et al., 2018; sun et al., 2017; li et al., 2017; kolesnikov et al., 2020). the other claim argues that deep models can easily memorize noisy labels, resulting in worse generalization (zhang et al., 2017; ma et al., 2018). in this paper, we show that both claims are partially true. while increasing the size of data does improve the model’s robustness to noise, our method can substantially boost the representation learning performance by addressing noise. LINEBREAK there exists a large body of literature on learning with label noise (jiang et al., 2018; han et al., 2018; guo et al., 2018; tanaka et al., 2018; arazo et al., 2019; li et al., 2020a). however, existing methods have several limitations that make them less effective for webly-supervised representation learning. first, most methods do not consider out-of-distribution (ood) samples, which is a major LINEBREAK figure 1: illustration of the normalized embedding space learned with mopro. samples from the same class gather around their class prototype, whereas ood samples are separated from in-distribution samples. label correction and ood removal are achieved based on a sample’s distance with the prototypes. LINEBREAK source of noise in real-world web datasets. second, many methods perform computation-heavy procedures for noise cleaning (jiang et al., 2018; li et al., 2019; 2020a), or require access to a set of samples with clean labels (vahdat, 2017; veit et al., 2017; lee et al., 2018), which limit their scalability in practice. LINEBREAK we propose a new method for efficient representation learning from weakly-labeled web images. our method is inspired by recent developments in contrastive learning for self-supervised learning (he et al., 2019; chen et al., 2020a; li et al., 2020b) we introduce momentum prototypes (mopro), a simple component which is effective in label noise correction, ood sample removal, and representation learning. a visual explanation of our method is shown in figure 1. we use a deep network to project images into normalized low-dimensional embeddings, and calculate the prototype for a class as the moving-average embedding for clean samples in that class. we train the network such that embeddings are pulled closer to their corresponding prototypes, while pushed away from other prototypes. images with corrupted labels are corrected either as another class or as an ood sample based on their distance to the momentum prototypes. LINEBREAK we experimentally show that: LINEBREAK • mopro achieves state-of-the-art performance on the upstream weakly-supervised learning task. • mopro substantially improves representation learning performance when the pretrained model is transferred to downstream image classification and object detection tasks. for the first time, we show that weakly-supervised representation learning achieves similar performance as supervised representation learning, under the same data and computation budget. with a larger web dataset, mopro outperforms imagenet supervised learning by a large margin. LINEBREAK • mopro learns a more robust and calibrated model that generalizes better to distribution variations. LINEBREAK related work LINEBREAK webly-supervised representation learning LINEBREAK a number of prior works exploit large web datasets for visual representation learning (divvala et al., 2014; chen & gupta, 2015; joulin et al., 2016; mahajan et al., 2018; sun et al., 2017; li et al., 2017; kolesnikov et al., 2020). these datasets contain a considerable amount of noise. approximately 20% of the labels in the jmt-300m dataset (sun et al., 2017) are noisy, whereas 34% of images in the webvision dataset (li et al., 2017) are considered outliers. surprisingly, most prior works have chosen to ignore the noise and applied vanilla supervised method, with the claim that the scale of data can overpower the noise (mahajan et al., 2018; sun et al., 2017; li et al., 2017). however, we show that supervised method cannot fully harvest the power of large-scale weakly-labeled datasets. LINEBREAK our method achieves substantial improvement by addressing noise, and advances the potential of webly-supervised representation learning. LINEBREAK learning with label noise LINEBREAK learning with label noise has been widely studied. some methods require access to a small set of clean samples (xiao et al., 2015; vahdat, 2017; veit et al., 2017; lee et al., 2018; zhang et al., 2020), and other methods assume that no clean labels are available. there exist two major types of approaches. the first type performs label correction using predictions from the network (reed et al., 2015; ma et al., 2018; tanaka et al., 2018; yi & wu, 2019; yang et al., 2020). the second type separates clean samples from corrupted samples, and trains the model on clean samples (han et al., 2018; arazo et al., 2019; jiang et al., 2018; wang et al., 2018; chen et al., 2019; li et al., 2020a). however, existing methods have yet shown promising results for large-scale weakly-supervised representation learning. the main reasons include: (1) most methods do not consider ood samples, which commonly occur in real-world web datasets; (2) most methods are computational-heavy due to co-training (han et al., 2018; li et al., 2020a; jiang et al., 2018; 2020), iterative training (tanaka et al., 2018; yi & wu, 2019; wang et al., 2018; chen et al., 2019), or meta-learning (li et al., 2019; zhang et al., 2019). LINEBREAK different from existing methods, mopro achieves both label correction and ood sample removal on-the-fly with a single step, based on the similarity between an image embedding and the momentum prototypes. mopro also leverages contrastive learning to learn a robust embedding space. LINEBREAK self-supervised representation learning LINEBREAK self-supervised methods have been proposed for representation learning using unlabeled data. the recent developments in self-supervised representation learning can be attributed to contrastive learning. most methods (he et al., 2019; chen et al., 2020a; oord et al., 2018; wu et al., 2018) leverage the task of instance discrimination, where augmented crops from the same source image are enforced to have similar embeddings. prototypical contrastive learning (pcl) (li et al., 2020b) performs clustering to find prototypical embeddings, and enforces an image embedding to be similar to its assigned prototypes. different from pcl, we update prototypes on-the-fly in a weakly-supervised setting, where the momentum prototype of a class is the moving average of clean samples’ embeddings. furthermore, we jointly optimize two contrastive losses and a cross-entropy loss. LINEBREAK current self-supervised representation learning methods are limited in (1) inferior performance in low-shot task adaptation, (2) huge computation cost, and (3) inadequate to harvest larger datasets. we show that weakly-supervised learning with mopro addresses these limitations. LINEBREAK method LINEBREAK in this section, we delineate the details of our method. first, we introduce the components in our representation learning framework. then, we describe the loss functions. finally, we explain the noise correction procedure for label correction and ood sample removal. a pseudo-code of mopro is provided in appendix b. LINEBREAK representation learning framework LINEBREAK our proposed framework consists of the following components. figure 2 gives an illustration. • a noisy training dataset {(xi, yi)}n i=1, where xi is an image and yi ∈ {1, ..., k} is its class label. • a pseudo-label ˆyi for each image xi, which is its corrected label. details for generating the LINEBREAK pseudo-label is explained in sec 3.3. LINEBREAK • an encoder network, which maps an augmented image ˜xi to a representation vector vi ∈ rde. we experiment with resnet-50 (he et al., 2016) as the encoder, where the activations of the final global pooling layer (de = 2048) are used as the representation vector. LINEBREAK • a classifier (a fully-connected layer followed by softmax) which receives the representation vi as LINEBREAK input and outputs class predictions pi. LINEBREAK figure 2: proposed weakly-supervised learning framework. we jointly optimize a prototypical contrastive loss using momentum prototypes, an instance contrastive loss using momentum embeddings, and a cross-entropy loss using pseudo-labels. the pseudo-label for a sample is generated based on its original training label, the model’s prediction, and the sample’s distance to the prototypes. LINEBREAK • a projection network, which maps the representation vi into a low-dimensional embedding zi ∈ rdp (dp = 128). zi is always normalized to the unit sphere. following simclr (chen et al., 2020a), we use a mlp with one hidden layer as the projection network. LINEBREAK • momentum embeddings z(cid:48) LINEBREAK i generated by a momentum encoder. the momentum encoder has the same architecture as the encoder followed by the projection network, and its parameters are the moving-average of the encoder’s and the projection network’s parameters. same as in moco (he et al., 2019), we maintain a queue of momentum embeddings of past samples. LINEBREAK • momentum prototypes c ∈ rdp×k. the momentum prototype of the k-th class, ck, is the LINEBREAK normalized moving-average embedding for samples with pseudo-label ˆyi = k. LINEBREAK contrastive loss LINEBREAK as illustrated in figure 1, we aim to learn an embedding space where samples from the same class gather around its class prototype, while samples from different classes are seperated. we achieve it with two contrastive losses: (1) a prototypical contrastive loss lpro which increases the similarity between an embedding and its corresponding class prototype, (zi, cˆyi ), in contrast to other prototypes; (2) an instance contrastive loss lins which increases the similarity between two embeddings of the same source image, (zi, z(cid:48) i), in contrast to embeddings of other images. specifically, the contrastive losses are defined as: LINEBREAK li LINEBREAK pro = − log LINEBREAK exp(zi · cˆyi/τ ) k=1 exp(zi · ck/τ ) LINEBREAK li LINEBREAK ins = − log LINEBREAK exp(zi · z(cid:48) i/τ ) r=0 exp(zi · z(cid:48) LINEBREAK r/τ ) LINEBREAK where τ is a temperature parameter, and ˆyi is the pseudo-label. we use r negative momentum embeddings to construct the denominator of the instance contrastive loss. LINEBREAK we train the classifier with cross-entropy loss, using pseudo-labels as targets. LINEBREAK we jointly optimize the contrastive losses and the classification loss. the training objective is: LINEBREAK ce = − log(pˆyi li i ) LINEBREAK l = LINEBREAK (li LINEBREAK ce + λproli LINEBREAK pro + λinsli LINEBREAK ins) LINEBREAK for simplicity, we set λpro = λins = 1 for all experiments. LINEBREAK noise correction LINEBREAK we propose a simple yet effective method for online noise correction during training, which cleans label noise and removes ood samples. for each sample, we generate a soft pseudo-label qi by LINEBREAK combining the classifier’s output probability pi with si, a class probability distribution calculated using the sample’s similarity w.r.t the momentum prototypes: LINEBREAK qi = αpi + (1 − α)si, exp(zi · ck/τ ) k=1 exp(zi · ck/τ ) LINEBREAK sk i = LINEBREAK where the combination weight is simply set as α = 0.5 in all experiments. LINEBREAK we convert qi into a hard pseudo-label ˆyi based on the following rules: (1) if the highest score of qi is above certain threshold t , use the class with the highest score as the pseudo-label; (2) otherwise, if the score for the original label yi is higher than uniform probability, use yi as the pseudo-label; (3) otherwise, label it as an ood sample. LINEBREAK ˆyi = LINEBREAK arg maxk qk i yi ood LINEBREAK if maxk qk elseif qyi otherwise. LINEBREAK i > t , i > 1/k, LINEBREAK we remove ood samples from both the cross-entropy loss and the prototypical contrastive loss so that they do not affect class-specific learning, but include them in the instance contrastive loss to further separate them from in-distribution samples. examples of ood images and corrected pseudo-labels are shown in the appendices. LINEBREAK momentum prototypes LINEBREAK for each class k, we calculate its momentum prototype as a moving-average of the normalized embeddings for samples with pseudo-label k. specifically, we update ck by: LINEBREAK ck ← normalize(mck + (1 − m)zi), ∀i ∈ {i | ˆyi = k}, LINEBREAK where normalize(c) = c/ (cid:107)c(cid:107)2. the momentum coefficient m is set 0.999 in our experiments. LINEBREAK experiments LINEBREAK dataset for upstream training LINEBREAK we use the webvision (li et al., 2017) dataset as the noisy training data. it consists of images automatically crawled from google and flickr, using visual concepts from imagenet as queries. we experiment with three versions of webvision with different sizes: (1) webvision-v1.0 contains 2.44m images with the same classes as the imagenet-1k (ilsvrc 2012) dataset; (2) webvisionv0.5 is a randomly sampled subset of webvision-v1.0, which contains the same number of images (1.28m) as imagenet-1k; (3) webvision-v2.0 contains 16m images with 5k classes. LINEBREAK implementation details LINEBREAK we follow standard settings for imagenet training: batch size is 256; total number of epochs is 90; optimizer is sgd with a momentum of 0.9; initial learning rate is 0.1, decayed at 40 and 80 epochs; weight decay is 0.0001. we use resnet-50 (he et al., 2016) as the encoder. for moprospecific hyperparameters, we set τ = 0.1, α = 0.5, t = 0.8 (t = 0.6 for webvision-v2.0). the momentum for both the momentum encoder and momentum prototypes is set as 0.999. the queue to store momentum embeddings has a size of 8192. we apply standard data augmentation (crop and horizontal flip) to the encoder’s input, and stronger data augmentation (color changes in moco (he et al., 2019)) to the momentum encoder’s input. we warm-up the model for 10 epochs by training on all samples with original labels, before applying noise correction. LINEBREAK upstream task performance LINEBREAK in table 1, we compare mopro with existing weakly-supervised learning methods trained on webvision-v1.0, where mopro achieves state-of-the-art performance. since the training dataset LINEBREAK method LINEBREAK architecture LINEBREAK resnet-50 cross-entropy (tu et al., 2020) inceptionresnet-v2 mentornet (jiang et al., 2018) inception-v2 curriculumnet (guo et al., 2018) cleannet (lee et al., 2018) resnet-50 curriculumnet (guo et al., 2018; tu et al., 2020) resnet-50 resnet-50 som (tu et al., 2020) resnet-50 distill (zhang et al., 2020) LINEBREAK cross-entropy (decoupled) mopro (ours) LINEBREAK resnet-50 resnet-50 LINEBREAK webvision LINEBREAK imagenet LINEBREAK top-1 LINEBREAK top-5 LINEBREAK top-1 LINEBREAK top-5 LINEBREAK table 1: comparison with state-of-the-art methods on webvision-v1.0. numbers denote accuracy (%) on the clean webvision-v1.0 validation set and the ilsvrc 2012 validation set. cleannet (lee et al., 2018) and distill (zhang et al., 2020) require data with clean annotations. LINEBREAK has imbalanced number of samples per-class, inspired by kang et al. (2020), we perform the following decoupled training steps to re-balance the classifier: (1) pretrain the model with mopro; (2) perform noise correction on the training data using the pretrained model, following the method in section 3.3; (3) keep the pretrained encoder fixed and finetune the classifier on the cleaned dataset, using square-root data sampling (mahajan et al., 2018) which balances the classes. we retrain the classifier for 15 epochs, using a learning rate of 0.01 which is decayed at 5 and 10 epochs. surprisingly, we also find that a vanilla cross-entropy method with decoupled classifier re-balancing can also achieve competitive performance, outperforming most existing baselines. LINEBREAK transfer learning
| 5
|
[
108.299,
415.9626768,
237.8999467,
427.9178768
] |
ZDaSIkWT-AP.pdf
| 2,022
| 0
|
LINEBREAK case-based reasoning for better generalization in textual reinforcement learning LINEBREAK mattia atzeni ibm research, epfl [email protected] LINEBREAK shehzaad dhuliawala eth zürich [email protected] LINEBREAK keerthiram murugesan ibm research [email protected] LINEBREAK mrinmaya sachan eth zürich [email protected] LINEBREAK abstract LINEBREAK text-based games (tbg) have emerged as promising environments for driving research in grounded language understanding and studying problems like generalization and sample efficiency. several deep reinforcement learning (rl) methods with varying architectures and learning schemes have been proposed for tbgs. however, these methods fail to generalize efficiently, especially under distributional shifts. in a departure from deep rl approaches, in this paper, we propose a general method inspired by case-based reasoning to train agents and generalize out of the training distribution. the case-based reasoner collects instances of positive experiences from the agent’s interaction with the world in the past and later reuses the collected experiences to act efficiently. the method can be applied in conjunction with any existing on-policy neural agent in the literature for tbgs. our experiments show that the proposed approach consistently improves existing methods, obtains good out-of-distribution generalization, and achieves new state-of-the-art results on widely used environments. LINEBREAK introduction LINEBREAK text-based games (tbgs) have emerged as key benchmarks for studying how reinforcement learning (rl) agents can tackle the challenges of grounded language understanding, partial observability, large action spaces, and out-of-distribution generalization (hausknecht et al., 2020; ammanabrolu & riedl, 2019). while we have indeed made some progress on these fronts in recent years (ammanabrolu & hausknecht, 2020; adhikari et al., 2020; murugesan et al., 2021b;a), these agents are still very inefficient and suffer from insufficient generalization to novel environments. as an example, state-of-the-art agents require 5 to 10 times more steps than a human to accomplish even simple household tasks (murugesan et al., 2021b). as the agents are purely neural architectures requiring significant training experience and computation, they fail to efficiently adapt to new environments and use their past experiences to reason in novel situations. this is in stark contrast to human learning which is much more robust, efficient and generalizable (lake et al., 2017). LINEBREAK motivated by this fundamental difference in learning, we propose new agents that rely on case-based reasoning (cbr) (aamodt & plaza, 1994) to efficiently act in the world. cbr draws its foundations in cognitive science (schank, 1983; kolodner, 1983) and mimics the process of solving new tasks based on solutions to previously encountered similar tasks. concretely, we design a general cbr framework that enables an agent to collect instances of past situations which led to a positive reward (known as cases). during decision making, the agent retrieves the case most similar to the current situation and then applies it after appropriately mapping it to the current context. LINEBREAK the cbr agent stores past experiences, along with the actions it performed, in a case memory. in order to efficiently use these stored experiences, the agent should be able to represent relevant contextual information from the state of the game in a compact way, while retaining the property LINEBREAK figure 1: overview of the approach and architecture of the cbr agent. a memory stores actions that have been used in previous interactions. the context of the game is learned from the state knowledge graph using a graph attention mechanism. actions are retrieved from the memory based on this context representation and mapped to the current state. if no valid action is obtained using cbr, the algorithm falls back to a neural agent. LINEBREAK that contexts that require similar actions receive similar representations. we represent the state of the game as a knowledge graph (ammanabrolu & hausknecht, 2020) and we address these challenges by utilizing (a) a seeded message propagation that focuses only on a subset of relevant nodes and (b) vector quantization (ballard, 2000) to efficiently map similar contexts to similar discrete representations. vector quantization allows the model to significantly compress the context representations while retaining their semantics; thereby, allowing for a scalable implementation of cbr in rl settings. an illustration of the framework is shown in figure 1. LINEBREAK our experiments show that cbr can be used to consistently boost the performance of various onpolicy rl agents proposed in the literature for tbgs. we obtain a new state-of-the-art on the textworld commonsense (murugesan et al., 2021b) dataset and we achieve better or comparable scores on 24 of the 33 games in the jericho suite (hausknecht et al., 2020) compared to previous work. we also show that cbr agents are resilient to domain shifts and suffer only marginal drops in performance (6%) on out-of-distribution settings when compared to their counterparts (35%). LINEBREAK preliminaries LINEBREAK text-based games. text-based games (tbgs) provide a challenging environment where an agent can observe the current state of the game and act in the world using only the modality of text. the state of the game is hidden, so tbgs can be modeled as a partially observable markov decision process (pomdp) (s, a, o, t , e, r), where s is the set of states of the environment of the game, a is the natural language action space, o is the set of observations or sequences of words describing the current state, t are the conditional transition probabilities from one state to another, e are the conditional observation probabilities, r : s × a → r is the reward function, which maps a state and action to a scalar reward that the agent receives. LINEBREAK case-based reasoning. case-based reasoning (cbr) is the process of solving new problems based on the solution of previously seen similar problems. generally, cbr assumes access to a memory that stores past problems (known as cases) and their solutions. when a new problem is encountered, cbr will (i) retrieve a similar problem and its solution from memory; (ii) reuse the solution by mapping it to the current problem; (iii) revise the solution by testing it and checking whether it is a viable way to address the new problem; and (iv) retain the solution in memory if the adaptation to the new problem was successful. LINEBREAK case-based reasoning in reinforcement learning LINEBREAK this section introduces our framework inspired by cbr for improving generalization in tbgs. even though we situate our work in tbgs, it serves as a good starting point for applying cbr in more general rl settings. we consider an on-policy rl agent that, at any given time step t, has access to a memory mt, that can be used to retrieve previous experiences. the memory contains LINEBREAK key-value pairs, where the keys are a context representation of a game state and values are actions that were taken by the agent w.r.t to this context. as mentioned in section 2, case-based reasoning can be formalized as a four-step process. we describe our proposed methodology for each step below. algorithm 1 provides a detailed formalization of our approach. LINEBREAK retrieve. given the state of the game st and the valid actions at, we want to retrieve from the memory mt previous experiences that might be useful in decision-making at the current state. to this end, for each admissible action at ∈ at, we define a context selector ct = context(st, at). the context selector is an action-specific representation of the state, namely the portion of the state that is relevant to the execution of an action. we will explain later how the context selector is defined in our implementation. for each context ct, we retrieve from the memory the context-action pair (cm has maximum similarity with ct. we denote as δ = sim(ct, cm t ) ∈ [0, 1] the relevance score given to the retrieved action. only actions am t with a relevance score above a retriever threshold τ are retrieved from mt. we denote as am the final set of action-relevance pairs returned by the retriever, as shown in algorithm 1. LINEBREAK t ), such that cm t LINEBREAK , am LINEBREAK t LINEBREAK t LINEBREAK reuse. the goal of the reuse step is to adapt the actions retrieved from the memory based on the current state. this is accomplished by a reuse function, that is applied to each retrieved action to construct a set ˜at of candidate actions that should be applicable to the current state, each paired with a confidence level. LINEBREAK if any of the action candidates ˜at is revise. a valid action, then the one with the highest relevance δ is executed, otherwise a neural agent π is used to select the best action a(cid:63) t . we denote with rt = r(st, a(cid:63) t ) the obtained reward. note that π can be an existing agent for tbgs (murugesan et al., 2021c;b; ammanabrolu & hausknecht, 2020). LINEBREAK algorithm 1: cbr in text-based rl LINEBREAK • retrieve let ct = {context(st, at) | at ∈ at} be a set of context selectors for state st at time step t am t ← ∅ for ct ∈ ct do , am let (cm t t )∈mt sim(ct, cm t ) arg max(cm let δ = sim(ct, cm t ) if δ > τ then am LINEBREAK t ) = t ,am LINEBREAK t ∪ {(am t LINEBREAK t ← am LINEBREAK end LINEBREAK end LINEBREAK • reuse build a set of action candidates: ˜at = {reuse(am t (am t LINEBREAK , st, δ) | , δ) ∈ am t } LINEBREAK • revise if at ∩ ˜at (cid:54)= ∅ then LINEBREAK let a(cid:63) LINEBREAK t , δ(cid:63) = arg max˜at,δ∈ ˜at LINEBREAK else LINEBREAK a(cid:63) t = arg maxat∈at π(at|st) LINEBREAK end let rt = r(st, a(cid:63) time step t by executing action a(cid:63) t LINEBREAK t ) be the reward obtained at LINEBREAK • retain let c(cid:63) action a(cid:63) t t , a(cid:63) t = {(c(cid:63) if rt > 0 then LINEBREAK t = context(st, a(cid:63) LINEBREAK t ) be the context of LINEBREAK t ), . . . , (c(cid:63) LINEBREAK mt+1 ← mt ∪ retain(t ) LINEBREAK end LINEBREAK retain. finally, the retain step stores successful experiences as new cases in the memory, so that they can be retrieved in the future. in principle, this can be accomplished by storing actions for which the agent obtained positive rewards. however, we found that storing previous actions as well can result in improved performance. therefore, whenever rt > 0, a retain function is used to select which of the past executed actions and their contexts should be stored in the memory. in our experiments, the retain function selects the k most recent actions, but other implementations are possible, as discussed in appendix d. LINEBREAK a cbr policy agent to generalize in text-based games LINEBREAK designing an agent that can act efficiently in tbgs using the described approach poses several challenges. above all, efficient memory use is crucial to making the approach practical and scalable. since the context selectors are used as keys for accessing values in the memory, their representation LINEBREAK needs to be such that contexts where similar actions were taken receive similar representations. at the same time, as the state space is exponential, context representations need to be focused only on relevant portions of the state and they need to be compressed and compact. LINEBREAK representing the context through seeded graph attention LINEBREAK state space as a knowledge graph. following previous works (ammanabrolu & riedl, 2019; ammanabrolu & hausknecht, 2020; murugesan et al., 2021c), we represent the state of the game as a dynamic knowledge graph gt = (vt, rt, et), where a node v ∈ vt represents an entity in the game, r ∈ rt is a relation type, and an edge v r−→ v(cid:48) ∈ et represents a relation of type r ∈ rt between entities v, v(cid:48) ∈ vt. in tbgs, the space of valid actions at can be modeled as a templatebased action space, where actions at are instances of a finite set of templates with a given set of entities, denoted as vat ⊆ vt. as an example, the action “kill orc with sword” can be seen as an instance of the template “kill v1 with v2”, where v1 and v2 are “orc” and “sword” respectively. LINEBREAK seeded graph attention. the state graph gt and the entities vat are provided as input to the agent for each action at ∈ at, in order to build an action-specific contextualized representation of the state. a pre-trained bert model (devlin et al., 2019) is used to get a representation h(0) v ∈ rd for each node v ∈ vt. inspired by sun et al. (2018), we propose a seeded graph attention mechanism (gat), so that the propagation of messages is weighted more for nodes close to the entities vat. let α(l) vu denote the attention coefficients given by a graph attention network (velickovic et al., 2018) at layer l for nodes v, u ∈ vt. then, for each node v ∈ vt, we introduce a coefficient β(l) that scales v with the amount of messages received by node v at layer l: LINEBREAK |vat | 0 LINEBREAK if v ∈ vat otherwise LINEBREAK v + λ LINEBREAK u∈nv LINEBREAK vuβ(l) α(l) u , LINEBREAK where nv denotes the neighbors of v, considering the graph as undirected. note that, at layer l = 1, only the nodes in vat receive messages, whereas for increasing values of l, β(l) v will be non-zero for their (l − 1)-hop neighbors as well. the representation of each v ∈ vt is then updated as: LINEBREAK v = ffn(l) h(l) LINEBREAK h(l−1) v LINEBREAK + β(l) v LINEBREAK vuw(l)h(l−1) α(l) LINEBREAK u LINEBREAK u∈nv LINEBREAK where ffn(l+1) is a 2-layer feed-forward network with relu non-linearity and w(l) ∈ rd×d are learnable parameters. finally, we compute a final continuous contextualized representation cat of the state by summing the linear projections of the hidden representations of each v ∈ vat and passing the result through a further feed-forward network. LINEBREAK memory access through context quantization LINEBREAK given a continuous representation cat of the context, we need an efficient way to access the memory mt to retrieve or store actions based on such a context selector. storing and retrieving based on the continuous representation cat would be impractical for scalability reasons. additionally, since the parameters of the agent change over the training time, the same context would result in several duplicated entries in the memory even with a pre-trained agent over different episodes. LINEBREAK discretization of the context. to address these problems, we propose to use vector quantization (ballard, 2000) before reading or writing to memory. following previous work (chen et al., 2018; sachan, 2020), we learn a discretization function φ : rd → zd k, that maps the continuous representation cat into a k-way d-dimensional code ct ∈ zd k, with |zk| = k (we refer to ct as a kd code). with reference to section 3, then we will use ct = context(st, at) = φ(cat) as the context selector used to access the memory mt. in order to implement the discretization function, we define a set of k key vectors ki ∈ rd, i = 1, . . . , k, and we divide each vector in d partitions kj i ∈ rd/d, j = 1, . . . , d. similarly, we divide cat in d partitions cj ∈ rd/d, j = 1, . . . , d. at then, we compute the j-th code zj of ct by nearest neighbor search, as zj = arg mini (cid:107)cj i (cid:107)2 2. at we use the straight-through estimator (bengio et al., 2013) to address the non differentialbility of the argmin operator. LINEBREAK − kj LINEBREAK memory access. the kd codes introduced above are used to provide a memory-efficient representation of the keys in the memory. then, given the kd code representing the current context selector ct, we query the memory by computing a similarity measure sim(ct, cm t ) between ct and each cm . the context-action pair with the highest similarity is returned as a result of the memory access, together with a relevance score δ representing the value of the similarity measure. LINEBREAK in mt. the similarity function is defined as the fraction of codes shared by ct and cm LINEBREAK t LINEBREAK t LINEBREAK symbolic action reuse and revise policy LINEBREAK we use a simple purely symbolic reuse function to adapt the actions retrieved from the memory to the current state. let ct be the context selector computed based on state st and the entities vat, as explained in sections 4.1 and 4.2. denote with (cm , am t ) the context-action pair retrieved from mt t with confidence δ. then, the reuse function reuse(am , st, δ) constructs the action candidate ˜at as the action with the same template as am applied to the entities vat. if the reuse step cannot generate a valid action, we revert to the neural policy agent π that outputs a probability distribution over the current admissible actions at. LINEBREAK t LINEBREAK t LINEBREAK training LINEBREAK in section 3, we have introduced an on-policy rl agent that relies on case-based reasoning to act in the world efficiently. this agent can be trained in principle using any online rl method. this section discusses the training strategies and learning objectives used in our implementation. LINEBREAK objective. two main portions of the model need to be trained: (a) the retriever, namely the neural network that computes the context representation and accesses the memory through its discretization, and (b) the main neural agent π which is used in the revise step. all agents π used in our experiments are trained with an advantage actor-critic (a2c) method. for optimizing the parameters of π, we use the same learning objectives defined by adolphs & hofmann (2019), as described in appendix a. whenever the executed action a(cid:63) t is not chosen by the model π but it comes from the symbolic reuse step, then we optimize instead an additional objective for the retriever, namely the following contrastive loss (hadsell et al., 2006): LINEBREAK l(t) LINEBREAK r = LINEBREAK (1 − yt)(1 − sim(ct, cm LINEBREAK yt max{0, µ − 1 + sim(ct, cm LINEBREAK where ct denotes the context selector of the action executed at time step t, cm is the corresponding key entry retrieved from mt, µ is the margin parameter of the contrastive loss, and yt = 1 if rt > 0, yt = 0 otherwise. this objective encourages the retriever to produce similar representations for two contexts where reusing an action yielded a positive reward. LINEBREAK t LINEBREAK pretraining. to make learning more stable and allow the agent to act more efficiently, we found it beneficial to pretrain the retriever. this minimizes large shifts in the context representations over the training time. we run a baseline agent (ammanabrolu & hausknecht, 2020) to collect instances of the state graph and actions that yielded positive rewards. then we train the retriever to encode to similar representations the contexts for which similar actions (i.e., actions with the same template) were used. this is achieved using the same contrastive loss defined above. LINEBREAK experiments LINEBREAK this section provides a detailed evaluation of our approach. we assess quantitatively the performance of cbr combined with existing rl approaches and we demonstrate its capability to improve sample efficiency and generalize out of the training distribution. next, we provide qualitative insights and examples of the behavior of the model and we perform an ablation study to understand the role played by the different components of the architecture. LINEBREAK experimental setup LINEBREAK agents. we consider several agents obtained by plugging existing rl methods in the revise step. we first define two simple approaches: cbr-only, where we augment a random policy with the LINEBREAK easy LINEBREAK medium LINEBREAK hard LINEBREAK #steps LINEBREAK norm. score LINEBREAK #steps LINEBREAK norm. score LINEBREAK #steps LINEBREAK norm. score LINEBREAK text tpc kg-a2c bike LINEBREAK cbr-only text + cbr tpc + cbr kg-a2c + cbr bike + cbr LINEBREAK table 1: test-set performance for twc in-distribution games LINEBREAK easy LINEBREAK medium LINEBREAK hard LINEBREAK #steps LINEBREAK norm. score LINEBREAK #steps LINEBREAK norm. score LINEBREAK #steps LINEBREAK norm. score LINEBREAK text tpc kg-a2c bike LINEBREAK cbr-only text + cbr tpc + cbr kg-a2c + cbr bike + cbr LINEBREAK table 2: test-set performance for twc out-of-distribution games LINEBREAK cbr approach, and text + cbr, which relies on the cbr method combined with a simple grubased policy network that consumes as input the textual observation from the game. next, we select three recently proposed tbg approaches: text+commonsense (tpc) (murugesan et al., 2021b), kg-a2c (ammanabrolu & hausknecht, 2020), and bike (murugesan et al., 2021c), to create the tpc + cbr, kg-a2c + cbr and bike + cbr agents. we treat the original agents as baselines. LINEBREAK datasets. we empirically verify the efficacy of our approach on textworld commonsense (twc) (murugesan et al., 2021b) and jericho (hausknecht et al., 2020). jericho is a well-known and challenging learning environment including 33 interactive fiction games. twc is an environment which builds on textworld (côté et al., 2018) and provides a suite of games requiring commonsense knowledge. twc allows agents to be tested on two settings: the in-distribution games, where the objects that the agent encounters in the test set are the same as the objects in the training set, and the out-of-distribution games which have no entity in common with the training set. for each of these settings, twc provides three difficulty levels: easy, medium, and hard. LINEBREAK evaluation metrics. following murugesan et al. (2021b), we evaluate the agents on twc based on the number of steps (#steps) required to achieve the goal (lower is better) and the normalized cumulative reward (norm. score) obtained by the agent (larger is better). on jericho, we follow previous work (hausknecht et al., 2020; guo et al., 2020; ammanabrolu & hausknecht, 2020) and we report the average score achieved over the last 100 training episodes. LINEBREAK results on textworld commonsense LINEBREAK table 1 reports the results on twc for the in-distribution set of games. overall, we observe that cbr consistently improves the performance of all the baselines. the performance boost is large enough that even a simple method as text + cbr outperforms all considered baselines except bike. LINEBREAK out-of-distribution generalization. cbr’s ability to retrieve similar cases should allow our method to better generalize to new and unseen problems. we test this hypothesis on the out-of LINEBREAK figure 2: performance on twc (showing mean and standard deviation averaged over 5 runs) for the three difficulty levels: easy (left), medium (middle), hard (right) using normalized score and number of steps. LINEBREAK distribution games in twc. the results of this experiment are reported in table 2. we notice that all existing approaches fail to generalize out of the training distribution and suffer a substantial drop in performance in this setting. however, when coupled with cbr, the drop is minor (on average 6% with cbr vs 35% without on the hard level). interestingly, even the cbr-only agent achieves competitive results compared to the top-performing baselines. LINEBREAK sample efficiency. another key benefit of our approach comes as better sample efficiency. with its ability to explicitly store prior solutions effectively, cbr allows existing algorithms to learn faster. figure 2 shows the learning curves for our best agents and the corresponding baselines. the plots report the performance of the agent over the training episodes, both in terms of the number of steps and the normalized score. overall, we observe that the cbr agents obtain faster convergence to their counterparts on all difficulty levels. LINEBREAK performance on the jericho games LINEBREAK we evaluate our best performing variant from the experiments on twc (bike + cbr) against existing approaches on the 33 games in the jericho environment. we compare our approach against strong baselines, including tdqn (hausknecht et al., 2020), drrn (he et al., 2016), kg-a2c (ammanabrolu & hausknecht, 2020), mprc-dqn (guo et al., 2020), and rc-dqn (guo et al., 2020). the same experimental setting and handicaps as the baselines are used, as we train for 100 000 steps and we assume access to valid actions. table 3 summarizes the results of the jericho games. we observe that our cbr agent achieves comparable or better performance than any baseline on 24 (73%) of the games, strictly outperforming all the other agents in 18 games. LINEBREAK qualitative analysis and ablation studies LINEBREAK insights on the model. figure 3 provides two examples showing the bike + cbr agent interacting with the zork1 game. in the example on top, the agent retrieves an experience that can be successfully reused and turned into a valid action at the current time step. the heat maps visualize the value of the context similarity function defined in section 4 for the top entries in the memory. in the negative example at the bottom instead, the agent retrieves an action that is not useful and needs to fall back to the neural policy π. figure 4 (top) shows the fraction of times that actions retrieved from the memory are reused successfully in the twc games. we observe that, both for in-distribution and out-of-distribution games, the trained agent relies on cbr from 60% to approximately 70% of the times. figure 4 (bottom) further shows the fraction of times that the neural agent would have been able to select a rewarded action as well, when the cbr reuses a successful action. the plot shows that, for the out-of-distribution games, the neural agent would struggle to select good actions when the cbr is used. LINEBREAK game LINEBREAK 905 acorncourt adventureland afflicted awaken detective dragon inhumane library moonlit omniquest pentari reverb snacktime temple ztuu advent balances deephome gold jewel karn ludicorp yomomma zenon zork1 zork3 anchor enchanter sorcerer spellbrkr spirit tryst205 LINEBREAK best agent LINEBREAK human (max) LINEBREAK human (walkthrough-100) LINEBREAK tdqn LINEBREAK drrn kg-a2c mprc-dqn rc-dqn bike + cbr LINEBREAK table 3: average raw score on the jericho games. we denote with colors the difficulty of the games (green for possible games, yellow for difficult games and red for extreme games). the last row reports the fraction and the absolute number of games where an agent achieves the best score. we additionally report human performance (human – max) and the 100-step results from a human-written walkthrough (human – walkthrough 100). results are taken from the original papers or “−” is used if a result was not reported. LINEBREAK figure 3: examples from the zork1 game, showing the content of the memory and the context similarities, in a situation where the agent is able to reuse a previous experience and in a case where the revise step is needed. LINEBREAK figure 4: fraction of times that a retrieved action is reused successfully on twc (top). fraction of times that the neural agent would have picked a rewarded action when cbr is used successfully (bottom). LINEBREAK ablation studies. in order to understand the role of the main modules of our cbr agent, we designed some ablation studies. first, instead of using the seeded gat, we define the context of a state-action pair context(st, at) as just one of the entities that at is applied to. this definition suits well the twc games because rewarded actions are always applied to one target object and a location for that object (see appendix g for details). note that, since the set of entities is discrete, no context quantization is needed. we report the performance of the resulting bike + cbr (w/o gat) agent in LINEBREAK easy LINEBREAK medium LINEBREAK hard LINEBREAK n bike + cbr (w/o gat) bike + cbr (w/o vq) LINEBREAK i LINEBREAK t bike + cbr (w/o gat) u o LINEBREAK bike + cbr (w/o vq) LINEBREAK table 4: results of the ablation study on twc, evaluated based on the number of steps (#steps) to solve the games. LINEBREAK figure 5: number of entries in the memory over training. LINEBREAK table 4. the results show that cbr on twc is effective even with this simple context definition, but the lower performance of the agent demonstrates the advantage of incorporating additional context information. finally, we investigate the role played by vector quantization, by experimenting with an agent (bike + cbr w/o vq) that stores the continuous context representations. in general, this poses scalability challenges, but since twc has only 5 games per difficulty level, each with a small number of objects, we were able to evaluate the performance of this agent on the three levels separately. the results, reported in table 4, show that this agent performs much worse than the other cbr implementations. this happens because storing continuous representations over the training results in duplicated entries in the memory and makes it harder to retrieve meaningful experiences. figure 5 demonstrates how the size (number of entries) in the memory grows over the training time. in this experiment, we trained the agent on all difficulty levels at the same time, resulting in the implementation running out of memory (oom) on the gpu. more ablation studies are reported in appendix c, d, e, f, and g. LINEBREAK related work LINEBREAK text-based rl. tbgs are a rich domain for studying grounded language understanding and how text information can be utilized in control. prior work has explored text-based rl to learn strategies for multi-user dungeon games (narasimhan et al., 2015) and other environments (branavan et al., 2012). zahavy et al. (2018) proposed the action-elimination deep q-network (ae-dqn), which learns to predict invalid actions in the text-adventure game zork. recently, côté et al. (2018) introduced textworld, a sandbox learning environment for training and evaluating rl agents on text-based games. on the same line, murugesan et al. (2021b) introduced twc that requires agents with commonsense knowledge (murugesan et al., 2020; basu et al., 2021). the ledeepchef system (adolphs & hofmann, 2019) achieved good results on the first textword problems (trischler et al., 2019) by supervising the model with entities from freebase, allowing the agent to generalize to unseen objects. a recent line of work learns symbolic (typically graph-structured) representations of the agent’s belief. notably, ammanabrolu & riedl (2019) proposed kg-dqn and adhikari et al. (2020) proposed gata. we also use graphs to model the state of the game. LINEBREAK case-based reasoning in rl. in the context of rl, cbr has been used to speed up and improve transfer learning in heuristic-based rl. celiberto jr et al. (2011) and bianchi et al. (2018) have shown that cases collected from one domain can be used as heuristics to achieve faster convergence when learning an rl algorithm on a different domain. in contrast to these works, we present a scalable way of using cbr alongside deep rl methods in settings with very large state spaces. more recently, cbr has been successfully applied in the field of knowledge-based reasoning. das et al. (2020) and das et al. (2021) show that cbr can effectively learn to generate new logical reasoning chains from prior cases, to answer questions on knowledge graphs. LINEBREAK conclusion and future work LINEBREAK in this work, we proposed new agents for tbgs using case-based reasoning. in contrast to expensive deep rl approaches, cbr simply builds a collection of its past experiences and uses the ones relevant to the current situation to decide upon its next action in the game. our experiments showed that cbr when combined with existing rl agents can make them more efficient and aid generalization in out-of-distribution settings. even though cbr was quite successful in the tbgs explored in our work, future work is needed to understand the limitations of cbr in such settings. LINEBREAK acknowledgements LINEBREAK this work was funded in part by an ibm fellowship to sd and in part by a small project grant to ms from the hasler foundation. LINEBREAK references LINEBREAK agnar aamodt and enric plaza. case-based reasoning: foundational issues, methodological LINEBREAK variations, and system approaches. ai communications, 7(1):39–59, 1994. LINEBREAK ashutosh adhikari, xingdi yuan, marc-alexandre côté, mikuláš zelinka, marc-antoine rondeau, romain laroche, pascal poupart, jian tang, adam trischler, and william l hamilton. learning dynamic knowledge graphs to generalize on text-based games. arxiv preprint arxiv:2002.09127, 2020. LINEBREAK leonard adolphs and thomas hofmann. ledeepchef: deep reinforcement learning agent for LINEBREAK families of text-based games. arxiv, abs/1909.01646, 2019. LINEBREAK prithviraj ammanabrolu and matthew hausknecht. graph constrained reinforcement learning for LINEBREAK natural language action spaces. arxiv preprint arxiv:2001.08837, 2020. LINEBREAK prithviraj ammanabrolu and mark riedl. playing text-adventure games with graph-based deep reinforcement learning. in proceedings of the 2019 conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pp. 3557–3565, 2019. LINEBREAK prithviraj ammanabrolu, ethan tien, matthew j. hausknecht, and mark o. riedl. how to avoid being eaten by a grue: structured exploration strategies for textual worlds. corr, abs/2006.07409, 2020. url https://arxiv.org/abs/2006.07409. LINEBREAK mattia atzeni and maurizio atzori. translating natural language to code: an unsupervised ontology-based approach. in first ieee international conference on artificial intelligence and knowledge engineering, aike 2018, laguna hills, ca, usa, september 26-28, 2018, pp. 1–8. ieee computer society, 2018. doi: 10.1109/aike.2018.00009. url https://doi.org/ 10.1109/aike.2018.00009. LINEBREAK mattia atzeni, jasmina bogojeska, and andreas loukas. sqaler: scaling question answering by decoupling multi-hop and logical reasoning. in a. beygelzimer, y. dauphin, p. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, 2021. url https://openreview.net/forum?id=2cqq_c1i0b. LINEBREAK dzmitry bahdanau, shikhar murty, michael noukhovitch, thien huu nguyen, harm de vries, and aaron c. courville. systematic generalization: what is required and can it be learned? in iclr 2019, 2019. LINEBREAK dana h. ballard. an introduction to natural computation. complex adaptive systems. mit press, LINEBREAK kinjal basu, keerthiram murugesan, mattia atzeni, pavan kapanipathi, kartik talamadupula, tim klinger, murray campbell, mrinmaya sachan, and gopal gupta. a hybrid neuro-symbolic approach for text-based games using inductive logic programming. in combining learning and reasoning: programming languages, formalisms, and representations, 2021. LINEBREAK yoshua bengio, nicholas léonard, and aaron c. courville. estimating or propagating gradients through stochastic neurons for conditional computation. corr, abs/1308.3432, 2013. url http://arxiv.org/abs/1308.3432. LINEBREAK reinaldo ac bianchi, paulo e santos, isaac j da silva, luiz a celiberto, and ramon lopez de mantaras. heuristically accelerated reinforcement learning by means of case-based reasoning and transfer learning. journal of intelligent & robotic systems, 91(2):301–312, 2018. LINEBREAK srk branavan, david silver, and regina barzilay. learning to win by reading manuals in a monte LINEBREAK carlo framework. journal of artificial intelligence research, 43:661–704, 2012. LINEBREAK luiz a celiberto jr, jackson p matsuura, ramon lopez de mantaras, and reinaldo ac bianchi. using cases as heuristics in reinforcement learning: a transfer learning application. in twentysecond international joint conference on artificial intelligence, 2011. LINEBREAK ting chen, martin renqiang min, and yizhou sun. learning k-way d-dimensional discrete codes for compact embedding representations. in jennifer g. dy and andreas krause (eds.), proceedings of the 35th international conference on machine learning, icml 2018, stockholmsmässan, stockholm, sweden, july 10-15, 2018, volume 80 of proceedings of machine learning research, pp. 853–862. pmlr, 2018. url http://proceedings.mlr.press/v80/chen18g. html. LINEBREAK marc-alexandre côté, ákos kádár, xingdi yuan, ben kybartas, tavian barnes, emery fine, james moore, matthew hausknecht, layla el asri, mahmoud adada, wendy tay, and adam trischler. textworld: a learning environment for text-based games. corr, abs/1806.11532, 2018. LINEBREAK rajarshi das, ameya godbole, shehzaad dhuliawala, manzil zaheer, and andrew mccallum. a simple approach to case-based reasoning in knowledge bases. arxiv preprint arxiv:2006.14198, 2020. LINEBREAK rajarshi das, manzil zaheer, dung thai, ameya godbole, ethan perez, jay-yoon lee, lizhen tan, lazaros polymenakos, and andrew mccallum. case-based reasoning for natural language queries over knowledge bases. arxiv preprint arxiv:2104.08762, 2021. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep bidirectional transformers for language understanding. in jill burstein, christy doran, and thamar solorio (eds.), proceedings of the 2019 conference of the north american chapter of the association for computational linguistics: human language technologies, naacl-hlt 2019, minneapolis, mn, usa, june 2-7, 2019, volume 1 (long and short papers), pp. 4171– 4186. association for computational linguistics, 2019. url https://www.aclweb.org/ anthology/n19-1423/. LINEBREAK xiaoxiao guo, mo yu, yupeng gao, chuang gan, murray campbell, and shiyu chang. interactive fiction game playing as multi-paragraph reading comprehension with reinforcement learning. in proceedings of the 2020 conference on empirical methods in natural language processing (emnlp), pp. 7755–7765, online, november 2020. association for computational linguistics. doi: 10.18653/v1/2020.emnlp-main.624. url https://aclanthology.org/2020. emnlp-main.624. LINEBREAK raia hadsell, sumit chopra, and yann lecun. dimensionality reduction by learning an invariant in 2006 ieee computer society conference on computer vision and pattern mapping. recognition (cvpr 2006), 17-22 june 2006, new york, ny, usa, pp. 1735–1742. ieee computer society, 2006. doi: 10.1109/cvpr.2006.100. url https://doi.org/10.1109/cvpr. 2006.100. LINEBREAK matthew hausknecht, prithviraj ammanabrolu, marc-alexandre côté, and xingdi yuan. interactive in proceedings of the aaai conference on artificial LINEBREAK fiction games: a colossal adventure. intelligence, volume 34, pp. 7903–7910, 2020. LINEBREAK ji he, jianshu chen, xiaodong he, jianfeng gao, lihong li, li deng, and mari ostendorf. deep reinforcement learning with a natural language action space. in proceedings of the 54th annual meeting of the association for computational linguistics, acl 2016, august 7-12, 2016, berlin, germany, volume 1: long papers. the association for computer linguistics, 2016. doi: 10. 18653/v1/p16-1153. url https://doi.org/10.18653/v1/p16-1153. LINEBREAK pavan kapanipathi, veronika thost, siva sankalp patel, spencer whitehead, ibrahim abdelaziz, avinash balakrishnan, maria chang, kshitij fadnis, chulaka gunasekara, bassem makni, nicholas mattei, kartik talamadupula, and achille fokoue. infusing knowledge into the textual entailment task using graph convolutional networks. aaai, 2020. LINEBREAK daniel keysers, nathanael schärli, nathan scales, hylke buisman, daniel furrer, sergii kashubin, nikola momchev, danila sinopalnikov, lukasz stafiniak, tibor tihon, dmitry tsarkov, xiao wang, marc van zee, and olivier bousquet. measuring compositional generalization: a LINEBREAK in 8th international conference on learning comprehensive method on realistic data. representations, iclr 2020, addis ababa, ethiopia, april 26-30, 2020. openreview.net, 2020. url https://openreview.net/forum?id=sygccnnkwr. LINEBREAK janet l kolodner. reconstructive memory: a computer model. cognitive science, 7(4):281–328, LINEBREAK brenden m. lake, tomer d. ullman, joshua b. tenenbaum, and samuel j. gershman. building machines that learn and think like people. behavioral and brain sciences, 40:e253, 2017. doi: 10.1017/s0140525x16001837. LINEBREAK k. murugesan, subhajit chaudhury, and kartik talamadupula. eye of the beholder: improved relation generalization for text-based reinforcement learning agents. arxiv, abs/2106.05387, 2021a. LINEBREAK keerthiram murugesan, mattia atzeni, pushkar shukla, mrinmaya sachan, pavan kapanipathi, and kartik talamadupula. enhancing text-based reinforcement learning agents with commonsense knowledge. corr, abs/2005.00811, 2020. url https://arxiv.org/abs/2005.00811. LINEBREAK keerthiram murugesan, mattia atzeni, pavan kapanipathi, pushkar shukla, sadhana kumaravel, gerald tesauro, kartik talamadupula, mrinmaya sachan, and murray campbell. text-based rl agents with commonsense knowledge: new challenges, environments and baselines. in thirty fifth aaai conference on artificial intelligence, 2021b. LINEBREAK keerthiram murugesan, mattia atzeni, pavan kapanipathi, kartik talamadupula, mrinmaya sachan, and murray campbell. efficient text-based reinforcement learning by jointly leveraging in proceedings of the 59th annual meeting of state and commonsense graph representations. the association for computational linguistics and the 11th international joint conference on natural language processing (volume 2: short papers), pp. 719–725, 2021c.
| 11
|
[
108,
412.1240784,
504.0037874,
465.9216784
] |
jLoC4ez43PZ.pdf
| 2,021
| 2
|
LINEBREAK graphcodebert: pre-training code representations with data flow LINEBREAK daya guo1∗, shuo ren2∗, shuai lu3∗, zhangyin feng4∗, duyu tang5, shujie liu5, long zhou5, nan duan5, alexey svyatkovskiy6, shengyu fu6, michele tufano6, shao kun deng6, colin clement6, dawn drain6, neel sundaresan6, jian yin1, daxin jiang7, and ming zhou5 1school of computer science and engineering, sun yat-sen university. 2beihang university, 3peking university, 4harbin institute of technology, 5microsoft research asia, 6microsoft devdiv, 7microsoft stca LINEBREAK abstract LINEBREAK pre-trained models for programming language have achieved dramatic empirical improvements on a variety of code-related tasks such as code search, code completion, code summarization, etc. however, existing pre-trained models regard a code snippet as a sequence of tokens, while ignoring the inherent structure of code, which provides crucial code semantics and would enhance the code understanding process. we present graphcodebert, a pre-trained model for programming language that considers the inherent structure of code. instead of taking syntactic-level structure of code like abstract syntax tree (ast), we use data flow in the pre-training stage, which is a semantic-level structure of code that encodes the relation of “wherethe-value-comes-from” between variables. such a semantic-level structure is less complex and does not bring an unnecessarily deep hierarchy of ast, the property of which makes the model more efficient. we develop graphcodebert based on transformer. in addition to using the task of masked language modeling, we introduce two structure-aware pre-training tasks. one is to predict code structure edges, and the other is to align representations between source code and code structure. we implement the model in an efficient way with a graph-guided masked attention function to incorporate the code structure. we evaluate our model on four tasks, including code search, clone detection, code translation, and code refinement. results show that code structure and newly introduced pre-training tasks can improve graphcodebert and achieves state-of-the-art performance on the four downstream tasks. we further show that the model prefers structure-level attentions over token-level attentions in the task of code search.1 LINEBREAK introduction LINEBREAK pre-trained models such as elmo (peters et al., 2018), gpt (radford et al., 2018) and bert (devlin et al., 2018) have led to strong improvement on numerous natural language processing (nlp) tasks. these pre-trained models are first pre-trained on a large unsupervised text corpus, and then fine-tuned on downstream tasks. the success of pre-trained models in nlp also promotes the development of pre-trained models for programming language. existing works (kanade et al., 2019; karampatsis & sutton, 2020; feng et al., 2020; svyatkovskiy et al., 2020; buratti et al., 2020) regard a source code as a sequence of tokens and pre-train models on source code to support code-related tasks such as code search, code completion, code summarization, etc. however, previous works only utilize source code for pre-training, while ignoring the inherent structure of code. such code structure provides useful semantic information of code, which would benefit the code understanding process. taking the expression v = max value − min value as an example, v is computed from max value and min value. programmers do not always follow the naming conventions so that it’s hard to understand the semantic of the variable v only from its name. the semantic structure of code provides a way to understand the semantic of the variable v by leveraging dependency relation between variables. LINEBREAK ∗work done while this author was an intern at microsoft research asia. contact: daya guo LINEBREAK ([email protected]) LINEBREAK 1all the codes and data are available at https://github.com/microsoft/codebert. LINEBREAK in this work, we present graphcodebert, a pre-trained model for programming language that considers the inherent structure of code. instead of taking syntactic-level structure of code like abstract syntax tree (ast), we leverage semantic-level information of code, i.e. data flow, for pretraining. data flow is a graph, in which nodes represent variables and edges represent the relation of “where-the-value-comes-from” between variables. compared with ast, data flow is less complex and does not bring an unnecessarily deep hierarchy, the property of which makes the model more efficient. in order to learn code representation from source code and code structure, we introduce two new structure-aware pre-training tasks. one is data flow edges prediction for learning representation from code structure, and the other is variable-alignment across source code and data flow for aligning representation between source code and code structure. graphcodebert is based on transformer neural architecture (vaswani et al., 2017) and we extend it by introducing a graph-guided masked attention function to incorporate the code structure. LINEBREAK we pre-train graphcodebert on the codesearchnet dataset (husain et al., 2019), which includes 2.3m functions of six programming languages paired with natural language documents. we evaluate the model on four downstream tasks: natural language code search, clone detection, code translation, and code refinement. experiments show that our model achieves state-of-the-art performance on the four tasks. further analysis shows that code structure and newly introduced pre-training tasks can improve graphcodebert and the model has consistent preference for attending data flow. LINEBREAK in summary, the contributions of this paper are: (1) graphcodebert is the first pre-trained model that leverages semantic structure of code to learn code representation. (2) we introduce two new structure-aware pre-training tasks for learning representation from source code and data flow. (3) graphcodebert provides significant improvement on four downstream tasks, i.e. code search, clone detection, code translation, and code refinement. LINEBREAK related works LINEBREAK pre-trained models for programming languages inspired by the big success of pre-training in nlp (devlin et al., 2018; yang et al., 2019; liu et al., 2019; raffel et al., 2019), pre-trained models for programming languages also promotes the development of code intelligence (kanade et al., 2019; feng et al., 2020; karampatsis & sutton, 2020; svyatkovskiy et al., 2020; buratti et al., 2020). kanade et al. (2019) pre-train a bert model on a massive corpus of python source codes by masked language modeling and next sentence prediction objectives. feng et al. (2020) propose codebert, a bimodal pre-trained model for programming and natural languages by masked language modeling and replaced token detection to support text-code tasks such as code search. karampatsis & sutton (2020) pre-train contextual embeddings on a javascript corpus using the elmo framework for program repair task. svyatkovskiy et al. (2020) propose gpt-c, which is a variant of the gpt-2 trained from scratch on source code data to support generative tasks like code completion. buratti et al. (2020) present c-bert, a transformer-based language model pre-trained on a collection of repositories written in c language, and achieve high accuracy in the abstract syntax tree (ast) tagging task. LINEBREAK different with previous works, graphcodebert is the first pre-trained model that leverages code structure to learn code representation to improve code understanding. we further introduce a graphguided masked attention function to incorporate the code structure into transformer and two new structure-aware pre-training tasks to learn representation from source code and code structure. LINEBREAK neural networks with code structure in recent years, some neural networks leveraging code structure such as ast have been proposed and achieved strong performance in code-related tasks like code completion (li et al., 2017; alon et al., 2019; kim et al., 2020), code generation (rabinovich et al., 2017; yin & neubig, 2017; brockschmidt et al., 2018), code clone detection (wei & li, 2017; zhang et al., 2019; wang et al., 2020), code summarization (alon et al., 2018; hu et al., 2018) and so on (nguyen & nguyen, 2015; allamanis et al., 2018; hellendoorn et al., 2019). nguyen & nguyen (2015) propose an ast-based language model to support the detection and suggestion of a syntactic template at the current editing location. allamanis et al. (2018) use graphs to represent programs and graph neural network to reason over program structures. hellendoorn et al. (2019) propose two different architectures using a gated graph neural network and transformers for combining local and global information to leverage richly structured representations of source code. however, these LINEBREAK works leverage code structure to learn models on specific tasks from scratch without using pre-trained models. in this work, we study how to leverage code structure for pre-training code representation. LINEBREAK data flow LINEBREAK in this section, we describe the basic concept and extraction of data flow. in next section, we will describe how to use data flow for pre-training. LINEBREAK data flow is a graph that represents dependency relation between variables, in which nodes represent variables and edges represent where the value of each variable comes from. unlike ast, data flow is same under different abstract grammars for the same source code. such code structure provides crucial code semantic information for code understanding. taking v = max value − min value as an example, programmers do not always follow the naming conventions so that it is hard to understand the semantic of the variable. data flow provides a way to understand the semantic of the variable v to some extent, i.e. the value of v comes from max value and min value in data flow. besides, data flow supports the model to consider long-range dependencies induced by using the same variable or function in distant locations. taking figure 1 as an example, there are four variables with same name (i.e. x3, x7, x9 and x11) but with different semantic. the graph in the figure shows dependency relation between these variables and supports x11 to pay more attention to x7 and x9 instead of x3. next, we describe how to extract data flow from a source code. LINEBREAK figure 1: the procedure of extracting data flow given a source code. the graph in the rightmost is data flow that represents the relation of ”where-the-value-comes-from” between variables. LINEBREAK figure 1 shows the extraction of data flow through a source code. given a source code c = {c1, c2, ..., cn}, we first parse the code into an abstract syntax tree (ast) by a standard compiler tool2. the ast includes syntax information of the code and terminals (leaves) are used to identify the variable sequence, denoted as v = {v1, v2, ..., vk}. we take each variable as a node of the graph and an direct edge ε = (cid:104)vi, vj(cid:105) from vi to vj refers that the value of j-th variable comes from i-th variable. taking x = expr as an example, edges from all variables in expr to x are added into the graph. we denote the set of directed edges as e = {ε1, ε2, ..., εl} and the graph g(c) = (v, e) is data flow used to represent dependency relation between variables of the source code c. LINEBREAK graphcodebert LINEBREAK in this section, we describe graphcodebert, a graph-based pre-trained model based on transformer for programming language. we introduce model architecture, graph-guided masked attention and pre-training tasks including standard masked language model and newly introduced ones. more details about model pre-training setting are provided in the appendix a. LINEBREAK 2https://github.com/tree-sitter/tree-sitter LINEBREAK figure 2: an illustration about graphcodebert pre-training. the model takes source code paired with comment and the corresponding data flow as the input, and is pre-trained using standard masked language modeling (devlin et al., 2018) and two structure-aware tasks. one structure-aware task is to predict where a variable is identified from (marked with orange lines) and the other is data flow edges prediction between variables (marked with blue lines). LINEBREAK model architecture LINEBREAK figure 2 shows the model architecture of graphcodebert. we follow bert (devlin et al., 2018) and use the multi-layer bidirectional transformer (vaswani et al., 2017) as the model backbone. instead of only using source code, we also utilize paired comments to pre-train the model to support more code-related tasks involving natural language such as natural language code search (feng et al., 2020). we further take data flow, which is a graph, as a part of the input to the model. LINEBREAK given a source code c = {c1, c2, ..., cn} with its comment w = {w1, w2, ..., wm}, we can obtain the corresponding data flow g(c) = (v, e) as discussed in the section 3, where v = {v1, v2, ..., vk} is a set of variables and e = {ε1, ε2, ..., εl} is a set of direct edges that represent where the value of each variable comes from. we concatenate the comment, source code and the set of variables as the sequence input x = {[cls], w, [sep ], c, [sep ], v }, where [cls] is a special token in front of three segments and [sep ] is a special symbol to split two kinds of data types. LINEBREAK graphcodebert takes the sequence x as the input and then converts the sequence into input vectors h 0. for each token, its input vector is constructed by summing the corresponding token and position embeddings. we use a special position embedding for all variables to indicate that they are nodes of data flow. the model applies n transformer layers over the input vectors to produce contextual representations h n = transf ormern(h n−1), n ∈ [1, n ]. each transformer layer contains an architecturally identical transformer that applies a multi-headed self-attention operation (vaswani et al., 2017) followed by a feed forward layer over the input h n−1 in the n-th layer. LINEBREAK gn = ln (m ultiattn(h n−1) + h n−1) h n = ln (f f n (gn) + gn) LINEBREAK where m ultiattn is a multi-headed self-attention mechanism, f f n is a two layers feed forward network, and ln represents a layer normalization operation. for the n-th transformer layer, the output ˆgn of a multi-headed self-attention is computed via: qi = h n−1w q i , ki = h n−1w k i qikt i√ dk LINEBREAK , vi = h n−1w v i LINEBREAK headi = softmax( LINEBREAK + m)vi LINEBREAK ˆgn = [head1; ...; headu]w o (5) n where the previous layer’s output h n−1 ∈ r|x|×dh is linearly projected to a triplet of queries, keys and values using model parameters w q i ∈ rdh×dk , respectively. u is the number of heads, i ,w k i n ∈ rdh×dh is the model parameters. m ∈ r|x|×|x| is a mask dk is the dimension of a head, and w o matrix, where mij is 0 if i-th token is allowed to attend j-th token otherwise −∞. LINEBREAK ,w v LINEBREAK graph-guided masked attention
| 4
|
[
108.249,
698.0240784,
293.2753174,
707.9866784
] |
eIHYL6fpbkA.pdf
| 2,021
| 0
|
LINEBREAK removing undesirable feature contributions using out-of-distribution data LINEBREAK saehyung lee, changhwa park, hyungyu lee, jihun yi, jonghyun lee, sungroh yoon∗ electrical and computer engineering, aiis, asri, inmc, and institute of engineering research seoul national university seoul 08826, south korea {halo8218,omega6464,rucy74,t080205,leejh9611,sryoon}@snu.ac.kr LINEBREAK abstract LINEBREAK several data augmentation methods deploy unlabeled-in-distribution (uid) data to bridge the gap between the training and inference of neural networks. however, these methods have clear limitations in terms of availability of uid data and dependence of algorithms on pseudo-labels. herein, we propose a data augmentation method to improve generalization in both adversarial and standard learning by using out-of-distribution (ood) data that are devoid of the abovementioned issues. we show how to improve generalization theoretically using ood data in each learning scenario and complement our theoretical analysis with experiments on cifar-10, cifar-100, and a subset of imagenet. the results indicate that undesirable features are shared even among image data that seem to have little correlation from a human point of view. we also present the advantages of the proposed method through comparison with other data augmentation methods, which can be used in the absence of uid data. furthermore, we demonstrate that the proposed method can further improve the existing state-of-the-art adversarial training. LINEBREAK introduction LINEBREAK the power of the enormous amount of data suggested by the empirical risk minimization (erm) principle (vapnik & vapnik, 1998) has allowed deep neural networks (dnns) to perform outstandingly on many tasks, including computer vision (krizhevsky et al., 2012) and natural language processing (hinton et al., 2012). however, most of the practical problems encountered by dnns have high-dimensional input spaces, and nontrivial generalization errors arise owing to the curse of dimensionality (bellman, 1961). moreover, neural networks have been found to be easily deceived by adversarial perturbations with a high degree of confidence (szegedy et al., 2013). several studies (goodfellow et al., 2014; krizhevsky et al., 2012) have been conducted to address these generalization problems resulting from erm. most of them handled the generalization problems by extending the training distribution (madry et al., 2017; lee et al., 2020). nevertheless, it has been demonstrated that more data are needed to achieve better generalization (schmidt et al., 2018). recent methods (carmon et al., 2019; xie et al., 2019) introduced unlabeled-in-distribution (uid) data to compensate for the lack of training samples. however, there are limitations associated with these methods. first, obtaining suitable uid data for selected classes is challenging. second, when applying supervised learning methods on pseudo-labeled data, the effect of data augmentation depends heavily on the accuracy of the pseudo-label generator. LINEBREAK in our study, in order to break through the limitations outlined above, we propose an approach that promotes robust and standard generalization using out-of-distribution (ood) data. especially, motivated by previous studies demonstrating the existence of common adversarial space among different images or even datasets (naseer et al., 2019; poursaeed et al., 2018), we show that ood data can be leveraged for adversarial learning. likewise, if the ood data share the same undesirable features as those of the in-distribution data in terms of standard generalization, they can be leveraged for standard learning. by definition, in this work, the classes of the ood data differ from those of the in-distribution data, and our method do not use the label information of the ood data. therefore the LINEBREAK ∗correspondence to: sungroh yoon [email protected]. LINEBREAK proposed method is free from the previously mentioned problems caused by uid data. we present a theoretical model which demonstrates how to improve generalization using ood data in both adversarial and standard learning. in our theoretical model, we separate desirable and undesirable features and show how the training on ood data, which shares undesirable features with in-distribution data, changes the weight values of the classifier. based on the theoretical analysis, we introduce out-ofdistribution data augmented training (oat), which assigns a uniform distribution label to all the ood data samples to remove the influence of undesirable features in adversarial and standard learning. in the proposed method, each batch is composed of training data and ood data, and ood data regularize the training so that only features that are strongly correlated with class labels are learned. we complement our theoretical findings with experiments on cifar-10 (krizhevsky et al., 2009), cifar-100 (krizhevsky et al., 2009), and a subset of imagenet (deng et al., 2009). in addition, we present the empirical evidence for the transferability of undesirable features through further studies on various datasets including simpson characters (attia, 2018), fashion product images (aggarwal, 2018), svhn (netzer et al., 2011), places365 (zhou et al., 2017), and visda-17 (peng et al., 2017). LINEBREAK (i) we propose a simple method, out-of-distribution data augmented traincontributions ing (oat), to leverage ood data for adversarial and standard learning, and theoretical analyses demonstrate how our proposed method can improve robust and standard generalization. (ii) the results of experimental procedures on cifar-10, cifar-100, and a subset of imagenet suggest that oat can help reduce the generalization gap in adversarial and standard learning. (iii) by applying oat using various ood datasets, it is shown that undesirable features are shared among diverse image datasets. it is also demonstrated that oat can effectively extend training distribution by comparison with other data augmentation methods that can be employed in the absence of uid data. (iv) the state-of-the-art adversarial training method using uid data is found to further improve by incorporating the proposed method of leveraging ood data. LINEBREAK background LINEBREAK undesirable features in adversarial learning tsipras et al. (2018) demonstrated the existence of a trade-off between standard accuracy and adversarial robustness with the distinction between robust and non-robust features. they showed the possibility that adversarial robustness is incompatible with standard accuracy by constructing a binary classification task that the data model consists of inputlabel pairs (x, y) ∈ rd+1 × {±1} sampled from a distribution as follows: LINEBREAK (cid:26)+y w.p. p LINEBREAK −y w.p. 1 − p LINEBREAK i.i.d.∼ n ((cid:15)y, 1). LINEBREAK here, x1 is a robust feature that is strongly correlated with the label, and the other features x2, . . . , xd+1 are non-robust features that are weakly correlated with the label. (cid:15) is small but sufficiently large such that a simple classifier attains a high standard accuracy, and p ≥ 0.5. to characterize adversarial robustness, the definitions of expected standard loss βs and expected adversarial loss βa for a data distribution d are defined as follows: LINEBREAK βs = e LINEBREAK (x,y)∼d LINEBREAK [l(x, y; θ)] , LINEBREAK βa = e LINEBREAK (x,y)∼d LINEBREAK max δ∈s LINEBREAK l(x + δ, y; θ) LINEBREAK here, l(; θ) is the loss function of the model, and s represents the set of perturbations that the adversary can apply to deceive the model. for equation (1), tsipras et al. (2018) showed that the following classifier can yield a small expected standard loss: LINEBREAK favg(x) = sign(w(cid:62) LINEBREAK unifx), where wunif = LINEBREAK they also proved that the classifier is vulnerable to adversarial perturbations, and that adversarial training results in a classifier that assigns zero weight values to non-robust features. LINEBREAK transferability of adversarial perturbations naseer et al. (2019) produced domain-agnostic adversarial perturbations, thereby showing common adversarial space among different datasets. they showed that an adversarial function trained on paintings, cartoons or medical data can deceive the classifier on imagenet data with a high success rate. the study findings show that even datasets from considerably different domains share non-robust features. therefore a method for supplementing the data needed for adversarial training is presented herein. LINEBREAK undesirable features in standard learning wang et al. (2020) noted that convolutional neural networks (cnn) can capture high-frequency components in images that are almost imperceptible to a human. this ability is thought to be closely related to the generalization behaviors of cnns, especially the capacity in memorizing random labels. several studies (geirhos et al., 2018; bahng et al., 2019) reported that cnns are biased towards local image features, and the generalization performance can be improved by regularizing that bias. in this context, a method of regularizing undesirable feature contributions using ood data is proposed, assuming that undesirable features arise from the bias of cnns or insufficient training data and are widely distributed in the input space. LINEBREAK methods LINEBREAK theoretical motivation LINEBREAK in this section, we analyze theoretically how ood data can be used to make up for the insufficient training samples in adversarial training based on the dichotomy between robust and non-robust features. the theoretical motivation of using ood data to reduce the contribution of undesirable features in standard learning can be found in appendix b. LINEBREAK i=1 and target feature-label pairs {(φ(˜xi), yi)}n LINEBREAK setup and overview we denote in-distribution data as target data. given a target dataset i=1 ⊂ x × {±1} sampled from a data distribution ˜d, where x is the input space, we {(˜xi, yi)}n suppose that a feature extractor φ : x → z ⊂ rd and a linear classification model are trained on {(˜xi, yi)}n i=1, respectively, to yield the small expected standard loss of the classification model. we then define an ood dataset {ˆxi}m i=1 ⊂ x sampled from a data distribution ˆd that has the same distribution of non-robust features as that of ˜d with reference to the preceding studies (naseer et al., 2019; moosavi-dezfooli et al., 2017). after fixing φ to facilitate the theoretical analysis on this framework, we demonstrate how adversarial training on the ood dataset affects the weight values of our classifier. LINEBREAK our data model the feature extractor φ can be considered to consist of several feature extractors φ : x → z ⊂ r. hence, we can set the distributions of the target feature-label pair (φ(˜x), y) = (˜z, y) ∈ rd × {±1} and the ood feature vector φ(ˆx) = ˆz ∈ rd as follows: LINEBREAK i.i.d.∼ n (ηy, 1), i.i.d.∼ n (ηq, 1), LINEBREAK where u.a.r stands for uniformly at random. from here on, we will only deal with the ood data, therefore the accents (tilde and caret) that distinguish between target data and ood data are omitted. in equation (4), the feature z1 = φ1(x) is the output of a robust feature extractor φ1, and the other features z2, . . . , zd+1 are those of non-robust feature extractors φ2, . . . , φd+1. since the ood input vectors do not have the same robust features as the target input vectors, z1 has zero mean and a small variance. furthermore, because the ood data have the same distribution of non-robust features as the target data, z2, . . . , zd+1 have a non-zero mean and a larger variance than the robust features. in addition, q represents the unknown label associated with the non-robust features, and η is a nonnegative constant which represents the degree of correlation between the non-robust features and the unknown label. please note that the input space of our classifier is the output space of φ in our data model. therefore, η is not limited to a small value even in the context of the (cid:96)p-bounded adversary. rather, the high degree of confidence that dnns show for the adversarial examples (goodfellow et al., 2014) suggests that η is large. LINEBREAK our linear classification model according to section 2, we know that our linear classification model (logistic regression), defined as follows, yields a low expected standard loss while demonstrating high adversarial vulnerability. LINEBREAK p(y = +1 | z) = σ(w(cid:62)z), p(y = −1 | z) = 1 − σ(w(cid:62)z), where w = LINEBREAK to observe the effect of adversarial training on the ood dataset, we train our classifier by applying the stochastic gradient descent algorithm to the cross-entropy loss function l(; w). LINEBREAK firstly, we construct the adversarial feature vector ¯z = φ(x + δ) : δ ∈ s against our classifier for adversarial training. theorem 1. let t ∈ [0, 1] be the given target value of the feature vector z in our classification model, and λ be a non-negative constant. then, when t = 0.5, the expectation of the adversarial feature vector is LINEBREAK ez [¯z1] = ez [z1] , ez [¯zk] ≈ ez [zk] + λ · q, where k ∈ {2, . . . , d + 1}. LINEBREAK (all the proofs of the theorems in this paper can be found in appendix a.) here, we assume the (cid:96)∞-bounded adversary. in theorem 1, we can observe that the adversary pushes the non-robust features farther in the direction of the unknown label q, which coincides with our intuition. when the given target value t is 0.5, the adversary will make our classification model output equal to zero or one to yield a large loss. LINEBREAK our classification model is trained on the adversarial features shown in theorem 1. theorem 2. when t = 0.5, the expected gradient of the loss function l(¯z, t; w) with respect to the weight vector w of our classification model is (cid:21) LINEBREAK (η + λ), where k ∈ {2, . . . , d + 1}. LINEBREAK e¯z LINEBREAK (cid:20) ∂l ∂wk LINEBREAK thus, the adversarial training with t = 0.5 on the ood dataset leads to the weight values corresponding to the non-robust features converging to zero while preserving w1 from the gradient update. this shows that we can reduce the impact of non-robust features using the ood dataset. we, however, should not only reduce the influence of the non-robust features, but also improve the classification accuracy using the robust feature. this can be achieved through the adversarial training on the target dataset. accordingly, we show the effect of the adversarial training on the ood dataset when w1 > 0 in our example. theorem 3. when t = 0.5 and w1 > 0, the expected gradient of the loss function l(¯z, t; w) with respect to the weight vector w of our classification model is LINEBREAK e¯z LINEBREAK λ, e¯z LINEBREAK (cid:20) ∂l ∂wk LINEBREAK (η + λ), where k ∈ {2, . . . , d + 1}. LINEBREAK theorem 3 shows that when w1 > 0, the adversarial training with t = 0.5 on the ood dataset reduces the influence of all the features in z. however, we can see that the expected gradients for the weight values associated with the non-robust features are always greater than the expected gradient for the weight value associated with the robust feature. in addition, the greater the value of η, the faster the weight value associated with it converges to zero. this means that the contribution of non-robust features with high influence decreases rapidly. in the case of multiclass classification, it is straightforward that t = 0.5 corresponds to uniform distribution label tunif = [ 1 c ], where c is the number of the classes. intuitively, the meaning of (x, tunif) is that the input x lies on the decision boundary. to reduce the training loss for (x, tunif), the classifier will learn that the features of x do not contribute to a specific class, which can be understood as removing the contributions of the features of x. LINEBREAK out-of-distribution data augmented training LINEBREAK based on our theoretical analysis, we introduce out-of-distribution data augmented training (oat). oat is the training on the union of the target dataset dt and the ood dataset do. when applying our proposed method, we need to consider the following two points: 1) temporary labels associated with ood data samples are required for supervised learning, and 2) the loss functions corresponding to dt and do should be properly combined. LINEBREAK first, we assign a uniform distribution label tunif to all the ood data samples as confirmed in our theoretical analysis. this labeling method enables us to leverage ood data for supervised learning at no extra cost. moreover, it means that our method is completely free from the limitations of the methods using uid data (see section 1). LINEBREAK second, although ood data can be used to improve the standard and robust generalization of neural networks, the training on target data is essential to enhance the classification accuracy of neural LINEBREAK networks. in addition, according to theorem 3, adversarial training on the pairs of ood data samples and tunif affects the weight for robust features as well as that for non-robust features. hence, the balance between losses from dt and do is important in oat. for this reason, we introduce a hyperparameter α ∈ r+ into our proposed method and train neural networks as follows: LINEBREAK oat-a: min LINEBREAK e (xt,y)∈dt oat-s: min LINEBREAK max δ∈s LINEBREAK l(xt + δ, y; θ) LINEBREAK + α e LINEBREAK xo∈do LINEBREAK max (cid:15)∈s LINEBREAK (cid:21) l(xo + (cid:15), tunif; θ) LINEBREAK e (xt,y)∈dt LINEBREAK [l(xt, y; θ)] + α e LINEBREAK xo∈do LINEBREAK [l(xo, tunif; θ)] . LINEBREAK here, oat-a and oat-s represent ood data augmented adversarial and standard learning, respectively. the pseudo-code for the overall procedure of our method is presented in algorithm 1. LINEBREAK algorithm 1 out-of-distribution augmented training (oat) require: target dataset dt, ood dataset do, uniform distribution label tunif, batch size n, training LINEBREAK iterations t , learning rate τ , hyperparameter α, adversarial attack function g LINEBREAK (xt, y ) = sample(dataset = dt, size = n 2 ) LINEBREAK if adversarial learning then LINEBREAK (cid:2) ¯xt, ¯xo (cid:2) ¯xt, ¯xo LINEBREAK else if standard learning then LINEBREAK 1: for t = 1 to t do 2: 3: xo = sample(dataset = do, size = n 2 ) 4: (cid:3) ← g([xt, xo] , [y, tunif] ; θ) 5: 6: (cid:3) ← [xt, xo] 7: 8: 9: 10: 11: end for 12: output: trained model parameter θ LINEBREAK end if model update: θ ← θ − τ · ∇θaverage( 1 LINEBREAK 2 l( ¯xt, y ; θ) + α LINEBREAK 2 l( ¯xo, tunif; θ)) LINEBREAK related studies LINEBREAK adversarial examples many adversarial attack methods have been proposed, including the projected gradient descent (pgd) and carlini & wagner (cw) attacks (madry et al., 2017; carlini & wagner, 2017). the pgd attack employs an iterative procedure of the fast gradient sign method (fgsm) (goodfellow et al., 2014) to find worst-case examples in which the training loss is maximized. cw attack finds adversarial examples using cw losses instead of cross-entropy losses. recently, croce & hein (2020) proposed autoattack (aa), which is a powerful ensemble attack with two extensions of the pgd attack and two existing attacks (croce & hein, 2019; andriushchenko et al., 2019). to defend against these adversarial attacks, various adversarial defense methods have been developed (goodfellow et al., 2014; kannan et al., 2018). madry et al. (2017) introduced adversarial training that uses adversarial examples as training data, and zhang et al. (2019) proposed trades to optimize a surrogate loss which is a sum of the natural error and boundary error. LINEBREAK ood detection lee et al. (2017) and hendrycks et al. (2018) dealt with the overconfidence problem of the confidence score-based ood detectors. they used uniform distribution labels as in our method to resolve the overconfidence issue. they did not, however, address the generalization problems of neural networks. specifically, our theoretical results allow us to explain the classification performance improvement of classifiers that were only considered as secondary effects in the abovementioned studies. further related works can be found in appendix c. LINEBREAK experimental results and discussion LINEBREAK experimental setup LINEBREAK ood datasets we created ood datasets from the 80 million tiny images dataset (torralba et al., 2008) (80m-ti), using the work of carmon et al. (2019) for cifar-10 and cifar-100, respectively. in addition, we resized (using a bilinear interpolation) imagenet to dimensions of 64 × 64 and LINEBREAK table 1: accuracy (%) comparison of the oat model with standard, pgd, and trades on cifar10, cifar100, and imgnet10 (64×64) under different threat models. we show the improved results compared to the counterpart of each model in bold. LINEBREAK model LINEBREAK target
| 5
|
[
195.9747148,
657.4760784,
221.000766,
667.4386784
] |
7grkzyj89A_.pdf
| 2,022
| 0
|
LINEBREAK generalization through the lens of leaveone-out error LINEBREAK gregor bachmann a, thomas hofmanna, and aur´elien lucchib LINEBREAK adepartment of computer science, eth z¨urich, switzerland bdepartment of mathematics and computer science, university of basel , {gregor.bachmann, thomas.hofmann}@inf.ethz.ch [email protected] LINEBREAK abstract LINEBREAK despite the tremendous empirical success of deep learning models to solve various learning tasks, our theoretical understanding of their generalization ability is very limited. classical generalization bounds based on tools such as the vc dimension or rademacher complexity, are so far unsuitable for deep models and it is doubtful that these techniques can yield tight bounds even in the most idealistic settings (nagarajan & kolter, 2019). in this work, we instead revisit the concept of leave-one-out (loo) error to measure the generalization ability of deep models in the so-called kernel regime. while popular in statistics, the loo error has been largely overlooked in the context of deep learning. by building upon the recently established connection between neural networks and kernel learning, we leverage the closed-form expression for the leave-one-out error, giving us access to an efficient proxy for the test error. we show both theoretically and empirically that the leave-one-out error is capable of capturing various phenomena in generalization theory, such as double descent, random labels or transfer learning. our work therefore demonstrates that the leave-one-out error provides a tractable way to estimate the generalization ability of deep neural networks in the kernel regime, opening the door to potential, new research directions in the field of generalization. LINEBREAK introduction LINEBREAK neural networks have achieved astonishing performance across many learning tasks such as in computer vision (he et al., 2016), natural language processing (devlin et al., 2019) and graph learning (kipf & welling, 2017) among many others. despite the large overparametrized nature of these models, they have shown a surprising ability to generalize well to unseen data. the theoretical understanding of this generalization ability has been an active area of research where contributions have been made using diverse analytical tools (arora et al., 2018; bartlett et al., 2019; 2017; neyshabur et al., 2015; 2018). yet, the theoretical bounds derived by these approaches typically suffer from one or several of the following limitations: i) they are known to be loose or even vacuous (jiang et al., 2019), ii) they only apply to randomized networks (dziugaite & roy, 2018; 2017), and iii) they rely on the concept of uniform convergence which was shown to be non-robust against adversarial perturbations (nagarajan & kolter, 2019). in this work, we revisit the concept of leave-one-out error (loo) and demonstrate its surprising ability to predict generalization for deep neural networks in the so-called kernel regime. this object is an important statistical estimator of the generalization performance of an algorithm that is theoretically motivated by a connection to the concept of uniform stability (pontil, 2002). it has also recently been advocated by nagarajan & kolter (2019) as a potential substitute for uniform convergence bounds. despite being popular in classical statistics (cawley & talbot, 2003; vehtari et al., 2016; fukunaga & hummels, 1989; zhang, 2003), loo has largely been overlooked in the context of deep learning, likely due to its high computational cost. however, recent advances from the neural tangent kernel perspective (jacot et al., 2018) render the loo error all of a sudden tractable thanks to the availability of a closed-form expression due to stone (1974, eq. 3.13). while the role of the loo error as an estimator of the generalization performance is debated in the statistics community LINEBREAK (zhang & yang, 2015; bengio & grandvalet, 2004; breiman, 1996; kearns & ron, 1999), the recent work by patil et al. (2021) established a consistency result in the case of ridge regression, ensuring that loo converges to the generalization error in the large sample limit, under mild assumptions on the data distribution. inspired by these recent advances, in this work, we investigate the use of loo as a generalization measure for deep neural networks in the kernel regime. we find that loo is a surprisingly rich descriptor of the generalization error, capturing a wide range of phenomena such as random label fitting, double descent and transfer learning. specifically, we make the following contributions: LINEBREAK • we extend the loo expression for the multi-class setting to the case of zero regularization LINEBREAK and derive a new closed-form formula for the resulting loo accuracy. LINEBREAK • we investigate both the loo loss and accuracy in the context of deep learning through the lens of the ntk, and demonstrate empirically that they both capture the generalization ability of networks in the kernel regime in a variety of settings. LINEBREAK • we showcase the utility of loo for practical networks by accurately predicting their trans LINEBREAK fer learning performance. LINEBREAK • we build on the mathematically convenient form of the loo loss to derive some novel LINEBREAK insights into double descent and the role of regularization. LINEBREAK our work is structured as follows. we give an overview of related works in section 2. in section 3 we introduce the setting along with the loo error and showcase our extensions to the multi-class case and loo accuracy. then, in section 4 we analyze the predictive power of loo in various settings and present our theoretical results on double descent. we discuss our findings and future work in section 5. we release the code for our numerical experiments on github1. LINEBREAK related work LINEBREAK originally introduced by lachenbruch (1967); mosteller & tukey (1968), the leave-one-out error is a standard tool in the field of statistics that has been used to study and improve a variety of models, ranging from support vector machines (weston, 1999), fisher discriminant analysis (cawley & talbot, 2003), linear regression (hastie et al., 2020; patil et al., 2021) to non-parametric density estimation (fukunaga & hummels, 1989). various theoretical perspectives have justified the use of the loo error, including for instance the framework of uniform stability (bousquet & elisseeff, 2002) or generalization bounds for knn models (devroye & wagner, 1979). elisseeff et al. (2003) focused on the stability of a learning algorithm to demonstrate a formal link between loo error and generalization. the vanilla definition of the loo requires access to a large number of trained models which is typically computationally expensive. crucially, stone (1974) derived an elegant closed-form formula for kernels, completely removing the need for training multiple models. in the context of deep learning, the loo error remains largely unexplored. shekkizhar & ortega (2020) propose to fit polytope interpolators to a given neural network and estimate its resulting loo error. alaa & van der schaar (2020) rely on a jackknife estimator, applied in a loo fashion to obtain better confidence intervals for bayesian neural networks. finally, we want to highlight the concurrent work of zhang & zhang (2021) who analyze the related concept of influence functions in the context of deep models. LINEBREAK recent works have established a connection between kernel regression and deep learning. surprisingly, it is shown that an infinitely-wide, fully-connected network behaves like a kernel both at initialization (neal, 1996; lee et al., 2018; de g. matthews et al., 2018) as well as during gradient flow training (jacot et al., 2018). follow-up works have extended this result to the non-asymptotic setting (arora et al., 2019a; lee et al., 2019), proving that wide enough networks trained with small learning rates are in the so-called kernel regime, i.e. essentially evolving like their corresponding tangent kernel. moreover, the analysis has also been adapted to various architectures (arora et al., 2019a; huang et al., 2020; du et al., 2019; hron et al., 2020; yang, 2020) as well as discrete gradient descent (lee et al., 2019). the direct connection to the field of kernel regression enables the usage of the closed-form expression for loo error in the context of deep learning, which to the best of our knowledge has not been explored yet. LINEBREAK 1https://github.com/gregorbachmann/leaveoneout LINEBREAK setting and background LINEBREAK in the following, we establish the notations required to describe the problem of interest and the setting we consider. we study the standard learning setting, where we are given a dataset of inputtarget pairs s = {(x1, y1), . . . , (xn, yn)} where each (xi, yi) i.i.d.∼ d for i = 1, . . . , n is distributed according to some probability measure d. we refer to xi ∈ x ⊂ rd as the input and to y ∈ y ⊂ rc as the target. we will often use matrix notations to obtain more compact formulations, thus summarizing all inputs and targets as matrices x ∈ rn×d and y ∈ rn×c. we will mainly be concerned with the task of multiclass classification, where targets yi are encoded as one-hot vectors. we consider a function space f and an associated loss function lf : x × y −→ r that measures how well a given function f ∈ f performs at predicting the targets. more concretely, we define the regularized empirical error as LINEBREAK ˆlλ s : f −→ r, f (cid:55)→ LINEBREAK lf (xi, yi) + λω(f ), LINEBREAK i=1 where λ > 0 is a regularization parameter and ω : f −→ r is a functional. for any vector v ∈ rc, let v∗ = argmaxk≤c vk. using this notation, we let af (x, y) := 1{f ∗(x)=y∗}. we then define the empirical accuracy ˆas as the average number of instances for which f ∈ f provides the correct prediction, i.e. LINEBREAK af (xi, yi) LINEBREAK finally, we introduce a learning algorithm qf : (x × y)n −→ f, that given a function class f and a training set s ∈ (x × y)n, chooses a function f ∈ f. we will exclusively be concerned with learning through empirical risk minimization, i.e. LINEBREAK qλ LINEBREAK f (s) := ˆf λ LINEBREAK s := argminf ∈f LINEBREAK ˆlλ LINEBREAK s (f ), LINEBREAK and use the shortcut ˆfs := ˆf λ=0 s the generalization loss and accuracy of the model, defined as LINEBREAK . in practice however, the most important measures are given by LINEBREAK l : f −→ r, f (cid:55)→ e(x,y)∼d [lf (x, y)] , LINEBREAK a : f −→ [0, 1], f (cid:55)→ p(x,y)∼d (f ∗(x) = y∗) . LINEBREAK a central goal in machine learning is to control the difference between the empirical error ˆls (f ) and the generalization error l(f ). in this work, we mainly focus on the mean squared loss, LINEBREAK lf (x, y) = LINEBREAK (fk(x) − yk)2, LINEBREAK and also treat classification as a regression task, as commonly done in the literature (lee et al., 2018; chen et al., 2020; arora et al., 2019a; hui & belkin, 2021; bachmann et al., 2021). finally, we consider the function spaces induced by kernels and neural networks, presented in the following. LINEBREAK kernel learning LINEBREAK a kernel k : x × x −→ r is a symmetric, positive semi-definite function, i.e. k(x, x(cid:48)) = k(x(cid:48), x) ∀ x, x(cid:48) ∈ x and for any set {x1, . . . , xn} ⊂ x , the matrix k ∈ rn×n with entries kij = k(xi, xj) is positive semi-definite. it can be shown that a kernel induces a reproducing kernel hilbert space, a function space equipped with an inner product (cid:104)·, ·(cid:105)h, containing elements LINEBREAK h = cl LINEBREAK (cid:16)(cid:8)f : fk(·) = LINEBREAK αikk(·, xi) for α ∈ rn×c, xi ∈ x (cid:9)(cid:17) LINEBREAK where cl is the closure operator. although h is an infinite dimensional space, it turns out that the minimizer ˆf λ LINEBREAK s can be obtained in closed form for mean squared loss, given by LINEBREAK ˆf λ s (x) = kt LINEBREAK x (k + λ1n)−1 y λ−→0−−−→ ˆfs (x) := kt LINEBREAK x k†y LINEBREAK where the regularization functional is induced by the inner product of the space, ω(f ) = ||f ||2 h, k ∈ rn×n has entries kij = k(xi, xj) and kx ∈ rn has entries (kx)i = k(x, xi). a† denotes the pseudo-inverse of a ∈ rn×n. we will analyze both the regularized ( ˆf λ s ) and unregularized model ( ˆfs ) and their associated loo errors in the following. for a more in-depth discussion of kernels, we refer the reader to hofmann et al. (2008); paulsen & raghupathi (2016). LINEBREAK neural networks and associated kernels LINEBREAK another function class that has seen a rise in popularity is given by the family of fully-connected neural networks of depth l ∈ n, LINEBREAK fn n =
| 3
|
[
124.997,
569.2490828,
157.28891028,
580.1268556
] |
fvLLcIYmXb.pdf
| 2,022
| 1
|
LINEBREAK as-mlp: an axial shifted mlp architecture for vision LINEBREAK dongze lian∗, zehao yu∗ shanghaitech university {liandz,yuzh}@shanghaitech.edu.cn LINEBREAK xing sun youtu lab, tencent {winfredsun}@tencent.com LINEBREAK shenghua gao† shanghaitech university & shanghai engineering research center of intelligent vision and imaging & shanghai engineering research center of energy efficient and custom ai ic {gaoshh}@shanghaitech.edu.cn LINEBREAK abstract LINEBREAK an axial shifted mlp architecture (as-mlp) is proposed in this paper. different from mlp-mixer, where the global spatial feature is encoded for information flow through matrix transposition and one token-mixing mlp, we pay more attention to the local features interaction. by axially shifting channels of the feature map, asmlp is able to obtain the information flow from different axial directions, which captures the local dependencies. such an operation enables us to utilize a pure mlp architecture to achieve the same local receptive field as cnn-like architecture. we can also design the receptive field size and dilation of blocks of as-mlp, etc, in the same spirit of convolutional neural networks. with the proposed asmlp architecture, our model obtains 83.3% top-1 accuracy with 88m parameters and 15.2 gflops on the imagenet-1k dataset. such a simple yet effective architecture outperforms all mlp-based architectures and achieves competitive performance compared to the transformer-based architectures (e.g., swin transformer) even with slightly lower flops. in addition, as-mlp is also the first mlp-based architecture to be applied to the downstream tasks (e.g., object detection and semantic segmentation). the experimental results are also impressive. our proposed as-mlp obtains 51.5 map on the coco validation set and 49.5 ms miou on the ade20k dataset, which is competitive compared to the transformer-based architectures. our as-mlp establishes a strong baseline of mlp-based architecture. code is available at https://github.com/svip-lab/as-mlp. LINEBREAK introduction LINEBREAK in the past decade, convolutional neural networks (cnns) (krizhevsky et al., 2012; he et al., 2016) have received widespread attention and have become the de-facto standard for computer vision. furthermore, with the in-depth exploration and research on self-attention, transformer-based architectures have also gradually emerged, and have surpassed cnn-based architectures in natural language processing (e.g., bert (devlin et al., 2018)) and vision understanding (e.g., vit (dosovitskiy et al., 2021), deit (touvron et al., 2021b)) with amounts of training data. recently, tolstikhin et al. (2021) first propose mlp-based architecture, where almost all network parameters are learned from mlp (linear layer). it achieves amazing results, which is comparable with cnn-like models. LINEBREAK such promising results drive our exploration of mlp-based architecture. in the mlp-mixer (tolstikhin et al., 2021), the model obtains the global receptive field through matrix transposition and token-mixing projection such that the long-range dependencies are covered. however, this rarely makes full use of the local information, which is very important in cnn-like architecture (simonyan & zisserman, 2015; he et al., 2016) because not all pixels need long-range dependencies, and the LINEBREAK ∗equal contribution. †corresponding author. LINEBREAK local information focuses more on extracting the low-level features. in the transformer-based architectures, swin transformer (liu et al., 2021b) computes the self-attention in a window (7 × 7) instead of the global receptive field, which is similar to directly using a convolution layer with a large kernel size (7×7) to cover the local receptive field. some other papers have also already emphasized the advantages of local receptive fields, and introduced local information in the transformer, such as localvit (li et al., 2021), nest (zhang et al., 2021), etc. driven by these ideas, we mainly explore the influence of locality on mlp-based architectures. LINEBREAK in order to introduce locality into the mlp-based architecture, one of the simplest and most intuitive ideas is to add a window to the mlp-mixer, and then perform a token-mixing projection of the local features within the window, just as done in swin transformer (liu et al., 2021b) and linmapper (fang et al., 2021). however, if we divide the window (e.g., 7 × 7) and perform the token-mixing projection in the window, then the linear layer has the 49 × 49 parameters shared between windows, which greatly limits the model capacity and thus affects the learning of parameters and final results. conversely, if the linear layer is not shared between windows, the model weights trained with fixed image size cannot be adapted to downstream tasks with various input sizes because unfixed input sizes will cause a mismatch in the number of windows. LINEBREAK therefore, a more ideal way to introduce locality is to directly model the relationship between a feature point and its surrounding feature points at any position, without the need to set a fixed window (and window size) in advance. to aggregate the features of different spatial positions in the same position and model their relationships, inspired by (wu et al., 2018; lin et al., 2019; wang et al., 2020; ho et al., 2019), we propose an axial shift strategy for mlp-based architecture, where we spatially shift features in both horizontal and vertical directions. such an approach not only aggregates features from different locations, but also makes the feature channel only need to be divided into k groups instead of k2 groups to obtain a receptive field of size k × k with the help of axial operation. after that, a channel-mixing mlp combines these features, enabling the model to obtain local dependencies. it also allows us to design mlp structure as the same as the convolutional kernel, for instance, to design the kernel size and dilation rate. LINEBREAK based on the axial shift strategy, we design axial shifted mlp architecture, named as-mlp. our as-mlp obtains 83.3% top-1 accuracy with 88m parameters and 15.2 gflops in the imagenet1k dataset without any extra training data. such a simple yet effective method outperforms all mlp-based architectures and achieves competitive performance compared to the transformer-based architectures. it is also worth noting that the model weights in mlp-mixer trained with fixed image size cannot be adapted to downstream tasks with various input sizes because the token-mixing mlp has a fixed dimension. on the contrary, the as-mlp architecture can be transferred to downstream tasks (e.g., object detection) due to the design of axial shift. as far as we know, it is also the first work to apply mlp-based architecture to the downstream task. with the pre-trained model in the imagenet-1k dataset, as-mlp obtains 51.5 map on the coco validation set and 49.5 ms miou on the ade20k dataset, which is competitive compared to the transformer-based architectures. LINEBREAK related work LINEBREAK cnn-based architectures. since alexnet (krizhevsky et al., 2012) won the imagenet competition in 2012, the cnn-based architectures have gradually been utilized to automatically extract image features instead of hand-crafted features. subsequently, the vgg network (simonyan & zisserman, 2015) is proposed, which purely uses a series of 3 × 3 convolution and fully connected layers. resnet (he et al., 2016) utilizes the residual connection to transfer features in different layers, which alleviates the gradient vanishing and obtains superior performance. some papers make further improvements to the convolution operation in cnn-based architecture, such as dilated convolution (yu & koltun, 2016) and deformable convolution (dai et al., 2017). efficientnet (tan & le, 2019; 2021) introduces neural architecture search into cnn to search for a suitable network structure. these architectures build the cnn family and are used extensively in computer vision tasks. LINEBREAK transformer-based architectures. transformer is first proposed in (vaswani et al., 2017), where the attention mechanism is utilized to model the relationship between features from the different spatial positions. subsequently, the popularity of bert (devlin et al., 2018) in nlp also promotes the research on transformer in the field of vision. vit (dosovitskiy et al., 2021) uses a transformer framework to extract visual features, where an image is divided into 16 × 16 patches and the convo LINEBREAK figure 1: a tiny version of the overall axial shifted mlp (as-mlp) architecture. LINEBREAK lution layer is completely abandoned. it shows that the transformer-based architecture can perform well in large-scale datasets (e.g., jft-300m). after that, deit (touvron et al., 2021b) carefully designs training strategies and data augmentation to further improve performance on the small datasets (e.g., imagenet-1k). deepvit (zhou et al., 2021) and cait (touvron et al., 2021c) consider the optimization problem when the network deepens, and train a deeper transformer network. crossvit (chen et al., 2021a) combines the local patch and global patch by using two vision transformers. cpvt (chu et al., 2021b) uses a conditional position encoding to effectively encode the spatial positions of patches. levit (graham et al., 2021) improves vit from many aspects, including the convolution embedding, extra non-linear projection and batch normalization, etc. transformer-ls (zhu et al., 2021) proposes a long-range attention and a short-term attention to model long sequences for both language and vision tasks. some papers also design hierarchical backbone to extract spatial features at different scales, such as pvt (wang et al., 2021), swin transformer (liu et al., 2021b), twins (chu et al., 2021a) and nest (zhang et al., 2021), which can be applied to downstream tasks. LINEBREAK mlp-based architectures. mlp-mixer (tolstikhin et al., 2021) designs a very concise framework that utilizes matrix transposition and mlp to transmit information between spatial features, and obtains promising performance. the concurrent work ff (melas-kyriazi, 2021) also applies a similar network architecture and reaches similar conclusions. subsequently, res-mlp (touvron et al., 2021a) is proposed, which also obtains impressive performance with residual mlp only trained on imagenet-1k. gmlp (liu et al., 2021a) and ea (guo et al., 2021) introduce spatial gating unit (sgu) and the external attention to improve the performance of the pure mlp-based architecture, respectively. recently, container (gao et al., 2021) proposes a general network that unifies convolution, transformer, and mlp-mixer. s2-mlp (yu et al., 2021) uses spatial-shift mlp for feature exchange. vip (hou et al., 2021). proposes a permute-mlp layer for spatial information encoding to capture long-range dependencies. different from these work, we focus on capturing the local dependencies with axially shifting features in the spatial dimension, which obtains better performance and can be applied to the downstream tasks. besides, the closest concurrent work with us, cyclemlp (chen et al., 2021b) and s2-mlpv2 (yu et al., 2021) are also proposed. s2-mlpv2 improves s2-mlp and cyclemlp designs cycle fully-connected layer (cycle fc) to obtain a larger receptive field than channel fc. LINEBREAK the as-mlp architecture LINEBREAK overall architecture LINEBREAK figure 1 shows our axial shifted mlp (as-mlp) architecture, which refers to the style of swin transformer (liu et al., 2021b). given an rgb image i ∈ r3×h×w , where h and w are the height and width of the image, respectively, as-mlp performs the patch partition operation, which splits the original image into multiple patch tokens with the patch size of 4 × 4, thus the combination of all tokens has the size of 48 × h 4 . as-mlp has four stages in total and there are different numbers of as-mlp blocks in different stages. figure 1 only shows the tiny versxion of as-mlp, and other variants will be discussed in sec. 3.4. all the tokens in the previous step will go through these four stages, and the final output feature will be used for image classification. in stage 1, a linear embedding and the as-mlp blocks are adopted for each token. the output has the dimension of c × h 4 , where c is the number of channels. stage 2 first performs patch merging on the features outputted from the previous stage, which groups the neighbor 2 × 2 patches to obtain a feature with the size of 4c × h 8 and then a linear layer is adopted to warp the feature size to 2c × h 8 , followed by the cascaded as-mlp blocks. stage 3 and stage 4 have similar structures to stage 2, and the hierarchical representations will be generated in these stages. LINEBREAK (a) LINEBREAK (b) LINEBREAK figure 2: (a) shows the structure of the as-mlp block; (b) shows the horizontal shift, where the arrows indicate the steps, and the number in each box is the index of the feature. LINEBREAK as-mlp block LINEBREAK the core operation of as-mlp architecture is the as-mlp block, which is illustrated in figure 2a. it mainly consists of the norm layer, axial shift operation, mlp, and residual connection. in the axial shift operation, we utilize the channel projection, vertical shift, and horizontal shift to extract features, where the channel projection maps the feature with a linear layer. vertical shift and horizontal shift are responsible for the feature translation along the spatial directions. LINEBREAK as shown in figure 2b, we take the horizontal shift as an example. the input has the dimension of c × h × w. for convenience, we omit h and assume c = 3, w = 5 in this figure. when the shift size is 3, the input feature is split into three parts and they are shifted by {-1, 0, 1} units along the horizontal direction, respectively. in this operation, zero padding is performed (indicated by gray blocks), and we also discuss the experimental results of using other padding methods in sec. 4. after that, the features in the dashed box will be taken out and used for the next channel projection. the same operation is also performed in the vertical shift. in the process of both shifts, since the feature performs different shift units, the information from different spatial positions can be combined together. in the next channel projection operation, information from different spatial locations can fully flow and interact. the code of as-mlp block is listed in alg. 1. LINEBREAK complexity. in the transformer-based architecture, the multi-head self-attention (msa) is usually adopted, where the attention between tokens is computed. swin transformer (liu et al., 2021b) introduces a window to partition the image and propose window multi-head self-attention (w-msa), which only considers the computation within this window. it significantly reduces the computation complexity. however, in the as-mlp block, without the concept of the window, we only axially shift (as) the feature from the previous layer, which does not require any multiplication and addition operations. further, the time cost of axial shift is very low and almost irrelevant to the shift size. given a feature map (is usually named patches in transformer) with the dimension of c × h × w, each axial shift operation in figure 2a only has four channel projection operations, which has the computation complexity 4hwc 2. if the window size in swin transformer (liu et al., 2021b) is m , the complexities of msa, w-msa and as are as follows: LINEBREAK ω(msa) = 4hwc 2 + 2(hw)2c, ω(w-msa) = 4hwc 2 + 2m 2hwc, ω(as) = 4hwc 2. LINEBREAK therefore, the as-mlp architecture has slightly less complexity than swin transformer. the specific complexity calculation of each layer is shown in appendix a.2. LINEBREAK comparisons between as-mlp, convolution, transformer and mlp-mixer LINEBREAK in this section, we compare as-mlp with the recent distinct building blocks used in computer vision, e.g., the standard convolution, swin transformer, and mlp-mixer. although these modules are explored in completely different routes, from the perspective of calculation, they are all based on a given output location point, and the output depends on the weighted sum of different sampling location features (multiplication and addition operation). these sampling location features include local dependencies (e.g., convolution) and long-range dependencies (e.g., mlp-mixer). figure 3 shows the main differences of these modules in the sampling location. given an input feature map x ∈ rh×w ×c, the outputs yi,j with different operations in position (i, j) are as follows: LINEBREAK algorithm 1 code of as-mlp block in a pytorch-like style. LINEBREAK # norm: normalization layer # proj: channel projection # actn: activation layer LINEBREAK import torch import torch.nn.functional as f LINEBREAK def shift(x, dim): LINEBREAK x = f.pad(x, "constant", 0) x = torch.chunk(x, shift_size, 1) x = [ torch.roll(x_s, shift, dim) for x_s, LINEBREAK shift in zip(x, range(-pad, pad+1))] LINEBREAK x = torch.cat(x, 1) return x[:, :, pad:-pad, pad:-pad] LINEBREAK def as_mlp_block(x): LINEBREAK shortcut = x x = norm(x) x = actn(norm(proj(x))) x_lr = actn(proj(shift(x, 3))) x_td = actn(proj(shift(x, 2))) x = x_lr + x_td x = proj(norm(x)) return x + shortcut LINEBREAK figure 3: the different sampling locations of convolution, swin transformer, mlp-mixer, and as-mlp. e.g., as-mlp (s = 3, d = 1) shows the sampling locations when the shift size is 3 and dilation is 1. LINEBREAK convolution. for convolution operation, a sliding kernel with the shape of k × k (receptive field region r) is performed on x to obtain the output y conv LINEBREAK i,j LINEBREAK y conv i,j = LINEBREAK (m,n)∈r LINEBREAK xi+m,j+n,:w conv LINEBREAK m,n,:, LINEBREAK where w conv ∈ rk×k×c is the learnable weight. h and w are the height and width of x, respectively. as shown in figure 3, the convolution operation has a local receptive field, thus it is more suitable at extracting features with the local dependencies. LINEBREAK swin transformer. swin transformer introduces a window into the transformer-based architecture to cover the local attention. the input x from a window is embedded to obtain q, k, v matrix, and the output yswin is the attention combination of features within the window: LINEBREAK (3) the introduction of locality further improves the performance of the transformer-based architecture and reduces the computational complexity. LINEBREAK i,j = softmax(q(xi,j)k(x)t / y swin LINEBREAK d)v (x). LINEBREAK mlp-mixer. mlp-mixer abandons the attention operation. it first transposes the input x, and then a token-mixing mlp is appended to obtain the output y mixer LINEBREAK i,j LINEBREAK i,j = (x t w mixer y mixer where w mixer ∈ rhw×hw is the learnable weight in token-mixing mlp. mlp-mixer perceives the global information only with matrix transposition and mlp. LINEBREAK iw +j)t , LINEBREAK as-mlp. as-mlp axially shifts the feature map as shown in figure 2b. given the input x, shift size s and dilation rate d, x is first divided into s splits in the horizontal and vertical direction. after the axial shift in figure 2b, the output y as LINEBREAK i,j is: LINEBREAK y as i,j = LINEBREAK xi+(cid:98) LINEBREAK c LINEBREAK 2 (cid:99)·d,j,cw as-h LINEBREAK c + LINEBREAK xi,j+(cid:98) LINEBREAK c LINEBREAK 2 (cid:99)·d,cw as-v LINEBREAK c LINEBREAK where w as-h, w as-v ∈ rc are the learnable weights of channel projection in the horizontal and vertical directions (here we omit activation function and bias). unlike mlp-mixer, we pay more attention to the local dependencies through axial shift of features and channel projection. such an operation is closely related to shift (wu et al., 2018) and tsm (lin et al., 2019). however, our method has the following characteristics: i) we use axial shift in the horizontal and vertical directions, which focuses more on the information exchange in two directions; ii) the proposed network is built upon swin transformer and pure mlp-based architecture, where only linear layer is used and bn is replaced by ln; iii) as will be shown in sec. 4, our network achieves superior performance, which shows the effectiveness of our method. although such an operation can be implemented in the original shift (wu et al., 2018), the feature channel needs to split into k2 groups to achieve a receptive field of size k × k. however, the axial operation makes the feature channel only need to be divided into k groups instead of k2 groups, which reduces the complexity. LINEBREAK network LINEBREAK input resolution LINEBREAK cnn-based LINEBREAK top-1 (%) LINEBREAK params LINEBREAK flops LINEBREAK throughput (image / s) LINEBREAK regnety-8gf (radosavovic et al., 2020) regnety-16gf (radosavovic et al., 2020) efficientnet-b5 (tan & le, 2019) LINEBREAK transformer-based LINEBREAK vit-b/16 (dosovitskiy et al., 2021) deit-b/16 (touvron et al., 2021b) pvt-large (wang et al., 2021) swin-t (liu et al., 2021b) swin-s (liu et al., 2021b) swin-b (liu et al., 2021b) swin-b (liu et al., 2021b) LINEBREAK gmlp-s (liu et al., 2021a) vip-small/14 (hou et al., 2021) vip-small/7 (hou et al., 2021) as-mlp-t (ours) LINEBREAK mixer-b/16 (tolstikhin et al., 2021) ff (melas-kyriazi, 2021) resmlp-36 (touvron et al., 2021a) s2-mlp-wide (yu et al., 2021) s2-mlp-deep (yu et al., 2021) vip-medium/7 (hou et al., 2021) as-mlp-s (ours) LINEBREAK gmlp-b (liu et al., 2021a) vip-large/7 (hou et al., 2021) as-mlp-b (ours) as-mlp-b (ours) LINEBREAK mlp-based LINEBREAK table 1: the experimental results of different networks on imagenet-1k. throughput is measured with the batch size of 64 on a single v100 gpu (32gb). the more complete accuracy and throughput comparisons are listed in appendix b.2. LINEBREAK variants of as-mlp architecture LINEBREAK figure 1 only shows the tiny version of our as-mlp architecture. following deit (touvron et al., 2021b) and swin transformer (liu et al., 2021b), we also stack different number of as-mlp blocks (the number of blocks in four stages) and expand the channel dimension (c in figure 1) to obtain variants of the as-mlp architecture of different model sizes, which are as-mlp-tiny (as-mlpt), as-mlp-small (as-mlp-s) and as-mlp-base (as-mlp-b), respectively. the specific configuration is as follows: LINEBREAK • as-mlp-t: c = 96, the number of blocks in four stages = {2, 2, 6, 2}; • as-mlp-s: c = 96, the number of blocks in four stages = {2, 2, 18, 2}; • as-mlp-b: c = 128, the number of blocks in four stages = {2, 2, 18, 2}. LINEBREAK the detailed configurations can be found in appendix a.1. table 1 in sec. 4 shows top-1 accuracy, model size (params), computation complexity (flops) and throughput of different variants. LINEBREAK experiments
| 5
|
[
108.299,
179.8876768,
200.0834953,
191.8428768
] |
n-bvaLSCC78.pdf
| 2,023
| 0
|
LINEBREAK ea-has-bench: energy-aware hyperparameter and architecture search benchmark LINEBREAK shuguang dou1 ∗, xinyang jiang2 †, cairong zhao1 †, dongsheng li2 1 tongji university, 2 microsoft research asia LINEBREAK abstract LINEBREAK the energy consumption for training deep learning models is increasing at an alarming rate due to the growth of training data and model scale, resulting in a negative impact on carbon neutrality. energy consumption is an especially pressing issue for automl algorithms because it usually requires repeatedly training large numbers of computationally intensive deep models to search for optimal configurations. this paper takes one of the most essential steps in developing energy-aware (ea) nas methods, by providing a benchmark that makes eanas research more reproducible and accessible. specifically, we present the first large-scale energy-aware benchmark that allows studying automl methods to achieve better trade-offs between performance and search energy consumption, named ea-has-bench. ea-has-bench provides a large-scale architecture/hyperparameter joint search space, covering diversified configurations related to energy consumption. furthermore, we propose a novel surrogate model specially designed for large joint search space, which proposes a b´ezier curve-based model to predict learning curves with unlimited shape and length. based on the proposed dataset, we modify existing automl algorithms to consider the search energy consumption, and our experiments show that the modified energy-aware automl methods achieve a better trade-off between energy consumption and model performance. LINEBREAK introduction LINEBREAK as deep learning technology progresses rapidly, its alarming increased rate of energy consumption causes growing concerns (schwartz et al., 2020; li et al., 2021a; strubell et al., 2019). neural architecture search (nas) (elsken et al., 2019), hyperparameter optimization (hpo) (feurer & hutter, 2019) lifted the manual effort of neural architecture and hyperparameter tuning but require repeatedly training large numbers of computationally intensive deep models, leading to significant energy consumption and carbon emissions. for instance, training 10k models on cifar-10 (krizhevsky et al., 2009) for 100 epochs consume about 500,000 kwh of energy power, which is equivalent to the annual electricity consumption of about 600 households in china. LINEBREAK as a result, it is essential to develop search energy cost aware (ea) automl methods, which are able to find models with good performance while minimizing the overall energy consumption throughout the search process. however, existing nas studies mainly focus on the resource cost of the searched deep model, such as parameter size, the number of float-point operations (flops), or latency (tan et al., 2019; wu et al., 2019; he et al., 2021). exploiting the trade-off between model performance and energy cost during the searching process has been rarely studied (elsken et al., 2019). in this paper, we propose to take one of the most essential steps in developing energy-aware (ea) nas methods that make ea-nas research more reproducible and accessible. specifically, we provide a benchmark for ea-nas called energy aware hyperparameter and architecture search benchmark (ea-has-bench), where the researchers can easily obtain the training energy cost and model performance of a certain architecture and hyperparameter configuration, without actually training the model. in order to support developing energy-aware hpo and nas methods, the proposed ea-has-bench should satisfy three requirements. LINEBREAK *work done during an internship in microsoft research asia. email: [email protected]. †corresponding authors. email: [email protected], [email protected] LINEBREAK size LINEBREAK table 1: overview of nas benchmarks related to ea-has-bench arch. type cell cell cell macro ✓ LINEBREAK lcs query LINEBREAK benchmark LINEBREAK nas-bench-101 nas-bench-201 nas-bench-301 nats-bench hw-nas-bench LINEBREAK nas LINEBREAK nas-bench-x11 LINEBREAK nas+ hpo LINEBREAK nas-hpo-bench nas-hpo-bench-ii ea-has-bench (ours) LINEBREAK bench. type tab. tab. surr. tab. tab./esti. cell cell surr. cell surr. cell surr. mlp tab. cell surr. macro ✓ surr. LINEBREAK accuracy accuracy & loss accuracy accuracy & loss latency & inference energy accuracy accuracy & loss accuracy accuracy accuracy accuracy & inference and total search energy LINEBREAK search energy cost our dataset needs to provide the total search energy cost of running a specific automl method. this can be obtained by measuring the energy cost of each particular configuration the method traverses and summing them up. as shown in table 1, most of the existing conventional benchmarks (ying et al., 2019; dong & yang, 2020; siems et al., 2020) like nas-bench-101 do not directly provide training energy cost but use model training time as the training resource budget, which as verified by our experiments, is an inaccurate estimation of energy cost. hw-nas-bench (li et al., 2021b) provides the inference latency and inference energy consumption of different model architectures but also does not provide the search energy cost. LINEBREAK energy related joint search space the search space of ea-has-bench should include the configurations that affect both the model training energy cost and performance. since both model architectures (e.g., scales, width, depth) and training hyperparameters (e.g., number of epochs) are correlated to the training energy cost, designing a joint hyperparameter and architecture search (has) search space is essential. most nas benchmarks use a single fixed training hyperparameter configuration for all architectures. existing has benchmarks (klein & hutter, 2019; hirose et al., 2021) use small toy search space which does not cover enough critical factors affecting the search energy cost. as a result, ea-has-bench provides the first dataset with a ten-billion-level architecture/hyperparameter joint space, covering diverse types of configurations related to search energy cost. LINEBREAK surrogate model for joint search space due to the enormous size of the proposed joint search space, a surrogate model is needed to fill out the entire search space with a subset of sampled configurations. existing surrogate methods (zela et al., 2022; yan et al., 2021) are not applicable to our proposed large-scale joint space. for instance, those methods do not consider the situation of maximum epoch variation and predict only a fixed-length learning curve or final performance. thus, we propose the b´ezier curve-based surrogate (bcs) model to fit accuracy learning curves of unlimited shape and length. LINEBREAK we summarize the contribution of this paper as follows: LINEBREAK • ea-has-bench is the first has dataset aware of the overall search energy cost. *. based on this dataset, we further propose a energy-aware automl method with search energy cost related penalties, showing energy-aware automl achieves a better trade-off between model performance and search energy cost. LINEBREAK • we provide the first large-scale benchmark containing an architecture/hyperparameter joint search space with over 10 billion configurations, covering various configurations related to search energy cost. LINEBREAK • we develop a novel surrogate model suitable for more general and complex joint has search space, which outperforms nas-bench-x11 and other parametric learning curvebased methods. LINEBREAK *the dataset and codebase of ea-has-bench are available at https://github.com/microsoft/ea-has LINEBREAK bench. LINEBREAK table 2: overview of ea-has-bench’s search space LINEBREAK type LINEBREAK regnet LINEBREAK hyperparameter depth d w0 wa wm group width LINEBREAK total of network architectures LINEBREAK optima LINEBREAK learning rate LINEBREAK max epoch decay policy optimizer LINEBREAK training data augmentation LINEBREAK total of hyperparameter space LINEBREAK creating energy aware benchmarks LINEBREAK ea-has-bench search space LINEBREAK unlike the search space of existing mainstream nas-bench that focuses only on network architectures, our ea-has-bench consists of a combination of two parts: the network architecture spaceregnet (radosavovic et al., 2020) and the hyperparameter space for optimization and training, in order to cover diversified configurations that affect both performance and energy consumption. the details of the search space are shown in table 2. LINEBREAK regnet search space. our benchmark applies regnet as the architecture search space because it contains several essential factors that control the scale and shape of the deep model, which corresponds to the training energy cost. specifically, regnet is a macro search space with the variation in width and depth explained by a quantized linear function. specifically, for widths of residual blocks: uj = w0 + wa × j, where 0 ≤ j ≤ d and d denotes the depth. an additional parameter wm is introduced to quantize uj, i.e. uj = w0 × wsj m and the quantized per-block widths wj is computed by LINEBREAK wj = w0 × w⌊sj ⌉ LINEBREAK m LINEBREAK where ⌊sj⌉ denotes round sj. the original search space of regnet is for imagenet and is non-trivial to directly apply to other datasets. as a result, we shrink down the original model size range of the regnet space and constraint the total parameters and flops of a model to a relatively small size, which achieves faster training and saves resources. LINEBREAK training hyperparameter search space. hyperparameter space (e.g., learning rate and maximum epoch) also has a great impact on energy consumption throughout the training phase. for example, the maximum epoch is almost proportional to training time, which is also proportional to training energy cost. different learning rate also causes different convergence rate and different total training time, resulting in different training energy cost. thus, for hyperparameter search space, ea-has-bench considers training epochs, and the most important factors in training schemes, i.e., base learning rate, decay policy of learning rate, optimizer, and data augmentation. as a result, the search space of ea-has-bench contains a total of 3.26 × 1010 configurations, including 6 × 107 architectures and 540 training hyperparameter settings with variant training epochs. LINEBREAK evaluation metrics LINEBREAK the ea-has-bench dataset provides the following three types of metrics to evaluate different configurations. LINEBREAK figure 1: overview of b´ezier curve-based surrogate model. hc denotes hyperparameter configuration. LINEBREAK model complexity. metrics related to model complexity include parameter size, flops, number of network activations (the size of the output tensors of each convolutional layer), as well as the inference energy cost of the trained model. LINEBREAK model performance. in order to support multi-fidelity nas algorithms such as hyperband (li et al., 2017), ea-has-bench provides the full training information including training, validation, and test accuracy learning curves for each hyperparameter and architecture configuration. LINEBREAK search cost. firstly, the energy cost (in kwh) and time (in seconds) to train a model under a certain configuration for one epoch are obtained. then, by accumulating the energy consumption and runtime at each epoch, we obtain the total search cost of a configuration, which allows nas/hpo methods to search optimal models under a limited cost budget. LINEBREAK b ´ezier curve-based surrogate model LINEBREAK due to the large ea-has-bench search space, directly training all configurations in the space is infeasible even for a small dataset like cifar10. as a result, some of the metrics can not be directly measured, including the model performance curve, search energy cost, and runtime. thus, similar to other recent works (zela et al., 2022; yan et al., 2021), we develop a surrogate model that expands the entire search space from a sampled subset of configurations. LINEBREAK as for energy cost and training time, we follow the surrogate nas benchmark (zela et al., 2022) and train lgb (lightgbm) (ke et al., 2017) models to predict these. however, for learning curve prediction, surrogate models proposed by the existing nas-bench are not applicable to ea-hasbench. since ea-has-bench contains various maximum training epochs in the search space, non of the existing surrogate model can cope with dimensionally varying inputs. more importantly, it is not possible to directly constrain the learning curve after using the dimensionality reduction operation (e.g., the error rate should be between 0 and 1). in our early experiments, the implementation of the nas algorithm on the nas-bench-x11 surrogate model would yield results with more than 100% accuracy. therefore, we propose a b´ezier curved-based surrogate (bcs) model to solve the above problems. LINEBREAK convert learning curve to b´ezier curve control points. for each configuration of network architecture and training hyperparameters, the surrogate model outputs the learning curve containing the accuracy or error rate of each epoch. inspired by the success of the b´ezier curve in other areas (liu et al., 2020), we choose the b´ezier curve to fit learning curves of arbitrary length. the shape of a b´ezier curve is entirely determined by its control points, and degree n control points correspond to a b´ezier curve of order n − 1. the b´ezier curve can be formulated in a recursive way as follows: LINEBREAK p (t) = LINEBREAK pibi,n(t), t ∈ [0, 1]
| 3
|
[
290.555,
67.0600828,
369.90591028,
77.9378556
] |
kBVJ2NtiY-.pdf
| 2,021
| 0
|
LINEBREAK learning what to do by simulating the past LINEBREAK david lindner∗ department of computer science eth zurich [email protected] LINEBREAK rohin shah, pieter abbeel & anca dragan center for human-compatible ai uc berkeley {rohinmshah,pabbeel,anca}@berkeley.edu LINEBREAK abstract LINEBREAK since reward functions are hard to specify, recent work has focused on learning policies from human feedback. however, such approaches are impeded by the expense of acquiring such feedback. recent work proposed that agents have access to a source of information that is effectively free: in any environment that humans have acted in, the state will already be optimized for human preferences, and thus an agent can extract information about what humans want from the state (shah et al., 2019). such learning is possible in principle, but requires simulating all possible past trajectories that could have led to the observed state. this is feasible in gridworlds, but how do we scale it to complex tasks? in this work, we show that by combining a learned feature encoder with learned inverse models, we can enable agents to simulate human actions backwards in time to infer what they must have done. the resulting algorithm is able to reproduce a specific skill in mujoco environments given a single state sampled from the optimal policy for that skill. LINEBREAK introduction LINEBREAK as deep learning has become popular, many parts of ai systems that were previously designed by hand have been replaced with learned components. neural architecture search has automated architecture design (zoph & le, 2017; elsken et al., 2019), population-based training has automated hyperparameter tuning (jaderberg et al., 2017), and self-supervised learning has led to impressive results in language modeling (devlin et al., 2019; radford et al., 2019; clark et al., 2020) and reduced the need for labels in image classification (oord et al., 2018; he et al., 2020; chen et al., 2020). however, in reinforcement learning, one component continues to be designed by humans: the task specification. handcoded reward functions are notoriously difficult to specify (clark & amodei, 2016; krakovna, 2018), and learning from demonstrations (ng et al., 2000; fu et al., 2018) or preferences (wirth et al., 2017; christiano et al., 2017) requires a lot of human input. is there a way that we can automate even the specification of what must be done? LINEBREAK it turns out that we can learn part of what the user wants simply by looking at the state of the environment: after all, the user will already have optimized the state towards their own preferences (shah et al., 2019). for example, when a robot is deployed in a room containing an intact vase, it can reason that if its user wanted the vase to be broken, it would already have been broken; thus she probably wants the vase to remain intact. LINEBREAK however, we must ensure that the agent distinguishes between aspects of the state that the user couldn’t control from aspects that the user deliberately designed. this requires us to simulate what the user must have done to lead to the observed state: anything that the user put effort into in the past is probably something the agent should do as well. as illustrated in figure 1, if we observe a cheetah balancing on its front leg, we can infer how it must have launched itself into that position. unfortunately, it is unclear how to simulate these past trajectories that lead to the observed state. so far, this has only been done in gridworlds, where all possible trajectories can be considered using dynamic programming (shah et al., 2019). LINEBREAK our key insight is that we can sample such trajectories by starting at the observed state and simulating backwards in time. to enable this, we derive a gradient that is amenable to estimation through backwards simulation, and learn an inverse policy and inverse dynamics model using supervised LINEBREAK ∗work done at the center for human-compatible ai, uc berkeley. LINEBREAK figure 1: suppose we observe a cheetah balancing on its front leg (left). given a simulator for the environment, deep rlsp is able to infer how the cheetah must have acted to end up in this position. it can then imitate these actions in order to recreate this skill. note that the state contains joint velocities in addition to positions, which makes the task more tractable than this picture might suggest. LINEBREAK learning to perform the backwards simulation. then, the only remaining challenge is finding a reward representation that can be meaningfully updated from a single state observation. to that end, rather than defining the reward directly on the raw input space, we represent it as a linear combination of features learned through self-supervised representation learning. putting these components together, we propose the deep reward learning by simulating the past (deep rlsp) algorithm. LINEBREAK we evaluate deep rlsp on mujoco environments and show that it can recover fairly good performance on the task reward given access to a small number of states sampled from a policy optimized for that reward. we also use deep rlsp to imitate skills generated using a skill discovery algorithm (sharma et al., 2020), in some cases given just a single state sampled from the policy for that skill. LINEBREAK information from the environment state cannot completely replace reward supervision. for example, it would be hard to infer how clean bob would ideally want his room to be, if the room is currently messy because bob is too busy to clean it. nonetheless, we are optimistic that information from the environment state can be used to significantly reduce the burden of human supervision required to train useful, capable agents. LINEBREAK method LINEBREAK in this section, we describe how deep rlsp can learn a reward function for high dimensional environments given access only to a simulator and the observed state s0. LINEBREAK notation. a finite-horizon markov decision process (mdp) m = (cid:104)s, a, t , r, p, t (cid:105) contains a set of states s and a set of actions a. the transition function t : s × a × s (cid:55)→ [0, 1] determines the distribution over next states given a state and an action, and p is a prior distribution over initial states. the reward function r : s (cid:55)→ r determines the agent’s objective. t ∈ z+ is a finite planning horizon. a policy π : s × a (cid:55)→ [0, 1] specifies how to choose actions given a state. given an initial state distribution, a policy and the transition function, we can sample a trajectory τ by sampling the first state from p, every subsequent action from π, and every subsequent state from t . we denote the probability distribution over trajectories as (cid:104)p, π, t (cid:105) and write τ ∼ (cid:104)p, π, t (cid:105) for the sampling step. we will sometimes write a single state s instead of a distribution p if the initial state is deterministic. the goal of reinforcement learning (rl) is to find a policy π∗ that maximizes the expected cumulative reward eτ ∼(cid:104)p,π,t (cid:105) LINEBREAK t=1 r(st) LINEBREAK we use φ : s → rn to denote a feature function (whether handcoded or learned) that produces a feature vector of length n for every state. the reward function r is linear over φ if it can be expressed in the form r(s) = θt φ(s) for some θ ∈ rn. LINEBREAK we assume that some past trajectory τ−t :0 = s−t a−t . . . a−1s0 produced the observed state s0. LINEBREAK idealized algorithm LINEBREAK we first explain what we would ideally do, if we had a handcoded a feature function φ and an enumerable (small) state space s that affords dynamic programming. this is a recap of reward learning by simulating the past (rlsp; shah et al., 2019). LINEBREAK we assume the human follows a boltzmann-rational policy πt(a | s, θ) ∝ exp(qt(s, a; θ)), where the q values are computed using soft value iteration. marginalizing over past trajectories, yields a distribution over the observed state p(s0 | θ) = (cid:80) p(τ = s−t a−t . . . a−1s0 | θ). we compute the maximum likelihood estimate, argmaxθ ln p(s0 | θ), via gradient ascent, by expressing the gradient of the observed state as a weighted combination of gradients of consistent trajectories (shah et al., 2019, appendix b): LINEBREAK s−t ...a−1 LINEBREAK ∇θ ln p(s0 | θ) = LINEBREAK [∇θ ln p(τ | θ)] LINEBREAK ∇θ ln p(τ | θ) is a gradient for inverse reinforcement learning. since we assume a boltzmann-rational human, this is the gradient for maximum causal entropy inverse reinforcement learning (mceirl; ziebart et al., 2010). however, we still need to compute an expectation over all trajectories that end in s0, which is in general intractable. shah et al. (2019) use dynamic programming to compute this gradient in tabular settings. LINEBREAK gradient as backwards-forwards consistency LINEBREAK approximating the expectation. for higher-dimensional environments, we must approximate the expectation over past trajectories p(τ−t :−1 | s0, θ). we would like to sample from the distribution, but it is not clear how to sample the past conditioned on the present. our key idea is that just as we can sample the future by rolling out forwards in time, we should be able to sample the past by rolling out backwards in time. note that by the markov property we have: LINEBREAK t=−t LINEBREAK t=−t LINEBREAK p(st | at, st+1, . . . s0, θ)p(at | st+1, at+1, . . . s0, θ) LINEBREAK p(st | at, st+1, θ)p(at | st+1, θ) LINEBREAK t LINEBREAK (at LINEBREAK | st+1, θ), the inverse dynamics t −1 LINEBREAK thus, given the inverse policy π−1 | at, st+1, θ), and the observed state s0, we can sample a past trajectory τ−t :−1 ∼ p(τ−t :−1 | s0, θ) by iteratively applying π−1 and t −1, starting from s0. analogous to forward trajectories, we express the sampling as τ−t :−1 ∼ (cid:104)s0, π−1, t −1(cid:105). thus, we can write the gradient in equation 1 as eτ−t :−1 ∼ (cid:104)s0,π−1,t −1(cid:105) [∇θ ln p(τ | θ)]. learning π, π−1 and t −1. in order to learn π−1, we must first know π. we assumed that the human was boltzmann-rational, which corresponds to the maximum entropy reinforcement learning objective (levine, 2018). we use the soft actor-critic algorithm (sac; haarnoja et al., 2018) to estimate the policy π(a | s, θ), since it explicitly optimizes the maximum entropy rl objective. LINEBREAK (st LINEBREAK t LINEBREAK given the forward policy π(a | s, θ) and simulator t , we can construct a dataset of sampled forward trajectories, and learn the inverse policy π−1 and the inverse dynamics t −1 using supervised learning. given these, we can then sample τ−t :−1, allowing us to approximate the expectation in the gradient. in general, both π−1 and t −1 could be stochastic and time-dependent. LINEBREAK estimating the gradient for a trajectory. we now turn to the term within the expectation, which is the inverse reinforcement learning gradient given a demonstration trajectory τ = s−t a−t . . . s0. assuming that the user is boltzmann-rational, this is the mceirl gradient (ziebart et al., 2010), which can be written as (shah et al., 2019, appendix a): LINEBREAK ∇θ ln p(τ | θ) = LINEBREAK t=−t LINEBREAK φ(st) LINEBREAK −f−t (s−t )+ LINEBREAK t=−t LINEBREAK e s(cid:48) t+1∼t (·|st,at) LINEBREAK f is the expected feature count under π, that is, f−t(s−t) (cid:44) eτ−t:0 ∼ (cid:104)s−t,π,t (cid:105) LINEBREAK the first term computes the feature counts of the demonstrated trajectory τ , while the second term computes the feature counts obtained by the policy for the current reward function θ (starting from LINEBREAK the initial state s−t ). since r(s) = θt φ(s), these terms increase the reward of features present in the demonstration τ and decrease the reward of features under the current policy. thus, the gradient incentivizes consistency between the demonstration and rollouts from the learned policy. LINEBREAK the last term is essentially a correction for the observed dynamics: if we see that st, at led to st+1, it corrects for the fact that we “could have” seen some other state s(cid:48) t+1. since this correction is zero in expectation (and expensive to compute), we drop it for our estimator. LINEBREAK gradient estimator. after dropping the last term in equation 2, expanding the definition of f, and substituting in to equation 1, our final gradient estimator is: LINEBREAK ∇θ ln p(s0 | θ) = LINEBREAK t=−t LINEBREAK φ(st) LINEBREAK t=−t LINEBREAK φ(s(cid:48) t) LINEBREAK thus, given s0, θ, π, t , π−1, and t −1, computing the gradient consists of three steps: LINEBREAK 1. simulate backwards from s0, and compute the feature counts of the resulting trajectories. 2. simulate forwards from s−t of these trajectories, and compute their feature counts. 3. take the difference between these two quantities. LINEBREAK this again incentivizes consistency, this time between the backwards and forwards trajectories: the gradient leads to movement towards “what the human must have done” and away from “what the human would do if they had this reward”. the gradient becomes zero when they are identical. LINEBREAK it may seem like the backwards and forwards trajectories should always be consistent with each other, since π−1 and t −1 are inverses of π and t . the key difference is that s0 imposes constraints on the backwards trajectories, but not on the forward trajectories. for example, suppose we observe s0 in which a vase is unbroken, and our current hypothesis is that the user wants to break the vase. when we simulate backwards, our trajectory will contain an unbroken vase, but when we simulate forwards from s−t , π will break the vase. the gradient would then reduce the reward for a broken vase and increase the reward for an unbroken vase. LINEBREAK learning a latent mdp LINEBREAK our gradient still relies on a feature function φ, with the reward parameterized as r(s) = θt φ(s). a natural way to remove this assumption would be to instead allow θ to parameterize a neural network, which can then learn whatever features are relevant to the reward from the rlsp gradient. LINEBREAK however, this approach will not work because the information contained in the rlsp gradient is insufficient to identify the appropriate features to construct: after all, it is derived from a single state. if we were to learn a single unified reward using the same gradient, the resulting reward would likely be degenerate: for example, it may simply identify the observed state, that is r(s) = 1[s = s0]. thus, we continue to assume that the reward is linear in features, and instead learn the feature function using self-supervised learning (oord et al., 2018; he et al., 2020). in our experiments, we use a variational autoencoder (vae; kingma & welling, 2014) to learn the feature function. the vae encodes the states into a latent feature representation, which we can use to learn a reward function if the environment is fully observable, i.e., the states contain all relevant information. LINEBREAK for partially observable environments recurrent state space models (rssms; karl et al., 2017; doerr et al., 2018; buesing et al., 2018; kurutach et al., 2018; hafner et al., 2019; 2020) could be used instead. these methods aim to learn a latent mdp, by computing the states using a recurrent model over the observations, thus allowing the states to encode the history. for such a model, we can imagine that the underlying pomdp has been converted into a latent mdp whose feature function φ is the identity. we can then compute gradients directly in this latent mdp. LINEBREAK deep rlsp LINEBREAK putting these components together gives us the deep rlsp algorithm (algorithm 1). we first learn a feature function φ using self-supervised learning, and then train an inverse dynamics model t −1, all using a dataset of environment interactions (such as random rollouts). then, we update θ using LINEBREAK algorithm 1 the deep rlsp algorithm. the initial dataset of environment interactions d can be constructed in many different ways: random rollouts, human play data, curiosity-driven exploration, etc. the specific method will determine the quality of the learned features. LINEBREAK (cid:46) train encoder and decoder for latent mdp LINEBREAK procedure deep rlsp({s0}, t ) LINEBREAK d ← dataset of environment interactions initialize φe, φd, π, π−1, t −1, θ randomly. φe, φd ← selfsupervisedlearning(d) initialize experience replay e with data in d. t −1 ← supervisedlearning(d) t ← 1 for i in [1..num_epochs] do LINEBREAK π ← sac(θ) π−1 ← supervisedlearning(φe, e) θ ← θ + α × computegrad({s0}, π, t , π−1, t −1, t , φe) if gradient magnitudes are sufficiently low then LINEBREAK return θ, φe LINEBREAK procedure computegrad({s0}, π, t , π−1, t −1, t , φe) LINEBREAK {τbackward} ← rollout({s0}, π−1, t −1, t ) φbackward ← averagefeaturecounts(φe, {τbackward}) {s−t } ← finalstates({τbackward}) {τforward} ← rollout({s−t }, π, t , t ) φforward ← averagefeaturecounts(φe, {τforward}) relabel {τbackward}, {τforward} and add them to e. return φbackward − φforward LINEBREAK (cid:46) train inverse dynamics (cid:46) start horizon at 1 LINEBREAK (cid:46) train policy (cid:46) train inverse policy (cid:46) update θ LINEBREAK (cid:46) advance horizon LINEBREAK (cid:46) simulate backwards from s0 (cid:46) compute backward feature counts LINEBREAK (cid:46) simulate forwards from s−t (cid:46) compute forward feature counts LINEBREAK equation 3, and continually train π, and π−1 alongside θ to keep them up to date. the full algorithm also adds a few bells and whistles that we describe next. LINEBREAK initial state distribution p. the attentive reader may wonder why our gradient appears to be independent of p. this is actually not the case: while π and t are independent of p, π−1 and t −1 do depend on it. for example, if we observe alice exiting the san francisco airport, the corresponding π−1 should hypothesize different flights if she started from new york than if she started from tokyo. however, in order to actually produce such explanations, we must train π−1 and t −1 solely on trajectories of length t starting from s−t ∼ p. we instead train π−1 and t −1 on a variety of trajectory data, which loses the useful information in p, but leads to several benefits. first, we can train the models on exactly the distributions that they will be used on, allowing us to avoid failures due to distribution shift. second, the horizon t is no longer critical: previously, t encoded the separation in time between s−t and s0, and as a result misspecification of t could cause bad results. since we now only have information about s0, it doesn’t matter much what we set t to, and as a result we can use it to set a curriculum (discussed next). finally, this allows deep rlsp to be used in domains where an initial state distribution is not available. note that we are no longer able to use information about p through π−1 and t −1. however, having information about p might be crucial in some applications to prevent deep rlsp from converging to a degenerate solution with s−t = s0 and a policy π that does nothing. while we did not find this to be a problem in our experiments, we discuss a heuristic to incorporate information about s−t into deep rlsp in appendix c. LINEBREAK curriculum. since the horizon t is no longer crucial, we can use it to provide a curriculum. we initially calculate gradients with low values of t , to prevent compounding errors in our learned models, and making it easier to enforce backwards-forwards consistency, and then slowly grow t , making the problem harder. in practice, we found this crucial for performance: intuitively, it is much easier to make short backwards and forwards trajectories consistent than with longer trajectories; the latter would likely have much higher variance. LINEBREAK multiple input states. if we get multiple independent s0 as input, we average their gradients. LINEBREAK experience replay. we maintain an experience replay buffer e that persists across policy training steps. we initialize e with the same set of environment interactions that the feature function and inverse dynamics model are trained on. when computing the gradient, we collect all backward and forward trajectories and add them to e. to avoid compounding errors from the inverse dynamics model, we relabel all transitions using a simulator of the environment. whenever we’d add a transition (s, a, s(cid:48)) to e, we initialize the simulator at s and execute a to obtain ˜s and add transition (s1, a, ˜s) to e instead. LINEBREAK experiments LINEBREAK setup LINEBREAK to demonstrate that deep rlsp can be scaled to complex, continuous, high-dimensional environments, we use the mujoco physics simulator (todorov et al., 2012). we consider the inverted pendulum, half-cheetah and hopper environments implemented in open ai gym (brockman et al., 2016). the hyperparameters of our experiments are described in detail in appendix b. we provide code to replicate our experiments at https://github.com/humancompatibleai/deep-rlsp. LINEBREAK baselines. to our knowledge, this is the first work to train policies using a single state as input. due to lack of alternatives, we compare against gail (ho & ermon, 2016) using the implementation from the imitation library (wang et al., 2020). for each state we provide to deep rlsp, we provide a transition (s, a, s(cid:48)) to gail. LINEBREAK ablations. in section 2.2, we derived a gradient for deep rlsp that enforces consistency between the backwards and forwards trajectories. however, we could also ignore the temporal information altogether. if an optimal policy led to the observed state s0, then it is probably a good bet that s0 is high reward, and that the agent should try to keep the state similar to s0. thus, we can simply set θ = φ(s0) LINEBREAK ||φ(s0)|| , and not deal with π−1 and t −1 at all. 0, . . . , sn LINEBREAK how should we handle multiple states s1 0 ? given that these are all sampled i.i.d. from rollouts of an optimal policy, a natural choice is to simply average the feature vectors of all of the states, which we call averagefeatures. alternatively, we could view each of the observed states as a potential waypoint of the optimal policy, and reward an agent for being near any one of them. we 0) implement this waypoints method as r(s) = maxi 0)|| · φ(s). note that both of these ablations still require us to learn the feature function φ. LINEBREAK φ(si ||φ(si LINEBREAK feature learning dataset. by default, we use random rollouts to generate the initial dataset that is used to train the features φ and the inverse model t −1. (this is d in algorithm 1.) however, in the inverted pendulum environment, the pendulum falls very quickly in random rollouts, and t −1 never learns what a balanced pendulum looks like. so, for this environment only, we combine random rollouts with rollouts from an expert policy that balances the pendulum. LINEBREAK gridworld environments LINEBREAK as a first check, we consider the gridworld environments in shah et al. (2019). in these stylized gridworlds, self-supervised learning should not be expected to learn the necessary features. for example, in the room with vase environment, the two door features are just particular locations, with no distinguishing features that would allow self-supervised learning to identify these locations as important. so, we run algorithm 1 without the feature learning and instead use the pre-defined feature function of the environments. with this setup we are able to use deep rlsp to recover the desired behavior from a single state in all environments in which the exact rlsp algorithm is able to recover it. however, averagefeatures fails on several of the environments. since only one state is provided, waypoints is equivalent to averagefeatures. it is not clear how to apply gail to these environments, and so we do not compare to it. further details on all of the environments and results can be found in appendix a. LINEBREAK environment LINEBREAK sac LINEBREAK # states deep rlsp averagefeatures waypoints LINEBREAK gail LINEBREAK inverted pendulum LINEBREAK cheetah (forward) LINEBREAK cheetah (backward) LINEBREAK hopper (terminate) LINEBREAK hopper (penalty) LINEBREAK table 1: average returns achieved by the policies learned through various methods, for different numbers of input states. the states are sampled from a policy trained using sac on the true reward function; the return of that policy is given as a comparison. besides the sac policy return, all values are averaged over 3 seeds and the standard error is given in parentheses. we don’t report waypoints on 1 state as it is identical to averagefeatures on 1 state. LINEBREAK solving the environments without access to the reward function LINEBREAK first we look at the typical target behavior in each environment: balancing the inverted pendulum, and making the half-cheetah and the hopper move forwards. additionally we consider the goal of making the cheetah run backwards (that is, the negative of its usual reward function). we aim to use deep rlsp to learn these behaviors without having access to the reward function. LINEBREAK we train a policy using soft actor critic (sac; haarnoja et al., 2018) to optimize for the true reward function, and sample either 1, 10 or 50 states from rollouts of this policy to use as input. we then use deep rlsp to infer a reward and policy. ideally we would evaluate this learned policy rather than reoptimizing the learned reward, since learned reward models can often be gamed (stiennon et al., 2020), but it would be too computationally expensive to run the required number of sac steps during each policy learning step. as a result, we run sac for many more iterations on the inferred reward function, and evaluate the resulting policy on the true reward function (which deep rlsp does not have access to). LINEBREAK results are shown in table 1. in hopper, we noticed that videos of the policies learned by deep rlsp looked okay, but the quantitative evaluation said otherwise. it turns out that the policies learned by deep rlsp do jump, as we might want, but they often fall down, terminating the episode; in contrast gail policies stand still or fall over slowly, leading to later termination and explaining their better quantitative performance. we wanted to also evaluate the policies without this termination bias, and so we evaluate the same policies in an environment that does not terminate the episode, but provides a negative reward instead; in this evaluation both deep rlsp and averagefeatures perform much better. we also provide videos of the learned policies at https://sites.google.com/view/ deep-rlsp, which show that the policies learned by deep rlsp do exhibit hopping behavior (though with a strong tendency to fall forward). LINEBREAK gail is only able to learn a truly good policy for the (very simple) inverted pendulum, even though it gets states and actions as input. deep rlsp on the other hand achieves reasonable behavior (though clearly not expert behavior) in all of the environments, using only states as input. surprisingly, the averagefeatures method also performs quite well, even beating the full algorithm on some tasks, though failing quite badly on pendulum. it seems that the task of running forward or backward is very well specified by a single state, since it can be inferred even without any information about the dynamics (except that which is encoded in the features learned from the initial dataset). LINEBREAK figure 2: we sample a few states from a policy performing a specific skill to provide as input. here, deep rlsp learns to balance the cheetah on the front leg from a single state. we provide videos of the original skills and learned policies at: https://sites.google.com/view/deep-rlsp. LINEBREAK learning skills from a single state LINEBREAK we investigate to what extent deep rlsp can learn other skills where the reward is not clear. evaluation on these tasks is much harder, because there is no ground truth reward. therefore we evaluate qualitatively how similar the policies learned by deep rlsp are to the original skill. we also attempted to quantify similarity by checking how quickly a discriminator could learn to distinguish between the learned policy and the original skill, but unfortunately this metric was not conclusive (results are reported in appendix d.1). unlike the previous case, we do not reoptimize the learned reward and only look at the policies learned by deep rlsp. LINEBREAK we consider skills learned by running dynamics-aware unsupervised discovery of skills (dads; sharma et al., 2020). since we are not interested in navigation, we remove the “x-y prior” used to get directional skills in dads. we run dads on the half-cheetah environment and select all skills that are not some form of running. this resulted in two skills: one in which the cheetah is moving forward making big leaps (“jumping”) and one in which it is slowly moving forward on one leg (“balancing”). as before we roll out these policies and sample individual states from the trajectories to provide as an input for deep rlsp. we then evaluate the policy learned by deep rlsp. since the best evaluation here is to simply watch what the learned policy does, we provide videos of the learned policies at https://sites.google.com/view/deep-rlsp. we also provide visualizations in appendix d.2. LINEBREAK the first thing to notice is that relative to the ablations, only deep rlsp is close to imitating the skill. none of the other policies resemble the original skills at all. while averagefeatures could perform well on simple tasks such as running, the full algorithm is crucial to imitate more complex behavior. LINEBREAK between deep rlsp and gail the comparison is less clear. deep rlsp can learn the balancing skill fairly well from a single state, which we visualize in figure 2 (though we emphasize that the videos are much clearer). like the original skill, the learned policy balances on one leg and slowly moves forward by jumping, though with slightly more erratic behavior. however, the learned policy sometimes drops back to its feet or falls over on its back. we suspect this is an artifact of the short horizon (t ≤ 10) used for simulating the past in our algorithm. a small horizon is necessary to avoid compounding errors in the learned inverse dynamics model, but can cause the resulting behavior to be more unstable on timescales greater than t . we see similar behavior when given 10 or 50 states. gail leads to a good policy given a single transition, where the cheetah balances on its front leg and head (rather than just the front leg), but does not move forward very much. however, with 10 or 50 transition, the policies learned by gail do not look at all like balancing. LINEBREAK however, the jumping behavior is harder to learn, especially from a single state. we speculate that here a single state is less informative than the balancing state. in the balancing state, the low joint velocities tell us that the cheetah is not performing a flip, suggesting that we had optimized for this specific balancing state. on the other hand, with the jumping behavior, we only get a single state of the cheetah in the air with high velocity, which is likely not sufficient to determine what the jump looked like exactly. in line with this hypothesis, at 1 state deep rlsp learns to erratically hop, at 10 states it executes slightly bigger jumps, and at 50 states it matches the original skill relatively closely. LINEBREAK the gail policies for jumping are also reasonable, though in a different way that makes it hard to compare. using 1 or 10 transitions, the policy doesn’t move very much, staying in contact with the ground most of the time. however, at 50 transitions, it performs noticeably forward hops slightly smoother than the policy learned by deep rlsp. LINEBREAK related work LINEBREAK learning from human feedback. many algorithms aim to learn good policies from human demonstrations, including ones in imitation learning (ho & ermon, 2016) and inverse reinforcement learning (irl; ng et al., 2000; abbeel & ng, 2004; fu et al., 2018). useful policies can also be learned from other types of feedback, such as preferences (christiano et al., 2017), corrections (bajcsy et al., 2017), instructions (bahdanau et al., 2019), or combinations of feedback modalities (ibarz et al., 2018). LINEBREAK while these methods require expensive human feedback, deep rlsp instead simulates the trajectories that must have happened. this is reflected in the algorithm: in equation 1, the inner gradient corresponds to an inverse reinforcement learning problem. while we used the mceirl formulation (ziebart et al., 2010), other irl algorithms could be used instead (fu et al., 2018). LINEBREAK learning from observations. for many tasks, we have demonstrations without action labels, e.g., youtube videos. learning from observations (lfo; torabi et al., 2019; gandhi et al., 2019) aims to recover a policy from such demonstrations. similarly to lfo, we do not have access to action labels, but our setting is further restricted to observing only a small number of states. LINEBREAK limitations and future work LINEBREAK summary. learning useful policies with neural networks requires significant human effort, whether it is done by writing down a reward function by hand, or by learning from explicit human feedback such as preferences or demonstrations. we showed that it is possible to reduce this burden by extracting “free” information present in the current state of the environment. this enables us to imitate policies in mujoco environments with access to just a few states sampled from those policies. we hope that deep rlsp will help us train agents that are better aligned with human preferences. learned models. the deep rlsp gradient depends on having access to a good model of π, t , π−1, and t −1. in practice, it was quite hard to train sufficiently good versions of the inverse models. this could be a significant barrier to practical implementations of deep rlsp. it can also be taken as a sign for optimism: self-supervised representation learning through deep learning is fairly recent and is advancing rapidly; such advances will likely translate directly into improvements in deep rlsp. LINEBREAK computational cost. imitation learning with full demonstrations can already be quite computationally expensive. deep rlsp learns several distinct neural network models, and then simulates potential demonstrations, and finally imitates them. unsurprisingly, this leads to increased computational cost. LINEBREAK safe rl. shah et al. (2019) discuss how the exact rlsp algorithm can be used to avoid negative side-effects in rl by combining preferences learned from the initial state with a reward function. while we focused on learning hard to specify behavior, deep rlsp can also be used to learn to avoid negative side-effects, which is crucial for safely deploying rl systems in the real world (amodei et al., 2016). LINEBREAK multiagent settings. in any realistic environment, there is not just a single “user” who is influencing the environment: many people act simultaneously, and the state is a result of joint optimization by all of them. however, our model assumes that the environment state resulted from optimization by a single agent, which will not take into account the fact that each agent will have constraints imposed upon them by other agents. we will likely require new algorithms for such a setting. LINEBREAK acknowledgments LINEBREAK this work was partially supported by open philanthropy, afosr, onr yip, nsf career, nsf nri, and microsoft swiss jrc. we thank researchers at the center for human-compatible ai and the interact lab for helpful discussion and feedback. LINEBREAK references LINEBREAK pieter abbeel and andrew y ng. apprenticeship learning via inverse reinforcement learning. in LINEBREAK proceedings of international conference on machine learning (icml), 2004. LINEBREAK dario amodei, chris olah, jacob steinhardt, paul christiano, john schulman, and dan mané. LINEBREAK concrete problems in ai safety. arxiv preprint arxiv:1606.06565, 2016. LINEBREAK dzmitry bahdanau, felix hill, jan leike, edward hughes, arian hosseini, pushmeet kohli, and edward grefenstette. learning to understand goal specifications by modelling reward. in international conference on learning representations (iclr), 2019. LINEBREAK andrea bajcsy, dylan p losey, marcia k o’malley, and anca d dragan. learning robot objectives LINEBREAK from physical human interaction. in conference on robot learning (corl), 2017. LINEBREAK christopher m bishop. mixture density networks. neural computing research group report, aston LINEBREAK university, 1994. LINEBREAK greg brockman, vicki cheung, ludwig pettersson, jonas schneider, john schulman, jie tang, and
| 9
|
[
108,
516.4650784,
504.0033874,
526.4276784
] |
cB4N3G5udUS.pdf
| 2,023
| 1
|
LINEBREAK randprox: primal–dual optimization algorithms with randomized proximal updates LINEBREAK laurent condat & peter richtárik visual computing center king abdullah university of science and technology (kaust) thuwal, kingdom of saudi arabia contact: see https://lcondat.github.io/ LINEBREAK abstract LINEBREAK proximal splitting algorithms are well suited to solving large-scale nonsmooth optimization problems, in particular those arising in machine learning. we propose a new primal–dual algorithm, in which the dual update is randomized; equivalently, the proximity operator of one of the function in the problem is replaced by a stochastic oracle. for instance, some randomly chosen dual variables, instead of all, are updated at each iteration. or, the proximity operator of a function is called with some small probability only. a nonsmooth variance-reduction technique is implemented so that the algorithm finds an exact minimizer of the general problem involving smooth and nonsmooth functions, possibly composed with linear operators. we derive linear convergence results in presence of strong convexity; these results are new even in the deterministic case, when our algorithms reverts to the recently proposed primal–dual davis–yin algorithm. some randomized algorithms of the literature are also recovered as particular cases (e.g., point-saga). but our randomization technique is general and encompasses many unbiased mechanisms beyond sampling and probabilistic updates, including compression. since the convergence speed depends on the slowest among the primal and dual contraction mechanisms, the iteration complexity might remain the same when randomness is used. on the other hand, the computation complexity can be significantly reduced. overall, randomness helps getting faster algorithms. this has long been known for stochastic-gradient-type algorithms, and our work shows that this fully applies in the more general primal–dual setting as well. LINEBREAK introduction
| 0
|
[
126.82956,
285.9596768,
205.9888518,
297.9148768
] |
ORp91sAbzI.pdf
| 2,023
| 0
|
LINEBREAK leveraging unlabeled data to track memorization LINEBREAK mahsa forouzesh1, hanie sedghi2, patrick thiran1 1école polytechnique fédérale de lausanne 2google research, brain team {mahsa.forouzesh, patrick.thiran}@epfl.ch, [email protected] LINEBREAK abstract LINEBREAK deep neural networks may easily memorize noisy labels present in real-world data, which degrades their ability to generalize. it is therefore important to track and evaluate the robustness of models against noisy label memorization. we propose a metric, called susceptibility, to gauge such memorization for neural networks. susceptibility is simple and easy to compute during training. moreover, it does not require access to ground-truth labels and it only uses unlabeled data. we empirically show the effectiveness of our metric in tracking memorization on various architectures and datasets and provide theoretical insights into the design of the susceptibility metric. finally, we show through extensive experiments on datasets with synthetic and real-world label noise that one can utilize susceptibility and the overall training accuracy to distinguish models that maintain a low memorization on the training set and generalize well to unseen clean data. LINEBREAK introduction LINEBREAK deep neural networks are prone to memorizing noisy labels in the training set, which are inevitable in many real world applications (frénay & verleysen, 2013; zhang et al., 2016; arpit et al., 2017; song et al., 2020a; nigam et al., 2020; han et al., 2020; zhang et al., 2021a; wei et al., 2021). given a new dataset that contains clean and noisy labels, one refers to the subset of the dataset with correct labels (respectively, with incorrect labels due to noise), as the clean (respectively, noisy) subset. when neural networks are trained on such a dataset, it is important to find the sweet spot from no fitting at all to fitting every sample. indeed, fitting the clean subset improves the generalization performance of the model (measured by the classification accuracy on unseen clean data), but fitting the noisy subset, referred to as “memorization”1, degrades its generalization performance. new methods have been introduced to address this issue (for example, robust architectures (xiao et al., 2015; li et al., 2020), robust objective functions (li et al., 2019; ziyin et al., 2020), regularization techniques (zhang et al., 2017; pereyra et al., 2017; chen et al., 2019; harutyunyan et al., 2020), and sample selection methods (nguyen et al., 2019)), but their effectiveness cannot be assessed without oracle access to the ground-truth labels to distinguish the clean and the noisy subsets, or without a clean test set. LINEBREAK our goal in this paper is to track memorization during training without any access to ground-truth labels. to do so, we sample a subset of the input data and label it uniformly at random from the set of all possible labels. the samples can be taken from unlabeled data, which is often easily accessible, or from the available training set with labels removed. this new held-out randomly-labeled set is created for evaluation purposes only, and does not affect the original training process. LINEBREAK first, we compare how different models fit the held-out randomly-labeled set after multiple steps of training on it. we observe empirically that models that have better accuracy on unseen clean test data show more resistance towards memorizing the randomly-labeled set. this resistance is captured by the number of steps required to fit the held-out randomly-labeled set. in addition, through our theoretical convergence analysis on this set, we show that models with high/low test accuracy are resistant/susceptible to memorization, respectively. LINEBREAK 1fitting samples that have incorrect random labels is done by memorizing the assigned label for each LINEBREAK particular sample. hence, we refer to it as memorization, in a similar spirit as feldman & zhang (2020). LINEBREAK figure 1: models trained on cifar-10 with 50% label noise. top (oracle access to ground-truth labels): we observe that the fit on the clean subset of the training set (shown in the top left) and the fit on the noisy subset (located below the fit on the clean subset) affect the predictive performance (measured by the classification accuracy) on unseen clean test data differently. fitting the clean (resp., noisy) subset improves (resp., degrades) test accuracy, as shown by the green (resp., red) arrow. with oracle access to ground-truth label, one can therefore select models with a high fit on the clean subset and a low fit on the noisy subset, as it is done in the top right to find desirable models. bottom (our approach in practice): in practice however, the ground-truth label, and hence the fit on the clean and noisy subsets are not available. in this paper, we propose the metric called susceptibility ζ to track the fit on the noisy subset of the training set. susceptibility is computed using a mini-batch of data that are assigned with random labels independently from the dataset labels. we observe a strong correlation between susceptibility and memorization. moreover, the susceptibility metric together with the training accuracy on the entire set, is used to recover models with low “memorization” (low fit on the noisy subset) and high “trainability” (high fit on the clean subset) without any ground-truth label oracle access. the average test accuracy of models in the top-left rectangle of the right figures are 77.93±4.68% and 76.15±6.32% for the oracle and our approach, respectively. hence, our method successfully recovers desirable models. LINEBREAK building on this result, we then propose an easy-to-compute metric that we call susceptibility to noisy labels, which is the difference in the objective function of a single mini-batch from the held-out randomly-labeled set, before and after taking an optimization step on it. at each step during training, the larger this difference is, the more the model is affected by (and is therefore susceptible to) the noisy labels in the mini-batch. figure 1 (bottom left) provides an illustration of the susceptibility metric. we observe a strong correlation between the susceptibility and the memorization within the training set, which is measured by the fit on the noisy subset. we then show how one can utilize this metric and the overall training accuracy to distinguish models with a high test accuracy across a variety of state-of-the-art deep learning models, including densenet (huang et al., 2017), efficientnet (tan & le, 2019), and resnet (he et al., 2016a) architectures, and various datasets including synthetic and real-world label noise (clothing-1m, animal-10n, cifar-10n, tiny imagenet, cifar-100, cifar-10, mnist, fashion-mnist, and svhn), see figure 1 (right). our main contributions and takeaways are summarized below: LINEBREAK 1. we empirically observe and theoretically show that models with a high test accuracy are LINEBREAK resistant to memorizing a randomly-labeled held-out set (sections 2 and 5). LINEBREAK 2. we propose the susceptibility metric, which is computed on a randomly-labeled subset of the available data. our extensive experiments show that susceptibility closely tracks memorization of the noisy subset of the training set (section 3). LINEBREAK 3. we observe that models which are trainable and resistant to memorization, i.e., having a high training accuracy and a low susceptibility, have high test accuracies. we leverage this observation to propose a model-selection method in the presence of noisy labels (section 4). LINEBREAK 4. we show through extensive experiments that our results are persistent for various datasets, LINEBREAK architectures, hyper-parameters, label noise levels, and label noise types (section 6). LINEBREAK figure 2: the evolution of output prediction of two neural networks during training on a single sample with a wrong randomly-assigned label (assigned label is “cat” while ground-truth label is “deer”) versus the number of epochs (steps) (cid:101)k. network1 is a googlenet (szegedy et al., 2015) (pre-)trained on cifar-10 dataset with clean labels and has initial test accuracy of 95.36%. network2 is a googlenet (pre-)trained on cifar-10 dataset with 50% label noise level and has initial test accuracy of 58.35%. network2 has a lower test accuracy compared to network1, and we observe that it memorizes this new sample after only (cid:101)k = 2 steps. in contrast, network1 persists in predicting the correct output for this sample for longer, and memorizes the new sample only after (cid:101)k = 99 steps. more examples and an ablation study on the effect of calibration are given in figures 12 and 14 in appendix d, respectively. LINEBREAK related work garg et al. (2021a) show that for models trained on a mixture of clean and noisy data, a low accuracy on the noisy subset of the training set and a high accuracy on the clean subset of the training set guarantee a low generalization error. with oracle access to the ground-truth labels to compute these accuracies, one can therefore predict which models perform better on unseen clean data. this is done in figure 1 (oracle part). however, in practice, there is no access to ground-truth labels. our work therefore complements the results of (garg et al., 2021a) by providing a practical approach (see figure 1 (practice part)). moreover, both our work and (zhang et al., 2019c) emphasize that a desirable model differentiates between fitting clean and noisy samples. zhang et al. (2019c) showcase this intuition by studying the drop in the training accuracy of models trained when label noise is injected in the dataset. we do it by studying the resistance/susceptibility of models to noisy labels of a held-out set. zhang et al. (2019c) only study the training accuracy drop for settings where the available training set is clean. however, when the training set is itself noisy, which is the setting of interest in our work, we observe that this training accuracy drop does not predict memorization, unlike our susceptibility metric (see figure 9 (left) in appendix a). furthermore, even though the metric proposed in lu & he (2022) is rather effective as an early stopping criterion, it is not able to track memorization, contrary to susceptibility (see figure 9 (middle)). for a thorough comparison to other related work refer to appendix a. LINEBREAK good models are resistant to memorization LINEBREAK consider models fw(x) with parameter matrix w trained on a dataset s = {(xi, yi)}n 1 , which is a collection of n input-output pairs that are drawn from a data distribution d over x × y in a multi-class classification setting. we raise the following question: how much are these models resistant/susceptible to memorization of a new low-label-quality (noisy) dataset when they are trained on it? intuitively, we expect a model with a high accuracy on correct labels to stay persistent on its predictions and hence to be resistant to the memorization of this new noisy dataset. we use the number of steps that it requires to fit the noisy dataset, as a measure for this resistance. the larger this number, the stronger the resistance (hence, the lower the susceptibility). in summary, we conjecture that models with high test accuracy on unseen clean data are more resistant to memorization of noisy labels, and hence take longer to fit a randomly-labeled held-out set. LINEBREAK 1 ∼ x that are either accessible, or are a subset of {xi}n LINEBREAK to mimic a noisy dataset, we create a set with random labels. more precisely, we define a randomlylabeled held-outset of samples (cid:101)s = {((cid:101)xi, (cid:101)yi)}(cid:101)n 1 , which is generated from (cid:101)n unlabeled samples {(cid:101)xi}(cid:101)n 1 . the outputs (cid:101)yi of dataset (cid:101)s are drawn independently (both from each other and from labels in s) and uniformly at random from the set of possible classes. therefore, to fit (cid:101)s, the model needs to memorize the labels. we track the fit (memorization) of a model on (cid:101)s after (cid:101)k optimization steps on the noisy dataset (cid:101)s. we perform the following empirical test. in figure 2, we compare two deep neural networks. the first one has a high classification accuracy on unseen clean test data, whereas the other one has a low LINEBREAK test accuracy. we then train both these models on a single sample with an incorrect label ( (cid:101)s contains a single incorrectly-labeled sample). we observe that the model with a high test accuracy takes a long time (in terms of number of training steps) to fit this sample; hence this model is resistant to memorization as the number of steps (cid:101)k required to fit (cid:101)s is large. in contrast, the model with a low test accuracy memorizes this sample after taking only a few steps; hence this model is susceptible to memorization as (cid:101)k required to fit (cid:101)s is small2. this observation reinforces our intuition, that good models, measured by a high test accuracy, are more resistant to memorization of noisy labels. LINEBREAK next, we further validate this observation theoretically by performing a convergence analysis on the held-out set (cid:101)s, where the input samples {(cid:101)xi}(cid:101)n 1 of (cid:101)s are the same as the inputs of dataset s (and hence (cid:101)n = n). we consider the binary-classification setting. the output vector (cid:101)y = ((cid:101)y1, · · · , (cid:101)yn)t is a vector of independent random labels that take values uniformly in {−1, 1}. therefore, creating this dataset (cid:101)s does not require extra information, and in particular no access to the data distribution d. consider the network fw(x) as a two-layer neural network with relu non-linearity (denoted by σ(x) = max{x, 0}) and m hidden-units: LINEBREAK fw(x) = LINEBREAK arσ (cid:0)wt LINEBREAK r x(cid:1) , LINEBREAK where x ∈ rd is the input vector, w = (w1, · · · , wm) ∈ rd×m, a = (a1, · · · , am) ∈ rm are the weight matrix of the first layer, and the weight vector of the second layer, respectively. for simplicity, 1 are denoted by vector fw ∈ rn instead of {fw(xi)}n the outputs associated with the inputs {xi}n 1 . the first layer weights are initialized as wr(0) ∼ n (cid:0)0, κ2i(cid:1) ∀r ∈ [m], where 0 < κ ≤ 1 is the magnitude of initialization and n denotes the normal distribution. ars are independent random variables taking values uniformly in {−1, 1}, and are considered to be fixed throughout training. LINEBREAK we define the objective function on datasets s and (cid:101)s, respectively, as LINEBREAK φ(w) = LINEBREAK ∥fw − y∥2 LINEBREAK (fw(xi) − yi)2 , LINEBREAK label noise level (lnl) of s (and accordingly of the label vector y) is the ratio n1/n, where n1 is the number of samples in s that have labels that are independently drawn uniformly in {−1, 1}, and the remaining n − n1 samples in s have the ground-truth label. the two extremes are s with lnl = 0, which is the clean dataset, and s with lnl = 1, which is a dataset with entirely random labels. to study the convergence of different models on (cid:101)s, we compute the objective function (cid:101)φ(w) after ˜k steps of training on the dataset (cid:101)s. therefore, the overall training/evaluation procedure is as follows; for r ∈ [m], the second layer weights of the neural network are updated according to gradient descent: LINEBREAK wr(t + 1) − wr(t) = −η LINEBREAK ∂φ (w(t)) ∂wr LINEBREAK where for 0 ≤ t < k: φ = φ, and for k ≤ t < k + ˜k: φ = (cid:101)φ, whereas η is the learning rate. note that we refer to φ(w(t)) as φ(t) and to (cid:101)φ(w(t)) as (cid:101)φ(t). LINEBREAK when a model fits the set (cid:101)s, the value of (cid:101)φ becomes small, say below some threshold ε. the resistance of a model to memorization (fit) on the set (cid:101)s is then measured by the number of steps (cid:101)k∗(ε) such that (cid:101)φ(k + (cid:101)k) ≤ ε for (cid:101)k > (cid:101)k∗(ε). the larger (respectively, smaller) (cid:101)k∗ is, the more the model is resistant (resp, susceptible) to this memorization. we can reason on the link between good model and memorization from the following proposition. LINEBREAK proposition 1 (informal). the objective function (cid:101)φ at step k + (cid:101)k is a decreasing function of the label noise level (lnl) in s, and of the number of steps (cid:101)k. LINEBREAK 2interestingly, we observe that the situation is different for a correctly-labeled sample. figure 13 in appendix d shows that models with a higher test accuracy typically fit an unseen correctly-labeled sample faster than models with a lower test accuracy. LINEBREAK figure 3: accuracy on the noisy subset of the training set versus susceptibility ζ(t) (equation (2)) for deep convolutional neural networks (ranging from a 5−layer cnn to more sophisticated structures such as efficientnet (tan & le, 2019)) trained on cifar-10 with 50% label noise. we observe a strong pearson correlation coefficient between train acc noisy and ζ(t): ρ = 0.884. LINEBREAK proposition 1 yields that models trained on s with a low lnl (which are models with a high test accuracy on clean data) push (cid:101)φ(k + (cid:101)k) to become large. the number of steps (cid:101)k∗(ε) should therefore be large for (cid:101)φ to become less than ϵ: these models resist to the memorization of (cid:101)s. conversely, models trained on s with a high lnl (which are models with a low test accuracy), allow for (cid:101)k∗(ε) to be small and give up rapidly to the memorization of (cid:101)s. these conclusions match the empirical observation in figure 2, and therefore further support the intuition that good models are resistant to memorization. please refer to section 5 for the formal theoretical results that produce proposition 1. LINEBREAK evaluating resistance to memorization LINEBREAK in section 2 we showed that desirable models in terms of high classification accuracy on unseen clean data are resistant to the memorization of a randomly-labeled set. in this section, we describe a simple and computationally efficient metric to measure this resistance. to evaluate it efficiently at each step of the forward pass, we propose to take a single step on multiple randomly labeled samples, instead of taking multiple steps on a single randomly labeled sample (as done in figure 2). to make the metric even more computationally efficient, instead of the entire randomly labeled set (cid:101)s (as in our theoretical developments), we only take a single mini-batch of (cid:101)s. for simplicity and with some abuse of notation, we still refer to this single mini-batch as (cid:101)s. to track the prediction of the model over multiple samples, we compare the objective function on (cid:101)s before and after taking a single optimization step on it. the learning rate, and its schedule, have a direct effect on this single optimization step. for certain learning rate schedules, the learning rate might become close to zero (e.g., at the end of training), and hence the magnitude of this single step would become too small to be informative. to avoid this, and to account for the entire history of the optimization trajectory3, we compute the average difference over the learning trajectory (a moving average). we propose the following metric, which we call susceptibility to noisy labels, ζ(t). at step t of training, LINEBREAK algorithm 1 computes the susceptibility to noisy labels ζ 1: input: dataset s, number of epochs t 2: sample a mini-batch (cid:101)s from s; replace its LINEBREAK 3: initialize network fw(0) 4: initialize ζ(0) = 0 5: for t = 1, · · · , t do 6: LINEBREAK update fw(t) from fw(t−1) using dataset s LINEBREAK (cid:101)w(t+1) from fw(t) using dataset (cid:101)s LINEBREAK compute (cid:101)φ(w(t)) update f LINEBREAK labels with random labels LINEBREAK ζ(t) = LINEBREAK (2) where w (τ ), (cid:101)w (τ + 1) are the model parameters before and after a single update step on (cid:101)s. algorithm 1 describes the computation of ζ. LINEBREAK 11: end for 12: return ζ. LINEBREAK 3the importance of the entire learning trajectory including its early phase is emphasized in prior work such LINEBREAK as (jastrzebski et al., 2020). LINEBREAK (a) test accuracy versus train accuracy for all models at all epochs LINEBREAK (b) test accuracy versus train accuracy for models that have ζ(t) ≤ 0.05 LINEBREAK figure 4: the effect of filtering the models based on the susceptibility metric ζ(t) for models trained on cifar-10 with 50% label noise. we observe that by removing models with a high value of ζ(t), the correlation between the training accuracy (accessible to us in practice) and the test accuracy (not accessible) increases a lot, and we observe that among the selected models, a higher training accuracy implies a higher test accuracy. refer to figures 16, 18, 21, 24, 26 for similar results on 5 other datasets. we use a threshold such that half of the models have ζ < threshold and hence remain after filtration. LINEBREAK the lower ζ(t) is, the less the model changes its predictions for (cid:101)s after a single step of training on it and thus the less it memorizes the randomly-labeled samples. we say therefore that a model is resistant (to the memorization of randomly-labeled samples) when the susceptibility to noisy labels ζ(t) is low. LINEBREAK susceptibility ζ tracks memorization for different models the classification accuracy of a model on a set is defined as the ratio of the number of samples where the label predicted by the model matches the label on the dataset, to the total number of samples. we refer to the subset for which the dataset label is different from the ground-truth label as the noisy subset of the training set. its identification requires access to the ground-truth label. recall that we refer to memorization within the training set as the fit on the noisy subset, which is measured by the accuracy on it. we call this accuracy “train acc noisy” in short. in figure 3, we observe a strong positive correlation between the memorization of the held-out randomly labeled set, which is tracked by ζ(t) (equation (2)) and the memorization of noisy labels within the training set, tracked by train acc noisy. susceptibility ζ, which is computed on a mini-batch with labels independent from the training set, can therefore predict the resistance to memorization of the noisy subset of the training set. in figure 36, we show the robustness of susceptibility ζ to the mini-batch size, and to the choice of the particular mini-batch. LINEBREAK susceptibility ζ tracks memorization for a single model it is customary when investigating different capabilities of a model, to keep checkpoints/snapshots during training and decide which one to use based on the desired property, see for example (zhang et al., 2019a; chatterji et al., 2019; neyshabur et al., 2020; andreassen et al., 2021; baldock et al., 2021). with access to ground-truth labels, one can track the fit on the noisy subset of the training set to find the model checkpoint with the least memorization, which is not necessarily the end checkpoint, and hence an early-stopped version of the model. however, the ground-truth label is not accessible in practice, and therefore the signals presented in figure 3 (left) are absent. moreover, as discussed in figure 7, the training accuracy on the entire training set is also not able to recover these signals. using susceptibility ζ, we observe that these signals can be recovered without any ground-truth label access, as shown in figure 3 (right). therefore, ζ can be used to find the model checkpoint with the least memorization. for example, in figure 3, for the resnet model, susceptibility ζ suggests to select model checkpoints before it sharply increases, which exactly matches with the sharp increase in the fit on the noisy subset. on the other hand, for the mobilenet model, susceptibility suggests to select the end checkpoint, which is also consistent with the selection according to the fit on the noisy subset. LINEBREAK good models are resistant and trainable LINEBREAK when networks are trained on a dataset that contains clean and noisy labels, the fit on the clean and noisy subsets affect the generalization performance of the model differently. therefore, as we observe in figure 4a for models trained on a noisy dataset (details are deferred to appendix b), the LINEBREAK figure 5: for models trained on cifar-10 with 50% label noise, using the average values of ζ(t) and of the training accuracy over the available models we can obtain 4 different regions. region 1: trainable and resistant, with average test accuracy of 76%. region 2: trainable but not resistant, with average test accuracy of 70.59%. region 3: not trainable but resistant, with average test accuracy of 52.49%. region 4: neither trainable nor resistant, with average test accuracy of 58.23%. we observe that the models in region 1 generalize well on unseen data, as they have a high test accuracy. LINEBREAK figure 6: the lower (dashed lines) and upper (solid lines) bound terms of theorem 2 that depend on the label noise level (lnl). they are computed from the eigenvectors and eigenvalues of the gram-matrix for 1000 samples of the mnist dataset, computed over 10 random draws computed with hyper-parameters η = 10−6, k = 10000 and δ = 0.05. we observe the bounds in theorem 2 are a decreasing function of lnl. LINEBREAK correlation between the training accuracy (accuracy on the entire training set) and the test accuracy (accuracy on the unseen clean test set) is low. interestingly however, we observe in figure 4b that if we remove models with a high memorization on the noisy subset, as indicated by a large susceptibility to noisy labels ζ(t), then the correlation between the training and the test accuracies increases significantly (from ρ = 0.608 to ρ = 0.951), and the remaining models with low values of ζ(t) have a good generalization performance: a higher training accuracy implies a higher test accuracy. this is especially important in the practical settings where we do not know how noisy the training set is, and yet must reach a high accuracy on clean test data. LINEBREAK after removing models with large values of ζ(t), we select models with a low label noise memorization. however, consider an extreme case: a model that always outputs a constant is also low at label noise memorization, but does not learn the useful information present in the clean subset of the training set either. clearly, the models should be “trainable” on top of being resistant to memorization. a “trainable model" is a model that has left the very initial stages of training, and has enough capacity to learn the information present in the clean subset of the dataset to reach a high accuracy on it. the training accuracy on the entire set is a weighted average of the training accuracy on the clean and noisy subsets. therefore, among the models with a low accuracy on the noisy subset (selected using susceptibility ζ in figure 4b), we should further restrict the selection to those with a high overall training accuracy, which corresponds to a high accuracy on the clean subset. LINEBREAK we can use the two metrics, susceptibility to noisy labels ζ(t) and overall training accuracy, to partition models that are being trained on some noisy dataset in four different regions using their average values, as shown in figure 5: region 1: trainable and resistant to memorization, region 2: trainable but not resistant, region 3: not trainable but resistant, and region 4: neither trainable nor resistant. note that the colors of each point, which indicate the value of the test accuracy are only for illustration and are not used to find these regions. the average test accuracy is the highest for models in region 1 (i.e., that are resistant to memorization on top of being trainable). in particular, going from region 2 to region 1 increases the average test accuracy of the selected models from 70.59% to 76%, i.e., a 7.66% relative improvement in the test accuracy. this improvement is consistent with other datasets as well: 6.7% for clothing-1m (figure 29a), 4.2% for animal-10n (figure 29b), 2.06% for cifar-10n (figure 29c), 31.4% for noisy mnist (figure 15), 33% for noisy fashion-mnist (figure 17), 33.6% for noisy svhn (figure 19), 15.1% for noisy cifar-100 (figure 22), and 8% for noisy tiny imagenet (figure 25) datasets (refer to appendix e for detailed results). LINEBREAK comparison with a noisy validation set: given a dataset containing noisy labels, a correctlylabeled validation set is not accessible without ground-truth label access. one can however use a subset of the available dataset and assess models using this noisy validation set. an important advantage of our approach compared to this assessment is the information that it provides about the memorization within the training set, which is absent from performance on a test or a noisy LINEBREAK validation set. for example, in figures 34a and 35a we observe models (on the very top right) that have memorized 100% of the noisy subset of the training set, and yet have a high test accuracy. however, some models (on the top middle/left part), which have the same fit on the clean subset but lower memorization, have lower or similar test accuracy. even the test accuracy was therefore not able to compare these models in terms of memorization. for more details, refer to appendix c. LINEBREAK moreover, as formally discussed in (lam & stork, 2003), the number of noisy validation samples that are equivalent to a single clean validation sample depends on the label noise level of the dataset and on the true error rate of the model, which are both unknown in practice, making it difficult to pick an acceptable size for the validation set without compromising the training set. if we use a small validation set (which allows for a large training set size), then we observe a very low correlation between the validation and the test accuracies (as reported in table 1 and figure 10 in appendix c). in contrast, our approach provides much higher correlation to the test accuracy. we also conducted experiments with noisy validation sets with larger sizes and observed that the size of the noisy validation set would need to be increased around ten-fold to reach the same correlation as our approach. increasing the size of the validation set removes data out of the training set, which may degrade the overall performance, whereas our approach leaves the entire available dataset for training. LINEBREAK convergence analysis LINEBREAK in this section, we elaborate on the analysis that leads to (the informal) proposition 1. a matrix, a vector and a scalar are denoted respectively by a, a, and a. the identity matrix is denoted by i. the indicator function of a random event a is denoted by i(a). the (i, j)−th entry of matrix a is aij. consider the setting described in section 2 with ∥x∥2 = 1 and |y| ≤ 1 for (x, y) ∼ d := x × y, where x = rd and y = r. for input samples {xi}n LINEBREAK 1 , the n × n gram matrix h∞ has entries LINEBREAK i xji{wt xi ≥ 0, wt xj ≥ 0}(cid:3) = LINEBREAK h∞ LINEBREAK ij = ew∼n (0,i) LINEBREAK (cid:2)xt and its eigen-decomposition is h∞ = (cid:80)n and λ0 = min{λi}n LINEBREAK i , where the eigenvectors vi ∈ rn are orthonormal 1 . using the eigenvectors and eigenvalues of h∞, we have the following theorem. (cid:1), with probability at least LINEBREAK i=1 λivivt LINEBREAK , and η = o (cid:0) λ0 n2 LINEBREAK , m = ω theorem 1. for κ = o 1 − δ over the random parameter initialization described in section 2, we have: LINEBREAK xt i xj LINEBREAK (cid:0)π − arccos(xt 2π LINEBREAK i xj)(cid:1) LINEBREAK , ∀i, j ∈ [n], (3) LINEBREAK the proof is provided in appendix j. LINEBREAK (cid:104) i y − vt vt LINEBREAK i (cid:101)y − (1 − ηλi)k vt i y LINEBREAK theorem 1 enables us to approximate the objective function on dataset (cid:101)s (equation (1)) as follows: LINEBREAK pi − (cid:101)pi − (1 − ηλi)k pi LINEBREAK where pi = vt LINEBREAK i=1 i y and (cid:101)pi = vt i (cid:101)y. let us define 1 − (1 − ηλi)k(cid:105)2 (cid:3) (cid:104) LINEBREAK e (cid:2)p2 LINEBREAK i LINEBREAK (1 − ηλi)2˜k , σ = var LINEBREAK we numerically observe that µ/2 ± (cid:112)σ/δ are both decreasing functions of the label noise level (lnl) of the label vector y, and of (cid:101)k (see figures 6, and 40, 41, 42, 43 in appendix k for different values of the learning rate η, number of steps k, and datasets). the approximation in equation (4) together with the above observation then yields the following lower and upper bounds for (cid:101)φ(k + ˜k). theorem 2. with probability at least 1 − δ over the draw of the random label vector (cid:101)y, given the approximation made in equation (4), LINEBREAK i=1 (1 − ηλi)2˜k is independent of lnl of the proof is provided in appendix k. because the term (cid:80)n the label vector y, we can conclude that (cid:101)φ(k + ˜k) is a decreasing function of lnl. moreover, since i=1 (1 − ηλi)2˜k is also a decreasing function of (cid:101)k. therefore, similarly, 0 < 1 − ηλi < 1, the term (cid:80)n we can conclude that (cid:101)φ(k + ˜k) is a decreasing function of (cid:101)k. proposition 1 summarizes this result. LINEBREAK on the generality of the observed phenomena LINEBREAK in this section, we provide additional experiments that show our empirical results hold across different choices of dataset, training and architecture design as well as label noise level and form. LINEBREAK dataset: in appendix e.1, we provide a walk-through on how to use our method for real-world noisy-labeled datasets clothing-1m, animal-10n, and cifar-10n. our results consistently hold for mnist, fashion mnist, svhn, cifar-100, and tiny imagenet datasets; see figures 15-29. LINEBREAK learning rate schedule: our results are not limited to a specific optimization scheme. in our experiments, we apply different learning rate schedules, momentum values, and optimizers (sgd and adam) (for details see appendix b). more specifically, we show in figure 31 (in appendix f) that the strong correlation between memorization and our metric ζ(t) stays consistent for both learning rate schedulers cosineannealing and exponential. LINEBREAK architecture: results of sections 3 and 4 are obtained from a variety of architecture families, such as densenet (huang et al., 2017), mobilenet (howard et al., 2017), vgg (simonyan & zisserman, 2014), and resnet (he et al., 2016a). for the complete list of architectures, see appendix b. we observe that ζ(t) does not only detect resistant architecture families (as done for example in figure 3), but that it is also able to find the best design choice (e.g., width) among configurations that are already resistant, see figure 30 in appendix f. LINEBREAK low label noise levels: for models trained on cifar-10 and cifar-100 datasets with 10% label noise (instead of 50%), we still observe a high correlation between accuracy on the noisy subset and ζ(t) in figures 32 and 33 in appendix f. moreover, we observe in figures 34 and 35 in appendix f that the average test accuracy of the selected models using our metric is comparable with the average test accuracy of the selected models with access to the ground-truth label. LINEBREAK asymmetric label noise: in addition to the real-world label noises and synthetic symmetric label noise, we have also performed experiments with synthetic asymmetric label noise as proposed in (xia et al., 2021). using our approach, the average test accuracy of the selected models is 66.307%, whereas the result from oracle is 66.793% (see figure 38 in appendix e). LINEBREAK conclusion LINEBREAK we have proposed a simple but surprisingly effective approach to track memorization of the noisy subset of the training set using a single mini-batch of unlabeled data. our contributions are three-fold. first, we have shown that models with a high test accuracy are resistant to memorization of a held-out randomly-labeled set. second, we have proposed a metric, susceptibility, to efficiently measure this resistance. third, we have empirically shown that one can utilize susceptibility and the overall training accuracy to distinguish models (whether they are a single model at various checkpoints, or different models) that maintain a low memorization on the training set and generalize well to unseen clean data while bypassing the need to access the ground-truth label. we have studied model selection in a variety of experimental settings and datasets with label noise, ranging from selecting the “best” models from “good” models (for easy datasets such as animal-10n) to selecting “good” models from “bad” models (for more complex datasets such as clothing-1m). LINEBREAK our theoretical results have direct implications for online settings. when the quality of the labels for new data stream is low, theorem 1 can directly compare how different models converge on this low quality data, and help in selecting resistant models, which converge slowly on this data. our empirical results provide new insights on the way models memorize the noisy subset of the training set: the process is similar to the memorization of a purely randomly-labeled held-out set. finally, an important direction for future work is to study how susceptibility performs as a regularizer. LINEBREAK ethics statement: this work is a foundational investigation into the theory of deep learning. we believe our submission does not raise ethical concerns. we use open public datasets and implementations. our study does not involve human subjects, potentially harmful insights, potential conflicts of interest and sponsorship, discrimination/bias/fairness concerns, privacy and security issues, legal compliance, and research integrity issues. LINEBREAK reproducibility statement: the source code to reproduce our results is available in the supplementary material. all the datasets and architectures used in this paper are publicly available and are properly cited. reproducibility of all our experiments is ensured by providing the experimental setup details in appendix b. the data processing steps are provided both in appendix b and in the source code. the assumptions and preliminaries needed for the proofs of our theoretical results are provided in appendix g. the proofs are provided in appendices h, i, j, and k. LINEBREAK acknowledgement: we thank chiyuan zhang and behnam neyshabur for their valuable feedback on the draft of this work. we would also like to thank anonymous reviewers, area chairs, and program chairs for their constructive comments, which helped us to improve the quality of this paper. LINEBREAK references LINEBREAK naveed akhtar and ajmal mian. threat of adversarial attacks on deep learning in computer vision: LINEBREAK zeyuan allen-zhu, yuanzhi li, and yingyu liang. learning and generalization in overparameterized LINEBREAK neural networks, going beyond two layers. arxiv preprint arxiv:1811.04918, 2018. LINEBREAK anders andreassen, yasaman bahri, behnam neyshabur, and rebecca roelofs. the evolution of out-of-distribution robustness throughout fine-tuning. arxiv preprint arxiv:2106.15831, 2021. LINEBREAK sanjeev arora, simon du, wei hu, zhiyuan li, and ruosong wang. fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. in international conference on machine learning, pp. 322–332. pmlr, 2019. LINEBREAK devansh arpit, stanisław jastrz˛ebski, nicolas ballas, david krueger, emmanuel bengio, maxinder s kanwal, tegan maharaj, asja fischer, aaron courville, yoshua bengio, et al. a closer look at memorization in deep networks. in international conference on machine learning, pp. 233–242. pmlr, 2017. LINEBREAK anish athalye, nicholas carlini, and david wagner. obfuscated gradients give a false sense of security: circumventing defenses to adversarial examples. in international conference on machine learning, pp. 274–283. pmlr, 2018. LINEBREAK robert baldock, hartmut maennel, and behnam neyshabur. deep learning through the lens of LINEBREAK example difficulty. advances in neural information processing systems, 34, 2021. LINEBREAK alberto bietti and julien mairal. on the inductive bias of neural tangent kernels. arxiv preprint LINEBREAK gavin brown, mark bun, vitaly feldman, adam smith, and kunal talwar. when is memorization of irrelevant training data necessary for high-accuracy learning? in proceedings of the 53rd annual acm sigact symposium on theory of computing, pp. 123–132, 2021. LINEBREAK nicholas carlini and david wagner. towards evaluating the robustness of neural networks. in 2017 LINEBREAK ieee symposium on security and privacy (sp), pp. 39–57. ieee, 2017. LINEBREAK satrajit chatterjee. coherent gradients: an approach to understanding generalization in gradient LINEBREAK descent-based optimization. arxiv preprint arxiv:2002.10657, 2020. LINEBREAK niladri s chatterji, behnam neyshabur, and hanie sedghi. the intriguing role of module criticality LINEBREAK in the generalization of deep networks. arxiv preprint arxiv:1912.00528, 2019. LINEBREAK pengfei chen, ben ben liao, guangyong chen, and shengyu zhang. understanding and utilizing deep neural networks trained with noisy labels. in international conference on machine learning, pp. 1062–1070. pmlr, 2019. LINEBREAK pengfei chen, junjie ye, guangyong chen, jingwei zhao, and pheng-ann heng. robustness of accuracy metric and its inspirations in learning with noisy labels. in proceedings of the aaai conference on artificial intelligence, volume 35, pp. 11451–11461, 2021. LINEBREAK simon s du, xiyu zhai, barnabas poczos, and aarti singh. gradient descent provably optimizes LINEBREAK over-parameterized neural networks. arxiv preprint arxiv:1810.02054, 2018. LINEBREAK vitaly feldman. does learning require memorization? a short tale about a long tail. in proceedings LINEBREAK of the 52nd annual acm sigact symposium on theory of computing, pp. 954–959, 2020. LINEBREAK vitaly feldman and chiyuan zhang. what neural networks memorize and why: discovering the long LINEBREAK tail via influence estimation. arxiv preprint arxiv:2008.03703, 2020. LINEBREAK benoît frénay and michel verleysen. classification in the presence of label noise: a survey. ieee LINEBREAK transactions on neural networks and learning systems, 25(5):845–869, 2013. LINEBREAK saurabh garg, sivaraman balakrishnan, j zico kolter, and zachary c lipton. ratt: leveraging LINEBREAK unlabeled data to guarantee generalization. arxiv preprint arxiv:2105.00303, 2021a. LINEBREAK saurabh garg, sivaraman balakrishnan, zachary chase lipton, behnam neyshabur, and hanie sedghi. leveraging unlabeled data to predict out-of-distribution performance. in neurips 2021 workshop on distribution shifts: connecting methods and applications, 2021b. LINEBREAK ian j goodfellow, jonathon shlens, and christian szegedy. explaining and harnessing adversarial LINEBREAK jindong gu and volker tresp. neural network memorization dissection. LINEBREAK arxiv preprint LINEBREAK chuan guo, geoff pleiss, yu sun, and kilian q weinberger. on calibration of modern neural networks. in international conference on machine learning, pp. 1321–1330. pmlr, 2017. LINEBREAK chuan guo, jacob gardner, yurong you, andrew gordon wilson, and kilian weinberger. simple black-box adversarial attacks. in international conference on machine learning, pp. 2484–2493. pmlr, 2019. LINEBREAK bo han, quanming yao, tongliang liu, gang niu, ivor w tsang, james t kwok, and masashi sugiyama. a survey of label-noise representation learning: past, present and future. arxiv preprint arxiv:2011.04406, 2020. LINEBREAK hrayr harutyunyan, kyle reing, greg ver steeg, and aram galstyan. improving generalization by controlling label-noise information in neural network weights. in international conference on machine learning, pp. 4071–4081. pmlr, 2020. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 770–778, 2016a. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. identity mappings in deep residual LINEBREAK networks. in european conference on computer vision, pp. 630–645. springer, 2016b. LINEBREAK andrew g howard, menglong zhu, bo chen, dmitry kalenichenko, weijun wang, tobias weyand, marco andreetto, and hartwig adam. mobilenets: efficient convolutional neural networks for mobile vision applications. arxiv preprint arxiv:1704.04861, 2017. LINEBREAK jie hu, li shen, and gang sun. squeeze-and-excitation networks. in proceedings of the ieee LINEBREAK conference on computer vision and pattern recognition, pp. 7132–7141, 2018. LINEBREAK gao huang, zhuang liu, laurens van der maaten, and kilian q weinberger. densely connected convolutional networks. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 4700–4708, 2017. LINEBREAK forrest n iandola, song han, matthew w moskewicz, khalid ashraf, william j dally, and kurt keutzer. squeezenet: alexnet-level accuracy with 50x fewer parameters and< 0.5 mb model size. arxiv preprint arxiv:1602.07360, 2016. LINEBREAK arthur jacot, franck gabriel, and clément hongler. neural tangent kernel: convergence and LINEBREAK generalization in neural networks. arxiv preprint arxiv:1806.07572, 2018. LINEBREAK stanislaw jastrzebski, maciej szymczak, stanislav fort, devansh arpit, jacek tabor, kyunghyun cho, and krzysztof geras. the break-even point on optimization trajectories of deep neural networks. arxiv preprint arxiv:2002.09572, 2020. LINEBREAK albert q jiang and lisa schut clare lyle yarin gal. can network flatness explain the training LINEBREAK speed-generalisation connection? LINEBREAK alex krizhevsky, ilya sutskever, and geoffrey e hinton. imagenet classification with deep convolutional neural networks. advances in neural information processing systems, 25:1097–1105, 2012. LINEBREAK david krueger, nicolas ballas, stanislaw jastrzebski, devansh arpit, maxinder s kanwal, tegan maharaj, emmanuel bengio, asja fischer, and aaron courville. deep nets don’t learn via memorization. 2017. LINEBREAK chuck p lam and david g stork. evaluating classifiers by means of test data with noisy labels. in LINEBREAK ya le and xuan yang. tiny imagenet visual recognition challenge. cs 231n, 7(7):3, 2015. LINEBREAK jaehoon lee, lechao xiao, samuel schoenholz, yasaman bahri, roman novak, jascha sohldickstein, and jeffrey pennington. wide neural networks of any depth evolve as linear models under gradient descent. advances in neural information processing systems, 32:8572–8583, 2019. LINEBREAK jingling li, mozhi zhang, keyulu xu, john p dickerson, and jimmy ba. noisy labels can induce LINEBREAK good representations. arxiv preprint arxiv:2012.12896, 2020. LINEBREAK jingling li, mozhi zhang, keyulu xu, john dickerson, and jimmy ba. how does a neural network’s architecture impact its robustness to noisy labels? advances in neural information processing systems, 34, 2021. LINEBREAK junnan li, yongkang wong, qi zhao, and mohan s kankanhalli. learning to learn from noisy labeled data. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 5051–5059, 2019. LINEBREAK sheng liu, jonathan niles-weed, narges razavian, and carlos fernandez-granda. early-learning regularization prevents memorization of noisy labels. arxiv preprint arxiv:2007.00151, 2020. LINEBREAK yangdi lu and wenbo he. selc: self-ensemble label correction improves learning with noisy labels. LINEBREAK clare lyle, lisa schut, binxin ru, yarin gal, and mark van der wilk. a bayesian perspective on LINEBREAK training speed and model selection. arxiv preprint arxiv:2010.14499, 2020. LINEBREAK ningning ma, xiangyu zhang, hai-tao zheng, and jian sun. shufflenet v2: practical guidelines for efficient cnn architecture design. in proceedings of the european conference on computer vision (eccv), pp. 116–131, 2018. LINEBREAK xingjun ma, hanxun huang, yisen wang, simone romano, sarah erfani, and james bailey. nor LINEBREAK malized loss functions for deep learning with noisy labels. in icml, 2020. LINEBREAK hartmut maennel, ibrahim alabdulmohsin, ilya tolstikhin, robert jn baldock, olivier bousquet, sylvain gelly, and daniel keysers. what do neural networks learn when trained with random labels? arxiv preprint arxiv:2006.10455, 2020. LINEBREAK preetum nakkiran, gal kaplun, yamini bansal, tristan yang, boaz barak, and ilya sutskever. deep double descent: where bigger models and more data hurt. journal of statistical mechanics: theory and experiment, 2021(12):124003, 2021. LINEBREAK yuval netzer, tao wang, adam coates, alessandro bissacco, bo wu, and andrew y ng. reading LINEBREAK digits in natural images with unsupervised feature learning. 2011. LINEBREAK behnam neyshabur, hanie sedghi, and chiyuan zhang. what is being transferred in transfer learning? LINEBREAK advances in neural information processing systems, 33:512–523, 2020. LINEBREAK duc tam nguyen, chaithanya kumar mummadi, thi phuong nhung ngo, thi hoai phuong nguyen, laura beggel, and thomas brox. self: learning to filter noisy labels with self-ensembling. arxiv preprint arxiv:1910.01842, 2019. LINEBREAK nitika nigam, tanima dutta, and hari prabhat gupta. impact of noisy labels in learning techniques: LINEBREAK a survey. in advances in data and information sciences, pp. 403–411. springer, 2020. LINEBREAK nicolas papernot, patrick mcdaniel, and ian goodfellow. transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arxiv preprint arxiv:1605.07277, 2016a. LINEBREAK nicolas papernot, patrick mcdaniel, somesh jha, matt fredrikson, z berkay celik, and ananthram swami. the limitations of deep learning in adversarial settings. in 2016 ieee european symposium on security and privacy (euros&p), pp. 372–387. ieee, 2016b. LINEBREAK deep patel and ps sastry. memorization in deep neural networks: does the loss function matter? in pacific-asia conference on knowledge discovery and data mining, pp. 131–142. springer, 2021. LINEBREAK anibal pedraza, oscar deniz, and gloria bueno. on the relationship between generalization and LINEBREAK robustness to adversarial examples. symmetry, 13(5):817, 2021. LINEBREAK gabriel pereyra, george tucker, jan chorowski, łukasz kaiser, and geoffrey hinton. regularizing neural networks by penalizing confident output distributions. arxiv preprint arxiv:1701.06548, 2017. LINEBREAK geoff pleiss, tianyi zhang, ethan elenberg, and kilian q weinberger. identifying mislabeled data using the area under the margin ranking. advances in neural information processing systems, 33: 17044–17056, 2020. LINEBREAK vaibhav pulastya, gaurav nuti, yash kumar atri, and tanmoy chakraborty. assessing the quality of the datasets by identifying mislabeled samples. in proceedings of the 2021 ieee/acm international conference on advances in social networks analysis and mining, pp. 18–22, 2021. LINEBREAK ilija radosavovic, raj prateek kosaraju, ross girshick, kaiming he, and piotr dollár. designing network design spaces. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 10428–10436, 2020. LINEBREAK nasim rahaman, aristide baratin, devansh arpit, felix draxler, min lin, fred hamprecht, yoshua bengio, and aaron courville. on the spectral bias of neural networks. in international conference on machine learning, pp. 5301–5310. pmlr, 2019. LINEBREAK robin ru, clare lyle, lisa schut, miroslav fil, mark van der wilk, and yarin gal. speedy performance estimation for neural architecture search. advances in neural information processing systems, 34, 2021. LINEBREAK mark sandler, andrew howard, menglong zhu, andrey zhmoginov, and liang-chieh chen. mobilenetv2: inverted residuals and linear bottlenecks. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 4510–4520, 2018. LINEBREAK karen simonyan and andrew zisserman. very deep convolutional networks for large-scale image LINEBREAK recognition. arxiv preprint arxiv:1409.1556, 2014. LINEBREAK hwanjun song, minseok kim, and jae-gil lee. selfie: refurbishing unclean samples for robust LINEBREAK deep learning. in icml, 2019. LINEBREAK hwanjun song, minseok kim, dongmin park, yooju shin, and jae-gil lee. learning from noisy LINEBREAK labels with deep neural networks: a survey. arxiv preprint arxiv:2007.08199, 2020a. LINEBREAK jiaming song, yann dauphin, michael auli, and tengyu ma. robust and on-the-fly dataset denoising for image classification. in european conference on computer vision, pp. 556–572. springer, 2020b. LINEBREAK david stutz, matthias hein, and bernt schiele. disentangling adversarial robustness and generalization. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 6976–6987, 2019. LINEBREAK christian szegedy, wojciech zaremba, ilya sutskever, joan bruna, dumitru erhan, ian goodfellow, and rob fergus. intriguing properties of neural networks. arxiv preprint arxiv:1312.6199, 2013. LINEBREAK christian szegedy, wei liu, yangqing jia, pierre sermanet, scott reed, dragomir anguelov, dumitru erhan, vincent vanhoucke, and andrew rabinovich. going deeper with convolutions. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 1–9, 2015. LINEBREAK mingxing tan and quoc le. efficientnet: rethinking model scaling for convolutional neural networks. LINEBREAK in international conference on machine learning, pp. 6105–6114. pmlr, 2019. LINEBREAK dimitris tsipras, shibani santurkar, logan engstrom, alexander turner, and aleksander madry. LINEBREAK robustness may be at odds with accuracy. arxiv preprint arxiv:1805.12152, 2018. LINEBREAK jiaheng wei, zhaowei zhu, hao cheng, tongliang liu, gang niu, and yang liu. learning with noisy labels revisited: a study using real-world human annotations. arxiv preprint arxiv:2110.12088, 2021. LINEBREAK jiaheng wei, zhaowei zhu, hao cheng, tongliang liu, gang niu, and yang liu. learning with noisy labels revisited: a study using real-world human annotations. in international conference on learning representations, 2022. LINEBREAK xiaobo xia, tongliang liu, bo han, nannan wang, mingming gong, haifeng liu, gang niu, dacheng tao, and masashi sugiyama. part-dependent label noise: towards instance-dependent label noise. advances in neural information processing systems, 33:7597–7610, 2020. LINEBREAK xiaobo xia, tongliang liu, bo han, chen gong, nannan wang, zongyuan ge, and yi chang. LINEBREAK robust early-learning: hindering the memorization of noisy labels. in iclr, 2021. LINEBREAK han xiao, kashif rasul, and roland vollgraf. fashion-mnist: a novel image dataset for benchmarking LINEBREAK machine learning algorithms. arxiv preprint arxiv:1708.07747, 2017. LINEBREAK tong xiao, tian xia, yi yang, chang huang, and xiaogang wang. learning from massive noisy labeled data for image classification. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 2691–2699, 2015. LINEBREAK saining xie, ross girshick, piotr dollár, zhuowen tu, and kaiming he. aggregated residual transformations for deep neural networks. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 1492–1500, 2017. LINEBREAK zhi-qin john xu, yaoyu zhang, tao luo, yanyang xiao, and zheng ma. frequency principle: fourier analysis sheds light on deep neural networks. arxiv preprint arxiv:1901.06523, 2019a. LINEBREAK zhi-qin john xu, yaoyu zhang, and yanyang xiao. training behavior of deep neural network in frequency domain. in international conference on neural information processing, pp. 264–274. springer, 2019b. LINEBREAK yao-yuan yang, cyrus rashtchian, hongyang zhang, ruslan salakhutdinov, and kamalika chaud LINEBREAK huri. a closer look at accuracy vs. robustness. arxiv preprint arxiv:2003.02460, 2020. LINEBREAK dong yin, ramchandran kannan, and peter bartlett. rademacher complexity for adversarially robust generalization. in international conference on machine learning, pp. 7085–7094. pmlr, 2019. LINEBREAK fisher yu, dequan wang, evan shelhamer, and trevor darrell. deep layer aggregation. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 2403–2412, 2018. LINEBREAK chiyuan zhang, samy bengio, and yoram singer. are all layers created equal? arxiv preprint LINEBREAK chiyuan zhang, samy bengio, moritz hardt, benjamin recht, and oriol vinyals. understanding deep learning (still) requires rethinking generalization. communications of the acm, 64(3):107–115, 2021a. LINEBREAK hongyang zhang, yaodong yu, jiantao jiao, eric xing, laurent el ghaoui, and michael jordan. theoretically principled trade-off between robustness and accuracy. in international conference on machine learning, pp. 7472–7482. pmlr, 2019b. LINEBREAK hongyi zhang, moustapha cisse, yann n dauphin, and david lopez-paz. mixup: beyond empirical LINEBREAK risk minimization. arxiv preprint arxiv:1710.09412, 2017. LINEBREAK jie zhang, earl barr, benjamin guedj, mark harman, and john shawe-taylor. perturbed model LINEBREAK validation: a new framework to validate model relevance. 2019c. LINEBREAK jing zhang, xindong wu, and victor s sheng. learning from crowdsourced labeled data: a survey. LINEBREAK xiao zhang, haoyi xiong, and dongrui wu. rethink the connections among generalization, memo LINEBREAK rization and the spectral bias of dnns. arxiv preprint arxiv:2004.13954, 2020. LINEBREAK xuanyang zhang, pengfei hou, xiangyu zhang, and jian sun. neural architecture search with random labels. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 10907–10916, 2021b. LINEBREAK zhaowei zhu, zihao dong, hao cheng, and yang liu. a good representation detects noisy labels. LINEBREAK liu ziyin, blair chen, ru wang, paul pu liang, ruslan salakhutdinov, louis-philippe morency, and masahito ueda. learning not to learn in the presence of noisy labels. arxiv preprint arxiv:2002.06541, 2020. LINEBREAK a additional related work LINEBREAK memorization arpit et al. (2017) describe memorization as the behavior shown by neural networks when trained on noisy data. patel & sastry (2021) define memorization as the difference in the predictive performance of models trained on the clean data and on the noisy data distributions, and propose a robust objective function that resists to memorization. the effect of neural network architecture on their robustness to noisy labels is studied in (li et al., 2021), which measure robustness to noisy labels by the prediction performance of the learned representations on the ground-truth target function. feldman & zhang (2020) formally define memorization of a sample for an algorithm as the inability of the model to predict the output of a sample based on the rest of the dataset, so that the only way that the model can fit the sample is by memorizing its label. our definition of memorization as the fit on the noisy subset of the training set follows the same principle; the fit of a randomly-labeled individual sample is only possible if the totally random label associated with the sample is memorized, and it is impossible to predict using the rest of the dataset. LINEBREAK learning before memorization multiple studies have reported that neural networks learn simple patterns first, and memorize the noisy labeled data later in the training process (arpit et al., 2017; gu & tresp, 2019; krueger et al., 2017; liu et al., 2020). hence, early stopping might be useful when learning with noisy labels. parallel to our study, lu & he (2022) propose early stopping metrics that are computed on the training set. these early stopping metrics are computed by an iterative algorithm (either a gmm or k-means) on top of the training loss histograms. this adds computational overhead compared to our approach, which is based on a simple metric that can be computed on the fly. moreover, we can observe in figure 9 that the metric proposed in lu & he (2022), which is the mean difference between distributions obtained from the gmm applied on top of the training losses, does not correlated with memorization on the training set, as opposed to our metric susceptibility. hence, we can conclude that, even though the mean difference metric might be a rather well early stopping criterion for a single setting, it does not perform well in terms of comparing different settings to one another. moreover, rahaman et al. (2019); xu et al. (2019a;b) show that neural networks learn lower frequencies in the input space first and higher frequencies later. however, the monotonic behaviour of neural networks during the training procedure is recently challenged by the epoch-wise double descent (zhang et al., 2020; nakkiran et al., 2021). when a certain amount of fit is observed on the entire training set, how much of this fit corresponds to the fit on the clean and noisy subsets, respectively, is still unclear. in this paper, we propose an approach to track the fit to the clean subset and the fit to the noisy subset (memorization) explicitly. LINEBREAK training speed lyle et al. (2020) show there is a connection between training speed and the marginal likelihood for linear models. jiang & gal also find an explanation for the connection between training speed and generalization, and ru et al. (2021) use this connection for neural architecture search. however, in figure 7, we observe that a sharp increase in the training accuracy (a high training speed), does not always indicate an increase in the value of accuracy on the noisy subset. this result suggests that studies that relate training speed with generalization (lyle et al., 2020; ru et al., 2021) might not be extended as such to noisy-label training settings. on the other hand, we observe a strong correlation between susceptibility ζ and accuracy on the noisy subset. LINEBREAK leveraging unlabeled/randomly-labeled data unlabeled data has been leveraged previously to predict out-of-distribution performance (when there is a mismatch between the training and test distributions) (garg et al., 2021b). li et al. (2019) introduce synthetic noise to unlabeled data, to propose a noise-tolerant meta-learning training approach. zhang et al. (2021b) use randomly labeled data to perform neural architecture search. in our paper, we leverage unlabeled data to track memorization of label noise. LINEBREAK benefits of memorization studies on long-tail data distributions show potential benefits from memorization when rare and atypical instances are abundant in the distribution (feldman, 2020; feldman & zhang, 2020; brown et al., 2021). these studies argue that the memorization of these rare instances is required to guarantee low generalization error. on a separate line of work, previous empirical observations suggest that networks trained on noisy labels can still induce good representations from the data, despite their poor generalization performance (li et al., 2020; maennel et al., 2020). in this work, we propose an approach to track memorization when noisy labels are present. LINEBREAK figure 7: accuracy on the entire, the clean and the noisy subsets of the training set, versus susceptibility in equation (2) for a 5−layer convolutional neural network trained on cifar-10 with 50% label noise without any regularization, with mixup (zhang et al., 2017), and with active passive loss using the normalized cross entropy together with reverse cross entropy loss (denoted by nce) (ma et al., 2020). the sharp increases in the overall training accuracy (illustrated by the red and yellow stars) can be caused by an increase in the accuracy of either the clean (the yellow star) and noisy (the red star) subsets. therefore, this sharp increase could not predict memorization, contrary to the susceptibility ζ, which is strongly correlated with the accuracy on the noisy subset (pearson correlation between train acc noisy and susceptibility ζ is ρ = 0.636). LINEBREAK theoretical results to analyze the convergence of different models on some randomly labeled set, we rely on recent results obtained by modelling the training process of wide neural networks by neural tangent kernels (ntk) (du et al., 2018; jacot et al., 2018; allen-zhu et al., 2018; arora et al., 2019; bietti & mairal, 2019; lee et al., 2019). in particular, the analysis in our paper is motivated by recent work on convergence analysis of neural networks (du et al., 2018; arora et al., 2019). arora et al. (2019) perform fine-grained convergence analysis for wide two-layered neural networks using gradient descent. they study the convergence of models trained on different datasets (datasets with clean labels versus random labels). in section 5, we study the convergence of different models trained on some randomly-labeled set. in particular, our models are obtained by training wide two-layered neural networks on datasets with varying label noise levels. as we highlight in the proofs, our work builds on previous art, especially (du et al., 2018; arora et al., 2019), yet we build on a non-trivial way and for a new problem statement. LINEBREAK robustness to adversarial examples deep neural networks are vulnerable to adversarial samples (szegedy et al., 2013; goodfellow et al., 2014; akhtar & mian, 2018): very small changes to the input image can fool even state-of-the-art neural networks. this is an important issue that needs to be addressed for security reasons. to this end, multiple studies towards generating adversarial examples and defending against them have emerged (carlini & wagner, 2017; papernot et al., 2016b;a; athalye et al., 2018). as a side topic related to the central theme of the paper, we examined the connection between models that are resistant to memorization of noisy labels and models that are robust to adversarial attacks. figure 8 compares the memorization of these models trained on some noisy dataset, with their robustness to adversarial attacks. we do not observe any positive or negative correlation between the two. some models are robust to adversarial attacks, but perform poorly when trained on datasets with noisy labels, and vice versa. this means that the observations made in this paper are orthogonal to the ongoing discussion regarding the trade-off between robustness to adversarial samples and test accuracy (tsipras et al., 2018; stutz et al., 2019; yang et al., 2020; pedraza et al., 2021; zhang et al., 2019b; yin et al., 2019). LINEBREAK (a) success rate versus accuracy on the noisy subset of the training set LINEBREAK (b) success rate versus susceptibility to noisy labels ζ LINEBREAK figure 8: simba (guo et al., 2019) adversarial attack success rate versus accuracy on the noisy subset of the training set for networks trained on cifar-10 with 50% label noise. to evaluate robustness of different models with respect to adversarial attacks, we compare the success rate of the adversarial attack simba proposed in (guo et al., 2019) after 1000 iterations. we observe no correlation between the success rate and neither accuracy on the noisy subset nor susceptibility ζ. LINEBREAK figure 9: left: accuracy on the noisy subset of the training set, versus the training accuracy drop presented in (zhang et al., 2019c) for the following neural network configurations trained on the cifar-10 dataset with 50% label noise: a 5-layer convolutional neural network, densenet, efficientnet, mobilenet, mobilenetv2, regnet, resnet, resnext, senet, and shufflenetv2. as proposed in (zhang et al., 2019c), to compute the training accuracy drop, we create a new dataset from the available noisy training set, by replacing 25% of its labels with random labels. we then train these networks on the new dataset, and then compute the difference in the training accuracy of the two setups, divided by 25 (the level of label noise that was injected). this is reported above as train acc drop. (zhang et al., 2019c) state that desirable networks should have a large drop; therefore there should ideally be a negative correlation between the training accuracy drop and the accuracy on the noisy subset. however, we observe a slight positive correlation. therefore, it is difficult to use the results of zhang et al. (2019c) to track memorization, i.e., training accuracy on the noisy subset. middle: accuracy on the noisy subset of the training set, versus the mean difference between the distributions obtained by applying gmm on the training losses, which is proposed in lu & he (2022) as an early stopping criterion. we observe a negative correlation between the two, and hence conclude that this metric cannot be used to compare memorization of different settings at different stages of training. right: as opposed to the other two metrics, we observe a strong positive correlation between our metric susceptibility ζ and memorization. LINEBREAK b experimental setup LINEBREAK generating noisy-labeled datasets we modify original datasets similarly to chatterjee (2020); for a fraction of samples denoted by the label noise level (lnl), we replace the labels with independent random variables drawn uniformly from {1, · · · , c} for a dataset with c number of classes. on average (1 − lnl) + (lnl) · 1/c of the samples still have their correct labels. note that lnl for (cid:101)s is 1. LINEBREAK experiments of figures 2, 12, 13 and 14 the models at epoch 0 are pre-trained models on either the clean or noisy versions of the cifar-10 dataset for 200 epochs using sgd with learning rate 0.1, momentum 0.9, weight decay 5 · 10−4, and cosineannealing learning rate schedule with t max = 200. the new sample is a sample drawn from the training set, and its label is randomly assigned to some class different from the correct class label. in figure 13, the new sample is an unseen sample drawn from the test set. LINEBREAK cifar-104 experiments the models are trained for 200 epochs on the cross-entropy objective function using sgd with weight decay 5 · 10−4 and batch size 128. the cnn (a simple 5-layer convolutional neuneural network architecture options are: (with (huang et al., 2017), efficientnet ral network), densenet scale=0.5, 0.75, 1, 1.25, 1.5), googlenet (szegedy et al., 2015), mobilenet (howard et al., 2017) (with scale=0.5, 0.75, 1, 1.25, 1.5), resnet (he et al., 2016a), mobilenetv2 (sandler et al., 2018) (with scale=0.5, 0.75, 1, 1.25, 1.5), preact resnet (he et al., 2016b), regnet (radosavovic et al., 2020), resnext (xie et al., 2017), senet (hu et al., 2018), shufflenetv2 (ma et al., 2018) (with scale=0.5, 1, 1.5, 2), dla (yu et al., 2018), and vgg (simonyan & zisserman, 2014). the learning rate value options are: 0.001, 0.005, 0.01, 0.05, 0.1, 0.5. the learning rate schedule options are: cosineannealing with t max 200, cosineannealing with t max 100, cosineannealing with t max 50, and no learning rate schedule. momentum value options are 0.9, 0. in addition, we include experiments with mixup (zhang et al., 2017), active passive losses: normalized cross entropy with reverse cross entropy (nce+rce) (ma et al., 2020), active passive losses: normalized focal loss with reverse cross entropy (nfl+rce) (ma et al., 2020), and robust early learning (xia et al., 2021) regularizers. LINEBREAK cifar-100 experiments the models are trained for 200 epochs on the cross-entropy objective function using sgd with learning rate 0.1, weight decay 5 · 10−4, momentum 0.9, learning rate schedule cosineannealing with t max 200 and batch size 128. the neural network architecture options are: cnn, densenet, efficientnet (with scale=0.5, 0.75, 1, 1.25, 1.5), googlenet, mobilenet (with scale=0.5, 0.75, 1, 1.25, 1.5), resnet, mobilenetv2 (with scale=0.5, 0.75, 1, 1.25, 1.5), regnet, resnext, shufflenetv2 (with scale=0.5, 1, 1.5, 2), dla, and vgg. in addition, we include experiments with mixup, active passive losses: nce+rce, active passive losses: nfl+rce, and robust early learning regularizers. LINEBREAK svhn (netzer et al., 2011) experiments the models are trained for 200 epochs on the cross-entropy objective function with learning rate 0.1 and batch size 128. the optimizer choices are sgd with weight decay 5 · 10−4, and momentum 0.9, and adam optimizers. the learning rate schedule options for the sgd experiments are: cosineannealing with t max 200, and exponential. the neural network architecture options are: densenet, (with scale= 1, 1.25, 1.5, 1.75), scale= 0.25, 1, 1.25), (with mobilenetv2 scale=0.25, 0.5, 1, 1.25, 1.5, 1.75), (with scale=0.25, 0.5, 0.75, 1), shufflenetv2 (with scale=0.25, 0.5, 0.75, 1), scale=0.25, 0.5, 0.75, 1), dla (with scale=0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75). LINEBREAK resnet senet LINEBREAK efficientnet LINEBREAK mobilenet LINEBREAK vgg LINEBREAK (with LINEBREAK (with LINEBREAK (with LINEBREAK and LINEBREAK mnist5 and fashion-mnist (xiao et al., 2017) experiments the models are trained for 200 epochs on the cross-entropy objective function with batch size 128, using sgd with learning rate 0.1, weight decay 5 · 10−4, and momentum 0.9. the learning rate LINEBREAK 4https://www.cs.toronto.edu/~kriz/cifar.html 5http://yann.lecun.com/exdb/mnist/ LINEBREAK cosineannealing with t max 200, LINEBREAK resnet50 LINEBREAK resnet18 LINEBREAK (with LINEBREAK tiny imagenet (le & yang, 2015) experiments the models are trained for 200 epochs on the cross-entropy objective function with batch size 128, using sgd with weight decay 5 · 10−4, and momentum 0.9. the learning rate schedule options are: cosineannealing with t max 200, exponential, and no learning rate schedule. the learning rate options are: 0.01, 0.05, 0.1, 0.5. the neural network architecture options are: alexnet, densenet, mobilenetv2, resnet, squeezenet (iandola et al., 2016), and vgg. LINEBREAK clothing-1m (xiao et al., 2015) experiments the models are trained for 20 epochs on the crossentropy objective function with batch size 128 using sgd with weight decay 5 · 10−4, and momentum 0.9. the learning rate schedule options are: cosineannealing with t max 20, and exponential. the learning rate options are: 0.01, 0.005, 0.001. the neural network architecture options are: alexnet, resnet18, resnet 34, resnext, and vgg. note that because this dataset has random labels we do not introduce synthetic label noise to the labels. LINEBREAK animal-10n (song et al., 2019) experiments the models are trained for 50 epochs on the crossentropy objective function with batch size 128 using sgd with weight decay 5 · 10−4, and momentum 0.9. the learning rate schedule options are: cosineannealing with t max 50, and exponential. the learning rate options are: 0.001, 0.005, 0.01. the neural network architecture options are: resnet18, resnet34, squeezenet, alexnet and vgg. note that because this dataset has random labels we do not introduce synthetic label noise to the labels. LINEBREAK cifar-10n (wei et al., 2022) experiments on these experiments, we work with the aggregate version of the label set which has label noise level of 9% (cifar-10n-aggregate in table 1 of wei et al. (2022)). the models are trained for 200 epochs on the cross-entropy objective function with batch size 128 using sgd with weight decay 5·10−4, and momentum 0.9 with cosineannealing learning rate schedule with t max 200. the learning rate options are: 0.1, 0.05. the neural network architecture options are: cnn, efficientnet, mobilenet, resnet, mobilenetv2, regnet, resnext, shufflenetv2, senet, dla and vgg. LINEBREAK each of our experiments take few hours to run on a single nvidia titan x maxwell gpu. LINEBREAK c comparison with baselines LINEBREAK comparison to a noisy validation set following the notations from chen et al. (2021), let the clean and noisy data distributions be denoted by d and ˜d, respectively, the classifiers by h, and the classification accuracy by a. suppose that the optimal classifier in terms of accuracy on the clean data distribution is h∗, i.e., h∗ = arg maxh ad(h). (chen et al., 2021) states that under certain assumptions on the label noise, the accuracy on the noisy data distribution is also maximized by h∗, that is h∗ = arg maxh a ˜d(h). however, these results do not allow us to compare any two classifiers h1 and h2, because we cannot conclude from the results in (chen et al., 2021) that if ad(h1) > ad(h2), then a ˜d(h1) > a ˜d(h2). moreover, it is important to note that these results hold when the accuracy is computed on unlimited dataset sizes. as stated in (lam & stork, 2003), the number of noisy validation samples that are equivalent to a single clean validation sample depends on the label noise level and on the true error rate of the model, which are both unknown in practice. nevertheless, below we thoroughly compare our approach with having a noisy validation set. LINEBREAK as discussed in section 4, the susceptibility ζ together with the training accuracy are able to select models with a high test accuracy. another approach to select models is to use a subset of the available noisy dataset as a held-out validation set. table 1 provides the correlation values between the test accuracy on the clean test set and the validation accuracy computed on noisy validation sets with varying sizes. on the one hand, we observe that the correlation between the validation accuracy and the test accuracy is very low for small sizes of the noisy validation set. on the other hand, in the same LINEBREAK train acc val acc our approach LINEBREAK table 1: the kendall τ correlation between each metric and the test accuracy for cnn, resnet, efficientnet, and mobilenet trained on cifar-10 with 50% label noise, where the validation accuracy (val acc) on a held-out subset of the data and the susceptibility ζ use a set with the size indicated in each row. we observe that our approach results in a much higher correlation compared to using a noisy validation set. furthermore, our approach is less sensitive to the size of the held-out set, compared to using a noisy validation set. in particular, to reach the same correlation value, our approach with set size = 10 is equivalent to using a noisy validation set with size = 512 (highlighted in red). also, our approach with set size = 128 is almost equivalent to using a noisy validation set with size = 1024 (highlighted in blue). hence, to use a noisy validation set, one requires around ten-fold the amount of held-out data. LINEBREAK table, we observe that if the same size is used to compute ζ, our approach provides a high correlation to the test accuracy, even for very small sizes of the held-out set. LINEBREAK in our approach, we first filter out models for which the value of ζ exceeds a threshold. we set the threshold so that around half of the models remain after this filtration. we then report the correlation between the training and test accuracies among the remaining models. as a sanity check, we doubled checked that, with this filtration, the model with the highest test accuracy was not filtered out. LINEBREAK moreover, in figure 10, we report the advantage of using our approach compared to using a noisy validation set for various values of the dataset label noise level (lnl) and the size of the set that computes the validation accuracy and susceptibility ζ. we observe that the lower the size of the validation set, and the higher the lnl, the more advantageous our approach is. note also that for high set sizes and low lnls, our approach produces comparable results to using a noisy validation set. LINEBREAK comparison to label noise detection approaches another line of work is studying methods that detect whether a label assigned to a given sample is correct or not (zhu et al., 2021; song et al., 2020b; pleiss et al., 2020; pulastya et al., 2021). such methods can estimate the clean and noisy subsets. then, by tracking the training accuracy on the clean and noisy subsets, similar to what is done in figure 5, they can select models that are located in region 1, i.e., that have a low estimated accuracy on the noisy subset and a high estimated accuracy on the clean subset. in figure 11, we compare the average test accuracy of models selected by our approach with those selected by such subset-selection methods. let x be the accuracy of the detection of the correct/incorrect label of a sample by the subset selection benchmark: if x = 100%, then the method has full access to the ground truth label for each label, if x = 90% the method correctly detects 90% of the labels. we observe a clear advantage of our method for x up to 96%, and comparable performance for x > 96%. LINEBREAK figure 10: the kendall τ correlation between our approach and the test accuracy minus the kendall τ correlation between validation accuracy (computed on a noisy set) and the test accuracy for various label noise levels (lnl) and set sizes. we observe the advantage of our approach to using a noisy validation set particularly for high lnls and low set sizes. for other combinations, we also observe comparable results (the correlation difference is very close to zero). note that the last row can be recovered from the difference in correlation values of table 1. LINEBREAK figure 11: comparison between the average test accuracy obtained using our approach and the average test accuracy obtained using a method that detects correctly-labeled samples within the training set from the incorrectly-labeled ones with x% accuracy (the xaxis). the results are obtained from training {cnn, resnet, efficientnet, mobilenet}×{without regularization, +mixup, +ncerce, + nflrce, +robust early learning} on cifar-10 with 50% label noise. we observe that to have the same performance as our approach, such methods require a very high accuracy (above 96%), and even with higher accuracies, our approach gives comparable results. LINEBREAK d additional experiments for section 2 LINEBREAK in this section, we provide additional experiments for the observation presented in section 2. in figure 12, we observe that networks with a high test accuracy are resistant to memorizing a new incorrectly-labeled sample. on the other hand, in figure 13, we observe that networks with a high test accuracy tend to fit a new correctly-labeled sample faster. LINEBREAK (a) example 1: original label: horse, assigned label: frog LINEBREAK (b) example 2: original label: cat, assigned label: truck LINEBREAK (c) example 3: original label: dog, assigned label: automobile LINEBREAK (d) example 4: original label: ship, assigned label: deer LINEBREAK figure 12: the evolution of output prediction of two networks that are trained on a single randomly labeled sample. in all sub-figures, network 1 has a higher test accuracy compared to network 2, and we observe it is less resistance to memorization of the single incorrectly-labeled sample. example 1: network 1 is a resnext trained on cifar-10 dataset with 50% random labels and has test accuracy of 58.85%. network 2 is a resnext that is not pre-trained and has test accuracy of 9.74%. example 2: network 1 is a senet trained on cifar-10 dataset with original labels and has test accuracy of 95.35%. network 2 is a senet that is trained on cifar-10 with 50% label noise and has test accuracy of 56.38%. example 3: network 1 is a regnet trained on cifar-10 dataset with original labels and has test accuracy of 95.28%. network 2 is a regnet that is trained on cifar-10 with 50% label noise and has test accuracy of 55.36%. example 4: network 1 is a mobilenet trained on cifar-10 dataset with original labels and has test accuracy of 90.56%. network 2 is a mobilenet that is trained on cifar-10 with 50% label noise and has test accuracy of 82.76%. LINEBREAK moreover, we study the effect of calibration on the observations of figures 2 and 12. a poor calibration of a model may affect the confidence in its predictions, which in turn might affect the susceptibility/resistance to new samples. therefore, in figure 14, we compare models that have almost the same calibration value. more precisely, network 1 is trained on the clean dataset, and network 2 (calibrated) is a calibrated version of the model that is trained on the noisy dataset using the temperature scaling approach (guo et al., 2017). we observe that even with the same calibration level, the model with a higher test accuracy is more resistant to memorizing a new incorrectly-labeled sample. LINEBREAK (a) example 1: original label: dog, assigned label: dog LINEBREAK (b) example 2: original label: frog, assigned label: frog LINEBREAK (c) example 3: original label: horse, assigned label: horse LINEBREAK (d) example 4: original label: cat, assigned label: cat LINEBREAK (e) example 5: original label: truck, assigned label: truck LINEBREAK figure 13: the evolution of output prediction of two networks that are trained on a single unseen correctly-labeled sample. in all sub-figures, network 1 has a higher test accuracy compared to network 2. we observe that give a new correctly-labeled sample network 2 learns it later, unlike our observation in figure 2 for a new incorrectly-labeled sample. example 1: network 1 is a googlenet trained on cifar-10 dataset with clean labels and has test accuracy of 95.36%. network 2 is a googlenet trained on cifar-10 dataset with 50% label noise level and has test accuracy of 58.35%. example 2: network 1 is a resnext trained on cifar-10 dataset with 50% random labels and has test accuracy of 58.85%. network 2 is a resnext that is not pre-trained and has test accuracy of 9.74%. example 3: network 1 is a senet trained on cifar-10 dataset with original labels and has test accuracy of 95.35%. network 2 is a senet that is trained on cifar-10 with 50% label noise and has test accuracy of 56.38%. example 4: network 1 is a regnet trained on cifar-10 dataset with original labels and has test accuracy of 95.28%. network 2 is a regnet that is trained on cifar-10 with 50% label noise and has test accuracy of 55.36%. example 5: network 1 is a mobilenet trained on cifar-10 dataset with original labels and has test accuracy of 90.56%. network 2 is a mobilenet that is trained on cifar-10 with 50% label noise and has test accuracy of 82.76%. LINEBREAK (a) example 1: original label: ship, assigned label: dog LINEBREAK (b) example 2: original label: cat, assigned label: truck LINEBREAK figure 14: the evolution of output prediction of networks that are trained on a single randomly labeled sample. in all sub-figures, network 1 (trained on the clean dataset) has a higher test accuracy than network 2 (trained on the noisy dataset), and we observe it is less resistant to memorization of the single incorrectly-labeled sample. furthermore, we have ensured using the temperature scaling method (guo et al., 2017) that the two models have the same calibration (ece) value. example 1: network 1 is a googlenet trained on cifar-10 dataset with original labels and has test accuracy of 95.36%. network 2 is a googlenet that is trained on cifar-10 with 50% label noise and has test accuracy of 58.35%. example 2: network 1 is a regnet trained on cifar-10 dataset with original labels and has test accuracy of 95.28%. network 2 is a regnet that is trained on cifar-10 with 50% label noise and has test accuracy of 55.36%. LINEBREAK e additional experiments for section 4 LINEBREAK in this section, we provide additional experiments for our main results for mnist, fashion-mnist, svhn, cifar-100, and tiny imagenet datasets. later in the section, we provide additional experiments on the clothing-1m, animal-10n and cifar-10n datasets, where as stated in appendix b are datasets with real-world label noise. LINEBREAK in figure 15, we observe that for networks trained on the noisy mnist datasets, models that are resistant to memorization and trainable have on average more than 20% higher test accuracy compared to models that are trainable but not resistant (similar results for other datasets are observed in figures 17, 19, 22, and 25). furthermore, without access to the ground-truth, the models with a high (respectively, low) accuracy on the clean (resp., noisy) subsets are recovered using susceptibility ζ as shown in figures 20 and 23. moreover, in figure 16, we observe that by selecting models with a low value of ζ(t) the correlation between training accuracy and test accuracy drastically increases from −0.766 to 0.863, which shows the effectiveness of the susceptibility metric ζ(t) (similar results for other datasets are observed in figures 18, 21, 24, and 26). LINEBREAK figure 15: using susceptibility ζ(t) and training accuracy, we can obtain 4 different regions for models trained on mnist with 50% label noise (details in appendix b). region 1: trainable and resistant, with average test accuracy of 95.38%. region 2: trainable and but not resistant, with average test accuracy of 72.65%. region 3: not trainable but resistant, with average test accuracy of 47.69%. region 4: neither trainable nor resistant. LINEBREAK (a) test accuracy versus train accuracy for all models at all epochs LINEBREAK (b) test accuracy versus train accuracy for models that have ζ(t) ≤ 0.05 LINEBREAK figure 16: for models trained on mnist with 50% label noise (details in appendix b), the correlation between training accuracy and test accuracy increases a lot by removing models based on the susceptibility metric ζ(t). LINEBREAK figure 17: using susceptibility ζ(t) and training accuracy we can obtain 4 different regions for models trained on fashion-mnist with 50% label noise (details in appendix b). region 1: trainable and resistant, with average test accuracy of 95.82%. region 2: trainable and but not resistant, with average test accuracy of 72.04%. region 3: not trainable but resistant, with average test accuracy of 52.68%. region 4: neither trainable nor resistant. LINEBREAK (a) test accuracy versus train accuracy for all models at all epochs LINEBREAK (b) test accuracy versus train accuracy for models that have ζ(t) ≤ 0.05 LINEBREAK figure 18: for models trained on fashion-mnist with 50% label noise (details in appendix b), the correlation between training accuracy and test accuracy increases a lot by removing models based on the susceptibility metric ζ(t). LINEBREAK figure 19: using susceptibility ζ(t) and training accuracy we can obtain 4 different regions for models trained on svhn with 50% label noise (details in appendix b). region 1: trainable and resistant, with average test accuracy of 88.64%. region 2: trainable and but not resistant, with average test accuracy of 66.34%. region 3: not trainable but resistant, with average test accuracy of 53.25%. region 4: neither trainable nor resistant, with average test accuracy of 85.17%. LINEBREAK (a) with oracle access to the ground-truth label. average test accuracy of the selected models = 87.56% LINEBREAK (b) without access to the ground-truth label. average test accuracy of the selected models = 85.44% LINEBREAK figure 20: for models trained on svhn with 50% label noise (details in appendix b), with the help of our susceptibility metric ζ(t) and the overall training accuracy, we can recover models with a high/low accuracy on the clean/noisy subset. LINEBREAK (a) test accuracy versus train accuracy for all models at all epochs LINEBREAK (b) test accuracy versus train accuracy for models that have ζ(t) ≤ 0.05 LINEBREAK figure 21: for models trained on svhn with 50% label noise (details in appendix b), the correlation between training accuracy and test accuracy increases a lot by removing models based on the susceptibility metric ζ(t). LINEBREAK figure 22: using susceptibility ζ(t) and training accuracy we can obtain 4 different regions for models trained on cifar-100 with 50% label noise (details in appendix b). region 1: trainable and resistant, with average test accuracy of 47.09%. region 2: trainable and but not resistant, with average test accuracy of 40.96%. region 3: not trainable but resistant, with average test accuracy of 22.65%. region 4: neither trainable nor resistant, with average test accuracy of 39.07%. LINEBREAK (a) with oracle access to the ground-truth label. average test accuracy of the selected models = 51.39% LINEBREAK (b) without access to the ground-truth label. average test accuracy of the selected models = 49.57% LINEBREAK figure 23: for models trained on cifar-100 with 50% label noise, with the help of our susceptibility metric ζ(t) and the overall training accuracy, we can recover models with a high/low accuracy on the clean/noisy subset. LINEBREAK (a) test accuracy versus train accuracy for all models at all epochs
| 28
|
[
130.505,
340.5172576,
293.0389328,
359.4466576
] |
PqvMRDCJT9t.pdf
| 2,023
| 0
|
LINEBREAK flow matching for generative modeling LINEBREAK yaron lipman1,2 ricky t. q. chen1 heli ben-hamu2 maximilian nickel1 matt le1 1meta ai (fair) 2weizmann institute of science LINEBREAK abstract LINEBREAK we introduce a new paradigm for generative modeling built on continuous normalizing flows (cnfs), allowing us to train cnfs at unprecedented scale. specifically, we present the notion of flow matching (fm), a simulation-free approach for training cnfs based on regressing vector fields of fixed conditional probability paths. flow matching is compatible with a general family of gaussian probability paths for transforming between noise and data samples—which subsumes existing diffusion paths as specific instances. interestingly, we find that employing fm with diffusion paths results in a more robust and stable alternative for training diffusion models. furthermore, flow matching opens the door to training cnfs with other, non-diffusion probability paths. an instance of particular interest is using optimal transport (ot) displacement interpolation to define the conditional probability paths. these paths are more efficient than diffusion paths, provide faster training and sampling, and result in better generalization. training cnfs using flow matching on imagenet leads to consistently better performance than alternative diffusion-based methods in terms of both likelihood and sample quality, and allows fast and reliable sample generation using off-the-shelf numerical ode solvers. LINEBREAK introduction LINEBREAK deep generative models are a class of deep learning algorithms aimed at estimating and sampling from an unknown data distribution. the recent influx of amazing advances in generative modeling, e.g., for image generation ramesh et al. (2022); rombach et al. (2022), is mostly facilitated by the scalable and relatively stable training of diffusion-based models ho et al. (2020); song et al. (2020b). however, the restriction to simple diffusion processes leads to a rather confined space of sampling probability paths, resulting in very long training times and the need to adopt specialized methods (e.g., song et al. (2020a); zhang & chen (2022)) for efficient sampling. LINEBREAK in this work we consider the general and deterministic framework of continuous normalizing flows (cnfs; chen et al. (2018)). cnfs are capable of modeling arbitrary probability path and are in particular known to encompass the probability paths modeled by diffusion processes (song et al., 2021). however, aside from diffusion that can be trained efficiently via, e.g., denoising score matching (vincent, 2011), no scalable cnf training algorithms indeed, maximum likelihood trainare known. ing (e.g., grathwohl et al. (2018)) require expensive numerical ode simulations, while existing simulation-free methods either involve intractable integrals (rozen et al., 2021) or biased gradients (ben-hamu et al., 2022). LINEBREAK the goal of this work is to propose flow matching (fm), an efficient simulation-free approach to training cnf models, allowing the adoption of general improbability paths to supervise cnf training. portantly, fm breaks the barriers for scalable cnf training beyond diffusion, and sidesteps the need to reason about diffusion processes to directly work with probability paths. LINEBREAK in particular, we propose the flow matching objective (section 3), a simple and intuitive training objective to regress onto a target vector field that generates a desired probability path. we first show that we can construct such target vector fields through per-example (i.e., conditional) formulations. then, inspired by denoising score matching, we show that a per-example training objective, termed conditional flow matching (cfm), provides equivalent gradients and does not require explicit knowledge of the intractable target vector field. furthermore, we discuss a general family of per-example probability paths (section 4) that can be used for flow matching, which subsumes existing diffusion paths as special instances. even on diffusion paths, we find that using fm provides more robust and stable training, and achieves superior performance compared to score matching. furthermore, this family of probability paths also includes a particularly interesting case: the vector field that corresponds to an optimal transport (ot) displacement interpolant (mccann, 1997). we find that conditional ot paths are simpler than diffusion paths, forming straight line trajectories whereas diffusion paths result in curved paths. these properties seem to empirically translate to faster training, faster generation, and better performance. LINEBREAK we empirically validate flow matching and the construction via optimal transport paths on imagenet, a large and highly diverse image dataset. we find that we can easily train models to achieve favorable performance in both likelihood estimation and sample quality amongst competing diffusion-based methods. furthermore, we find that our models produce better trade-offs between computational cost and sample quality compared to prior methods. figure 1 depicts selected unconditional imagenet 128×128 samples from our model. LINEBREAK preliminaries: continuous normalizing flows LINEBREAK let rd denote the data space with data points x = (x1, . . . , xd) ∈ rd. two important objects we use in this paper are: the probability density path p : [0, 1] × rd → r>0, which is a time dependent1 probability density function, i.e., (cid:82) pt(x)dx = 1, and a time-dependent vector field, v : [0, 1] × rd → rd. a vector field vt can be used to construct a time-dependent diffeomorphic map, called a flow, ϕ : [0, 1] × rd → rd, defined via the ordinary differential equation (ode): LINEBREAK d dt LINEBREAK ϕt(x) = vt(ϕt(x)) LINEBREAK previously, chen et al. (2018) suggested modeling the vector field vt with a neural network, vt(x; θ), where θ ∈ rp are its learnable parameters, which in turn leads to a deep parametric model of the flow ϕt, called a continuous normalizing flow (cnf). a cnf is used to reshape a simple prior density p0 (e.g., pure noise) to a more complicated one, p1, via the push-forward equation LINEBREAK where the push-forward (or change of variables) operator ∗ is defined by LINEBREAK pt = [ϕt]∗p0 LINEBREAK t (x)) det LINEBREAK (x) LINEBREAK a vector field vt is said to generate a probability density path pt if its flow ϕt satisfies equation 3. one practical way to test if a vector field generates a probability path is using the continuity equation, which is a key component in our proofs, see appendix a. we recap more information on cnfs, in particular how to compute the probability p1(x) at an arbitrary point x ∈ rd in appendix c. LINEBREAK flow matching LINEBREAK let x1 denote a random variable distributed according to some unknown data distribution q(x1). we assume we only have access to data samples from q(x1) but have no access to the density function itself. furthermore, we let pt be a probability path such that p0 = p is a simple distribution, e.g., the standard normal distribution p(x) = n (x|0, i), and let p1 be approximately equal in distribution to q. we will later discuss how to construct such a path. the flow matching objective is then designed to match this target probability path, which will allow us to flow from p0 to p1. LINEBREAK 1we use subscript to denote the time parameter, e.g., pt(x). LINEBREAK given a target probability density path pt(x) and a corresponding vector field ut(x), which generates pt(x), we define the flow matching (fm) objective as LINEBREAK lfm(θ) = et,pt(x)∥vt(x) − ut(x)∥2, LINEBREAK where θ denotes the learnable parameters of the cnf vector field vt (as defined in section 2), t ∼ u[0, 1] (uniform distribution), and x ∼ pt(x). simply put, the fm loss regresses the vector field ut with a neural network vt. upon reaching zero loss, the learned cnf model will generate pt(x). LINEBREAK flow matching is a simple and attractive objective, but na¨ıvely on its own, it is intractable to use in practice since we have no prior knowledge for what an appropriate pt and ut are. there are many choices of probability paths that can satisfy p1(x) ≈ q(x), and more importantly, we generally don’t have access to a closed form ut that generates the desired pt. in this section, we show that we can construct both pt and ut using probability paths and vector fields that are only defined per sample, and an appropriate method of aggregation provides the desired pt and ut. furthermore, this construction allows us to create a much more tractable objective for flow matching. LINEBREAK constructing pt, ut from conditional probability paths and vector fields LINEBREAK a simple way to construct a target probability path is via a mixture of simpler probability paths: given a particular data sample x1 we denote by pt(x|x1) a conditional probability path such that it satisfies p0(x|x1) = p(x) at time t = 0, and we design p1(x|x1) at t = 1 to be a distribution concentrated around x = x1, e.g., p1(x|x1) = n (x|x1, σ2i), a normal distribution with x1 mean and a sufficiently small standard deviation σ > 0. marginalizing the conditional probability paths over q(x1) give rise to the marginal probability path LINEBREAK pt(x) = LINEBREAK pt(x|x1)q(x1)dx1, LINEBREAK where in particular at time t = 1, the marginal probability p1 is a mixture distribution that closely approximates the data distribution q, LINEBREAK interestingly, we can also define a marginal vector field, by “marginalizing” over the conditional vector fields in the following sense (we assume pt(x) > 0 for all t and x): LINEBREAK ut(x) = LINEBREAK ut(x|x1) LINEBREAK pt(x|x1)q(x1) pt(x) LINEBREAK where ut(·|x1) : rd → rd is a conditional vector field that generates pt(·|x1). it may not seem apparent, but this way of aggregating the conditional vector fields actually results in the correct vector field for modeling the marginal probability path. LINEBREAK our first key observation is this: LINEBREAK the marginal vector field (equation 8) generates the marginal probability path (equation 6). LINEBREAK this provides a surprising connection between the conditional vfs (those that generate conditional probability paths) and the marginal vf (those that generate the marginal probability path). this connection allows us to break down the unknown and intractable marginal vf into simpler conditional vfs, which are much simpler to define as these only depend on a single data sample. we formalize this in the following theorem. theorem 1. given vector fields ut(x|x1) that generate conditional probability paths pt(x|x1), for any distribution q(x1), the marginal vector field ut in equation 8 generates the marginal probability path pt in equation 6, i.e., ut and pt satisfy the continuity equation (equation 25). LINEBREAK the full proofs for our theorems are all provided in appendix b. theorem 1 can also be derived from the diffusion mixture representation theorem in peluchetti (2021) that provides a formula for the marginal drift and diffusion coefficients in diffusion sdes. LINEBREAK conditional flow matching LINEBREAK unfortunately, due to the intractable integrals in the definitions of the marginal probability path and vf (equations 6 and 8), it is still intractable to compute ut, and consequently, intractable to na¨ıvely compute an unbiased estimator of the original flow matching objective. instead, we propose a simpler objective, which surprisingly will result in the same optima as the original objective. specifically, we consider the conditional flow matching (cfm) objective, lcfm(θ) = et,q(x1),pt(x|x1) LINEBREAK (9) where t ∼ u[0, 1], x1 ∼ q(x1), and now x ∼ pt(x|x1). unlike the fm objective, the cfm objective allows us to easily sample unbiased estimates as long as we can efficiently sample from pt(x|x1) and compute ut(x|x1), both of which can be easily done as they are defined on a per-sample basis. our second key observation is therefore: LINEBREAK the fm (equation 5) and cfm (equation 9) objectives have identical gradients w.r.t. θ. LINEBREAK that is, optimizing the cfm objective is equivalent (in expectation) to optimizing the fm objective. consequently, this allows us to train a cnf to generate the marginal probability path pt—which in particular, approximates the unknown data distribution q at t=1— without ever needing access to either the marginal probability path or the marginal vector field. we simply need to design suitable conditional probability paths and vector fields. we formalize this property in the following theorem. LINEBREAK theorem 2. assuming that pt(x) > 0 for all x ∈ rd and t ∈ [0, 1], then, up to a constant independent of θ, lcfm and lfm are equal. hence, ∇θlfm(θ) = ∇θlcfm(θ). LINEBREAK conditional probability paths and vector fields LINEBREAK the conditional flow matching objective works with any choice of conditional probability path and conditional vector fields. in this section, we discuss the construction of pt(x|x1) and ut(x|x1) for a general family of gaussian conditional probability paths. namely, we consider conditional probability paths of the form LINEBREAK pt(x|x1) = n (x | µt(x1), σt(x1)2i), (10) where µ : [0, 1] × rd → rd is the time-dependent mean of the gaussian distribution, while σ : [0, 1] × r → r>0 describes a time-dependent scalar standard deviation (std). we set µ0(x1) = 0 and σ0(x1) = 1, so that all conditional probability paths converge to the same standard gaussian noise distribution at t = 0, p(x) = n (x|0, i). we then set µ1(x1) = x1 and σ1(x1) = σmin, which is set sufficiently small so that p1(x|x1) is a concentrated gaussian distribution centered at x1. LINEBREAK there is an infinite number of vector fields that generate any particular probability path (e.g., by adding a divergence free component to the continuity equation, see equation 25), but the vast majority of these is due to the presence of components that leave the underlying distribution invariant—for instance, rotational components when the distribution is rotation-invariant—leading to unnecessary extra compute. we decide to use the simplest vector field corresponding to a canonical transformation for gaussian distributions. specifically, consider the flow (conditioned on x1) LINEBREAK ψt(x) = σt(x1)x + µt(x1). (11) when x is distributed as a standard gaussian, ψt(x) is the affine transformation that maps to a normally-distributed random variable with mean µt(x1) and std σt(x1). that is to say, according to equation 4, ψt pushes the noise distribution p0(x|x1) = p(x) to pt(x|x1), i.e., LINEBREAK this flow then provides a vector field that generates the conditional probability path: LINEBREAK [ψt]∗ p(x) = pt(x|x1). LINEBREAK d dt LINEBREAK ψt(x) = ut(ψt(x)|x1). LINEBREAK reparameterizing pt(x|x1) in terms of just x0 and plugging equation 13 in the cfm loss we get (cid:13) (cid:13) (cid:13)vt(ψt(x0)) − LINEBREAK lcfm(θ) = et,q(x1),p(x0) LINEBREAK d dt LINEBREAK since ψt is a simple (invertible) affine map we can use equation 13 to solve for ut in a closed form. let f ′ denote the derivative with respect to time, i.e., f ′ = d LINEBREAK dt f , for a time-dependent function f . LINEBREAK theorem 3. let pt(x|x1) be a gaussian probability path as in equation 10, and ψt its corresponding flow map as in equation 11. then, the unique vector field that defines ψt has the form: σ′ t(x1) σt(x1) LINEBREAK (x − µt(x1)) + µ′ LINEBREAK ut(x|x1) = LINEBREAK consequently, ut(x|x1) generates the gaussian path pt(x|x1). LINEBREAK special instances of gaussian conditional probability paths LINEBREAK our formulation is fully general for arbitrary functions µt(x1) and σt(x1), and we can set them to any differentiable function satisfying the desired boundary conditions. we first discuss the special cases that recover probability paths corresponding to previously-used diffusion processes. since we directly work with probability paths, we can simply depart from reasoning about diffusion processes altogether. therefore, in the second example below, we directly formulate a probability path based on the wasserstein-2 optimal transport solution as an interesting instance. LINEBREAK example i: diffusion conditional vfs. diffusion models start with data points and gradually add noise until it approximates pure noise. these can be formulated as stochastic processes, which have strict requirements in order to obtain closed form representation at arbitrary times t, resulting in gaussian conditional probability paths pt(x|x1) with specific choices of mean µt(x1) and std σt(x1) (sohl-dickstein et al., 2015; ho et al., 2020; song et al., 2020b). for example, the reversed (noise→data) variance exploding (ve) path has the form pt(x|x1) = n (x|x1, σ2 LINEBREAK where σt is an increasing function, σ0 = 0, and σ1 ≫ 1. next, equation 16 provides the choices of µt(x1) = x1 and σt(x1) = σ1−t. plugging these into equation 15 of theorem 3 we get LINEBREAK ut(x|x1) = − LINEBREAK the reversed (noise→data) variance preserving (vp) diffusion path has the form (cid:90) t LINEBREAK (cid:1) i), where αt = e− 1 LINEBREAK 2 t (t), t (t) = LINEBREAK β(s)ds, LINEBREAK and β is the noise scale function. equation 18 provides the choices of µt(x1) = α1−tx1 and σt(x1) = LINEBREAK 1−t. plugging these into equation 15 of theorem 3 we get LINEBREAK ut(x|x1) = LINEBREAK e−t (1−t)x − e− 1 LINEBREAK our construction of the conditional vf ut(x|x1) does in fact coincide with the vector field previously used in the deterministic probability flow (song et al. (2020b), equation 13) when restricted to these conditional diffusion processes; see details in appendix d. nevertheless, combining the diffusion conditional vf with the flow matching objective offers an attractive training alternative—which we find to be more stable and robust in our experiments—to existing score matching approaches. LINEBREAK another important observation is that, as these probability paths were previously derived as solutions of diffusion processes, they do not actually reach a true noise distribution in finite time. in practice, p0(x) is simply approximated by a suitable gaussian distribution for sampling and likelihood evaluation. instead, our construction provides full control over the probability path, and we can just directly set µt and σt, as we will do next. LINEBREAK example ii: optimal transport conditional vfs. an arguably more natural choice for conditional probability paths is to define the mean and the std to simply change linearly in time, i.e., LINEBREAK according to theorem 3 this path is generated by the vf LINEBREAK µt(x) = tx1, and σt(x) = 1 − (1 − σmin)t. LINEBREAK ut(x|x1) = LINEBREAK t = 0.0 diffusion path – conditional score function LINEBREAK ot path – conditional vector field LINEBREAK figure 2: compared to the diffusion path’s conditional score function, the ot path’s conditional vector field has constant direction in time and is arguably simpler to fit with a parametric model. note the blue color denotes larger magnitude while red color denotes smaller magnitude. LINEBREAK which, in contrast to the diffusion conditional vf (equation 19), is defined for all t ∈ [0, 1]. the conditional flow that corresponds to ut(x|x1) is LINEBREAK ψt(x) = (1 − (1 − σmin)t)x + tx1, LINEBREAK and in this case, the cfm loss (see equations 9, 14) takes the form: LINEBREAK lcfm(θ) = et,q(x1),p(x0) LINEBREAK (cid:13) (cid:13) (cid:13)vt(ψt(x0)) − allowing the mean and std to change linearly not only leads to simple and intuitive paths, but it is actually also optimal in the following sense. the conditional flow ψt(x) is in fact the optimal transport (ot) displacement map between the two gaussians p0(x|x1) and p1(x|x1). the ot interpolant, which is a probability path, is defined to be (see definition 1.1 in mccann (1997)): LINEBREAK pt = [(1 − t)id + tψ]⋆p0 (24) where ψ : rd → rd is the ot map pushing p0 to p1, id denotes the identity map, i.e., id(x) = x, and (1 − t)id + tψ is called the ot displacement map. example 1.7 in mccann (1997) shows, that in our case of two gaussians where the first is a standard one, the ot displacement map takes the form of equation 22. LINEBREAK intuitively, particles under the ot displacement map always move in straight line trajectories and with constant speed. figure 3 depicts intersampling paths for the diffusion and ot conditional vfs. estingly, we find that sampling trajectory from diffusion paths can “overshoot” the final sample, resulting in unnecessary backtracking, whilst the ot paths are guaranteed to stay straight. LINEBREAK diffusion LINEBREAK ot LINEBREAK figure 3: diffusion and ot conditional trajectories. LINEBREAK figure 2 compares the diffusion conditional score function (the regression target in a typical diffusion methods), i.e., ∇ log pt(x|x1) with pt defined as in equation 18, with the ot conditional vf (equation 21). the start (p0) and end (p1) gaussians are identical in both examples. an interesting observation is that the ot vf has a constant direction in time, which arguably leads to a simpler regression task. this property can also be verified directly from equation 21 as the vf can be written in the form ut(x|x1) = g(t)h(x|x1). figure 8 in the appendix shows a visualization of the diffusion vf. lastly, we note that although the conditional flow is optimal, this by no means imply that the marginal vf is an optimal transport solution. nevertheless, we expect the marginal vector field to remain relatively simple. LINEBREAK related work LINEBREAK continuous normalizing flows were introduced in (chen et al., 2018) as a continuous-time version of normalizing flows (see e.g., kobyzev et al. (2020); papamakarios et al. (2021) for an overview). originally, cnfs are trained with the maximum likelihood objective, but this involves expensive ode simulations for the forward and backward propagation, resulting in high time complexity due to the sequential nature of ode simulations. although some works demonstrated the capability of cnf generative models for image synthesis (grathwohl et al., 2018), scaling up to very high dimensional images is inherently difficult. a number of works attempted to regularize the ode to be easier to solve, e.g., using augmentation (dupont et al., 2019), adding regularization terms (yang & karniadakis, 2019; finlay et al., 2020; onken et al., 2021; tong et al., 2020; kelly et al., 2020), or stochastically sampling the integration interval (du et al., 2022). these works merely aim to regularize the ode but do not change the fundamental training algorithm. LINEBREAK score matching w/ diffusion LINEBREAK flow matching w/ diffusion LINEBREAK f i LINEBREAK d LINEBREAK w m s LINEBREAK f i LINEBREAK d LINEBREAK w m f LINEBREAK t o LINEBREAK w m f LINEBREAK flow matching w/ ot LINEBREAK figure 4: (left) trajectories of cnfs trained with different objectives on 2d checkerboard data. the ot path introduces the checkerboard pattern much earlier, while fm results in more stable training. (right) fm with ot results in more efficient sampling, solved using the midpoint scheme. LINEBREAK in order to speed up cnf training, some works have developed simulation-free cnf training frameworks by explicitly designing the target probability path and the dynamics. for instance, rozen et al. (2021) consider a linear interpolation between the prior and the target density but involves integrals that were difficult to estimate in high dimensions, while ben-hamu et al. (2022) consider general probability paths similar to this work but suffers from biased gradients in the stochastic minibatch regime. in contrast, the flow matching framework allows simulation-free training with unbiased gradients and readily scales to very high dimensions. LINEBREAK another approach to simulation-free training relies on the construction of a diffusion process to indirectly define the target probability path (sohl-dickstein et al., 2015; ho et al., 2020; song & ermon, 2019). song et al. (2020b) shows that diffusion models are trained using denoising score matching (vincent, 2011), a conditional objective that provides unbiased gradients with respect to the score matching objective. conditional flow matching draws inspiration from this result, but generalizes to matching vector fields directly. due to the ease of scalability, diffusion models have received increased attention, producing a variety of improvements such as loss-rescaling (song et al., 2021), adding classifier guidance along with architectural improvements (dhariwal & nichol, 2021), and learning the noise schedule (nichol & dhariwal, 2021; kingma et al., 2021). however, (nichol & dhariwal, 2021) and (kingma et al., 2021) only consider a restricted setting of gaussian conditional paths defined by simple diffusion processes with a single parameter—in particular, it does not include our conditional ot path. in an another line of works, (de bortoli et al., 2021; wang et al., 2021; peluchetti, 2021) proposed finite time diffusion constructions via diffusion bridges theory resolving the approximation error incurred by infinite time denoising constructions. while existing works make use of a connection between diffusion processes and continuous normalizing flows with the same probability path (maoutsa et al., 2020b; song et al., 2020b; 2021), our work allows us to generalize beyond the class of probability paths modeled by simple diffusion. with our work, it is possible to completely sidestep the diffusion process construction and reason directly with probability paths, while still retaining efficient training and log-likelihood evaluations. lastly, concurrently to our work (liu et al., 2022; albergo & vanden-eijnden, 2022) arrived at similar conditional objectives for simulation-free training of cnfs, while neklyudov et al. (2023) derived an implicit objective when ut is assumed to be a gradient field. LINEBREAK experiments LINEBREAK we explore the empirical benefits of using flow matching on the image datasets of cifar10 (krizhevsky et al., 2009) and imagenet at resolutions 32, 64, and 128 (chrabaszcz et al., 2017; deng et al., 2009). we also ablate the choice of diffusion path in flow matching, particularly between the standard variance preserving diffusion path and the optimal transport path. we discuss how sample generation is improved by directly parameterizing the generating vector field and using the flow matching objective. lastly we show flow matching can also be used in the conditional generation setting. unless otherwise specified, we evaluate likelihood and samples from the model using dopri5 (dormand & prince, 1980) at absolute and relative tolerances of 1e-5. generated samples can be found in the appendix, and all implementation details are in appendix e. LINEBREAK model LINEBREAK nll↓ LINEBREAK fid↓ nfe↓ nll↓ LINEBREAK fid↓ nfe↓ nll↓ LINEBREAK fid↓ nfe↓ LINEBREAK model LINEBREAK cifar-10 LINEBREAK nll↓ LINEBREAK fid↓ LINEBREAK ablations ddpm score matching scoreflow
| 7
|
[
108.003,
656.3473036278,
155.448416791,
685.5308527135
] |
5ECQL05ub0J.pdf
| 2,022
| 2
|
LINEBREAK resonance in weight space: covariate shift can drive divergence of sgd with momentum LINEBREAK kirby banman1, liam peet-pare2, nidhi hegde1, alona fyshe1, martha white1 department of computing science1, department of mathematical and statistical sciences2 university of alberta edmonton, ab t6g 2e8 {kdbanman, peetpare, nidhi.hegde, alona, whitem}@ualberta.ca LINEBREAK abstract LINEBREAK most convergence guarantees for stochastic gradient descent with momentum (sgdm) rely on iid sampling. yet, sgdm is often used outside this regime, in settings with temporally correlated input samples such as continual learning and reinforcement learning. existing work has shown that sgdm with a decaying stepsize can converge under markovian temporal correlation. in this work, we show that sgdm under covariate shift with a fixed step-size can be unstable and diverge. in particular, we show sgdm under covariate shift is a parametric oscillator, and so can suffer from a phenomenon known as resonance. we approximate the learning system as a time varying system of ordinary differential equations, and leverage existing theory to characterize the system’s divergence/convergence as resonant/nonresonant modes. the theoretical result is limited to the linear setting with periodic covariate shift, so we empirically supplement this result to show that resonance phenomena persist even under non-periodic covariate shift, nonlinear dynamics with neural networks, and optimizers other than sgdm. LINEBREAK introduction LINEBREAK stochastic gradient descent (sgd) (robbins & monro, 1951) – and its variants such as adagrad (duchi et al., 2011), adam (kingma & ba, 2014) and rmsprop (hinton et al., 2012) – are very widely used optimization algorithms across machine learning. sgd is conceptually straightforward, easy to implement, and often performs well in practice. among the variants of sgd, accelerated versions based on polyak’s or nesterov’s acceleration (polyak, 1964; nesterov, 1983), known generally as stochastic gradient descent with momentum (sgdm), are used widely due to the improvements in convergence rate they offer. sgdm can give up to a quadratic speedup to sgd on many functions, and is in fact optimal among all methods having only information about the gradient at consecutive iterates for convex and lipschitz continuous optimization problems (nesterov, 2004; goh, 2017). sgdm has the same computational complexity as sgd, but exhibits superior convergence rates under reasonable assumptions (su et al., 2014). LINEBREAK these convergence results for sgdm, however, rely on independent and identically distributed (iid) sampling. little is known about the convergence properties of sgdm under non-iid sampling, yet the non-iid setting is critical. in many machine learning problems it is expensive or impossible to obtain iid samples. in online learning (rakhlin et al., 2010) and reinforcement learning (rl) (sutton & barto, 2018), the data becomes available in a sequential order and there is a temporal dependence among the samples. there is a particularly strong temporal dependence in rl, where observed states are sampled according to the transition dynamics of the underlying markov decision process (mdp). federated learning (hsieh et al., 2020) and time-series learning (kuznetsov & mohri, 2014) provide further examples of when non-iid sampling is essential to the learning problem. LINEBREAK without momentum, sgd’s convergence rate has been examined under non-iid sampling with the stochastic approximation framework in (benveniste et al., 2012; kushner & yin, 2003), and more recently under specific assumptions of ergodicity (duchi et al., 2012) or markovian sampling (nagaraj et al., 2020; doan et al., 2020b; sun et al., 2018). convergence rates under markovian sampling are also known for adam-type algorithms when applied to policy gradient and temporal difference LINEBREAK learning (xiong et al., 2020). to our knowledge, however, there has been little work on providing convergence rates or guarantees for sgdm under non-iid sampling. in (doan et al., 2020a), a progress bound is provided for sgdm under markovian sampling based on mixing time—the time required for a distribution’s convergence toward its stationary distribution—along with a convergence rate guarantee under decaying step-sizes. in this work, we assume a fixed step-size, since it is a common choice in the online setting, especially when the practitioner is unsure of mixing rate or stationarity. LINEBREAK there is a broad literature using ordinary differential equations (odes) to analyze gradient descent methods by approximating descent updates as continuous-time flows. early work is comprehensively discussed in (kushner & yin, 2003; benveniste et al., 2012). despite the age and establishment of the linear setting, the gradient flow lens continues to reveal new insights (e.g. implicit rank reduction (arora et al., 2019)) and new perspectives on old insights (e.g. regularization of early stopping (ali et al., 2019)). recent work has paid particular attention to the flow induced by momentum accelerated methods (su et al., 2014; wibisono et al., 2016; wilson et al., 2016; scieur et al., 2017; muehlebach & jordan, 2021; diakonikolas & orecchia, 2019; muehlebach & jordan, 2019; li et al., 2017; simsekli et al., 2020; betancourt et al., 2018; kovachki & stuart, 2019; attouch et al., 2018; shi et al., 2019; siegel, 2019; zhang et al., 2018; berthier et al., 2021; kovachki & stuart, 2021). in these works, it is demonstrated that linear regression under iid sampling with sgdm can be represented as an ode resembling a harmonic oscillator, sometimes with a time-decaying damping coefficient. LINEBREAK contributions: in this work, we show that non-iid sampling, due to covariate shift, induces a related system: the parametric oscillator, a harmonic oscillator having coefficients which vary over time in a manner capable of exponentially exciting the system (mumford, 1960; csörg˝o & hatvani, 2010; halanay, 1966). we characterize the underlying time-varying ode, which requires a novel approach to incorporate covariate shift, and develop specific conditions on covariate shift that lead to divergence in sgdm. we provide an empirical design, with synthetic data, to systematically test the response of the learning system to different covariate shift frequencies. we empirically validate that resonancedriven divergence occurs in a learning system which aligns well with theoretical assumptions. we follow with similar demonstrations on learning systems which progressively relax further and further away from our theoretical assumptions, including non-periodic covariate shift, learning with neural networks and optimizers other than sdgm. the implications of this work are that resonance can occur in learning systems with momentum, causing instability or poor accuracy, simply due to certain temporal correlations in the input sequence. our results provide a novel direction to better understand the properties of our learning systems for time varying inputs—namely beyond iid sampling—and point to a gap in the robustness of our algorithms that merits further investigation. LINEBREAK problem setting LINEBREAK we investigate the effect of non-iid sampling on a model optimized using sgdm. we assume labelled training data sampled from discreteindexed, real-valued stochastic processes {xk}k∈n and {yk}k∈n such that {xk}k∈n has a unique stationary distribution π. yk is a function of xk with zero-mean observation noise, yk = f (xk) + ϵk. the learning algorithm does not have access to iid samples from π. instead, the learning algorithm may only update parameters θk at time k using samples zk = (xk, yk), where xk’s marginal over time converges to π. the goal is to train a model with parameters θ to minimize an objective function l(z; θ) with respect to the stationary distribution π: θ∗ = arg minθ∈rd eπ[l(z; θ)] = (cid:82) r l(z; θ)dπ(x). an example of this problem setting is illustrated in figure 1. LINEBREAK figure 1: an example of the problem setting. 1d regression (left), gaussian covariates {xk} with shifting mean ¯xk over time (right). LINEBREAK this setting is identical to that explored in prior work on markovian sampling (sun et al., 2018; xiong et al., 2020; nagaraj et al., 2020), but we do not require that our stochastic processes adhere to the markov property. note, also, that the underlying functional relationship between the inputs, xk, LINEBREAK and the targets, yk, does not change over time. that is, the non-iid sampling is a result of covariate shift rather than a changing relationship between the inputs and targets. LINEBREAK we consider polyak’s heavy ball method (polyak, 1964) with the formulation from sutskever et al. (2013), namely sgd with momentum (sgdm) LINEBREAK vk+1 = µvk − η∇θl(zk; θk) LINEBREAK where η ≥ 0 is the learning rate and µ ∈ (0, 1) the momentum coefficient. our goal is to understand the behavior of sgdm when learning on this non-iid sequence zk. LINEBREAK covariate shift as a driving force LINEBREAK in this section we characterize sgdm as a discretization of a particular parametric oscillator in continuous time. a parametric oscillator resembles a harmonic oscillator ode, but has time-varying system coefficients which are capable of driving the system. it is well understood that parametric oscillators can suffer from global solution instability due to coefficients oscillating at particular frequencies (halanay, 1966), a condition known as parametric resonance. we show parametric resonance conditions sufficient to induce exponential divergence in sgdm. we provide proof sketches and defer complete proofs to appendix a.4. LINEBREAK notation: capital letters are matrices and random variables. {xk} is a stochastic process, shorthand for {xk}k∈n. k and t index discrete and continuous time, respectively. when a discrete sequence and a function approximate each other, they share the same symbol and are differentiated by subscript k and function argument t, e.g. the sequence {θk} and the function θ(t). pk is the joint distribution of xk and yk. for loss function l(z; θ) on training pair z = (x, y) and weights θ, we denote the time-varying expected gradient gk(θ) := epk [∇θl(z; θ)] LINEBREAK covariate shift induces a linear time-varying expected gradient LINEBREAK we begin by showing that linear least squares regression with covariate shift and a fixed target induces a linear time-varying expected loss gradient. that is, the gradient function gk(θ) = bk(θ − θ∗) for some matrix bk that varies with time, due to covariate shift. assumption 1. the covariate generating process {xk}k∈n is not corr(xk1, xk1) ̸= corr(xk2, xk2) for some k1, k2 ∈ n. assumption 2. the targets yk are a fixed linear function of xk with iid zero-mean observation noise, ϵk such that e[ϵk] = 0. that is, yk = ⟨θ∗, xk⟩ + ϵk where θ∗ ∈ rd is fixed for all k. proposition 1. under assumptions 1, 2, a linear model with weights θk making predictions (cid:98)yk = ⟨θk, xk⟩ with a mean squared error (mse) objective will induce time-varying linear expected loss gradients gk(θk) = bk(θk − θ∗) for all k ∈ n, where bk ∈ rd×d and bk1 ̸= bk2 for some k1, k2. LINEBREAK identically distributed: LINEBREAK proof sketch: we fix a time step k and take the expectation of the mse loss over observation noise, and over the distribution of xk. a time-varying expected loss surface remains, and the linear setting implies the loss gradient is a linear function for all steps k, with bk depending on xk: LINEBREAK bk = 2corr(xk, xk) = 2cov(xk, xk) + 2epk [xk]epk [xk]t LINEBREAK ode correspondence LINEBREAK next, we show that the iterates {θk} generated by sgdm are a first order numerical integration of a particular ode. the procedure is similar to (muehlebach & jordan, 2021), but due to the time-varying loss gradient, we must pay specific attention to the conditions on the ode necessary to have integration consistency, . let b(t) be a matrix-valued function, lipschitz continuous in t, such that {bk} are samples spaced ηk). the existence and uniqueness of this b(t) are ensured if we assume the {xk} are sampled from an underlying continuous-time x(t). proposition 2. the sgdm iterates {θk} numerically integrate the ode system in equation 3 with integration step LINEBREAK η and first order consistency. LINEBREAK η apart, i.e. bk = b( LINEBREAK ¨θ(t) + LINEBREAK ˙θ(t) + b(t)(θ(t) − θ∗) = 0 LINEBREAK proof sketch: first, the ode in equation 3 is converted to first order linear form, and split into a sum of two separate systems. the sum’s terms have implicit and explicit euler integrations; using operator splitting, these can be composed into a consistent numerical integrator for linear time-varying systems. then, it is shown that the composed integrator is precisely equivalent to sgdm when the integration time step is LINEBREAK the first order consistency guarantee in proposition 2 means that when the step-size η is small and initial conditions agree between continuous and discrete time, i.e. θ0 = θ(0), the continuous and discrete time trajectories approximate each other as θk ≈ θ(k η), where the difference between them η (hairer et al., 2006). therefore, assuming θ0 = θ(0), depends on the integration time step h = the difference accrued in one step of k (local error) is θ1 = θ( η) + o(η) and over arbitrarily many √ steps (global error) is θk = θ( LINEBREAK ηk) + o(ηk). LINEBREAK parametric resonance for ode convergence and divergence LINEBREAK the conditions sufficient for convergence and divergence in equation 3 may be shown using established dynamical systems theory. the conditions sufficient for divergence are precisely the conditions for parametric resonance, when b(t) is periodic. note that periodicity in the first or second moment of {xk} is sufficient to induce periodicity in b(t). as per elementary results in linear ode theory, the system in equation 3 can be transformed into a linear time-varying first order form LINEBREAK ˙ξ(t) = a(t)ξ(t) LINEBREAK a(t) = LINEBREAK id×d η id×d LINEBREAK where solution trajectories θ(t) of equation 3 are embedded in solution trajectories ξ(t) of equation 4. equation 4 admits a fundamental solution matrix1 ψ(t) such that the spectral radius ρ of ψ(t ) characterizes ode instability, which implies divergence for sgdm, in theorem 1. theorem 1. when b(t) is periodic such that b(t) = b(t + t ) for some t > 0, the spectral radius ρ of ψ(t ) characterizes the stability of solution trajectories of equation 3 as follows: LINEBREAK • ρ > 1 =⇒ trivial solution θ(t) = θ∗ is unstable. all other solutions diverge as θ(t) → ∞ LINEBREAK exponentially with rate ρ. LINEBREAK • ρ < 1 =⇒ trivial solution is asymptotically stable, all other solutions converge as θ(t) → θ∗ LINEBREAK exponentially with rate ρ. LINEBREAK proof sketch: ode 3’s stability depends on the relationship between the coefficient 1−µ η and the expected gradient signal because they determine the spectral radius of ψ(t ). the spectral radius ρ is the convergence/divergence rate per period t towards/away from the stationary point θ∗. □ LINEBREAK the spectral radius conditions characterize when ode solution trajectories θ(t) will converge or diverge, and proposition 2 tells us that these solution trajectories are approximations of discrete time sgdm trajectories {θk} under identical initialization. but does convergence or divergence of θ(t) imply the same for sgdm? experiment 4.1 empirically suggests that the approximation is sufficient, since the boundary at ρ = 1 in figure 2a agrees with both continuous and discrete time. however, given theorem 1 and proposition 2, we have a theoretical guarantee of sgdm’s divergence, but not its convergence. this is because the divergence rate of θ(t) is exponential, and proposition 2 provides a bound on long tail behaviour as θk = θ( ηk) + o(ηk). since the approximation error is linear in time k, and the divergence rate is exponential, the divergence rate dominates, and we are guaranteed that a diverging θ(t) corresponds to a diverging {θk}. however, the same argument does not imply that a convergent θ(t) corresponds to a convergent {θk}, because the linear error bound technically permits the discrete trajectory to escape θ∗ at a linear rate. empirically, we see agreement for both convergent and divergent cases, but we defer theoretical proof to future work. LINEBREAK summary: there is a chain of dependencies starting from the non-iid sampling in {xk}, and ending at the monodromy’s spectral radius. LINEBREAK {xk} → x(t) → b(t) → a(t) → ψ(t) → ψ(t ) → ρ LINEBREAK in order, we have the discrete stochastic process {xk} from which training inputs are sampled, and its underlying continuous stochastic process x(t). if {xk} and x(t) were iid, then the matrix b LINEBREAK 1a fundamental solution matrix for system equation 4 is any matrix-valued function of time ψ(t) whose LINEBREAK columns are linearly independent solutions to equation 4. we choose ψ(t) such that ψ(0) = i2d×2d. LINEBREAK would be constant, but the non-iid nature means b(t) is a function of time. the matrix a(t) is the matrix describing sgdm’s continuous time dynamics as a linear time-varying ode ˙ξ = a(t)ξ, and the matrix b(t) is a simply a submatrix of a(t). since we have a linear ode, the space of solution trajectories is spanned by the columns of the ode’s fundamental solution matrix ψ(t). moreover, since we have a periodic a(t) with period t , the stability of all solutions can be determined simply from the largest eigenvalue of ψ(t ), a.k.a. its spectral radius ρ. LINEBREAK the intuition behind ρ’s importance comes from the following fact: after each elapsed period t , the phase space (including weight space) is subject to the linear transformation ψ(t ). so as time increases, say n periods, the linear transformation is applied iteratively as ψ(t )n, so it is clear that any eigenvalue larger than unity means all solutions eventually diverge exponentially. this is precisely the parametric resonance condition. for a detailed example of all these quantities characterizing the divergence of a simple learning system, see appendix a.1. LINEBREAK technical novelty: there are two key novel technical contributions to obtain the results above. (1) the ode correspondence for non-iid data in combination with momentum methods is new. the non-iid data, which induces time variation in ode dynamics, is subtle to address, because elementary ode correspondence (i.e. consistency guarantees) require time invariant ode dynamics. our proof specifically addresses this difficulty using operator splitting theory from recent numerical integration literature. (2) once we have this ode, it is straightforward to recognize that it is a parametric oscillator. the utility of this connection, however, is that it opens up entirely new avenues for analysis, since there is deeply established literature on the dynamics of these systems. the primary second technical novelty, therefore, is to leverage this connection, and use floquet theory to give precise divergence conditions for a given η and µ, under periodic covariate shift. LINEBREAK validating theory & ablating towards conditions in the wild LINEBREAK we now empirically evaluate the effect of resonance in learning problems. first, experiment 4.1 validates the theoretical predictions by investigating the dynamics of a learning problem which closely matches the theoretical assumptions in section 3. specifically, we assess whether or not the spectral radius ρ predicts optimizer convergence or divergence. then, the remaining experiments 4.2 - 4.6 test for this phenomena in settings beyond our theory. each experiment makes a single step away from a theoretical assumption, first relaxing the periodicity assumption, then using stochastic rather than expected gradients and then moving to nonlinear models (neural networks) and optimizers (adam). LINEBREAK across all experiments, input samples at each training step k are drawn from gaussian distributions with diagonal covariance matrices, i.e. xk ∼ n (¯xk, cid×d), and we induce covariate shift by constructing a time-varying mean sequence {¯xk}. each mean sequence is designed such that (a) its frequency content can be swept with a single parameter f or t and (b) iid sampling is induced by setting f = 0 or t = 0, so that each experiment has an iid baseline for comparison. the specification of ¯xk is provided in table 1 for each experiment. this empirical design allows us to systematically test response to different frequencies. see appendix a.5 for specification of all experiment details, including visual depictions of all synthetic {xk} and their frequency content. LINEBREAK validating theory LINEBREAK we start in a setting as close as possible to the theoretical predictions, with linear regression for a quadratic loss, and covariate shift such that the mean e[xk] varies as a strict sinusoid. we perform regression in two weights (i.e. inputs xk and labels yk are scalar-valued). we draw 20 samples from each xk, so that the loss gradient for each time step k is close to its expected value. LINEBREAK since we have only two weights, the learning system’s underlying ode can be easily specified, such that the fundamental solution matrix can be numerically computed. as per theorem 1, we can use the spectral radius of the fundamental solution matrix evaluated at time t to make theoretical predictions of where the system should converge or diverge. as depicted in figure 2a, the theory agrees very well with empirical results. this suggests that parametric resonance is indeed the dominant mechanism behind sgdm divergence under covariate shift. in the appendix, refer to example a.1 for the procedure used to compute the theoretical predictions (i.e. spectral radii ρ), and figure 6a for the full surface from which the contour lines in figure 2a are rendered. LINEBREAK table 1: covariate shift details for each experiment. LINEBREAK experiment LINEBREAK 4.1 validating theory LINEBREAK sweep param. mean sequence {¯xk}k∈n f ∈ [0, 0.05] LINEBREAK 4.2 ablating periodicity LINEBREAK 4.3 ablating expected gradient LINEBREAK ¯xk = LINEBREAK 4.4 ablating periodicity further LINEBREAK 4.5 ablating optimizer linearity LINEBREAK 4.6 ablating model linearity LINEBREAK ξ ∼ n (0, id×d) iid LINEBREAK ¯xk = ξi where i = LINEBREAK (cid:22) k t ξi ∼ n (0, vid×d) iid ¯xk same as above. ¯xk same as above. LINEBREAK (a) resonance regions for sinusoidal ¯xk LINEBREAK (b) ar(2) stochastic mean LINEBREAK figure 2: empirical heatmap of momentum µ versus period t for sgdm for linear regression, overlaid by contours of theoretical prediction. each pixel is the distance ||θk − θ∗|| averaged over the final 500 steps k and 10 runs. dark pixels converge quickly and stably, bright pixels diverge exponentially. the contours show divergence predictions from theorem 1: the white contour has ρ = 1, with ρ increasing with redness. LINEBREAK ablating periodicity LINEBREAK we repeat experiment 4.1, but with the mean of xk varying stochastically instead of deterministically. the result in theorem 1 assumes the expected gradient varies periodically over time given fixed weights θ. but even with aperiodic and/or stochastic time variation, our ltv system equation 4 might be similarly susceptible to instability; the theory does not have periodicity as a necessary condition of divergence. to test this, we replace our periodic covariate shift mean with a mean that moves according to an ar(2) process. the ar(2) process is tuned to have a frequency peak exactly at the frequency of the sinusoidal covariate shift of experiment 4.1, to change only the nature of the shift—aperiodicity—rather than the frequency. LINEBREAK we can see from the heatmap in figure 2b that under this setting we observe very similar resonance behaviour in the learning system, which aligns well with the identical predicted stability regions. note that both theoretical and empirical results in figures 2a and 2b suggest that sufficiently low momentum values µ mitigate the resonance phenomenon, which agrees with the role it plays in the ode system: decreasing µ increases damping. we also observe that resonance regions shrink as step size η is decreased; see the appendix for plots demonstrating this trend. analytically characterizing the bounds of stable µ, η in terms of system properties is an interesting future direction. LINEBREAK ablating expected gradient LINEBREAK ablating periodicity further
| 6
|
[
108.249,
454.6730784,
278.8119848,
464.6356784
] |
C_PRLz8bEJx.pdf
| 2,023
| 0
|
LINEBREAK dm-nerf: 3d scene geometry decomposition and manipulation from 2d images LINEBREAK bing wang1,2,3† lu chen1,2† bo yang1,2∗ 1 shenzhen research institute, the hong kong polytechnic university 2 vlar group, the hong kong polytechnic university 3university of oxford [email protected] [email protected] LINEBREAK abstract LINEBREAK in this paper, we study the problem of 3d scene geometry decomposition and manipulation from 2d views. by leveraging the recent implicit neural representation techniques, particularly the appealing neural radiance fields, we introduce an object field component to learn unique codes for all individual objects in 3d space only from 2d supervision. the key to this component is multiple carefully designed loss functions to enable every 3d point, especially in non-occupied space, to be effectively optimized without 3d labels. in addition, we introduce an inverse query algorithm to freely manipulate any specified 3d object shape in the learned scene representation. notably, our manipulation algorithm can explicitly tackle key issues such as object collisions and visual occlusions. our method, called dm-nerf, is among the first to simultaneously reconstruct, decompose, manipulate and render complex 3d scenes in a single pipeline. extensive experiments on three datasets clearly show that our method can accurately decompose all 3d objects from 2d views, allowing any interested object to be freely manipulated in 3d space such as translation, rotation, size adjustment, and deformation. LINEBREAK introduction LINEBREAK in many cutting-edge applications such as mixed reality on mobile devices, users may desire to virtually manipulate objects in 3d scenes, such as moving a chair or making a flying broomstick in a 3d room. this would allow users to easily edit real scenes at fingertips and view objects from new perspectives. however, this is particularly challenging as it involves 3d scene reconstruction, decomposition, manipulation, and photorealistic rendering in a single framework (savva et al., 2019). LINEBREAK a traditional pipeline firstly reconstructs explicit 3d structures such as point clouds or polygonal meshes using sfm/slam techniques (ozyesil et al., 2017; cadena et al., 2016), and then identifies 3d objects followed by manual editing. however, these explicit 3d representations inherently discretize continuous surfaces, and changing the shapes often requires additional repair procedures such as remeshing (alliez et al., 2002). such discretized and manipulated 3d structures can hardly retain geometry and appearance details, resulting in the generated novel views to be unappealing. given this, it is worthwhile to design a new pipeline which can recover continuous 3d scene geometry only from 2d views and enable object decomposition and manipulation. LINEBREAK recently, implicit representations, especially nerf (mildenhall et al., 2020), emerge as a promising tool to represent continuous 3d geometries from images. a series of succeeding methods (boss et al., 2021; chen et al., 2021; zhang et al., 2021c) are rapidly developed to decouple lighting factors from structures, allowing free edits of illumination and materials. however, they fail to decompose 3d scene geometries into individual objects. therefore, it is hard to manipulate individual object shapes in complex scenes. recent works (stelzner et al., 2021; zhang et al., 2021b; kania et al., 2022; yuan et al., 2022; tschernezki et al., 2022; kobayashi et al., 2022; kim et al., 2022; benaim et al., 2022; ren et al., 2022) have started to learn disentangled shape representations for potential geometry manipulation. however, they either focus on synthetic scenes or simple model segmentation, and can hardly extend to real-world 3d scenes with dozens of objects. LINEBREAK ∗corresponding author LINEBREAK † equal contribution LINEBREAK figure 1: the general workflow of dm-nerf. nerf (green block) is used as the backbone. we propose the object field and manipulation components as illustrated by blue and orange blocks. in this paper, we aim to simultaneously recover continuous 3d scene geometry, segment all individual objects in 3d space, and support flexible object shape manipulation such as translation, rotation, size adjustment and deformation. in addition, the edited 3d scenes can be also rendered from novel views. however, this task is extremely challenging as it requires: 1) an object decomposition approach amenable to continuous and implicit 3d fields, without relying on any 3d labels for supervision due to the infeasibility of collecting labels in continuous 3d space; 2) an object manipulation method agreeable to the learned implicit and decomposed fields, with an ability to clearly address visual occlusions inevitably caused by manipulation. LINEBREAK to tackle these challenges, we design a simple pipeline, dm-nerf, which is built on the successful nerf, but able to decompose the entire 3d space into object fields and freely manipulate their geometries for realistic novel view rendering. as shown in figure 1, it consists of 3 major components: 1) the existing radiance field to learn volume density and appearance for every 3d point in space; 2) the object field which learns a unique object code for every 3d point; 3) the object manipulator that directly edits the shape of any specified object and automatically tackles visual occlusions. LINEBREAK the object field is the core of dm-nerf. this component aims to predict a one-hot vector, i.e., object code, for every 3d point in the entire scene space. however, learning such code involves critical issues: 1) there are no ground truth 3d object codes available for full supervision; 2) the number of total objects is variable and there is no fixed order for objects; 3) the non-occupied (empty) 3d space must be taken into account, but there are no labels for supervision as well. in section 3.1, we show that our object field together with multiple carefully designed loss functions can address them properly, under the supervision of color images with 2d object masks only. LINEBREAK once the object field is well learned, our object manipulator aims to directly edit the geometry and render novel views when specifying the target objects, viewing angels, and manipulation settings. a na¨ıve method is to obtain explicit 3d structures followed by manual editing and rendering, so that any shape occlusion and collision can be explicitly addressed. however, it is extremely inefficient to evaluate dense 3d points from implicit fields. to this end, as detailed in section 3.2, we introduce a lightweight inverse query algorithm to automatically edit the scene geometry. LINEBREAK overall, our pipeline can simultaneously recover 3d scene geometry, decompose and manipulate object instances only from 2d images. extensive experiments on multiple datasets demonstrate that our method can precisely segment all 3d objects and effectively edit 3d scene geometry, without sacrificing high fidelity of novel view rendering. our key contributions are: • we propose an object field to directly learn a unique code for each object in 3d space only from 2d images, showing remarkable robustness and accuracy over the commonly-used individual image based segmentation methods. LINEBREAK • we propose an inverse query algorithm to effectively edit specified object shapes, while generating LINEBREAK realistic scene images from novel views. LINEBREAK • we demonstrate superior performance for 3d decomposition and manipulation, and also contribute the first synthetic dataset for quantitative evaluation of 3d scene editing. our code and dataset are available at https://github.com/vlar-group/dm-nerf LINEBREAK we note that recent works objectnerf (yang et al., 2021), nsg (ost et al., 2021) and objectsdf (wu et al., 2022) address the similar task as ours. however, objectnerf only decomposes a foreground object, nsg focuses on decomposing dynamic objects, and objectsdf only uses semantic label as regularization. none of them directly learns to segment multiple 3d objects as ours. a few works (norman et al., 2022; kundu et al., 2022; fu et al., 2022) tackle panoptic segmentation in radiance fields. however, they fundamentally segment objects in 2d images followed by learning a separate radiance field for each object. by comparison, our method learns to directly segment all objects in the 3d scene radiance space, and it demonstrates superior accuracy and robustness than LINEBREAK 2d object segmentation methods such as maskrcnn (he et al., 2017) and swin transformer (liu et al., 2021b), especially when 2d object labels are noisy during training, as detailed in section 4. LINEBREAK related work LINEBREAK explicit 3d representations: to represent 3d geometry of objects and scenes, voxel grids (choy et al., 2016), octree (tatarchenko et al., 2017), meshes (kato et al., 2018; groueix et al., 2018), point clouds (fan et al., 2017) and shape primitives (zou et al., 2017) are widely used. although impressive progress has been achieved in shape reconstruction (yang et al., 2019a; xie et al., 2019), completion (song et al., 2017), generation (lin et al., 2018), and scene understanding (tulsiani et al., 2018; gkioxari et al., 2019), the quality of these representations are inherently limited by the spatial resolution and memory footprint. therefore, they are hard to represent complex 3d scenes. implicit 3d representations: to overcome the discretization issue of explicit representations, coordinate based mlps have been recently proposed to learn implicit functions to represent continuous 3d shapes. these implicit representations can be generally categorized as: 1) signed distance fields (park et al., 2019), 2) occupancy fields (mescheder et al., 2019), 3) unsigned distance fields (chibane et al., 2020; wang et al., 2022), 4) radiance fields (mildenhall et al., 2020), and 5) hybrid fields (wang et al., 2021). among them, both occupancy fields and signed distance fields can only recover closed 3d shapes, and are hard to represent open geometries. these representations have been extensively studied for novel view synthesis (niemeyer et al., 2020; trevithick & yang, 2021) and 3d scene understanding (zhang et al., 2021a; zhi et al., 2021a;b). thanks to the powerful representation, impressive results have been achieved, especially from the neural radiance fields and its succeeding methods. in this paper, we also leverage the success of implicit representations, particularly nerf, to recover the geometry and appearance of 3d scenes from 2d images. LINEBREAK 3d object segmentation: to identify 3d objects from complex scenes, existing methods generally include 1) image based 3d object detection (mousavian et al., 2017), 2) 3d voxel based detection methods (zhou & tuzel, 2018) and 3) 3d point cloud based object segmentation methods (yang et al., 2019b). given large-scale datasets with full 3d object annotations, these approaches have achieved excellent object segmentation accuracy. however, they are particularly designed to process explicit and discrete 3d geometries. therefore, they are unable to segment continuous and fine-grained shapes, and fail to support geometry manipulation and realistic rendering. with the fast development of implicit representation, it is desirable to learn object segmentation for implicit surfaces. to the best of our knowledge, this paper is among the first to segment all 3d objects of implicit representations for complex scenes, only with color images and 2d object labels for supervision. LINEBREAK 3d scene editing: existing methods of editing 3d scenes from images can be categorized as 1) appearance editing and 2) shape editing. a majority of works (sengupta et al., 2019; boss et al., 2021; zhang et al., 2021c; chen et al., 2021) focus on lighting decomposition for appearance editing. although achieving appealing results, they cannot separately manipulate individual objects. a number of recent works (munkberg et al., 2021; liu et al., 2021a; jang & agapito, 2021; stelzner et al., 2021; guandao yang et al., 2021) start to learn disentangled shape representations for potential geometry manipulation. however, they can only deal with single objects or simple scenes, without being able to learn unique object codes for precise shape manipulation and novel view rendering. in addition, there are also a plethora of works (tewari et al., 2020; niemeyer & geiger, 2021; dhamo et al., 2021; alaluf et al., 2022) on generation based scene editing. although they can manipulate the synthesized objects and scenes, they cannot discover and edit objects from real-world images. LINEBREAK dm-nerf LINEBREAK given a set of l images for a static scene with known camera poses and intrinsics {(i1, ξ1, k1) · · · (il, ξl, kl)}, nerf uses simple mlps to learn the continuous 3d scene geometry and appearance. in particular, it takes 5d vectors of query point coordinates p = (x, y, z) and viewing directions v = (θ, ϕ) as input, and predicts the volume density σ and color c = (r, g, b) for point p. in our pipeline, we leverage this vanilla nerf as the backbone to learn continuous scene representations, although other nerf variants can also be used. our method aims to decompose all individual 3d objects, and freely manipulate any object in the 3d scene space. to achieve this, we design an object field component to parallelly learn an object code for every query point p, together with an object manipulator to edit the learned radiance fields and object fields. LINEBREAK figure 2: the architecture of our pipeline. given a 3d point p, we learn an object code through three loss functions: ℓ2d obj/ℓ3d empty/ℓ3d obj in eqs 5&8&9, using 2d and 3d supervision signals. LINEBREAK object fields LINEBREAK object field representation: as shown in figure 2, given the input point p, we model the object field as a function of its coordinates, because the object signature of a 3d point is irrelevant to the viewing angles. the object field is represented by a one-hot vector o. basically, this one-hot object code aims to accurately describe the object ownership of any point in 3d space. LINEBREAK however, there are two issues here: 1) the total number of objects in 3d scenes is variable and it can be 1 or many; 2) the entire 3d space has a large non-occupied volume in addition to solid objects. to tackle these issues, we define the object code o as h + 1 dimensional, where h is a predefined number of solid objects that the network is expected to predict in maximum. we can safely choose a relative large value for h in practice. the last dimension of o is particularly reserved to represent the non-occupied space. notably, this dedicated design is crucial for tackling occlusion and collision during object manipulation discussed in section 3.2. formally, the object field is defined as: LINEBREAK o = f (p), where o ∈ rh+1 LINEBREAK the function f is parameterized by a series of mlps. represents the input point p is non-occupied or the point is empty. LINEBREAK if the last dimension of code o is 1, it LINEBREAK object code projection: considering that it is infeasible to collect object code labels in continuous 3d space for full supervision while it is fairly easy and low-cost to collect object labels on 2d images, we aim to project the object codes along the query light ray back to a 2d pixel. since the volume density σ learned by the backbone nerf represents the geometry distribution, we simply approximate the projected object code of a pixel ˆo using the sampling strategy and volume rendering formulation of nerf. formally, it is defined as: LINEBREAK ˆo = LINEBREAK tkαkok, where tk = exp(− LINEBREAK σiδi), αk = 1 − exp(−σkδk) LINEBREAK with k representing the total sample points along the light ray shooting from a pixel, σi representing the learned density of the ith sample point, δk representing the distance between the (k + 1)th and kth sample points. from this projection formulation, we can easily obtain 2d masks of 3d object codes given the pose and camera parameters of any query viewing angles. LINEBREAK object code supervision: as shown in the right part of figure 2, having projected 2d object predictions at hand, we choose 2d images with object annotations for supervision. however, there are two issues: 1) the number and order of ground truth objects can be very different across different views due to visual occlusions. for example, as to the same 3d object in space, its object annotation in image #1 can be quite different from its annotation in image #2. therefore, it is non-trivial to consistently figure 3: illustration of 2d object matching and supervision for ℓ2d obj. utilize 2d annotations for supervision. 2) the 2d annotations only provide labels for 3d solid objects, as non-occupied 3d space is never recorded in 2d images. therefore, it is impossible to directly supervise non-occupied space, i.e., the last dimension of ˆo, from 2d annotations. these issues make adaptions of existing 2d methods ineffective, e.g., maskrcnn (he et al., 2017) or swin transformer (liu et al., 2021b), fundamentally because they do not consider the consistency between 3d and 2d, but just segment objects on individual images. LINEBREAK to tackle the first issue, we use the optimal association and supervision strategy proposed by 3d-bonet (yang et al., 2019b). as illustrated in figure 3, assuming we generate l images of 2d object predictions {i1 . . . il . . . il}, il ∈ ru ×v ×(h+1) and have the corresponding l images of 2d LINEBREAK ground truth object labels { ¯i1 . . . ¯il . . . ¯il}, ¯il ∈ ru ×v ×t , in which h is the predefined number of objects and t represents the number of ground truth objects. note that the ground truth number of objects in each image is usually different, but here we use the same t to avoid an abuse of notation. LINEBREAK for each pair, we firstly take the first h dimensions (solid object predictions) of i and reshape them to be m ∈ rn ×h , where n = u ×v , while the last dimension is never used at this stage. likewise, ¯i is reshaped to be ¯m ∈ rn ×t . then, m and ¯m are fed into hungarian algorithm (kuhn, 1955) to associate every ground truth 2d object mask with a unique predicted 2d object mask, according to soft intersection-over-union (siou) and cross-entropy score (ces) (yang et al., 2019b). formally, the soft intersection-over-union (siou) cost between the hth predicted object mask and the tth ground truth object mask in the lth pair is defined as follows: LINEBREAK csiou LINEBREAK h,t = LINEBREAK h ∗ ¯m n t ) t − (cid:80)n n=1(m n t are the nth values of mh and ¯mt. the cross-entropy score (ces) between mh LINEBREAK n=1(m n ¯m n LINEBREAK h ∗ ¯m n t ) LINEBREAK n=1 m n LINEBREAK h and ¯m n where m n and ¯mt is formally defined as: LINEBREAK cces LINEBREAK h,t = − LINEBREAK (cid:2) ¯m n LINEBREAK t log m n LINEBREAK h + (1 − ¯m n LINEBREAK t ) log(1 − m n LINEBREAK h )(cid:3) LINEBREAK h,t + cces after the optimal association based on (csiou ), we reorder the predicted object masks to align with the t ground truth masks, and then we directly minimize the cost of all ground truth objects in every pair. the final loss ℓ2d obj is defined by averaging across all l image pairs. LINEBREAK h,t LINEBREAK ℓ2d obj = LINEBREAK (sioul + cesl), where sioul = LINEBREAK (csiou t,t LINEBREAK ), cesl = LINEBREAK (cces t,t LINEBREAK to tackle the second issue, we turn to supervise the non-occupied object code in 3d space with the aid of estimated surface distances. in particular, given a specific query light ray on which we sample k 3d points to compute the projected 2d object code ˆo, we simultaneously compute an approximate distance d between camera center and the surface hit point along that query light: LINEBREAK d = LINEBREAK tkαkδk, where tk = exp(− LINEBREAK σiδi), αk = 1 − exp(−σkδk) LINEBREAK where k represents the total sample points along light ray, σi is the learned density, and δk is the distance between (k + 1)th and kth sample points, as same as equation 2. LINEBREAK as shown in figure 4, once we have the surface distance d at hand, we can easily know the relative position between every kth sample point and the surface point s along the light ray. naturally, we can then identify the subset of sample points surely belonging to empty space as indicated by green points, the subset of sample points near the surface as indicated by red points, and the remaining subset of sample points behind the surface as indicated by black points. such geometric information provides critical signals to supervise empty space, i.e., the figure 4: empty points identification. last dimension of object code o. note that, the sample points behind the surface may not surely belong to empty space, and therefore cannot be used as supervision signals. we use the following kernel functions to obtain a surfaceness score sk and an emptiness score ek for the kth sample point with the indicator function represented by 1(). LINEBREAK sk = exp(cid:0) − (dk − d)2(cid:1), LINEBREAK ek = (1 − sk) ∗ 1(d − ∆d − dk > 0) LINEBREAK where dk represents the distance between camera center and the kth sample point, and ∆d is a hyperparameter to compensate the inaccuracy of estimated surface distance d. note that, the indicator function is defined as: 1() = 1 if d − ∆d − dk > 0, and otherwise 1() = 0. it is used to mask out the sample points behind surface point during loss calculation. given the emptiness and surfaceness scores for the total k sample points along the ray, we use the simple log loss to supervise the last dimension of object code denoted as oh+1 LINEBREAK k LINEBREAK ℓ3d empty = − LINEBREAK ek ∗ log(oh+1 LINEBREAK k LINEBREAK ) + sk ∗ log(1 − oh+1 LINEBREAK k LINEBREAK since there should be no solid object at all in the empty space, we apply the following ℓ3d obj loss on the first h dimensions of the object code to push them to be zeros, being complementary to the existing ℓ2d obj loss. the hth dimension of the kth sample point’s object code is denoted by oh k. (cid:16) LINEBREAK ℓ3d obj = − LINEBREAK ek ∗ LINEBREAK log(1 − oh k) LINEBREAK to sum up, we firstly project object codes in 3d space back to 2d pixels along light rays using volume rendering equation, and then use optimal association strategy to compute the loss value with 2d object labels only. in addition, we introduce the key emptiness and surfaceness scores for points in 3d space with the aid of estimated surface distances. these unique scores are used to supervise the non-occupied 3d space. the whole object field is jointly supervised by: LINEBREAK ℓ = ℓ2d obj + ℓ3d empty + ℓ3d obj LINEBREAK object manipulator LINEBREAK if we want to manipulate a specific 3d object shape (e.g., translation, rotation and size adjustment), how does the whole scene look like in a new perspective after manipulation, assuming the object code and manipulation matrix are precomputed from users’ interactions (e.g., click, drag or zoom)? LINEBREAK intuitively, there could be two strategies: 1) firstly project 3d scene into 2d images, and then edit objects in 2d space. 2) firstly edit objects in 3d space, and then project into 2d images. compared with the first strategy which would inevitably incur inconsistency across multiple images due to the independent edits on individual views, the latter is more favourable. remarkably, our object field component can support the latter strategy. regarding such a manipulation task on implicit fields, the core question is: how do we edit the codes σ/c/o of every sample point along the query light ray, such that the generated novel view exactly shows the new appearance? this is nontrivial as: • first, we need to address potential collisions between objects during manipulation. this is quite intuitive, thanks to our special design of emptiness score in the last dimension of object code o. • second, due to visual occlusions, object codes behind surface points may not be accurate as they are not sufficiently optimized. by comparison, the projected object code ˆo along a light ray tends to be more accurate primarily because we have ground truth 2d labels for strong supervision. • at last, we need a systematic procedure to update the codes with the known manipulation infor LINEBREAK mation. to this end, we design an inverse query approach. inverse query: we design a creative inverse query approach to address all above issues, realizing the favourable strategy: editing in 3d space followed by 2d projection. in particular, as shown in figure 5, for any 3d sample point pk along a specific query light ray, given the target (i.e., to-be-edited) object code ot and its manipulation settings: relative translation ∆p=(∆x, ∆y, ∆z), rotation matrix r3×3, and scaling factor t>0, we firstly compute an inverse 3d point pk′, and then evalfigure 5: inverse points computation. uate whether pk and pk′ belong to the target object, and lastly decide to whether edit the codes or not. formally, we introduce inverse query algorithm 1 to conduct a single light ray editing and rendering for object shape manipulation. naturally, we can shoot a bunch of rays from any novel viewing angles to generate images of manipulated 3d scenes. LINEBREAK implementation LINEBREAK to preserve the high-quality of image rendering, our loss in equation 10 is only used to optimize the mlps of object field branch. the backbone is only optimized by the original nerf photo-metric loss (mildenhall et al., 2020). the whole network is end-to-end trained from scratch. the single hyper-parameter for our object field ∆d is set as 0.05 meters in all experiments. LINEBREAK experiments 4.1 datasets LINEBREAK dm-sr: to the best of our knowledge, there is no 3d scene dataset suitable for quantitative evaluation of geometry manipulation. therefore, we create a synthetic dataset with 8 different and complex indoor rooms, called dm-sr. for each scene, we generate the following 5 groups of images: • group 1 (w/o manipulation): color images and 2d object masks at 400×400 pixels are rendered LINEBREAK from viewpoints on the upper hemisphere. we generate 300 views for training. LINEBREAK algorithm 1 our inverse query algorithm to manipulate the learned implicit fields. (1) ot is the target object code, one-hot with h + 1 dimensions. {∆p, r3×3, t > 0} represent the manipulation information for the target object. (2) {p1 · · · pk · · · pk } represent the k sample points along a specific query light ray r. note that, we convert all object codes into hard one-hot vectors for easy implementation. LINEBREAK input: LINEBREAK • the target object code ot, manipulation information {∆p, r3×3, t ≥ 0}; • the sample points {p1 · · · pk · · · pk } along a specific query light ray r; LINEBREAK output: LINEBREAK • the final pixel color ¯c rendered from the query ray r after manipulation; • the final pixel object code ¯o rendered from the query ray r after manipulation; LINEBREAK preliminary step: LINEBREAK • obtain the projected pixel object code ˆo of light ray r before manipulation; LINEBREAK note: the loop below shows how to edit per sample point in 3d space. for pk in {p1 · · · pk · · · pk } do LINEBREAK • compute the inverse point pk′ for pk: pk′ = (1/t)r−1(pk − ∆p); • obtain the codes {σk, ck, ok} for the point pk; • obtain the codes {σk′ , ck′ , ok′ } for the inverse point pk′ ; • tackle visual occlusions: LINEBREAK if ok = ot and ok ̸= ˆo do: ok ← ˆo note: the target object is behind the surface but will be manipulated; LINEBREAK • obtain new implicit codes {¯σk, ¯ck, ¯ok} for pk after manipulation: LINEBREAK ̸= 1 and ok′ = ot do: LINEBREAK collision detected, exit. LINEBREAK k LINEBREAK if ok ̸= ot and oh+1 if ok ̸= ot and ok′ = ot do: if ok = ot and ok′ = ot do: if ok = ot and ok′ ̸= ot do: if ok ̸= ot and ok′ ̸= ot do: LINEBREAK {¯σk, ¯ck, ¯ok} ← {σk′ , ck′ , ok′ } ; {¯σk, ¯ck, ¯ok} ← {σk′ , ck′ , ok′ } ; {¯σk, ¯ck, ¯ok} ← {0, 0, 0} ; {¯σk, ¯ck, ¯ok} ← {σk, ck, ok} ; LINEBREAK after the above for loop, every point pk will get new implicit codes {¯σk, ¯ck, ¯ok}. note: the step below shows how to project edited 3d points to a 2d image. according to volume rendering equation, the final pixel color and object code are: LINEBREAK • ¯c = (cid:80)k where LINEBREAK ¯tk ¯αk ¯ck, ¯tk = exp(− (cid:80)k−1 LINEBREAK ¯tk ¯αk ¯ok LINEBREAK ¯αk = 1 − exp(−¯σkδk). LINEBREAK • group 2 (translation only): one object is selected to be translated along x or y axis with ∼ 0.3m. • group 3 (rotation only): one object is selected to be rotated around z axis with about 90 degrees. • group 4 (scaling only): one object is selected to be scaled down about 0.8× smaller. • group 5 (joint translation/rotation/scaling): one object is selected to be simultaneously trans LINEBREAK lated about ∼ 0.3m, rotated about 90 degrees, scaled down about 0.8× smaller. LINEBREAK for each group, 100 views are generated for testing at the same viewpoints. LINEBREAK replica: replica (straub et al., 2019) is a reconstruction-based 3d dataset of high fidelity scenes. we request the authors of semantic-nerf (zhi et al., 2021a) to generate (180 training / 180 testing) color images and 2d object masks with camera poses at 640×480 pixels for each of 7 scenes. each scene has 59∼93 objects with very diverse sizes. LINEBREAK scannet: scannet (dai et al., 2017) is a large-scale challenging real-world dataset. we select 8 scenes (∼10 objects in each one) for evaluation. each scene has ∼3000 raw images with 2d object masks and camera poses, among which we evenly select 300 views for training and 100 for testing. LINEBREAK 4.2 baseline and metrics scene decomposition: the most relevant work to us is objectnerf (yang et al., 2021), but its design is vastly different: 1) it requires a point cloud as input for voxelization in training, but we do not. 2) it needs gt bounding boxes of target objects to manually prune point samples during editing, but we do not need any annotations in editing. 3) it only learns to binarily segment the foreground object and background, by pre-defining an object library in training and editing. however, our object code is completely learned from scratch. this means that objectnerf is not comparable due to the fundamental differences. note that, the recent semantic-nerf (zhi et al., 2021a) is also not comparable because it only learns 3d semantic categories, not individual 3d objects. in fact, we notice that all recent published relevant works (yang et al., 2021; zhi et al., 2021a; wu et al., 2022; kundu et al., 2022; norman et al., 2022; fu et al., 2022) do not directly tackle and evaluate multiple 3d object segmentation in literature. in this regard, we use the powerful mask-rcnn (he et al., 2017) and swin transformer (liu et al., 2021b) as baselines. LINEBREAK since we train our dm-nerf in scene-specific fashion, for fairness, we also fine-tune mask-rcnn and swin transformer models (pretrained under detectron2 library) on every single scene. in particular, we carefully fine-tune both models using up to 480 epochs until convergence with learning rate 5e−4 and then pick up the best models on the testing split of each scene for comparison. LINEBREAK object manipulation: since there is no method that can directly manipulate objects in continuous radiance fields, we adapt the recent point-nerf (xu et al., 2022) for comparison, because it can recover both explicit 3d scene point clouds and novel views. adaptation details are in appendix. LINEBREAK metrics: we use the standard psnr/ssim/lpips scores to evaluate color image synthesis (mildenhall et al., 2020), and use ap of all 2d test images to evaluate 3d scene decomposition. LINEBREAK 3d scene decomposition LINEBREAK 4.3 training with 100% accurate 2d labels: we evaluate the performance of scene decomposition on 3 datasets. for dm-sr dataset, we evaluate our method and baselines on images of group 1 only, while the images of groups 2/3/4/5 are used for object manipulation. for every single scene in these datasets, using 100% accurate 2d object ground truth labels, we train a separate model for our method, and fine-tune separate models for mask-rcnn (mr) and swin transformer (swint). LINEBREAK analysis: table 1 shows that our method, not surprisingly, achieves excellent results for novel view rendering thanks to the original nerf backbone. notably, our method obtains nearly perfect object segmentation results across multiple viewing points of complex 3d scenes in all three datasets, clearly outperforming baselines. figure 10 shows that our results have much sharper object boundaries thanks to the explicit 3d geometry applied in our object field. LINEBREAK dm-sr dataset LINEBREAK replica dataset LINEBREAK scannet dataset LINEBREAK novel view synthesis LINEBREAK decomposition LINEBREAK novel view synthesis LINEBREAK decomposition LINEBREAK novel view synthesis LINEBREAK decomposition LINEBREAK psnr↑ ssim↑ lpips↓ mr swint ours LINEBREAK table 1: quantitative results on three datasets. the metric for object decomposition is ap0.75. robustness to noisy 2d labels: since our method inherently has multi-view consistency while the 2d segmentation methods do not, it is expected that our method has better robustness to inaccurate and noisy 2d labels in training. to validate this advantage, we conduct the following experiments on dm-sr dataset. particularly, as illustrated in figure 6, we randomly assign incorrect object labels to different amounts of image pixels of all training images (10%/50%/70%/80%/90%), and then our method and baselines are all trained with these noisy 2d labels. LINEBREAK analysis: as shown in table 2, it can be seen that our method still achieves an excellent object segmentation score (ap0.75 = 74.08) on testing/novel views, even though 80% of 2d labels are incorrect in training. by contrast, both baselines fail catastrophically once more than 50% of labels are noisy in training. basically, this is because our dedicated losses ℓ2d obj/ℓ3d empty/ℓ3d obj explicitly take into account object geometry consistency across multi-views, thus allowing the estimated 3d object codes to be resistant against wrong labels, whereas the existing 2d object segmentation methods only independently process single images, being easily misled by wrong labels in training. this clearly demonstrates the remarkable robustness of our method. more experiments and quantitative/qualitative results regarding robustness are in appendix. LINEBREAK extension to panoptic segmentation: our method can be easily extended to tackling panoptic segmentation by adding an extra semantic branch parallel to object code branch. due to the limited space, quantitative and qualitative results are provided in appendix. LINEBREAK figure 6: examples of 2d object labels with different levels of noise. LINEBREAK 50% noisy labels LINEBREAK 80% noisy labels LINEBREAK point-nerf ours ablation 1: ours (w/o ℓ3d) ablation 2: ours (w/o vo) LINEBREAK point-nerf ours ablation 1: ours (w/o ℓ3d) ablation 2: ours (w/o vo) LINEBREAK translation LINEBREAK scale LINEBREAK rotation LINEBREAK joint LINEBREAK table 3: quantitative results of object manipulation and ablation studies on dm-sr dataset. LINEBREAK 3d object manipulation LINEBREAK in this section, we directly use our model trained on the images of group 1 to test on the remaining images of groups 2/3/4/5 in dm-sr dataset. in particular, with the trained model, we feed the known manipulation information of groups 2/3/4/5 into algorithm 1, generating images and 2d object masks. these (edited) images and masks are compared with the ground truth 2d views. for comparison, we carefully train point-nerf models in scene-specific fashion and apply the same manipulation information to its learned point clouds followed by novel view rendering. LINEBREAK analysis: table 3 shows that the quality of our novel view rendering is clearly better than pointnerf (xu et al., 2022), although it decreases after manipulation compared with non-manipulation in table 1, primarily because the lighting factors are not decomposed and the illumination of edited objects shows discrepancies. however, the object decomposition is still nearly perfect, as also shown for deformation manipulation in figure 11. more results are in appendix. LINEBREAK ablation study LINEBREAK to evaluate the effectiveness of our key designs of object field and manipulator, we conduct two ablation studies. 1) we only remove the loss functions (ℓ3d empty + ℓ3d obj) which are jointly designed to learn correct codes for empty 3d points, denoted as w/o ℓ3d. 2) during manipulation, we remove the step “tackle visual occlusions” in algorithm 1, denoted as w/o vo. as shown in table 3, both of our loss functions for empty space regularization and visual occlusion handling step are crucial for accurate 3d scene decomposition and manipulation. more ablation results are in appendix. LINEBREAK 5 discussion and conclusion we have shown that it is feasible to simultaneously reconstruct, decompose, manipulate and render complex 3d scenes in a single pipeline only from 2d views. by adding an object field component into the implicit representation, we successfully decompose all individual objects in 3d space. the decomposed object shapes can be further freely edited by our visual occlusion aware manipulator. LINEBREAK one limitation is the lack of decomposing lighting factors, which is non-trivial and left for future work. in addition, manipulation of originally occluded objects or parts may produce artifacts due to the inaccuracy of learned radiance fields, although these artifacts can be easily repaired by applying simple heuristics such as continuity of surfaces or using better neural backbones. LINEBREAK acknowledgements: this work was supported in part by national natural science foundation of china under grant 62271431, in part by shenzhen science and technology innovation commission under grant jcyj20210324120603011, in part by research grants council of hong kong under grants 25207822 & 15225522. LINEBREAK references LINEBREAK yuval alaluf, ron mokady, and amit h bermano. hyperstyle: stylegan inversion with hyper LINEBREAK networks for real image editing. cvpr, 2022. LINEBREAK pierre alliez, mark meyer, and mathieu desbrun. interactive geometry remeshing. tog, 2002. sagie benaim, frederik warburg, peter ebert, and christensen serge. volumetric disentanglement LINEBREAK mark boss, varun jampani, raphael braun, ce liu, jonathan t. barron, and hendrik. neural-pil: LINEBREAK neural pre-integrated lighting for reflectance decomposition. neurips, 2021. LINEBREAK cesar cadena, luca carlone, henry carrillo, yasir latif, davide scaramuzza, jose neira, ian d. reid, and john j. leonard. past, present, and future of simultaneous localization and mapping: towards the robust-perception age. ieee transactions on robotics, 2016. LINEBREAK wenzheng chen, joey litalien, jun gao, zian wang, clement fuji tsang, sameh khamis, or litany, and sanja fidler. dib-r++: learning to predict lighting and material with a hybrid differentiable renderer. neurips, 2021. LINEBREAK julian chibane, aymen mir, and gerard pons-moll. neural unsigned distance fields for implicit LINEBREAK function learning. neurips, 2020. LINEBREAK christopher b. choy, danfei xu, junyoung gwak, kevin chen, and silvio savarese. 3d-r2n2: a LINEBREAK unified approach for single and multi-view 3d object reconstruction. eccv, 2016.
| 9
|
[
117.963,
412.7520784,
461.10315,
422.9438182
] |
fjh7UGQgOB.pdf
| 2,023
| 1
|
LINEBREAK rethinking graph lottery tickets: graph sparsity matters LINEBREAK bo hui1, da yan2, xiaolong ma3, wei-shinn ku1 1 auburn university 2 the university of alabama at birmingham 3 clemson university LINEBREAK abstract LINEBREAK lottery ticket hypothesis (lth) claims the existence of a winning ticket (i.e., a properly pruned sub-network together with original weight initialization) that can achieve competitive performance to the original dense network. a recent work, called ugs, extended lth to prune graph neural networks (gnns) for effectively accelerating gnn inference. ugs simultaneously prunes the graph adjacency matrix and the model weights using the same masking mechanism, but since the roles of the graph adjacency matrix and the weight matrices are very different, we find that their sparsifications lead to different performance characteristics. specifically, we find that the performance of a sparsified gnn degrades significantly when the graph sparsity goes beyond a certain extent. therefore, we propose two techniques to improve gnn performance when the graph sparsity is high. first, ugs prunes the adjacency matrix using a loss formulation which, however, does not properly involve all elements of the adjacency matrix; in contrast, we add a new auxiliary loss head to better guide the edge pruning by involving the entire adjacency matrix. second, by regarding unfavorable graph sparsification as adversarial data perturbations, we formulate the pruning process as a min-max optimization problem to gain the robustness of lottery tickets when the graph sparsity is high. we further investigate the question: can the “retrainable” winning ticket of a gnn be also effective for graph transferring learning? we call it the transferable graph lottery ticket (glt) hypothesis. extensive experiments were conducted which demonstrate the superiority of our proposed sparsification method over ugs, and which empirically verified our transferable glt hypothesis. LINEBREAK introduction LINEBREAK graph neural networks (gnns) (kipf & welling, 2017; hamilton et al., 2017) have demonstrated state-of-the-art performance on various graph-based learning tasks. however, large graph size and over-parameterized network layers are factors that limit the scalability of gnns, causing high training cost, slow inference speed, and large memory consumption. recently, lottery ticket hypothesis (lth) (frankle & carbin, 2019) claims that there exists properly pruned sub-networks together with original weight initialization that can be retrained to achieve comparable performance to the original large deep neural networks. lth has recently been extended to gnns by chen et al. (2021b), which proposes a unified gnn sparsification (ugs) framework that simultaneously prunes the graph adjacency matrix and the model weights to accelerate gnn inference on large graphs. specifically, two differentiable masks mg and mθ are applied to the adjacency matrix a and the model weights θ, respectively, during end-to-end training by element-wise product. after training, lowest-magnitude elements in mg and mθ are set to zero w.r.t. pre-defined ratios pg and pθ, which basically eliminates low-scored edges and weights, respectively. the weight parameters are then rewound to their original initialization, and this pruning process is repeated until pre-defined sparsity levels are reached, i.e., LINEBREAK graph sparsity 1 − LINEBREAK ≥ sg LINEBREAK and LINEBREAK weight sparsity 1 − LINEBREAK ≥ sθ, LINEBREAK where ∥.∥0 is the l0 norm counting the number of non-zero elements. LINEBREAK intuitively, ugs simply extends the basic parameter-masking algorithm of frankle & carbin (2019) for identifying winning tickets to also mask and remove graph edges. however, our empirical study LINEBREAK (a) performance study of ugs variants LINEBREAK (b) types of edges and nodes in gnn training LINEBREAK figure 1: ugs analysis LINEBREAK finds that the performance of a sparsified gnn degrades significantly when the graph sparsity goes beyond a certain level, while it is relatively insensitive to weight sparsification. specifically, we compare ugs with its two variants: (1) “only weight,” which does not conduct graph sparsification, and (2) “80% edges,” which stops pruning edges as soon as the graph sparsity is increased to 20% or above. figure 1(a) shows the performance comparison of ugs and the two variants on the cora dataset (chen et al., 2021b), where we can see that the accuracy of ugs (the red line) collapses when the graph sparsity becomes larger than 25%, while the two variants do not suffer from such a significant performance degradation since neither of them sparsifies the edges beyond 20%. clearly, the performance of gnns is vulnerable to graph sparsification: removing certain edges tends to undermine the underlying structure of the graph, hampering message passing along edges. LINEBREAK in this paper, we propose two techniques to improve gnn performance when the graph sparsity is high. the first technique is based on the observation that in ugs, only a fraction of the adjacency matrix elements (i.e., graph edges) are involved in loss calculation. as an illustration, consider the semi-supervised node classification task shown in figure 1(b) where the nodes in yellow are labeled, and we assume that a gnn with 2 graph convolution layers is used so only nodes within two hops from the yellow nodes are involved in the training process, which are highlighted in green. note that the gray edges in figure 1(b) are not involved in loss calculation, i.e., no message passing happens along the dashed edges so their corresponding mask elements get zero gradients during backpropagation. on the cora dataset, we find that around 50% edges are in such a situation, leaving the values of their corresponding mask elements unchanged throughout the entire training process. after checking the source code of ugs, we find that it initializes these mask elements by adding a random noise, so the ordering of the edge mask-scores is totally determined by this initial mask randomization rather than the graph topology. as a result, the removal of low-scored edges tends to be random in later iterations of ugs, causing performance collapse as some important “dashed” edges are removed. LINEBREAK to address this problem, we add a new auxiliary loss head to better guide the edge pruning by involving the entire adjacency matrix. specifically, this loss head uses a novel loss function that measures the inter-class separateness of nodes with wasserstein distance (wd). for each class, we calculate the wd between (1) the set of nodes that are predicted to be in the class and (2) the set of other nodes. by minimizing wd for all classes, we maximize the difference between the extracted node features of different classes. now that this loss function involves all nodes, all elements in the graph mask mg will now have gradient during backpropagation. LINEBREAK our second technique is based on adversarial perturbation, which is widely used to improve the robustness of deep neural networks (wong et al., 2020). to improve the robustness of the graph lottery tickets (i.e., the pruned gnn subnetworks) when graph sparsity is high, we regard unfavorable graph sparsification as an adversarial data perturbation and formulate the pruning process as a min-max optimization problem. specifically, a minimizer seeks to update both the weight parameters θ and its mask mθ against a maximizer that aims to perturb the graph mask mg. by performing projected gradient ascent on the graph mask, we are essentially using adversarial perturbations to significantly improve the robustness of our graph lottery tickets against the graph sparsity. LINEBREAK we further investigate the question: can we use the obtained winning ticket of a gnn for graph transfer learning? studying this problem is particularly interesting since the “retrainability” of a winning ticket (i.e., a pruned sub-network together with original weight initialization) on the same task is the most distinctive property of lottery ticket hypothesis (lth): many works (liu LINEBREAK et al., 2019; frankle & carbin, 2019) have verified the importance of winning ticket initialization and stated that the winning ticket initialization might land in a region of the loss landscape that is particularly amenable to optimization. here, we move one step further in the transfer learning setting, to investigate if the winning ticket identified on a source task also works on a target task. the answer is affirmative through our empirical study, and we call it the transferable graph lth. LINEBREAK the contributions of this paper are summarized as follows: LINEBREAK we design a new auxiliary loss function to guide the edges pruning for identifying graph lottery tickets. our new auxiliary loss is able to address the issue of random edge pruning in ugs. LINEBREAK we formalize our sparsification algorithm as a min-max optimization process to gain the robustness of lottery tickets to the graph sparsity. LINEBREAK we empirically investigated and verified the transferable graph lottery ticket hypotheses. LINEBREAK preliminary LINEBREAK this section defines our notations, reviews the concept of gnns, defines graph lottery tickets, and reports our empirical study of ugs’s random edge pruning issue. LINEBREAK notations and gnn formulation. we consider an undirected graph g = (v, e) where v and e are the sets of nodes and edges of g, respectively. each node vi ∈ v has a feature vector xi ∈ rf , where f is the number of node features. we use x ∈ rn ×f to denote the feature matrix of the whole graph g, where n = |v| is the number of nodes, and x stacks xi of all nodes vi as its rows. let a ∈ rn ×n be the adjacency matrix of g, i.e., ai,j = 1 if there is an edge ei,j ∈ e between nodes vi and vj , and ai,j = 0 otherwise. graph convolutional networks (gcn) (kipf & welling, 2017) is the most popular and widely adopted gnn model. without loss of generality, we consider a gcn with two graph convolution layers, which is formulated as follows: LINEBREAK z = softmax LINEBREAK ∈ rn ×c. LINEBREAK here, w(0) is an input-to-hidden weight matrix and w(1) is a hidden-to-output weight matrix. the softmax activation function is applied row-wise and σ(·) = max(0, ·) is the relu activation function. the total number of classes is c. the adjacency matrix with self-connections ˜a = a + in is normalized by ˆa = ˜d− 1 2 where ˜d is the degree matrix of ˜a. for the semi-supervised node classification tasks, the cross-entropy error over labeled nodes is given by: LINEBREAK l∈yl LINEBREAK ylj log(zlj), LINEBREAK where yl is the set of node indices for those nodes with labels, yl is the one-hot encoding (row) vector of node vl’s label. LINEBREAK graph lottery tickets. if a sub-network of a gnn with the original initialization trained on a sparsified graph has a comparable performance to the original gnn trained on the full graph in terms of test accuracy, then the gnn subnetwork along with the sparsified graph is defined as a graph lottery ticket (glt) (chen et al., 2021b). different from the general lth literature, glt consists of three elements: (1) a sparsified graph obtained by pruning some edges in g, (2) a gnn sub-network and (3) the initialization of its learnable parameters. LINEBREAK without loss of generality, let us consider a 2-layer gcn denoted by f (x, θ0) where θ0 = {w(0) 0 } is the initial weight parameters. then, the task is to find two masks mg and mθ such that the sub-network f (x, mθ ⊙ θ0) along with the sparsified graph {mg ⊙ a, x} can be trained to a comparable accuracy as f (x, θ0). LINEBREAK ugs analysis. lth algorithms including ugs (chen et al., 2021b) sort the elements in a mask by magnitude and “zero out” the smallest ones for sparsification. to find and remove the insignificant connections and weights in the graph and the gnn model, ugs updates two masks mg and mθ by backpropagation. however, recall from figure 1(b) that ugs suffers from the issue that only a fraction of edges in g are related to the training loss as given by eq (2) for semi-supervised node LINEBREAK dataset LINEBREAK table 1: statistic of edges with gradients LINEBREAK classification. table 1 shows (1) the number of nodes in the training v.s. entire dataset and (2) the percentage of edges with gradients during backpropagation for three graph datasets: cora, citeseer and pubmed. we can see that a significant percentage of edges (up to 91% as in pubmed) are not related to the training loss. we carefully examined the source code of ugs and found that the pruning process for these edges tends to be random since each element in the graph mask is initialized by adding a random noise to its magnitude. as we have seen in figure 1(a), the accuracy of ugs collapses when the graph sparsity becomes high. it is crucial to properly guide the mask learning for those edges not related to the training loss in eq (2) to alleviate the performance degradation. LINEBREAK percentage of edges related to loss LINEBREAK cora citeseer pubmed LINEBREAK # of nodes (training/all) LINEBREAK methodology LINEBREAK auxiliary loss function. since l0 as given by eq (2) does not involve all edges for backpropagation, we hereby design another auxiliary loss function l1 to better guide the edge pruning together with l0. LINEBREAK given gnn output z and a class c, we separate potential nodes of class c and the other nodes by: LINEBREAK zc = {zi ∈ rows(z) | argmax(zi) = c} LINEBREAK and z¯c = {zi ∈ rows(z) | argmax(zi) ̸= c}, LINEBREAK for c ∈ {1, 2, · · · , c}. since zi of those i ∈ yl are properly guided by l0, we can use argmax(zi) = c to filter out the potential nodes that belong to class c. for each class c, we then calculate the wasserstein distance (wd) between zc and z¯c: LINEBREAK wd(zc, z¯c) = LINEBREAK inf π∼π(zc,z¯c) LINEBREAK e(zi,zj)∼π[∥zi − zj∥], LINEBREAK where π(zc, z¯c) denotes the set of all joint distributions π(zi, zj) whose marginals are, respectively, zc and z¯c: LINEBREAK π(zc, z¯c) = {p : p1 = zc, pt 1 = z¯c}. LINEBREAK wasserstein distance (wd) (villani, 2009) is widely used to measure the distance between two distributions, especially under the vanishing overlap of two distributions. intuitively, it is the cost of the optimal plan for transporting one distribution to match another distribution: in eq (5), π(zc, z¯c) is the set of valid transport plans, where p is a coupling matrix with each element pij representing how much probability mass from point zi ∈ zc is assigned to a point zj ∈ z¯c; and 1 is an all-one vector. we consider zc and z¯c as the distribution of class c and other classes, respectively. equation (4) can be approximated by a smooth convex optimization problem with an entropic regularization term: LINEBREAK ⟨d, p⟩ − ε LINEBREAK min p LINEBREAK i,j LINEBREAK pij log(pij), LINEBREAK where d is the pairwise euclidean distance matrix between points of zc and z¯c, and ⟨·, ·⟩ is the frobenius inner product. minimizing eq (6) is solved using sinkhorn iterations (cuturi, 2013), which form a sequence of linear operations straightforward for backpropagation. LINEBREAK ideally, we want the node representations in one class to be very different from those in other classes so that the classes can be easily distinguished. by maximizing wd(zc, z¯c) for all classes c, we maximize the difference between gnn outputs for different classes. formally, the auxiliary loss function to minimize is given by: LINEBREAK c∈c LINEBREAK wd(zc, z¯c). LINEBREAK to explore the relationship between unsupervised loss l1 with the supervised loss l0 (i.e., eq (2)), we train a 2-layer gcn on cora with l0 as the only loss function, and figure 2 plots the value of l0 as well as the corresponding value of (cid:80) c∈c wd(zc, z¯c) (abbr. wd) during the training process. we can see that as training loss l0 decreases, the value of wd increases. the curves of both l0 and wd LINEBREAK start to bounce back after 100 epochs. therefore, maximizing wd is consistent with improving classification accuracy. note that (cid:80) c∈c wd(zc, z¯c) is unsupervised and related to all nodes in the training set. it is natural to use this new metric to guide the pruning of edges that are not directly related to l0: if masking an edge decreases wd, this edge tends to be important and its removal will decrease the test accuracy of node classification. LINEBREAK our sparsification method uses a semi-supervised loss that combines l0 and l1 (or, wd): l = l0 + λl1. LINEBREAK sparsification. to prune the edges and weights while retaining robustness, we formulate gnn sparsification as a min-max problem given by: min θ,mθ LINEBREAK max mg LINEBREAK figure 2: supervised loss l0 v.s. wd. note that as training loss l0 decreases, the value of wd increases. both l0 and wd start to bounce back after 100 epochs. LINEBREAK where the outer minimization seeks to train the model weights and their masks to minimize the classification error, and the inner maximization aims to adversarially perturb the graph mask. LINEBREAK let us use l(θ, mθ, mg) to denote (l0 + λl1), then the optimization problem in eq (8) can be solved by alternating the following two steps as specified by (i) eq (9) and (ii) eqs (10) & (11). LINEBREAK specifically, the inner maximization perturbs the graph mask at (t + 1)th iteration as follows: LINEBREAK m(t) LINEBREAK g + η1∇mg l(θ(t), m(t) LINEBREAK where pc[m] = arg minm′∈c ∥m′ − m∥2 f is a differentiable projection operation that projects the mask values onto [0, 1], and η1 > 0 is a proper learning rate. while the second step for outer minimization is given by: LINEBREAK θ ← m(t) LINEBREAK ∇mθ l(θ(t), m(t) LINEBREAK g LINEBREAK d LINEBREAK m(t+1) g dm(t) θ LINEBREAK ∇mg l(θ(t), m(t) LINEBREAK g LINEBREAK (cid:16) ∇θl(θ(t), m(t) LINEBREAK g LINEBREAK d LINEBREAK m(t+1) g LINEBREAK dθ(t) LINEBREAK ∇mg l(θ(t), m(t) LINEBREAK g LINEBREAK where the last term is an implicit gradient obtained by chain rule over m(t+1) LINEBREAK g LINEBREAK as given by eq (9). LINEBREAK algorithm 1 iterative pruning process input:initial masks mg = a, mθ = 1 ∈ r||θ|| output: sparsified masks mg and mθ 1: while 1 − ∥mg∥0 ∥a∥0 g = mg, m(0) m(0) for iteration t = 0, 1, 2, · · · , t − 1 do LINEBREAK < sθ do LINEBREAK g LINEBREAK compute m(t+1) with eq (9) compute m(t+1) with eq (10) compute θ(t+1) with eq (11) LINEBREAK end for mg = m(t −1) set pg% of the lowest-scored values in mg to 0 and set the others to 1 set pθ% of the lowest-scored values in mθ to 0 and set the others to 1 LINEBREAK , mθ = m(t −1) LINEBREAK g LINEBREAK we follow ugs’s framework to repeatedly train, prune, and reset a gnn with initial weights after each round until the desired sparsity levels sg and sθ are reached. algorithm 1 illustrates our iterative LINEBREAK pruning process. at each round once the model is trained and masks are computed, we set pg fraction of the lowest-scored values in mg to 0 and set the others to 1. likewise, (1 − pθ) fraction of the weights in θ will survive to the next round. finally, we retrain the obtained sub-network using only l0 to report the test accuracy. LINEBREAK transfer learning with graph lottery tickets LINEBREAK this section explores whether a graph lottery ticket (glt) can be used for graph transfer learning. specifically, we ask two questions: (1) can we use the graph winning ticket of a gnn for transfer learning? here, the graph winning ticket is associated with the originally initialized weight parameters. (2) can we use the post-trained winning ticket of a gnn for transfer learning? here, “post-trained” means that the winning ticket directly uses the trained weight parameters on the source task to bootstrap the training on the target task. LINEBREAK to answer these two questions, we consider the node classification tasks on two citation networks arxiv and mag (hu et al., 2020). in both tasks, each node represents an author and is associated with a 128-d feature vector obtained by averaging the word embeddings of papers that are published by the author. we train a 3-layer gcn model on arxiv and transfer the model to mag by replacing the last dense layer. since the graphs of arxiv and mag are different, we only transfer mθ and θ from arxiv, and use the original graph of mag without sparsification. figure 3 shows the training accuracy curves on mag with winning tickets obtained from arxiv. here, “post-trained glt” (red line) starts training with the pretrained winning ticket on arxiv, while "re-initialized glt" (green line) starts training with the winning ticket re-initialized using original initial weight parameters. we can see that the sub-network obtained from arxiv transfers well on mag in both settings, so the answers to our two questions are affirmative. also, the blue (resp. black) line starts training with the post-trained gnn from arxiv without any edge or weight pruning; while the yellow line starts training with the winning ticket but with randomly initialized weight parameters. we can observe that (1) the post-trained winning ticket (red) achieves the same performance as the post-trained gnn (blue), showing that the transferred performance is not sensitive to weight pruning; and that (2) the winning ticket identified on the source task (green) achieves even better performance on the target task than a randomly initialized gnn (black). note that gradient descent could get trapped in undesirable stationary points if it starts from arbitrary points, and our glt identified from the source task allows the initialization to land in a region of the loss landscape that is particularly amenable to optimization (ganea et al., 2018). LINEBREAK figure 3: training curves on mag. notice that the post-trained winning ticket achieves the similar performance as the post-trained gnn. also, the winning ticket achieves even better performance than a randomly initialized gnn. LINEBREAK experiment
| 5
|
[
108.299,
224.7606768,
194.1824456,
236.7158768
] |
tYxG_OMs9WE.pdf
| 2,021
| 2
|
LINEBREAK property controllable variational autoencoder via invertible mutual dependence LINEBREAK xiaojie guo department of ist george mason university fairfax, va 22030, usa [email protected] LINEBREAK yuanqi du department of cs george mason university fairfax, va 22030, usa [email protected] LINEBREAK ∗ liang zhao department of cs emory university atlanta, ga 30322, usa [email protected] LINEBREAK abstract LINEBREAK deep generative models have made important progress towards modeling complex, high dimensional data. their usefulness is nevertheless often limited by a lack of control over the generative process or a poor understanding of the latent representation. to overcome these issues, attention is now focused on discovering latent variables correlated to the data properties and manipulating these properties. this paper presents the property-controllable vae (pcvae), where a new bayesian model is proposed to inductively bias the latent representation using explicit data properties via novel group-wise and property-wise disentanglement terms. each data property corresponds seamlessly to a latent variable, by enforcing invertible mutual dependence between them. this allows us to move along the learned latent dimensions to control specific properties of the generated data with great precision. quantitative and qualitative evaluations confirm that the pcvae outperforms the existing models by up to 28% in capturing and 65% in manipulating the desired properties. the code for the proposed pcvae is available at:https://github.com/xguo7/pcvae. LINEBREAK introduction LINEBREAK important progress has been made towards learning the underlying low-dimensional representation and generative process of complex high dimensional data such as images (pu et al., 2016), natural languages (bowman et al., 2016), chemical molecules (kadurin et al., 2017; guo et al., 2019) and geo-spatial data (zhao, 2020) via deep generative models. in recent years, a surge of research has developed new ways to further enhance the disentanglement and independence of the latent dimensions, creating models with better robustness, improved interpretability, and greater generalizability with inductive bias (see figures 1(a) and 1(b)) (kingma et al., 2014; kulkarni et al., 2015; creswell et al., 2017) or without any bias (higgins et al., 2017; chen et al., 2018; kumar et al., 2018). although it is generally assumed that the complex data is generated from the latent representations, their latent dimensions are typically not associated with physical meaning and hence cannot reflect real data generation mechanisms such as the relationships between structural and functional characteristics. a critical problem that remains unsolved is how to best identify and enforce the correspondence between the learned latent dimensions and key aspects of the data, such as the bio-physical properties of a molecule. knowing such properties is crucial for many applications that depend on being able to interpret and control the data generation process with the desired properties. LINEBREAK in an effort to achieve this, several researchers (klys et al., 2018; locatello et al., 2019b) have suggested methods that enforce a subset of latent dimensions correspond to targeted categorical properties, as shown in figure 1(c). though the initial results have been encouraging, critical challenges remain unsolved such as: (1) difficulty in handling continuous-valued properties. the control imposed on data generation limits existing techniques to categorical (typically binary) properties, to enable tractable model inference and sufficient coverage of the data. however, continuous-valued properties (e.g., the scale and light level of images) are also common in real world data, while their model inference usually can be easily intractable. also, many cases require to generate data LINEBREAK corresponding author: [email protected] LINEBREAK figure 1: while most existing models (e.g., sub-figures (a) (kingma et al., 2014; kulkarni et al., 2015) and (b) (creswell et al., 2017)) do not explicitly learn the correspondence between latent dimensions and data properties, some recent work (sub-figures (c) (klys et al., 2018) and (d)) has started to explore this. the generative model (right) and its model inference (left) are shown in each sub-figure. dotted arrows represent the enforcement of independence and double arrows represent the invertible dependence between two variables. x refers to data, z and w refer to two subsets of latent variables, and y refers to the properties. LINEBREAK with properties of which the values are unseen during training process. this cannot be achieved by conventional techniques such as conditional models without making strong assumption on the model distributions. (2) difficulty in efficiently enhancing mutual independence among latent variables relevant and irrelevant to the properties. this problem requires to ensure that each property is only correlated to its corresponding latent variable(s) and independent of all the others. directly enforcing such mutual independence inherently between all pairs of latent variables incurs quadratic number of optimization efforts. hence an efficient way is imperative. (3) difficulty in capturing and controlling correlated properties. it is feasible that several independent latent variables can capture multiple independent properties. but when the properties are correlated, they cannot be “one-on-one” mapped to corresponding independent latent variables anymore. however, correlated properties are commonly found in formatting a real world data. LINEBREAK to solve the above challenges, we propose a new model, property-controllable vae (pcvae), where a new bayesian model is proposed to inductively bias the latent representation using explicit data properties via novel group-wise and property-wise disentanglement terms. each data property is seamlessly linked to the corresponding latent variable by innovatively enforcing an invertible mutual dependence between them, as shown in figure 1(d). hence, when generating data, the corresponding latent variables are manipulated to simultaneously control multiple desired properties without influencing the others. we have also further extended our model to handle inter-correlated properties. our key contributions are summarized as follows: • a new bayesian model that inductively biases the latent representation using explicit real data properties is proposed. a variational inference strategy and inference model have been customized to ensure effective bayesian inference. LINEBREAK • group-wise and property-wise disentanglement terms are proposed to enhance the mutual inde LINEBREAK pendence among property, relevant and irrelevant latent variables . LINEBREAK • the invertible mutual dependence between property-latent variable pair is achieved by enforcing LINEBREAK an invertibility constraint over a residual-based decoder. LINEBREAK • the quantitative and qualitative evaluation performed for this study revealed our pcvae outperforms existing methods by up to 28% in capturing and 65% in manipulating the desired properties. LINEBREAK related works LINEBREAK disentanglement representation learning. an important relevant area of research is disentangled representation learning (alemi et al., 2017; chen et al., 2018; higgins et al., 2017; kim & mnih, 2018), which structures the latent space by minimizing the mutual information between all pairs of latent variables. the goal here is to learn representations that separate out the underlying explanatory factors that are responsible for variations in the data, as these have been shown to be relatively resilient with respect to the complex variants involved (bengio et al., 2013; ma et al., 2019; guo et al., 2020), and thus can be used to enhance generalizability as well as improve robustness against adversarial attack. as noted by locatello et al. (2019a), it is impossible for disentangled representation learning to capture the desired properties without supervision and inductive biases. LINEBREAK learning latent representations via supervision. this ensures that the latent variables capture the desired properties though supervision, generally by directly defining properties as latent variables in the model (locatello et al., 2019b). unfortunately, apart from providing an explicit variable for the labelled property, this yields no other easily interpretable structures, such as discovering latent variables that are correlated to the properties, as the model proposed in the current study does. this LINEBREAK is also an issue with other methods of structuring latent space that have been explored, such as batching data according to labels (kulkarni et al., 2015; zhang et al., 2020) or using a discriminator network in a non-generative model (lample et al., 2017). some researchers addressed this problem by introducing the architecture bias through a two-way factored autoencoder and realize the supervision based on a pair-wise contrastive loss (gyawali et al., 2019). other researchers addressed this problem by linking latent variables with observed labels through adversarial learning (creswell et al., 2017; edwards & storkey, 2015; ganin et al., 2016; mathieu et al., 2016). the most relevant work for our purpose is csvae (klys et al., 2018), where a subset of latent variables are correlated with binary properties via an adversarial learning. all the above works can not handle multiple continuous-valued properties due to their strict assumptions on the distribution of properties. LINEBREAK data manipulation and generation. here, trained machine learning models are utilized to manipulate and generate data in a controllable way with the desired properties, which is especially useful for applications in the image domain. several works have specifically considered transferring attributes in images, which is the same goal as that in the casve. these earlier works (zhou et al., 2017; xiao et al., 2017; 2018) all transfer attributes from a source image onto a target image. these models can only perform categorical attribute transformation between images (e.g., “splice the beard style of image a onto image b”), but only through interpolation between existing images. once trained, our proposed model can generate an objects with any value of a certain property (either observed or unobserved during training) that can be encoded in the subset of latent variables. LINEBREAK property controllable vae LINEBREAK problem formulation LINEBREAK suppose we are given a dataset d where each data instance is (x, y) with x ∈ rn and y = {yk ∈ k r} k=1 to represent k properties of interest of x. for example, if x is a molecule, then we may have properties of interest, such as clogp and clogs. we assume that the data (x, y) are generated by some random process from continuous latent random variables (z, w). each variable in w controls one of the properties of interest in y, while the variables in z control all the other aspects of x. LINEBREAK our goal is to learn such a generative model involving (x, y) and (z, w), where the subset of variables (i.e., z) are disentangled from subset w, and the variables inside w are disentangled from each other. once this model has been learned, then we can expect different elements of variables in w to control different properties of interest, which is a highly desirable goal for many data generation downstream tasks. for example, we may want to decrease the value of a specific property (e.g., protein energy) by changing the value of the corresponding element in w. it is also possible to directly set a desired property value (e.g., the mass of a molecule) and then generate the corresponding x with this target value (i.e., a molecule with the target mass value). LINEBREAK overall objective LINEBREAK in this section, we first introduce the bayesian variational inference of pcvae. then we introduce the group-wise and property-wise disentanglement terms as part of the overall objective. following this, an invertibility constraint is introduced to enforce mutual dependence between each propertylatent variable pair. at last, pcvae is extended to capture and control multiple correlated properties. LINEBREAK 3.2.1 bayesian variational inference of pcvae the goal in section 3.1 requires us to not only model the dependence between x and (w, z) for latent representation learning and data generation, but also model the dependence between y and w for property manipulation. we propose to achieve this by maximizing a form of variational lower bound on the joint log likelihood p(x, y) of our model. given an approximate posterior q(z, w∣x, y), we can use the jensen’s equality to obtain the variational lower bound of p(x, y) as: LINEBREAK log p(x, y) = log eq(z,w∣x,y)[p(x, y, w, z)/q(z, w∣x, y)] LINEBREAK (1) the joint likelihood log p(x, y, w, z) can be decomposed as log p(x, y∣z, w) + log p(z, w). we have two assumptions: (1) w only encodes the information from y, namely, x and y are conditionally independent given w (i.e., x ⊥ y∣w); (2) z is independent from w and y, namely z ⊥ w LINEBREAK ≥ eq(z,w∣x,y)[log p(x, y, w, z)/q(z, w∣x, y)]. LINEBREAK and z ⊥ y, which is equal to y ⊥ z∣w (see derivation in appendix a.3). first, based on the two assumptions, we can get x ⊥ y∣(z, w) (see derivation in appendix a.4). thus, we have log p(x, y∣z, w) = log p(x∣z, w) + log p(y∣z, w) . then, based on the assumption y ⊥ z∣w, we can have log p(y∣z, w) = log p(y∣w). then we get log p(x, y∣z, w) = log p(x∣z, w) + log p(y∣w). to explicitly represent the dependence between x and (z, w) as well as the dependence between y and w, we can parameterize the joint log-likelihood as log pθ,γ(x, y, w, z) with θ and γ as: LINEBREAK log pθ,γ(x, y, w, z) = log pθ(x∣z, w) + log p(z, w) + log pγ(y∣w). LINEBREAK given the condition that a parameterized qφ(z, w∣x, y) = qφ(z, w∣x) = qφ(z∣x)qφ(w∣x) (since the information on y is included in x), by taking eq. 2 into the above variational lower bound term in eq. 1, we obtain the negative part as an upper bound on − log pθ,γ(x, y) (as shown in the right sub-figure of figure 1(d)): LINEBREAK l1 = − eqφ(z,w∣x)[log pθ(x∣z, w)] − eqφ(w∣x)[log pγ(y∣w)] + dkl(qφ(z, w∣x)∣∣p(z, w)) LINEBREAK this gives us the proposed bayesian variational inference of pcvae. the detailed derivation of eq. 3 can be found in appendix a.1. as there are k properties of interest in y which are assigned and disentangled by the latent variables in w, the second term in eq. 3 can be detailed as ∑k k LINEBREAK eqφ(w∣x)[log pγ(yk∣wk)]. LINEBREAK 3.2.2 group-wise and property-wise disentanglement LINEBREAK considering that the above derivation is conditional on two requirements: (1) z is independent from w and y and (2) the variables in w are independent from each other, while in practice minimizing the above objective l1 will not imply that our model will satisfy these conditions. we therefore propose to further penalize the novel group-wise- and property-wise disentanglement terms. LINEBREAK we first decompose the kl (kullback-leibler) divergence term in eq. 3 as: ep(x)[dkl(qφ(z, w∣x)∣∣p(z, w))] = dkl(qφ(z, w, x) ∥ q(z, w)p(x)) dkl(q(zi) ∥ p(zi)) + ∑ + dkl(q(z, w) ∥ ∏ LINEBREAK i,j LINEBREAK + ∑ i LINEBREAK dkl(q(wj) ∥ p(wj)) LINEBREAK j LINEBREAK the second term in the right of the above equation is referred to as the total correlation (tc), as defined by chen et al. (2018), which is one of many generalizations of mutual information to more than two random variables. the detailed derivation of this decomposition can be found in appendix a.1. the penalty on this tc term forces the model to find statistically independent factors in the data distribution. a heavier penalty on this term induces a more disentangled representation among all variables in both z and w, but as stated in our problem formulation, we only require that (1) variables in w are disentangled to capture different properties, and (2) although z is disentangled from w, the latent variables inside z do not need to be disentangled from each other. roughly enforcing the disentanglement between all pairs of latent variables in w and z, as done by the existing tc term, can incur at least quadratic number of redundant optimization efforts and could lead to poor convergence. thus, we further decompose and analyze the tc term as: LINEBREAK dkl(q(z, w) ∥ ∏ LINEBREAK i,j LINEBREAK + dkl(q(w) ∥ ∏ LINEBREAK i LINEBREAK + dkl(q(z) ∥ ∏ i LINEBREAK q(zi)). LINEBREAK the first term in the right part of above decomposition enforces the independence between the two subsets of latent variables z and w, which we term group-wise disentanglement. the second term enforces the independences of variables inside w, ensuring that each latent variable can only capture the information of the single property assigned to it. we term this property-wise disentanglement. imposing a heavy penalty on these two terms can satisfy the two requirements mentioned above. we can now obtain the second part for the objective of pcvae by introducing the coefficient ρ as: l2 = dkl(q(z, w)∣∣q(z)q(w)) + ρdkl(q(w)∣∣ ∏ LINEBREAK q(wi)) LINEBREAK i LINEBREAK invertible constraint for property control LINEBREAK as stated in the problem formulation, an important goal for our new model is to generate a data point x that retains the original property value of a given property yk with great precision. more importantly, there should be no strict assumptions of parameters for p(yk) and q(wk∣yk). the most LINEBREAK straightforward way to do this is to model both the mutual dependence between yk and its relevant latent variable wk, namely, q(wk∣yk) and p(yk∣wk), which, however, could incur double errors in this two-way mapping. to address it, we innovatively propose instead an invertible function that mathematically ensures the exact recovery of wk given yk based on the following deduction. LINEBREAK in the above objective, we only explicitly model the conditional distribution of pγ(yk∣wk), hence, to achieve the precisely control of property via z and w, which is necessary to generate x with a certain property yk = m, we need to maximize the probability that yk = m as follows: LINEBREAK x ∼ pθ(x∣z, w), LINEBREAK z, w ← arg maxz∼p(z),w∼p(w) pγ(yk = m∣z, w), LINEBREAK which is equal to: LINEBREAK x ∼ pθ(x∣z, w), z ∼ p(z), wj,j /=k ∼ p(wj), wk ← arg maxwk∼p(wk) pγ(yk = m∣wk) where wk can be determined as follows (n in the followings denotes gaussian distribution): LINEBREAK wk ← arg maxwk∼p(wk) pγ(yk = m∣wk) = wk ← arg maxwk∼p(wk) log n (yk = m∣fk(wk; γ), σk) 2 = wk ← fk = wk ← arg maxwk∼p(wk) LINEBREAK −(m − fk(wk; γ)) LINEBREAK (m) LINEBREAK therefore, by learning an invertible function fk(wk; γ) from wk to the expectation of yk to model pγ(yk∣wk), we can easily achieve the desired precise control of the property. the above derivation are based on the assumption that y is a continuous-value. it can also be extended into the situation when y is discrete property, as detailed in appendix a.2. to learn an invertible function fk(wk; γ), we propose to leverage an invertible neural network. inspired by the invertible resnet (behrmann et al., 2019), we decompose the function fk(wk; γ) as fk(wk; γ) = ¯fk(wk; γ) + wk. as proved by behrmann et al. (2019), the sufficient condition that fk(wk; γ) is invertible is that lip( ¯fk) < 1, where lip( ¯fk) is the lipschitz-constant of ¯fk(wk; γ). thus, the overall objective of the proposed pcvae is finally formalized as: min θ,φ,γ subject to lip( ¯fk) < 1 for all k ∈ k, where α is the coefficient parameter. remark (monotonic relationship of property-latent variable pair). given the condition that fk(wk; γ) is invertible and continuous (lip( ¯fk) is less than 1), fk(wk; γ) is thus a monotonic function. this is very important to increase (or decrease) the value of property yk by increasing (or decreasing) wk, especially when the desired value of property is not available. LINEBREAK l1 + αl2 with LINEBREAK 3.2.4 generalization of handling correlated properties LINEBREAK as stated in the third challenge in section 1, there are usually several groups of properties involved in describing the data x and each group has several properties. these different groups are independent, but the properties within the same group are correlated. thus, we can further generalize the above objective framework to handle the correlated properties inside the same group. LINEBREAK mk the notation for yk is extended to yk = {yj,k ∈ r} j=1, signifying that there are mk correlated properties inside the k-th property group. the properties inside the same property set yk are correlated, while the different property sets (e.g. yp and yk) are independent. similarly, the notation for wk is extended as a group of latent variables to control the corresponding property set. for the properties inside the same group, we assume all depend on the same group of latent variables wk as LINEBREAK p(yj,k∣wk) = n (yj,k∣fk(wk; γ)[j], σj,k)), where fk(wk; γ)[j] denotes the j-th element of the output of fk(wk; γ). thus, the second term in eq. 3 can be generalized as ∑k k LINEBREAK eqφ(w∣x)[log pγ(yj,k∣wk)]. LINEBREAK ∑mk j LINEBREAK neural network architecture of pcvae LINEBREAK as shown in figure 1(d), there is an encoder (left-hand side of figure 1(d)) that models the distribution q(z, w∣x) and two decoders (right-hand side of figure 1(d)) that model the distribution p(y∣w) and p(x∣z, w). to implement the encoder and decoders in the first objective (i.e., l1), we use multi-perceptions (mlps) , convolution neural networks (cnns) or graph neural networks (gnns) to represent the distributions over relevant random variables. LINEBREAK to implement the second part l2, it is necessary to calculate the group-wise and property-wise disentanglement terms. noting that the calculation of the density q(z), q(w) and q(wi) in groupwise and property-wise disentanglement terms depends on the entire data space. as such, it is inaccessible to compute it exactly during training. thus, as the same operation conducted by chen et al. (2018), we utilize the na¨ıve monte carlo approximation based on a mini-batch of samples to underestimate q(z), q(w) and q(wk). the detailed operation is described in appendix b.3. LINEBREAK to implement the invertible constraint and model the distribution of pγ(yk∣wk), we utilize mlps to model the function ¯fk(⋅). since the function ¯fk(⋅) modeled by mlps is a composition of contractive nonlinearities (e.g., relu, elu, tanh) and linear mappings, based on the definition of lipschitzconstant we have lip( ¯fk) < 1 if ∥ wl ∥2< 1 for l ∈ l, where wl refer to the weights of the l-th layer in ¯fk, ∥ ⋅ ∥2 denotes the spectral norm, and l refers to the number of layer in the mlps. to realize the above constraint on weights of neural networks, we propose to use the spectral normalization for each layer of mlps, as introduced by behrmann et al. (2019). LINEBREAK 3.4 precisely property controllable generation our proposed model can be applied to an important downstream task, namely precisely property controllable generation. given the value of a required property yk, the goal of property controllable generation is to generate a data x which holds the same value as this desired property. to achieve this, three steps are conducted: (1) infer the value of wk based on the well-trained neural network ¯fk(⋅) and the given property yk via fixed-point iteration by following wi+1 ∶= yk − ¯fk(wi k; γ), where k is the updated latent variable at the i-th iteration step and w0 wi k = yk; (2) randomly sample the values of z and the remaining variables in w from their prior distributions (i.e., gaussian distribution) to obtain all the latent variables; and (3) generate a data x using the decoder based on the latent variables that are inferred from the previous two steps. LINEBREAK k LINEBREAK experiment LINEBREAK this section reports the results of the qualitative and quantitative evaluation carried out to test the performance of the proposed model on two datasets in two domains, namely images and molecules. all experiments were conducted on a 64-bit machine with an nvidia gpu (gtx 1080 ti, 11016 mhz, 11 gb gddr5). the architectures and hyper-parameters can be found in appendix b. the code for the proposed pcvae is available at:https://github.com/xguo7/pcvae. LINEBREAK experiment setup
| 5
|
[
108.249,
312.1260784,
218.7037185,
322.0886784
] |
lq62uWRJjiY.pdf
| 2,023
| 2
|
LINEBREAK adaptive budget allocation for parameterefficient fine-tuning LINEBREAK qingru zhang†∗, minshuo chen‡, alexander bukharin†, pengcheng he⋄, yu cheng⋄, weizhu chen⋄ and tuo zhao† †georgia institute of technology ‡princeton university ⋄microsoft azure ai qingru.zhang,abukharin3,tourzhao { [email protected] penhe,yu.cheng,wzchen { LINEBREAK @gatech.edu } LINEBREAK @microsoft.com LINEBREAK abstract LINEBREAK fine-tuning large pre-trained language models on downstream tasks has become an important paradigm in nlp. however, common practice fine-tunes all of the parameters in a pre-trained model, which becomes prohibitive when a large number of downstream tasks are present. therefore, many fine-tuning methods are proposed to learn incremental updates of pre-trained weights in a parameter efficient way, e.g., low-rank increments. these methods often evenly distribute the budget of incremental updates across all pre-trained weight matrices, and overlook the varying importance of different weight parameters. as a consequence, the finetuning performance is suboptimal. to bridge this gap, we propose adalora, which adaptively allocates the parameter budget among weight matrices according to their importance score. in particular, adalora parameterizes the incremental updates in the form of singular value decomposition. such a novel approach allows us to effectively prune the singular values of unimportant updates, which is essentially to reduce their parameter budget but circumvent intensive exact svd computations. we conduct extensive experiments with several pre-trained models on natural language processing, question answering, and natural language generation to validate the effectiveness of adalora. results demonstrate that adalora manifests notable improvement over baselines, especially in the low budget settings. our code is publicly available at https://github.com/ qingruzhang/adalora. LINEBREAK introduction LINEBREAK pre-trained language models (plms) have manifested superior performance in various natural language processing tasks (devlin et al., 2019; liu et al., 2019; he et al., 2021b; radford et al., 2019; brown et al., 2020). the most common way to adapt pre-trained models to down-stream tasks is to fine-tune all the parameters (full fine-tuning, qiu et al. (2020); raffel et al. (2020)). however, pre-trained models typically incurs large memory footprint. for example, bert model (devlin et al., 2019) consists up to 300 million parameters; t5 (raffel et al., 2020) comprises up to 11 billion parameters and gpt-3 (brown et al., 2020) contains up to 175 billion parameters. when building a nlp system upon these pre-trained models, we usually handle multiple tasks that arrive simultaneously (radford et al., 2019). given a large number of down-stream tasks, full fine-tuning requires that each task maintains a separated copy of large models. the resulting memory consumption is prohibitively expensive. LINEBREAK to address this issue, researchers have proposed two main lines of research to reduce the fine-tuning parameters, while maintaining or even improving the performance of plms. specifically, one line of research focuses on adding small neural modules to plms and fine-tune only these modules for each task – the base model is kept frozen and shared across tasks. in this way, only a small number of task-specific parameters are introduced and updated, greatly enhancing the practicality of large models. for example, adapter tuning (houlsby et al., 2019; rebuffi et al., 2017; pfeiffer et al., 2020; LINEBREAK ∗work was done during qingru zhang’s internship at microsoft azure ai. LINEBREAK (a) selected weight matrix LINEBREAK (b) selected layers LINEBREAK figure 1: given the total trainable parameters as 0.28m, we apply lora only to selected weight matrices (left) or selected layers (right) of debertav3-base and compare the fine-tuning performance on mnli-m. figure 1a: we only fine-tune a selected type of weight matrix of every transformer layer, including query/key/value projection (wq, wk, wv), output projection (wo) in the self-attention, and two weight matrices (wf1 , wf2 ) in two-layer ffns. in figure 1b, we apply lora to every weight matrix of the selected layers. LINEBREAK he et al., 2022) inserts small neural modules called adapters between the layers of the base model. prefix tuning (li & liang, 2021) and prompt tuning (lester et al., 2021) attach additional trainable prefix tokens to the input or hidden layers of the base model. these methods have shown to achieve comparable performance to full fine-tuning, while only updating less than 1% of the original model parameters, significantly releasing the memory consumption. LINEBREAK another line of research proposes to model the incremental update of the pre-trained weights in a parameter-efficient way, without modifying the model architecture (zaken et al., 2021; guo et al., 2020; hu et al., 2022). given a pre-trained weight matrix1 w (0), for example, diff pruning (guo et al., 2020) models its incremental update ∆ as a sparse matrix. diff pruning initializes ∆ as the same dimension as w (0) and then prunes ∆ element-wise based on the magnitude of the entries. as such, diff pruning can increase the parameter efficiency substantially by adaptively retaining important updates and pruning unimportant ones. nonetheless, diff pruning has several limitations. first, it relies on low-level implementation to speed up the computation of unstructured sparse matrices, which is not well supported by existing deep learning frameworks. therefore, we have to store ∆ as a dense matrix during training. second, it needs to update every entry of ∆ with their gradients and then prune them. this results in similar computational cost as full fine-tuning (guo et al., 2020). LINEBREAK to overcome these drawbacks, hu et al. (2022) propose a method named lora, which parameterizes ∆ as a low-rank matrix by the product of two much smaller matrices: LINEBREAK w = w (0) + ∆ = w (0) + ba, LINEBREAK rr×d2 and b LINEBREAK rd1×r with r LINEBREAK where w (0), ∆ . during fine-tuning, only } a and b are updated. the rank r is chosen to be much smaller than the dimension of w (e.g., r = 8 when d1 = d2 = 1024). with less than 0.5% additional trainable parameters, the training overhead can be reduced up to 70%, compared to full fine-tuning. however, lora achieves comparable or even better performance than full fine-tuning (hu et al., 2022). meanwhile, the product of two samll matrices is more friendly to implement and deploy than unstructured sparse matrices in diff pruning. lora still has limitations as it prespecifies the rank r of each incremental matrix ∆ identical. this ignores the fact that the importance of weight matrices varies significantly across modules and layers when fine-tuning pre-trained models. to illustrate this point, we present an concrete example in figure 1. we compare the performance of lora when fine-tuning specific modules or layers with the same number of trainable parameters. figure 1a shows that fine-tuning feed-forward networks (ffn) achieves better performance than self-attention modules. in addition, figure 1b demonstrates that weight matrices in top layers are more important than those in bottom layers. LINEBREAK adding more trainable parameters to the critical weight matrices can lead to better model performance. in contrast, adding more parameters to those less important weight matrices yields very marginal gains or even hurt model performance. given the parameter budget, i.e., the number of total trainable parameters, we always prefer to allocate more parameters to those important modules. distributing the budget evenly to all weight matrices/layers, like lora and other methods (e.g., adapter and prefix tuning), often gives suboptimal performance. to this end, a natural question is: LINEBREAK how can we allocate the parameter budget adaptively according to importance of modules to improve the performance of parameter-efficient fine-tuning? LINEBREAK 1unless specified otherwise, we use w (0) to denote any pre-trained weight matrix. LINEBREAK to answer this question, we propose a new method – adalora (adaptive low-rank adaptation), which dynamically allocates the parameter budget among weight matrices during lora-alike finetuning. specifically, adalora adjusts the rank of incremental matrices to control their budget. critical incremental matrices are assigned with high rank such that they can capture more fine-grained and task-specific information. less importance ones are pruned to have lower rank to prevent overfitting and save the computational budget. there are some methods to control the rank of matrices in the existing literature of matrix approximation (cai et al., 2010; koltchinskii et al., 2011; toh & yun, 2010). most of them directly compute singular value decomposition (svd) of a matrix and then truncate the smallest singular values. such an operation can manipulate the rank explicitly and, more importantly, minimize the difference between the resulting matrix and the original matrix. however, for fine-tuning large models, it becomes prohibitively expensive to iteratively apply svd for a large number of high-dimensional weight matrices. therefore, instead of computing svd exactly, we parameterize ∆ as ∆ = p λq to mimic svd. the diagonal matrix λ contains singular values while the orthogonal matrices p and q represent left/right singular vectors of ∆. to regularize the orthogonality of p and q, an additional penalty is added to training loss. such a parameterization avoids the intensive computations of svd. besides, another advantage is that we only need to drop the unimportant singular values while the singular vectors are maintained. this preserves the possibility of future recovery and stabilizes the training. see a detailed comparison to lora in section 3. based on our svd parameterization, adalora dynamically adjusts the rank of ∆ = p v q by importance scoring. specifically, we divide the incremental matrix p λq into triplets, where each i contains the i-th singular value and the corresponding singular vectors. to quantify the triplet importance of triplets, we propose a novel importance metric, which takes account of the contribution i to the model performance (sanh et al., 2020; liang et al., 2021; zhang et al., of every entry in 2022). triplets with low importance scores are granted low priority and hence the singular values are zeroed out. triplets with high importance are retained for fine-tuning. moreover, we also propose a global budget scheduler to facilitate the training. in particular, we start from an initial parameter budget, which is slightly higher than the final budget, and then gradually reduce it until matching the target. such a scheduler can improve the training stability and model performance. please see section 3 for a detailed description of our importance metric and budget scheduler. LINEBREAK g LINEBREAK g LINEBREAK we conduct extensive experiments on a wide range of tasks and models to demonstrate the effectiveness of adalora. specifically, we evaluate the performance using debertav3-base (he et al., 2021a) on natural language understanding (glue, wang et al. (2019)) and question answering (squadv1, rajpurkar et al. (2016) and squadv2, rajpurkar et al. (2018)) datasets. we also apply our methods to bart-large (lewis et al., 2019) and evaluate the performance on natural language generation (xsum, narayan et al. (2018) and cnn/dailymail, hermann et al. (2015)) tasks. we show adalora consistently outperforms the baseline, especially under low budget settings. for example, with less than 0.1% trainable parameters of full fine-tuning, adalora achieves a 1.2% f1 improvement on the squad2.0 dataset compared with state-of-the-art approaches. LINEBREAK background LINEBREAK transformer-based models. a typical transformer model consists of l stacked blocks, where each block contains two submodules: a multi-head attention (mha) and a fully connected ffn. given the input sequence x LINEBREAK rn×d, mha performs the attention function in parallel h heads: (cid:112) LINEBREAK mha (x) = concat(head1, ..., headh)wo, LINEBREAK headi = softmax rd×d is an output projection and wqi , wki, wvi ∈ LINEBREAK rd×dh are query, key and value where wo projections of head i. dh is typically set to d/h. the other important module is a ffn which consists of two linear transformations with a relu activation in between: ffn(x) = relu(xwf1 + rdm×d. finally, a residual connection is used rd×dm and wf2 ∈ b1)wf2 + b2, where wf1 ∈ followed by a layer normalization (ba et al., 2016). low rank adaptation. lora (hu et al., 2022) models the incremental update of the pre-trained weights by the product of two small matrices. for h = w (0)x, the modified forward pass is: LINEBREAK xwqi(xwki)⊤/ LINEBREAK dh LINEBREAK xwvi, LINEBREAK h = w (0)x + ∆x = w (0)x + bax, LINEBREAK where w (0), ∆ . a typically adopts a } ∈ random gaussion initialization while b is initialized with zero to have ∆ = 0 at the beginning of LINEBREAK rd1×r with r LINEBREAK rr×d2 and b LINEBREAK training. we further denote ai∗ as the i-th row of a, b∗i as the i-th column of b, and } as the i-th doublet. hu et al. (2022) only apply lora to query and value projections (i.e, wq and wv) in the mhas. he et al. (2022) extend it to weight matrices of ffns (i.e, wf1 and wf2), leading to the performance improvement . meanwhile, they propose a unified view of various efficient tuning methods including adapter tuning, prefix tuning and lora. LINEBREAK ai∗, b∗i LINEBREAK g LINEBREAK i = LINEBREAK adalora method LINEBREAK our method contains two important components: (i) svd-based adaptation, which formulates the incremental matrices in the form of singular value decomposition; (ii) importance-aware rank allocation, which prunes redundant singular values based on our newly-designed importance metric. LINEBREAK svd-based adaptation LINEBREAK as mentioned in section 1, we propose to parameterize the incremental updates of the pre-trained weight matrices in the form of singular value decomposition: LINEBREAK λi { LINEBREAK p∗i, λi, qi∗ LINEBREAK 1≤i≤r with r LINEBREAK w = w (0) + ∆ = w (0) + p λq, LINEBREAK where p matrix λ i = LINEBREAK rd1×r and q ∈ rr×r contains the singular values LINEBREAK (3) rr×d2 represent the left/right singular vectors of ∆ and the diagonal min(d1, d2). we further denote } as the triplet containing the i-th singular value and vectors. in practice, since g λ is diagonal, we only need to save it as a vector in rr. λ is initialized with zero while p and q adopt a random gaussian initialization to ensure ∆ = 0 at the beginning of training. to enforce the orthogonality of p and q, i.e., p ⊤p = qq⊤ = i, we utilize the following regularizer2: p ⊤p LINEBREAK i (4) − in our method, λ is iteratively pruned to adjust the rank after each gradient decent step. as mentioned in section 1, one can directly compute svd for every ∆ to manipulate singular values. the computational complexity, however, is o(min(d1, d2)d1d2). it becomes extremely expensive to iteratively apply svd for a large number of high-dimensional incremental matrices. in contrast, our parameterization avoids intensive svd computation, greatly releasing the computational overhead. LINEBREAK qq⊤ ∥ LINEBREAK r(p, q) = LINEBREAK i LINEBREAK we remark that one can also apply structured pruning to lora to control the rank (i.e., prune ba doublet-wise in (1)), whereas it has the following disadvantages. first, when a doublet is measured as unimportant, we have to prune all of its elements. it makes scarcely possible to reactivate the pruned doublets as their entries are all zeroed out and not trained. in contrast, adalora only masks out the singular values based on (3) while the singular vectors are always maintained. it preserves the potential of future recovery for the triplets dropped by mistake. second, a and b of lora are not orthogonal, meaning the doublets can be dependent with each other. discarding the doublets can incur larger variation from the original matrix than truncating the smallest singular values. therefore, the incremental matrices are often altered dramatically after each step of rank allocation, which causes training instability and even hurts generalization. to demonstrate this point, we present an ablation study in section 4.4, which compares adalora with structured pruning for lora. LINEBREAK importance-aware rank allocation LINEBREAK we apply the svd-based adaptation (3) to every weight matrix including wq, wk, wv, wf1 and wf2 of each transformer layer. in order to control the budget, we iteratively prune singular values in correspondence to their importance score during the training. for clear reference, we use k to index the incremental matrix, i.e., ∆k = pkλkqk for k = 1, . . . , n, where n is the number of adapted weight matrices. we denote the i-th triplet of ∆k as pk,∗i, λk,i, qk,i∗ and its g { n n importance score as sk,i. we further denote the parameter sets pk k=1, k=1, } } { ). with the regularization (4), the training objective k=1 r(pk, qk), where γ > 0 is the regularization k for LINEBREAK n ( qk , k=1 and training cost as ) + γ (cid:80)n q } { p e ) = , is given by coefficient. at the t-th step, we first take a stochastic gradient step to update p (t) k = 1, . . . , n. specifically, for λ(t) k ˜λ(t) k = λ(t) LINEBREAK k and q(t) LINEBREAK k,i = = LINEBREAK k , λ(t) LINEBREAK } λk { LINEBREAK (t)), LINEBREAK ( p LINEBREAK c q LINEBREAK (t), LINEBREAK (t), LINEBREAK q LINEBREAK q LINEBREAK p LINEBREAK p LINEBREAK l LINEBREAK e LINEBREAK e LINEBREAK e LINEBREAK c LINEBREAK k − LINEBREAK λk l LINEBREAK ( p LINEBREAK e LINEBREAK q LINEBREAK 2we present the experiments in appendix i to verify the effectiveness of the regularization. LINEBREAK where η > 0 is learning rate. then, given importance score s(t) following LINEBREAK k , the singular values are pruned LINEBREAK t LINEBREAK (˜λ(t) LINEBREAK k , s(t) LINEBREAK k ), with LINEBREAK t LINEBREAK (˜λ(t) LINEBREAK k , s(t) LINEBREAK k )ii = LINEBREAK k,ii s(t) LINEBREAK k,i is in the top-b(t) of s(t), otherwise, LINEBREAK s(t) k,i} { LINEBREAK λk,i | LINEBREAK where s(t) = 1≤k≤n,1≤i≤r contains the importance score of all triplets. here b(t) is the budget of remaining singular values at the t-th step, which we explain more in section 3.3. in this way, we leave more budget to the incremental matrices of higher priority by pruning the singular values of less important ones. in the sequel, we introduce several options to design the importance score. magnitude of singular values is the most straightforward way to quantify the importance of every triplet, i.e., sk,i = . in this way, only the least significant singular values are discarded. it | minimizes the deviation from the original matrix and further stabilizes the training. many existing methods use this criterion to control the rank of matrix (cai et al., 2010; koltchinskii et al., 2011; toh & yun, 2010). however, we remark that such a simple metric cannot properly quantify the contribution of parameters to model performance. sensitivity-based importance is another option for importance scoring, which quantifies the sensitivity of parameters to the training loss (molchanov et al., 2019; sanh et al., 2020; liang et al., 2021; zhang et al., 2022). the prior work, however, leverages the sensitivity to quantify the importance of single entries and applies it for unstructured pruning that prunes weights element-wise. when it turns to our case, we have to design a new metric as the triplets are discarded group-wise. every entry’s sensitivity ought to be considered and properly combined to quantify the overall contribution of the triplet to model performance. therefore, we propose a newly-designed importance metric in account k,i: of both the singular value and vectors in triplet LINEBREAK sk,i = s(λk,i) + LINEBREAK s(pk,ji) + LINEBREAK s(qk,ij), LINEBREAK where we calculate the mean importance of pk,∗i and qk,i∗ such that sk,i does not scale with the ) is a specific importance function for single entries. we can k,i. here s( number of parameters in g · ), which is defined as the magnitude of the gradient-weight product: adopt the sensitivity for s( · LINEBREAK wij | where wij is any trainable parameter. (8) essentially approximates the change in loss when a parameter is zeroed out. if the removal of a parameter has a large influence, then the model is sensitive to it and we should retain it (molchanov et al., 2019; liang et al., 2021; zhang et al., 2022). LINEBREAK wij l| LINEBREAK i(wij) = LINEBREAK however, zhang et al. (2022) point out that the sensitivity in (8) is not yet a reliable importance indicator. such a score is estimated on the sampled mini batch. the stochastic sampling and complicated training dynamics incur high variability and large uncertainty for estimating the sensitivity with (8). therefore, zhang et al. (2022) propose to resolve this issue by sensitivity smoothing and uncertainty quantification: LINEBREAK (t) LINEBREAK (t) LINEBREAK i LINEBREAK u LINEBREAK (wij) =β1i LINEBREAK (wij) + (1 LINEBREAK (wij) =β2u LINEBREAK (wij) + (1 LINEBREAK β1)i (t)(wij) (cid:12) (cid:12)i (t)(wij) (cid:12) β2) LINEBREAK (t) LINEBREAK i LINEBREAK (t) LINEBREAK where 0 < β1, β2 < 1. i the uncertainty term quantified by the local variation between i (t) and i (t) importance as the product between i LINEBREAK and u LINEBREAK (t) LINEBREAK is the smoothed sensitivity by exponential moving average and u LINEBREAK (t) LINEBREAK (t) LINEBREAK is . then they define the LINEBREAK , which can be another option for s( · LINEBREAK s(t)(wij) = i LINEBREAK (t) LINEBREAK (wij) LINEBREAK (t) LINEBREAK (wij). LINEBREAK u LINEBREAK we present a detailed ablation study in section 4.4 to compare the performance of different importance metrics. we find the proposed metric (7) based on the sensitivity variant (11) generally performs best. we summarize the detailed algorithm in algorithm 1 presented in appendix a. LINEBREAK global budget scheduler
| 5
|
[
108.249,
697.3765094,
262.0726564,
707.3391094
] |
vVJZtlZB9D.pdf
| 2,023
| 0
|
LINEBREAK a general framework for proving the equivariant strong lottery ticket hypothesis LINEBREAK damien ferbach∗ école normale supérieure, psl, and mila † [email protected] LINEBREAK christos tsirigotis ∗ université de montréal and mila LINEBREAK gauthier gidel ‡ université de montréal and mila LINEBREAK avishek (joey) bose mcgill university and mila LINEBREAK abstract LINEBREAK the strong lottery ticket hypothesis (slth) stipulates the existence of a subnetwork within a sufficiently overparameterized (dense) neural network that—when initialized randomly and without any training—achieves the accuracy of a fully trained target network. recent works by da cunha et al. (2022b); burkholz (2022a) demonstrate that the slth can be extended to translation equivariant networks—i.e. cnns—with the same level of overparametrization as needed for the slts in dense networks. however, modern neural networks are capable of incorporating more than just translation symmetry, and developing general equivariant architectures such as rotation and permutation has been a powerful design principle. in this paper, we generalize the slth to functions that preserve the action of the group g—i.e. g-equivariant network—and prove, with high probability, that one can approximate any g-equivariant network of fixed width and depth by pruning a randomly initialized overparametrized g-equivariant network to a g-equivariant subnetwork. we further prove that our prescribed overparametrization scheme is optimal and provides a lower bound on the number of effective parameters as a function of the error tolerance. we develop our theory for a large range of groups, including subgroups of the euclidean e(2) and symmetric group g ≤ sn—allowing us to find slts for mlps, cnns, e(2)-steerable cnns, and permutation equivariant networks as specific instantiations of our unified framework. empirically, we verify our theory by pruning overparametrized e(2)-steerable cnns, k-order gnns, and message passing gnns to match the performance of trained target networks. LINEBREAK introduction LINEBREAK many problems in deep learning benefit from massive amounts of annotated data and compute that enables the training of models with an excess of a billion parameters. despite this appeal of overparametrization many real-world applications are resource-constrained (e.g., on device) and demand a reduced computational footprint for both training and deployment (deng et al., 2020). a natural question that arises in these settings is then: is it possible to marry the benefits of large models—empirically beneficial for effective training—to the computational efficiencies of smaller sparse models? LINEBREAK a standard line of work for building compressed models from larger fully trained networks with minimal loss in accuracy is via weight pruning (blalock et al., 2020). there is, however, increasing empirical evidence to suggest weight pruning can occur significantly prior to full model convergence. frankle and carbin (2019) postulate the extreme scenario termed lottery ticket hypothesis (lth) where a subnetwork extracted at initialization can be trained to the accuracy of the parent network—in effect “winning" the weight initialization lottery. in an even more striking phenomenon ramanujan et al. (2020) find that not only do such sparse subnetworks exist at initialization but they already achieve impressive performance without any training. this remarkable occurrence termed the LINEBREAK ∗denotes equal contribution. †work done during an internship at mila ‡canada cifar ai chair LINEBREAK strong lottery ticket hypothesis (slth) was proven for overparametrized dense networks with no biases (malach et al., 2020; pensia et al., 2020; orseau et al., 2020), non-zero biases (fischer and burkholz, 2021), and vanilla cnns (da cunha et al., 2022b). recently, burkholz (2022b) extended the work of pensia et al. (2020) to most activation functions that behave like relu around the origin, and adopted another overparametrization framework as in pensia et al. (2020) such that the overparametrized network has depth l + 1 (no longer 2l). however, the optimality with respect to the number of parameters (theorem 2 in pensia et al. (2020)) is lost with this method. moreover, burkholz (2022a) extended the results of da cunha et al. (2022b) on cnns to non-positive inputs. LINEBREAK modern architectures, however, are more than just mlps and cnns and many encode data-dependent inductive biases in the form of equivariances and invariances that are pivotal to learning smaller and more efficient networks (he et al., 2021). this raises the important question: can we simultaneously get the benefits of equivariance and pruning? in other words, does there exist winning tickets for the equivariant strong lottery for general equivariant networks given sufficient overparametrization? LINEBREAK present work. in this paper, we develop a unifying framework to study and prove the existence of strong lottery tickets (slts) for general equivariant networks. specifically, in our main result (thm. 1) we prove that any fixed width and depth target g-equivariant network that uses a point-wise relu can be approximated with high probability to a pre-specified tolerance by a subnetwork within a random g-equivariant network that is overparametrized by doubling the depth and increasing the width by a logarithmic factor. such a theorem allows us to immediately recover the results of pensia et al. (2020); orseau et al. (2020) for mlps and of burkholz et al. (2022); da cunha et al. (2022b) for cnns as specific instantiations under our unified equivariant framework. furthermore, we prove that a logarithmic overparametrization is necessarily optimal—by providing a lower bound in thm. 2—as a function of the tolerance. crucially, this is irrespective of which overparametrization strategy is employed which demonstrates the optimality of theorem 1. notably, the extracted subnetwork is also g-equivariant, preserving the desirable inductive biases of the target model; such a fact is importantly not achievable via a simple application of previous results found in (pensia et al., 2020; da cunha et al., 2022b). LINEBREAK our theory is broadly applicable to any equivariant network that uses a pointwise relu nonlinearity. this includes the popular e(2)-steerable cnns with regular representations (weiler and cesa, 2019) (corollary 1) that model symmetries of the 2d-plane as well as subgroups of the symmetric group of n elements sn, allowing us to find slts for permutation equivariant networks (corollary 2) as a specific instantiation. we substantiate our theory by conducting experiments by explicitly computing the pruning masks for randomly initialized overparametrized e(2)-steerable networks, k-order gnns, and mpgnns to approximate another fully trained target equivariant network. LINEBREAK 2 background and related work notation and convention. for p ∈ n, [p] denotes {0, · · · , p − 1}. we assume that the starting index of tensors (vectors, matrices,...) is 0, e.g., wp,q , p, q ∈ [d]. g is a group, and ρ is its representation. we use | · | for the cardinality of a set, while (cid:76) represents the direct sum of vector spaces or group representations and ⊗ indicates the kroenecker product. we use ∗ to denote a convolution. we define x+, x− as x+ = max(0, x) and x− = min(0, x). ∥ · ∥ is a ℓp norm while |||·||| is its operator norm. for a basis b = {b1, . . . , bp}, we write |||b||| = max∥α∥∞≤1 |||(cid:80)p k=1 αkbk|||. σ(x) = x+ is the pointwise relu. finally, we take (ϵ, δ) ∈ [0, 1 2 ]2, and u([a, b]) is the uniform distribution on [a, b]. equivariance. we are interested in building equivariant networks that encode the symmetries induced by a given group g as inductive biases. to act using a group we require a group representation ρ : g → gl(rd), which itself is a group homomorphism and satisfies ρ(g1g2) = ρ(g1)ρ(g2) as gl(rd) is the group of d × d invertible matrices with group operation being ordinary matrix multiplication. let us now recall the main definition for equivariance: definition 2.1. let x ⊂ rdx and y ⊂ rdy be two sets with an action of a group g. a map f : x → y is called g-equivariant, if it respects the action, i.e., ρy (g)f (x) = f (ρx (g)x), ∀g ∈ g and x ∈ x . a map h : x → y is called g-invariant, if h(x) = h(ρx (g)x), ∀g ∈ g and x ∈ x . LINEBREAK as a composition of equivariant functions is equivariant, to build an equivariant network it is sufficient to take each layer fi to be g-equivariant and utilize a g-equivariant non-linearity (e.g. pointwise relu). given a vector space and a corresponding group representation we can define a feature space fi := (rdi, ρi). note that we can stack multiple such feature spaces in a layer, for example, the input feature space to an equivariant layer i can be written as ni blocks fni i LINEBREAK := (cid:76)ni LINEBREAK fi. LINEBREAK ni→ni+1 LINEBREAK i → fni+1 LINEBREAK ∈ rni×ni+1 , (p, q) ∈ [ni] × [ni+1]}, where each element κp,q LINEBREAK a g-equivariant basis is a basis of the space of equivariant linear maps between two vector spaces. we can decompose a g-equivariant linear map fi : fi → fi+1 in a corresponding equivariant basis bi→i+1 = {bi→i+1,k ∈ rdi×di+1, ∀k ∈ [|bi→i+1|]}. when working with stacks of ni (resp. ni+1) input (resp. output) feature spaces we may express the full equivariant basis by considering κni→ni+1 = {κp,q ni→ni+1 is a matrix with a single non-zero entry at position (p, q). then the basis for g-equivariant maps between fni i+1 can be written succinctly as the kronecker product between two basis elements κni→ni+1 ⊗ bi→i+1. some instances of g and fi are presented in tab. 2. for example, in the case of cnns with kernel size d2, the linear map f is a convolution where ni (resp. ni+1) are the number of input (resp. output) channels and κni→ni+1 ⊗bi→i+1 is the basis of convolutions of size d2 ×ni ×ni+1. related work on strong lottery tickets. winning slts approximate a target relu network f (x) by pruning an overparametrized relu network g(x) with weights in any given layer drawn i.i.d. from wi ∼ u([−1, 1]).1 our error metric of choice is the uniform approximation over a unit ball: maxx∈rd:||x||≤1 ||f (x) − ˆg(x)|| ≤ ϵ, where ˆg(x) is the subnetwork constructed from pruning g(x). let us first consider the case of approximating a single neuron wi ∈ [−1, 1] in some layer of f (x) with n i.i.d. samples x1, . . . , xn ∼ u([−1, 1]). if n = o(1/ϵ) then there exists a xi that is ϵ-close to wi (malach et al., 2020). a similar approximation fidelity can be achieved with an exponentially smaller number of samples by not relying on just a single xi but instead a subset whose sum approximates the target weight. lueker (1998); da cunha et al. (2022a) proved that n = o(log(1/ϵ)) random variables were sufficient for the existence of a solution to the random subset-sum problem (a subset s ⊆ {1, . . . , n} such that |wi − (cid:80) i∈s xi| ≤ ϵ). pensia et al. (2020) utilize the subset-sum approach for weights on dense networks resulting in a logarithmic overparametrization of the width of a layer in g(x). to bypass the non-linearity (relu) pensia et al. (2020) decompose the output activation σ(wx) = w+x+ + w−x− and approximate each term separately. with no additional assumption on the inputs (da cunha et al. (2022b) assume positive entries), this approach fails for equivariant networks as each entry of the output of an equivariant linear map is affected by multiple input entries. LINEBREAK slt for general equivariant nets LINEBREAK our results and proof techniques build upon the line of work by pensia et al. (2020), da cunha et al. (2022b), and burkholz (2022a). specifically, we rely on the subset-sum algorithm (lueker, 1998) to aid in approximating any given parameter of the target network. departing from prior work, the main idea used in our technical analysis is to prune an overparametrized equivariant network in a way that preserves equivariance, as applying subsetsum using da cunha et al. (2022b) construction may destroy the prunned network’s equivariance. LINEBREAK figure 1: general equivariant pruning method LINEBREAK challenges in adapting proof techniques. there are two major difficulties in adapting the tools first introduced in pensia et al. (2020) to g-steerable networks. in proving the slth for dense networks the relevant parameters that can be pruned are all the parameters of weight matrices, which can be intuitively understood as pruning in a canonical basis. however, such a strategy immediately fails for g-equivariant maps as the canonical basis is not generally g-equivariant, thus pruning in this basis breaks the structure of the network and its equivariance. in fact, as described in weiler and cesa (2019) a g-equivariant linear map consists of linearly combining the elements of the equivariant basis with learned combination coefficients which are the effective parameters of the g-equivariant model. to preserve equivariance we may only prune these parameters and not any weight in fi. however, this introduces a new complication as the interaction with the relu becomes more challenging. da cunha et al. (2022b) circumvent this in the special case of regular cnns by assuming only positive inputs. in contrast, our main technical lemma (lem. 1), introduces a construction that does not require such a restrictive assumption and generalizes the techniques of burkholz (2022a) to g-equivariant networks. LINEBREAK overparameterized network shape. we seek to approximate a single g-equivariant layer with two random overparameterized g-equivariant layers. we take the input ∥x∥ ≤ 1 to be LINEBREAK 1it will work with any distribution which contains a uniform distribution, e.g. gaussian, see §a LINEBREAK in a bounded domain to control the error which could diverge on unbounded domains. let fi i → fni+1 be the set of g-equivariant linear maps fni i+1 of the i-th layer in the target network. |||fi||| ≤ 1, is a specific realization of a target equivariant map that we then, fi ∈ fi s.t., will approximate—i.e. fi(x) = wf i (x). without any loss of generality, let the coefficients of wf i be such that |αk| ≤ 1 when decomposed in the basis κni→ni+1 ⊗ bi→i+1. concretely, i ||| ≤ 1(cid:9). we can now refi ∈ fi := (cid:8)wf k αkbk : bk ∈ κni→ni+1 ⊗ bi→i+1, |αk| ≤ 1, |||wf cursively apply the previous constructions to construct a desired g-equivariant target network f ∈ f of depth l ∈ n. analagously, we can define an atomic unit of our random overparameterized source model hi as the set of g-equivariant maps with one intermediate feature space (layer) f˜ni followed i by a relu. that is, any hi ∈ hi applied to an input x can be written as hi(x) = wh 2ix). in our construction, we choose wh 2i whose equivariant basis is κni→˜ni ⊗ bi→i where ˜ni is the overparametrization factor of the i-th layer. we assume bi→i contains the identity element, which is trivially equivariant. the basis coefficients of wh p→q,k, which refers to the coefficient of the k-th basis element in bi→i for the map between the p-th block of fni to the q-th block of i f˜ni p→q,k. i fig. 1 illustrates this construction after pruning the first layer for ni = ni+1 = 1 which leads to a “diamond" shape. we can finally apply the previous construction to build an overparametrized network h ∈ h of depth 2l. we summarize all the notation used in the rest of the paper in tab. 1. LINEBREAK 2i+1 can be decomposed in the basis κ˜ni→ni+1 ⊗ bi→i+1 with coefficients µ(i) LINEBREAK 2i are written as λ(i) LINEBREAK . similarly, wh LINEBREAK wh LINEBREAK 2i : fni LINEBREAK g-equivariant map i → f˜ni i → fni+1 i → fni+1 LINEBREAK 2i+1 : f˜ni i : fni LINEBREAK i LINEBREAK wf LINEBREAK wh LINEBREAK basis LINEBREAK basis coefficients LINEBREAK κni→˜ni ⊗ bi→i LINEBREAK λ(i) p→q,k , LINEBREAK p ∈ [ni], q ∈ [˜ni], k ∈ [|bi→i|] LINEBREAK κ˜ni→ni+1 ⊗ bi→i+1 LINEBREAK κni→ni+1 ⊗ bi→i+1 LINEBREAK µ(i) p→q,k , LINEBREAK α(i) LINEBREAK p→q,k , LINEBREAK p ∈ [˜ni], q ∈ [ni+1], k ∈ [|bi→i+1|] LINEBREAK p ∈ [ni], q ∈ [ni+1], k ∈ [|bi→i+1|] LINEBREAK table 1: summary of notation used to decompose each g-equivariant map in the source and target networks. LINEBREAK theoretical results LINEBREAK we first prove lemma 1 which states that with high probability a random overparametrized gequivariant network of depth l = 2 (fig. 1) can ϵ-approximate any target map in fi via pruning. LINEBREAK lemma 1. let hi ∈ hi be a random overparametrized g-equivariant network as defined above, with coefficients λ(i) p→q,k drawn from u([−1, 1]). further suppose that each ˜ni = c1ni log( nini+1 max(|bi→i+1|,|||bi→i+1|||) ) where c1 is a constant. then, with probability 1 − δ, for every target g-equivariant layer fi ∈ fi, one can find two pruning masks s2i, s2i+1 on the coefficients λ(i) p→q,k respectively such that: LINEBREAK p→q,k and µ(i) LINEBREAK p→q,k and µ(i) LINEBREAK min(ϵ,δ) LINEBREAK max x∈rdi×ni , ∥x∥≤1 LINEBREAK 2i)x) − fi(x)∥ ≤ ϵ . LINEBREAK proof sketch. we prune all non-identity coefficients of the basis decomposition of the first layer obtaining “diamond” shape (see fig. 1 for (ni = ni+1 = 1)) allowing us to bypass the pointwise relu. the two layers can now be used to approximate every weight of the target by solving independent subset-sum problems on the coefficients of the second layer. the full proof is provided in §b.1. LINEBREAK to approximate any f in fi which is a g-equivariant target network of depth l and fixed width, we can now apply lemma 1 l-times to obtain our main theorem, whose proof is provided in §b.2. LINEBREAK p→q,k and µ(i) LINEBREAK theorem 1. let h ∈ h be a random overparametrized g-equivariant network with coefficients λ(i) p→q,k, for i ∈ [l] and indices p, q, k as defined in table 1, all drawn from u([−1, 1]). suppose that ˜ni = c2ni log( nini+1 max(|bi→i+1|,|||bi→i+1|||)l ), where c2 is a constant. then with probability 1 − δ, for every f ∈ f, one can find a collection of pruning LINEBREAK min(ϵ,δ) LINEBREAK masks s2l−1, . . . s0 on the coefficients λ(i) LINEBREAK p→q,k for every layer i ∈ [l] such that: LINEBREAK p→q,k and µ(i) 2l−1)σ (cid:0). . . σ((s0 ⊙ wh LINEBREAK 0 )x)(cid:1) − f (x)∥ ≤ ϵ . LINEBREAK max x∈rd0×n0 , ∥x∥≤1 LINEBREAK we recover a similar overparametrization as pensia et al. (2020) with respect to the width of h. however, the significant improvement provided by this result is that, since we do not prune dense nets but g-equivariant ones, the number of effective parameters in the overparametrized network is |bi→i+1|/didi+1 smaller than a dense net of the same width. in section 3.2 we make this difference explicit and show theorem 1 is optimal up to log factors not only with respect to the tolerance ϵ but also with respect to |bi→i+1|/didi+1 quantifying the expressiveness of g-equivariant networks. LINEBREAK lower bound on the overparametrization LINEBREAK when searching for equivariant winning tickets a natural question that arises is the optimality of the overparametrization factor ˜ni with respect to the tolerance ϵ. in the same vein as pensia et al. (2020) for mlps, we now prove under mild assumptions that, in the equivariant setting, ˜ni is indeed optimal (theorem 2). we will assume that our equivariant basis bi→i+1 has the following property: ∀fi ∈ span(bi→i+1) where fi = (cid:80) k αkbi→i+1,k we have: |||fi||| ≤ 1 =⇒ |αk| ≤ 1, k ≥ 0. note that this can be obtained by a rescaling of the basis elements. lastly, we also assume the existence of positive constants m1 and m2 such that |bi→i| ≤ m1|bi→i+1| and ni ≤ m2ni+1. these assumptions are relatively mild and hold in the practical situations described in tab. 2 (cf §b.3 for details). under these assumptions we achieve the following (tight) lower bound. LINEBREAK theorem 2. let ˆhi be a network with θ parameters such that: LINEBREAK ∀fi ∈ fi, ∃si ∈ {0, 1}θ such that LINEBREAK max x∈rdi×ni , ∥x∥≤1 LINEBREAK ∥(si ⊙ ˆhi)(x) − fi(x)∥ ≤ ϵ . LINEBREAK then θ is at least ω (cid:0)nini+1|bi→i+1| log( 1 LINEBREAK ϵ )(cid:1) and ˜ni is at least ω(ni log (cid:0) 1 LINEBREAK (cid:1)) in theorem 1. LINEBREAK proof idea. the full proof is provided in §b.3 and relies on a counting argument to compare the number of pruning masks and functions in fi within a distance of at least 2ϵ of each other. LINEBREAK thm. 2 dictates that if we wish to approximate a g-equivariant network target network to ϵ-tolerance by pruning an overparametrized arbitrary network, the latter must have at least ω(nini+1|bi→i+1| log( 1 ϵ )) parameters. applying the above result to our prescribed overparametrization scheme in thm. 1 we find our proposed strategy is optimal with respect to ϵ and almost optimal with respect to |bi→i+1|. we incur a small extra log factor whose origin is discussed in §b.3. in the equivariant setting, the result in pensia et al. (2020) is far from optimal as their result gives guarantees on the pruning of dense nets with a similar width as the g-equivariant targets which incurs an increase by a factor didi+1/|bi→i+1| in the number of parameters. as a specific example, for overparametrized g-steerable networks (tab. 2), we have didi+1/|bi→i+1| = d2|g|. on images of shape r224×224×3 with g = c8, it corresponds to ≈ 4.105 fewer “effective" parameters than a dense network. finally, we note that thm. 2 makes no statement on which overparametrization strategy achieves such a lower bound. remarkably, the pruning strategy prescribed by thm. 1 recovers this optimal lower bound on ˜ni, meaning that, unsurprisingly, g-equivariant nets are the most suitable structure to prune. LINEBREAK slt for specific choices of g LINEBREAK in this section, we turn our focus to specific instantiations of our main theoretical results for different choices of groups. to apply theorem 1, one simply needs to specify the group g, the group representation ρ(g), and finally the feature space f. for instance, we can immediately recover the results for dense networks (pensia et al., 2020) by noticing g = {e} is the trivial group with a trivial action on rd (see the proof in §c). in table 2 below we highlight different g-equivariant architectures through the framework provided in §3 before proving each setting in the remainder of the section. LINEBREAK a case study with cnns LINEBREAK as a warmup, let us consider the case of vanilla cnns that possess translation symmetry. in this case, g = (z2, +) the group of translations of the plane and di = d2 where d2 is the size of a feature map LINEBREAK mlp LINEBREAK cnn LINEBREAK g LINEBREAK {e} LINEBREAK ρi LINEBREAK trivial LINEBREAK fi(x − t) LINEBREAK e(2)-cnn LINEBREAK ρreg(g)fi(g−1(x − t)) LINEBREAK fi r LINEBREAK , ρi) LINEBREAK |bi→i+1| ∨ |||bi→i+1||| LINEBREAK , ρi) LINEBREAK permutation LINEBREAK s(n) LINEBREAK xiσ(1),...,iσ(k),j LINEBREAK (rnki , ρi) LINEBREAK ˜b(ki + ki+1) ∨ (nki + 1) LINEBREAK instantiations of theorem 1 for different choices of g. mlp was proven in pensia et al. table 2: (2020), cnn was proven in da cunha et al. (2022b); burkholz (2022a). we note a ∨ b := max(a, b). at layer i. finally, ρi acts on the feature space rd2 by translating the coordinates of a point in the plane. the equivariant basis of fi in this setting (what we denoted bi→i+1 in the general case) are i ∈ rd2×ni×ni+1 that are built using the canonical basis and ni and ni+1 convolutions with kernels kf are the input/output channels. we can apply thm. 1 to achieve cor. 4 (see §d for details) which recovers burkholz (2022a, thm. 3.1) and is a strict generalization of the result by da cunha et al. (2022b). LINEBREAK 4.2 slt for e(2) steerable nets the euclidean group e(2) is the group of isometries of the plane r2 and is defined as the semi-direct product between the translation and orthogonal groups of two dimensions (r2, +) ⋊ o(2) with elements (t, g) ∈ e(2) being shifts and planar rotations or flips. the most general method to build equivariant networks for e(2) is in the framework of steerable g-cnn’s where filters are designed to be steerable with respect to the action of g (cohen and welling, 2017; weiler et al., 2018). concretely, steerable feature fields associate a d-dimensional feature vector to each point in a base space f : r2 → rd which transform according to their induced representation LINEBREAK ind(r2⋊g) LINEBREAK g LINEBREAK f (x) → LINEBREAK ind(r2⋊g) LINEBREAK g LINEBREAK (tg) · f
| 5
|
[
280.035,
405.3552556,
308.56368896,
415.3178556
] |
sPfB2PI87BZ.pdf
| 2,022
| 0
|
LINEBREAK mapping conditional distributions for domain adaptation under generalized target shift LINEBREAK matthieu kirchmeyer1,2, alain rakotomamonjy2,3, emmanuel de b´ezenac1, patrick gallinari1,2 1cnrs-isir, sorbonne university; 2criteo ai lab; 3universit´e de rouen, litis LINEBREAK abstract LINEBREAK we consider the problem of unsupervised domain adaptation (uda) between a source and a target domain under conditional and label shift a.k.a generalized target shift (getars). unlike simpler uda settings, few works have addressed this challenging problem. recent approaches learn domain-invariant representations, yet they have practical limitations and rely on strong assumptions that may not hold in practice. in this paper, we explore a novel and general approach to align pretrained representations, which circumvents existing drawbacks. instead of constraining representation invariance, it learns an optimal transport map, implemented as a nn, which maps source representations onto target ones. our approach is flexible and scalable, it preserves the problem’s structure and it has strong theoretical guarantees under mild assumptions. in particular, our solution is unique, matches conditional distributions across domains, recovers target proportions and explicitly controls the target generalization risk. through an exhaustive comparison on several datasets, we challenge the state-of-the-art in getars. LINEBREAK introduction LINEBREAK unsupervised domain adaptation (uda) methods (pan & yang, 2010) train a classifier with labelled samples from a source domain s such that its risk on an unlabelled target domain t is low. this problem is ill-posed and simplifying assumptions were considered. initial contributions focused on three settings which decompose differently the joint distribution over input and label x × y : covariate shift (covs) (shimodaira, 2000) with ps(y |x) = pt (y |x), ps(x) (cid:54)= pt (x), target shift (tars) (zhang et al., 2013) with ps(y ) (cid:54)= pt (y ), ps(x|y ) = pt (x|y ) and conditional shift (zhang et al., 2013) with ps(x|y ) (cid:54)= pt (x|y ), ps(y ) = pt (y ). these assumptions are restrictive for real-world applications and were extended into model shift when ps(y |x) (cid:54)= pt (y |x), ps(x) (cid:54)= pt (x) (wang & schneider, 2014; 2015) and generalized target shift (getars) (zhang et al., 2013) when ps(x|y ) (cid:54)= pt (x|y ), ps(y ) (cid:54)= pt (y ). we consider getars where a key challenge is to map the source domain onto the target one to minimize both conditional and label shifts, without using target labels. the current sota in gong et al. (2016); combes et al. (2020); rakotomamonjy et al. (2021); shui et al. (2021) learns domain-invariant representations and uses estimated class-ratios between domains as importance weights in the training loss. however, this approach has several limitations. first, it updates representations through adversarial alignment which is prone to well-known instabilities, especially on applications where there is no established deep learning architectures e.g. click-through-rate prediction, spam filtering etc. in contrast to vision. second, to transfer representations, the domain-invariance constraint breaks the original problem structure and it was shown that this may degrade the discriminativity of target representations (liu et al., 2019). existing approaches that consider this issue (xiao et al., 2019; li et al., 2020; chen et al., 2019) were not applied to getars. finally, generalization guarantees are derived under strong assumptions, detailed in section 2.3, which may not hold in practice. LINEBREAK in this paper, we address these limitations with a new general approach, named optimal sample transformation and reweight (ostar), which maps pretrained representations using optimal transport (ot). ostar proposes an alternative to constraining representation invariance and performs jointly three operations: given a pretrained encoder, (i) it learns an ot map, implemented as a neural network (nn), between encoded source and target conditionals, (ii) it estimates target proportions for sample reweighting and (iii) it learns a classifier for the target domain using source labels. LINEBREAK ostar has several benefits: (i) it is flexible, scalable and preserves target discriminativity and (ii) it provides strong theoretical guarantees under mild assumptions. in summary, our contributions are: LINEBREAK • we propose an approach, ostar, to align pretrained representations under getars. without constraining representation-invariance, ostar jointly learns a classifier for inference on the target domain and an ot map, which maps representations of source conditionals to those of target ones under class-reweighting. ostar preserves target discriminativity and experimentally challenges the state-of-the-art for getars. LINEBREAK • ostar implements its ot map as a nn shared across classes. our approach is thus flexible and has native regularization biases for stability. moreover it is scalable and generalizes beyond training samples unlike standard linear programming based ot approaches. LINEBREAK • ostar has strong theoretical guarantees under mild assumptions: its solution is unique, recovers target proportions and correctly matches source and target conditionals at the optimum. it also explicitly controls the target risk with a new wasserstein-based bound. LINEBREAK our paper is organized as follows. in section 2, we define our problem, approach and assumptions. in section 3, we derive theoretical results. in section 4, we describe our implementation. we report in section 5 experimental results and ablation studies. in section 6, we present related work. LINEBREAK proposed approach LINEBREAK in this section, we successively define our problem, present our method, ostar and its main ideas and introduce our assumptions, used to provide theoretical guarantees for our method. LINEBREAK problem definition LINEBREAK (cid:98)s and z LINEBREAK s , y(i) t }m LINEBREAK s )}n i=1 ∈ x m LINEBREAK denoting x the input space and y = {1, ... , k} the label space, we consider uda between a source s = (xs, ys, ps(x, y )) with labeled samples (cid:98)s = {(x(i) i=1 ∈ (xs × ys)n and a target t = (xt , yt , pt (x, y )) with unlabeled samples (cid:98)t = {x(i) t . we denote z ⊂ rd a latent space and g : x → z an encoder from x to z. zs and zt are the encoded source and (cid:98)t the corresponding training sets and z a random variable in this target input domains, z space. the latent marginal probability induced by g on d ∈ {s, t } is defined as ∀a ⊂ z, pg d(a) (cid:44) g#(pd(a))1. for convenience, py d(z). in all generality, latent conditional distributions and label marginals differ across domains; this is the getars assumption (zhang et al., 2013) made in feature space z rather than input space x , as in definition 1. getars is illustrated in figure 1a and states that representations from a given class are different across domains with different label proportions. operating in the latent space has several practical advantages e.g. improved discriminativity and dimension reduction. definition 1 (getars). getars is characterized by conditional mismatch across domains i.e. ∃j ∈ {1, ... , k}, ps(z|y = j) (cid:54)= pt (z|y = j) and label shift i.e. py LINEBREAK d ∈ rk denotes the label marginal pd(y ) and pd(z) (cid:44) pg LINEBREAK s (cid:54)= py t . LINEBREAK our goal is to learn a classifier in z with low target risk, using source labels. this is challenging as (i) target labels are unknown and (ii) there are two shifts to handle. we will show that this can be achieved with pretrained representations if we recover two key properties: (i) a map which matches source and target conditional distributions and (ii) target proportions to reweight samples by classratios and thus account for label shift. our approach, ostar, achieves this objective. LINEBREAK mapping conditional distributions under label shift LINEBREAK we now present the components in ostar, their objective and the various training steps. components the main components of ostar, illustrated in figure 1b, are detailed below. these components are learned and estimated using the algorithm detailed in section 4. they include: LINEBREAK • a fixed encoder g : x → z, defined in section 2.1. • a mapping φ : z → z, acting on source samples encoded by g. LINEBREAK 1f#ρ is the push-forward measure f#ρ(b) = ρ (cid:0)f −1(b)(cid:1), for all measurable set b. LINEBREAK (a) uda under getars in latent space z LINEBREAK (b) mapping & reweighting source samples with ostar LINEBREAK figure 1: illustration of our approach on a 2-class uda problem [better viewed in color]. (a) a pretrained encoder g defines a latent space z with labelled source samples ×◦ and unlabelled target samples ×◦ under conditional and label shift (getars). (b) we train a target classifier fn on a new domain n , where labelled samples ×◦ are obtained by (i) mapping source samples with φ acting on conditional distributions and (ii) reweighting these samples by estimated class-ratios py n /py s . φ n should estimate target proportions py should match source and target conditionals and py t . LINEBREAK • a label proportion vector py • a classifier fn : z → {1, ... , k} for the target domain in a hypothesis class h over z. LINEBREAK n on the simplex ∆k. LINEBREAK g encodes source and target samples in a latent space such that it preserves rich informaobjective tion about the target task and such that the risk on the source domain is small. g is fixed throughout training to preserve target discriminativity. φ should map encoded source conditionals in zs onto corresponding encoded target ones in zt to account for conditional shift; zn denotes the mapped space. py n ) define a new labelled domain in latent space n = (zn , yn , pn (z, y )) through a sample transformation and reweight operation of the encoded s domain, as illustrated in figure 1b. indeed, the pushforward by φ of encoded source conditionals defines conditionals in domain n , pφ LINEBREAK t to account for label shift. components (φ, py LINEBREAK n should estimate the target proportions py LINEBREAK n (z|y ): LINEBREAK ∀k, pφ LINEBREAK n (z|y = k) (cid:44) φ# LINEBREAK ps(z|y = k) LINEBREAK then, py LINEBREAK n weights each conditional in n . this yields a marginal distribution in n , pφ LINEBREAK n (z): LINEBREAK pφ n (z) (cid:44) LINEBREAK n pφ py =k LINEBREAK n (z|y = k) LINEBREAK finally, classifier fn is trained on labelled samples from domain n . this is possible as each sample in n is a projection of a labelled sample from s. fn can then be used for inference on t . we will show that it has low target risk when components φ and py n achieve their objectives detailed above. LINEBREAK training we train ostar’s components in two stages. first, we train g along a source classifier fs from scratch by minimizing source classification loss; alternatively, g can be tailored to specific problems with pretraining. second, we jointly learn (fn , φ, py n ) to minimize a classification loss in domain n and to match target conditionals and proportions with those in domain n . as target conditionals and proportions are unknown, we propose a proxy problem for (φ, py n ) to match instead latent marginals pt (z) and pφ n (z) (1). we solve this proxy problem under least action principle measured by a monge transport cost (santambrogio, 2015), denoted c(φ), as in problem (ot): LINEBREAK φ,py LINEBREAK min n ∈∆k subject to pφ LINEBREAK z∈z LINEBREAK k=1 n (z) = pt (z) LINEBREAK 2 ps(z|y = k)dz LINEBREAK (ot) LINEBREAK for any function φ e.g. parametrized by a nn, c(φ) is the transport cost of encoded source conditionals by φ. it uses a cost function, c(x, y) = (cid:107)x − y(cid:107)p 2, where without loss of generality p = 2. the optimal c(φ) is the sum of wasserstein-2 distances between source conditionals and their mappings. problem (ot) seeks to minimize c(φ) under marginal matching. we provide some further
| 2
|
[
108,
59.9860784,
504.0031456,
103.0448556
] |
9MO7bjoAfIA.pdf
| 2,023
| 1
|
LINEBREAK self-ensemble protection: training checkpoints are good data protectors LINEBREAK sizhe chen1,2, geng yuan2, xinwen cheng1, yifan gong2, minghai qin2, yanzhi wang2, xiaolin huang1∗ 1department of automation, shanghai jiao tong university 2department of electrical and computer engineering, northeastern university LINEBREAK abstract LINEBREAK as data becomes increasingly vital, a company would be very cautious about releasing data, because the competitors could use it to train high-performance models, thereby posing a tremendous threat to the company’s commercial competence. to prevent training good models on the data, we could add imperceptible perturbations to it. since such perturbations aim at hurting the entire training process, they should reflect the vulnerability of dnn training, rather than that of a single model. based on this new idea, we seek perturbed examples that are always unrecognized (never correctly classified) in training. in this paper, we uncover them by model checkpoints’ gradients, forming the proposed self-ensemble protection (sep), which is very effective because (1) learning on examples ignored during normal training tends to yield dnns ignoring normal examples; (2) checkpoints’ cross-model gradients are close to orthogonal, meaning that they are as diverse as dnns with different architectures. that is, our amazing performance of ensemble only requires the computation of training one model. by extensive experiments with 9 baselines on 3 datasets and 5 architectures, sep is verified to be a new state-of-the-art, e.g., our small ℓ∞ = 2/255 perturbations reduce the accuracy of a cifar-10 resnet18 from 94.56% to 14.68%, compared to 41.35% by the best-known method. code is available at https://github.com/sizhe-chen/sep. LINEBREAK introduction LINEBREAK large-scale datasets have become increasingly important in training high-performance deep neural networks (dnns). thus, it is a common practice to collect data online (mahajan et al., 2018; sun et al., 2017), an almost unlimited data source. this poses a great threat to the commercial competence of data owners such as social media companies since the competitors could also train good dnns from their data. therefore, great efforts have been devoted to protecting data from unauthorized use in model training. the most typical way is to add imperceptible perturbations to the data, so that dnns trained on it have poor generalization (huang et al., 2020a; fowl et al., 2021b). LINEBREAK existing data protection methods use a single dnn to generate incorrect but dnn-sensitive features (huang et al., 2020a; fu et al., 2021; fowl et al., 2021b) for training data by, e.g., adversarial attacks (goodfellow et al., 2015). however, the data protectors cannot know what dnn and what training strategies the unauthorized users will adopt. thus, the protective examples should aim at hurting the dnn training, a whole dynamic process, instead of a static dnn. therefore, it would be interesting to study the vulnerability of dnn training. recall that the vulnerability of a dnn is revealed by the adversarial examples which are similar to clean ones but unrecognized by the model (madry et al., 2018). similarly, we depict the vulnerability of training by the perturbed training samples that are never predicted correctly during training. learning on examples ignored during normal training tends to yield dnns ignoring normal examples. LINEBREAK such examples could be easily uncovered by the gradients from the ensemble of model training checkpoints. however, ensemble methods have never been explored in data protection to the best of our knowledge, so it is natural to wonder LINEBREAK can we use these intermediate checkpoint models for data protection in a self-ensemble manner? LINEBREAK ∗correspondence to xiaolin huang ([email protected]). LINEBREAK an effective ensemble demands high diversity of sub-models, which is generally quantified by their gradient similarity (pang et al., 2019; yang et al., 2021), i.e., the gradients on the same image from different sub-models should be orthogonal. surprisingly, we found that checkpoints’ gradients are as orthogonal as dnns with different architectures in the conventional ensemble. in this regard, we argue that intermediate checkpoints are very diverse to form the proposed self-ensemble protection (sep), challenging existing beliefs on their similarity (li et al., 2022). LINEBREAK by sep, effective ensemble protection is achieved by the computation of training only one dnn. since the scale of data worth protecting is mostly very large, sep avoids tremendous costs by training multiple models. therefore, our study enables a practical ensemble for large-scale data, which may help improve the generalization, increase the attack transferability, and study dnn training dynamics. LINEBREAK multiple checkpoints offer us a pool of good features for an input. thus, we could additionally take the advantage of diverse features besides diverse gradients at no cost. inspired by neural collapse theory (papyan et al., 2020), which demonstrates that the mean feature of samples in a class is a highly representative depiction of this class, we bring about a novel feature alignment loss that induces a sample’s last-layer feature collapse into the mean of incorrect-class features. with features from multiple checkpoints, fa robustly injects incorrect features so that dnns are deeply confounded. LINEBREAK equipping sep with fa, our method achieves astonishing performance by revealing the vulnerability of dnn training: (1) our examples are mostly mis-classified in any training processes compared to a recent method (sandoval-segura et al., 2022), and (2) clean samples are always much closer to each other than to protected samples, indicating that the latter belong to another distribution that could not be noticed by normal training. by setting ℓ∞ = 2/255, a very small bound, sep perturbations on the cifar-10 training set reduce the testing accuracy of a resnet18 from 94.56% to 14.68%, while the best-known results could only reach 41.35% with the same amount of overall calculation to craft the perturbations. the superiority of our method is also observable in the study on cifar-100 and imagenet subset on 5 architectures. we also study perturbations under different norms, and found that mixing ℓ∞ and ℓ0 perturbations (wu et al., 2023) is the only effective way to resist ℓ∞ adversarial training, which could recover the accuracy for all other types of perturbations. our contributions could be summarized below. LINEBREAK • we propose that protective perturbations should reveal the vulnerability of the dnn training LINEBREAK process, which we depict by the examples never classified correctly in training. LINEBREAK • we uncover such examples by the self-ensemble of model checkpoints, which are found to LINEBREAK be surprisingly diverse as data protectors. LINEBREAK • our method is very effective even using the computation of training one dnn. equipped with a novel feature alignment loss, our ℓ∞ = 8/255 perturbations lead dnns to have < 5.7% / 3.2% / 0.6% accuracy on cifar-10 / cifar-100 / imagenet subset. LINEBREAK related work LINEBREAK small perturbations are known to be able to fool dnns into incorrect predictions (szegedy et al., 2014). such test-time adversarial perturbations are crafted effectively by adversarially updating samples with model gradients (carlini & wagner, 2017), and the produced adversarial examples (aes) transfer to hurt other dnns as well (chen et al., 2022). similarly, training-time adversarial perturbations, i.e., poisoning examples, are also obtainable by adversarially modify training samples using dnn gradients (koh & liang, 2017; fowl et al., 2021b). all dnns trained on poisoning examples generalize poorly on clean examples, making poisoning methods helpful in protecting data from unauthorized use of training. besides adversarial noise, it has been demonstrated that error-minimization (huang et al., 2020a), gradient alignment (fowl et al., 2021a) and influence functions (fang et al., 2020) are also useful in protecting data. however, current methods only use one dnn because the scale of data worth protection is very large for training multiple models. LINEBREAK ensemble is validated as a panacea for boosting adversarial attacks (liu et al., 2017; dong et al., 2018). by aggregating the probabilities (liu et al., 2017), logits or losses (dong et al., 2018) of multiple models, ensemble attacks significantly increase the black-box attack success rate. ensemble attacks could be further enhanced by reducing the gradient variance of sub-models (xiong et al., 2022), and such an optimization way is also adopted in our method. besides, ensemble has also LINEBREAK been shown effective as a defense method by inducing low diversity across sub-models (pang et al., 2019; yang et al., 2020; 2021) or producing diverse aes in adversarial training (tramèr et al., 2018; wang & wang, 2021). despite the good performance of ensemble in attacks and defenses, it has not been introduced to protect datasets due to its inefficiency. in this regard, we adopt the self-ensemble strategy, which only requires the computation of training one dnn. its current applications are focused on semi-supervised learning (zhao et al., 2019; liu et al., 2022). LINEBREAK two similar but different tasks besides poisoning-based data protection are adversarial training and backdoor attacks. adversarial training (madry et al., 2018; zhang et al., 2019; stutz et al., 2020) continuously generates aes with current checkpoint gradients to improve the model’s robustness towards worst-case perturbations. in contrast, data protection produces fixed poisoning examples so that unauthorized training yields low clean accuracy. backdoor attacks (geiping et al., 2020; huang et al., 2020b) perturb a small proportion of the training set to make the dnns mispredict certain samples, but remain well-functional on other clean samples. while data protectors perturb the whole training set to degrade the model’s performance on all clean samples. LINEBREAK the proposed method
| 2
|
[
108.299,
520.3136768,
251.7200712,
532.2688768
] |
Yz-XtK5RBxB.pdf
| 2,021
| 2
|
LINEBREAK deep repulsive clustering of ordered data based on order-identity decomposition LINEBREAK seon-ho lee and chang-su kim school of electrical engineering, korea university [email protected], [email protected] LINEBREAK abstract LINEBREAK we propose the deep repulsive clustering (drc) algorithm of ordered data for effective order learning. first, we develop the order-identity decomposition (orid) network to divide the information of an object instance into an order-related feature and an identity feature. then, we group object instances into clusters according to their identity features using a repulsive term. moreover, we estimate the rank of a test instance, by comparing it with references within the same cluster. experimental results on facial age estimation, aesthetic score regression, and historical color image classification show that the proposed algorithm can cluster ordered data effectively and also yield excellent rank estimation performance. LINEBREAK introduction LINEBREAK there are various types of ‘ordered’ data. for instance, in facial age estimation (ricanek & tesafaye, 2006), face photos are ranked according to the ages. also, in a video-sharing platform, videos can be sorted according to the numbers of views or likes. in these ordered data, classes, representing ranks or preferences, form an ordered set (schr¨oder, 2003). attempts have been made to estimate the classes of objects, including multi-class classification (pan et al., 2018), ordinal regression (frank & hall, 2001), metric regression (fu & huang, 2008). recently, a new approach, called order learning (lim et al., 2020), was proposed to solve this problem. LINEBREAK order learning is based on the idea that it is easier to predict ordering relationship between objects than to estimate the absolute classes (or ranks); telling the older one between two people is easier than estimating their exact ages. hence, in order learning, the pairwise ordering relationship is learned from training data. then, the rank of a test object is estimated by comparing it with reference objects with known ranks. however, some objects cannot be easily compared. it is less easy to tell the older one between people of different genders than between those of the same gender. lim et al. (2020) tried to deal with this issue, by dividing an ordered dataset into disjoint chains. but, the chains were not clearly separated, and no meaningful properties were discovered from the chains. LINEBREAK in this paper, we propose a reliable clustering algorithm, called deep repulsive clustering (drc), of ordered data based on order-identity decomposition (orid). figure 1 shows a clustering example of ordered data. note that some characteristics of objects, such as genders or races in age estimation, are not related to their ranks, and the ranks of objects sharing such characteristics can be compared more reliably. to discover such characteristics without any supervision, the proposed orid network decomposes the information of an object instance into an order-related feature and an identity feature unrelated to the rank. then, the proposed drc clusters object instances using their identity features; in each cluster, the instances share similar identity features. furthermore, given a test instance, we decide its cluster based on the nearest neighbor (nn) rule, and compare it with reference instances within the cluster to estimate its rank. to this end, we develop a maximum a posteriori (map) estimation rule. experimental results on ordered data for facial age estimation, aesthetic score regression (kong et al., 2016), and historical color image classification (palermo et al., 2012) demonstrate that the proposed algorithm separates ordered data clearly into meaningful clusters and provides excellent rank estimation performances for unseen test instances. LINEBREAK the contributions of this paper can be summarized as follows. LINEBREAK figure 1: a clustering example of facial photos, which are ordered according to ages. without any supervision, the proposed algorithm can obtain meaningful clusters using identity features. LINEBREAK • we first propose the notion of identity features of ordered data and develop the orid LINEBREAK network for the order-identity decomposition. LINEBREAK • we develop the drc algorithm to cluster data on a unit sphere effectively using a repulsive LINEBREAK term. we also prove the local optimality of the solution. LINEBREAK • we propose the map decision rule for rank estimation. the proposed algorithm provides the state-of-the-art performances for facial age estimation and aesthetic score regression. LINEBREAK related work LINEBREAK order learning LINEBREAK the notion of order learning was first proposed by lim et al. (2020). it aims to determine the order graph of classes and classify an object into one of the classes. in practice, it trains a pairwise comparator, which is a ternary classifier, to categorize the relationship between two objects into one of three cases: one object is bigger than, similar to, or smaller than the other. then, it estimates the rank of a test object, by comparing it with reference objects with known ranks. however, not every pair of objects are easily comparable. although lim et al. (2020) attempted to group objects into clusters, in which objects could be more accurately compared, their clustering results were unreliable. LINEBREAK pairwise comparison has been used to estimate object ranks, because relative evaluation is easier than absolute evaluation in general. saaty (1977) proposed the scaling method to estimate absolute priorities from relative priorities, which has been applied to various decision processes, including aesthetic score regression (lee & kim, 2019). also, some learning to rank (ltr) algorithms are based on pairwise comparison (liu, 2009; cohen et al., 1998; burges et al., 2005; tsai et al., 2007). LINEBREAK order learning attempts to combine (possibly inconsistent) pairwise ordering results to determine the rank of each object. thus, it is closely related to the cohen et al.’s ltr algorithm (1998), which learns a pairwise preference function and obtains a total order of a set to maximize agreements among preference judgments of pairs of elements. also, order learning is related to rank aggregation (dwork et al., 2001), in which partially ordered sets are combined into a linearly ordered set to achieve the maximum consensus among those partial sets. rank aggregation has been studied in various fields (br¨uggemann et al., 2004). since optimal aggregation is np-hard, dwork et al. (2001) proposed an approximate algorithm, called markov chain ordering. there are many other approximate schemes, such as the local kemenization, borda count, and scaled footrule aggregation. LINEBREAK clustering LINEBREAK data clustering is a fundamental problem to partition data into disjoint groups, such that elements in the same group are similar to one another but elements from different groups are dissimilar. although various clustering algorithms have been proposed (hartigan & wong, 1979; ester et al., 1996; kohonen, 1990; dhillon & modha, 2001; reynolds, 2009), conventional algorithms often yield poor performance on high-dimensional data due to the curse of dimensionality and ineffectiveness of similarity metrics. dimensionality reduction and feature transform methods have been studied to map raw data into a new feature space, in which they are more easily separated. linear transforms, such as pca (wold et al., 1987), and non-linear transformations, including kernel methods (hofmann et al., 2008) and spectral clustering (ng et al., 2002), have been proposed. LINEBREAK recently, deep neural networks have been adopted effectively as feature embedding functions (lecun et al., 2015), and these deep-learning-based feature embedding functions have been combined with classical clustering algorithms. for instance, caron et al. (2018) proposed a deep clustering algorithm based on k-means. it clusters features from a neural network and then trains the network using the cluster assignments as pseudo-labels. this is done iteratively. also, yang et al. (2016) jointly learned feature representations and clustered images, based on agglomerative clustering. chang et al. (2017) recast the image clustering task into a binary classification problem to predict whether a pair of images belong to the same cluster or different clusters. similarly to these algorithms, we use a neural network to determine a feature space in which clustering is done more effectively. however, we consider the clustering of ordered data, and each cluster should consists of elements, whose ranks can be compared more accurately. LINEBREAK there are conventional approaches to use clustering ideas to aid in classification or rank estimation. for example, yan et al. (2015) developed a hierarchical classifier, which clusters fine categories into coarse category groups and classifies an object into a fine category within its coarse category group. for extreme multiclass classification, daum´e iii et al. (2017) proposed to predict a class label among candidate classes only, which are dynamically selected by the recall tree. it is however noted that the leaves of the recall tree do not partition the set of classes. also, for age estimation, li et al. (2019) proposed a tree-like structure, called bridge-tree, to divide data into overlapping age groups and train a local regressor for each group. the set of local regressors can be more accurate than a global regressor to deal with the entire age range. whereas these conventional approaches group data in the label dimension to perform their tasks more effectively, the proposed algorithm cluster data in the dimension orthogonal to the label dimension. in other words, we cluster data using identity features, instead of using order features. LINEBREAK proposed algorithm LINEBREAK problem definition LINEBREAK an order is a binary relation, often denoted by ≤, on a set θ = {θ1, θ2, . . . , θm} (schr¨oder, 2003). it should satisfy three properties of reflexivity (θi ≤ θi for all i), antisymmetry (θi ≤ θj and θj ≤ θi imply θi = θj), and transitivity (θi ≤ θj and θj ≤ θk imply θi ≤ θk). then, θ is called a partially ordered set. furthermore, if every pair of elements are comparable (θi ≤ θj or θj ≤ θi for all i, j), θ is called a chain or linearly ordered set. LINEBREAK an order describes ranks or priorities of classes. for example, in age estimation, θi may represent the age class of i-year-olds. then, θ14 ≤ θ49 represents that 14-year-olds are younger than 49-year-olds. as mentioned previously, it is less easy to tell the older one between people of different genders. an algorithm, hence, may compare a subject with reference subjects of the same gender only. in such a case, each age class θi represents two subclasses θfemale of different types, and the algorithm compares only subjects of the same type. lim et al. (2020) assumed that subclasses of different types are incomparable and thus the set of subclasses is the union of k disjoint chains, where k is the number of types. however, in many ranking applications, objects of different types can be compared (although less easily than those of the same type are). thus, instead of assuming incomparability across chains, we assume that there is a total order on θ = {θ1, θ2, . . . , θm}, in which each class θi consists of k types of subclasses, and that object instances of the same type are more easily compared than those of different types. LINEBREAK and θmale i LINEBREAK i LINEBREAK suppose that n training instances in x = {x1, x2, . . . , xn} are given. also, suppose that there are m ranks and the ground-truth rank of each instance is known. in this sense, x contains ordered data. the problem is twofold. the first goal is to decompose the whole instances x into k disjoint clusters {cj}k LINEBREAK j=1 in which instances are more easily compared; LINEBREAK x = (cid:83)k LINEBREAK j=1 cj LINEBREAK where ci ∩cj = ∅ for i (cid:54)= j. in other words, we aim to partition the ordered data in x into k clusters, by grouping them according to their characteristics unrelated to their ranks. these characteristics, which tend to remain the same even when an object experiences rank changes, are referred to as ‘identity’ features in this work. for example, in age estimation, genders or races can be identity features. however, we perform the clustering without any supervision for identity features. notice LINEBREAK figure 2: an overview of the orid network. LINEBREAK that instances within a cluster would be compared more easily than those across clusters, since they have similar identity features. the number k of clusters is assumed to be known a priori. impacts of k on the clustering performance are discussed in appendix b.7. the second goal is to assign an unseen test instance into one of the clusters and determine its rank by comparing it with reference instances within the cluster. to achieve these goals, we propose the orid network and the drc algorithm. LINEBREAK order-identity decomposition LINEBREAK in general, object instances can be compared more easily, as they have more similar identity features irrelevant to order. therefore, we decompose the information of each object instance into an order feature and an identity feature. to this end, we propose the orid network in figure 2, composed of three parts: autoencoder, discriminator, and comparator. LINEBREAK 1) autoencoder: similarly to deep clustering algorithms in (yang et al., 2017; dizaji et al., 2017; chen et al., 2017; ji et al., 2017), we use the autoencoder g ◦ f (·), based on a neural network, to extract feature vectors. the encoder hx = f (x) maps an input vector x to a feature vector hx, while the decoder ˆx = g(hx) reconstructs ˆx from hx. by minimizing the reconstruction loss (cid:107)x − ˆx(cid:107)1, f is trained to represent x compactly with as little loss of information as possible. we decompose the overall feature hx ∈ rdor+did into the order feature hx 1 , hx dor+1, hx LINEBREAK ]t 2 , . . . , hx dor dor+2, . . . , hx (3) dor+did or and hx where dor and did are the dimensions of hx id. however, without additional control, the output hx of the neural network f would be highly entangled (higgins et al., 2018). to put together order-related information into hx LINEBREAK or = [hx hx id = [hx hx LINEBREAK or and the identity feature hx LINEBREAK dor+2, . . . , hx LINEBREAK or, we employ the comparator. LINEBREAK id, given by LINEBREAK dor+1, hx LINEBREAK dor+did LINEBREAK 2) comparator: using the order features hx or of a pair of instances x and y, we train the comparator, which classifies their ordering relationship into one of three categories ‘bigger,’ ‘similar,’ and ‘smaller’: LINEBREAK or and hy LINEBREAK x (cid:31) y if θ(x) − θ(y) > τ, LINEBREAK x ≈ y if |θ(x) − θ(y)| ≤ τ, LINEBREAK (4) where θ(·) denotes the class of an instance. as in (lim et al., 2020), ‘(cid:31), ≈, ≺’ represent the ordering relationship between instances, while ‘>, =, <’ do the mathematical order between classes. the comparator outputs the softmax probability pxy = (pxy ≺ ). it is trained to minimize the ≈ , qxy cross-entropy between pxy and the ground-truth one-hot vector qxy = (qxy ≺ ). because it is trained jointly with the autoencoder, the information deciding the ordering relationship tends to be encoded into the order features hx or and hy or. on the other hand, the remaining information necessary for the reconstruction of ˆx and ˆy are encoded into the identity features hx LINEBREAK x ≺ y if θ(x) − θ(y) < −τ, LINEBREAK (cid:31) , qxy LINEBREAK (cid:31) , pxy LINEBREAK ≈ , pxy LINEBREAK id and hy id. LINEBREAK 3) discriminator: we adopt the discriminator d that tells real images from synthesized images, generated by the decoder g. using the gan loss (goodfellow et al., 2014), the discriminator helps the decoder to reconstruct more realistic output ˆx and ˆy. LINEBREAK appendix a provides detailed network structures of these components in orid. LINEBREAK deep repulsive clustering LINEBREAK after obtaining the identity features hx1 id , . . . , hxn id of all instances xi ∈ x , we partition them into k clusters. each cluster contains instances that are more easily comparable to one another. the LINEBREAK id , hx2 LINEBREAK identity features are normalized in eq. (3) and lie on the unit sphere in rdid . in other words, we cluster data points on the unit sphere. thus, the cosine similarity is a natural affinity metric. let cj, 1 ≤ j ≤ k, denote the k clusters. also, let cj, constrained to be on the unit sphere, denote the ‘centroid’ or the representative vector for the instances in cluster cj. we define the quality of cluster cj as LINEBREAK x∈cj LINEBREAK (hx LINEBREAK id)tcj − α 1 k−1 LINEBREAK l(cid:54)=j(hx LINEBREAK id)tcl LINEBREAK where the first term is the similarity of an instance in cj to the centroid cj, the second term with the negative sign quantifies the average dissimilarity of the instance from the other centroids, and α is a nonnegative weight. for a high quality cluster, instances should be concentrated around the centroid and be far from the other clusters. the second term is referred to as the repulsive term, as its objective is similar to the repulsive rule in (lee et al., 2015). although conventional methods also try to increase inter-cluster dissimilarity (ward jr, 1963; lee et al., 2015), to the best of our knowledge, drc is the first attempt to use an explicit repulsive term in deep clustering, which jointly optimizes clustering and feature embedding. next, we measure the overall quality of the clustering by (cid:80) LINEBREAK x∈cj we aim to find the optimum clusters to maximize this objective function j, yet finding the global optimum is np-complete (kleinberg et al., 1998; garey et al., 1982). hence, we propose an iterative algorithm, called drc, to find a local optimum, as in the k-means algorithm (gersho & gray, 1991). LINEBREAK id)tcj − α 1 k−1 LINEBREAK j=1, {cj}k LINEBREAK j({cj}k LINEBREAK l(cid:54)=j(hx LINEBREAK id)tcl LINEBREAK (hx LINEBREAK 1. centroid rule: after fixing the clusters {cj}k LINEBREAK j=1 to maximize j in eq. (6). because the centroids should lie on the unit sphere, we solve the constrained optimization problem: LINEBREAK j=1, we update the centroids {cj}k LINEBREAK maximize j({cj}k LINEBREAK j=1) subject to ct LINEBREAK jcj = 1 for all j = 1, . . . , k. LINEBREAK using lagrangian multipliers (bertsekas, 1996), the optimal centroids are obtained as (cid:13) hx (cid:13). id LINEBREAK cj = (cid:0) (cid:80) LINEBREAK id − α 1 hx k−1 LINEBREAK id − α 1 hx k−1 LINEBREAK hx id LINEBREAK x∈x \cj LINEBREAK x∈x \cj LINEBREAK x∈cj LINEBREAK x∈cj LINEBREAK 2. nn rule: on the other hand, after fixing the centroids, we update the membership of each LINEBREAK instance to maximize j in eq. (6). the optimal cluster cj is given by id)tcl for all 1 ≤ l ≤ k(cid:9). LINEBREAK id)tcj ≥ (hx in other words, an instance should be assigned to cj if its nearest centroid is cj. LINEBREAK cj = (cid:8)x | (hx LINEBREAK we apply the centroid rule and the nn rule iteratively until convergence. because both rules monotonically increase the same objective function j and the inequality j ≤ n + α k−1 n always holds, j is guaranteed to converge to a local maximum. readers interested in the convergence are referred to (sabin & gray, 1986; pollard, 1982). LINEBREAK without the repulsive term in eq. (6) (i.e. at α = 0), centroid cj in eq. (8) is updated by LINEBREAK hx id(cid:107), in contrast, with a positive α, the as done in the spherical k-means (dhillon & modha, 2001). objective function j is reduced when the centroids are far from one another. ideally, in equilibrium, the centroid of a cluster should be the opposite of the centroid of all the other clusters; LINEBREAK x∈cj LINEBREAK x∈cj LINEBREAK cj = (cid:80) LINEBREAK x∈cj LINEBREAK x∈cj LINEBREAK hx id hx id(cid:107) LINEBREAK x∈x \cj LINEBREAK x∈x \cj LINEBREAK hx id hx id(cid:107) LINEBREAK for all j = 1, 2, . . . , k. LINEBREAK note that the orid network and thus the encoded feature space are trained jointly with the repulsive clustering. as the training goes on, the centroids repel one another, and the clusters are separated more clearly due to the repulsive term. LINEBREAK we jointly optimize the clusters and the orid network parameters, as described in algorithm 1. first, we train the orid network for warm-up epochs, by employing every pair of instances x and y as input. then, using the identity features, we partition the input data into k clusters using k-means. second, we repeat the fine-tuning of the orid network and the repulsive clustering alternately. in the fine-tuning, a pair of x and y are constrained to be from the same cluster, and the following loss function is employed. LINEBREAK (cid:96) = λrec(cid:96)rec + λclu(cid:96)clu + λcom(cid:96)com + λgan(cid:96)gan. LINEBREAK appendix b describes this loss function in detail, proves the optimality of the centroid and nn rules in eq. (8) and (9), and analyzes the impacts of the repulsive term in eq. (6). LINEBREAK fine-tune orid network to minimize loss λrec(cid:96)rec + λclu(cid:96)clu + λcom(cid:96)com + λgan(cid:96)gan repeat LINEBREAK algorithm 1 drc-orid input: ordered data x = {x1, x2, . . . , xn}, k = the number of clusters 1: train orid network for warm-up epochs to minimize loss λrec(cid:96)rec + λcom(cid:96)com + λgan(cid:96)gan 2: partition x into c1, c2, . . . , ck using k-means 3: repeat 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: until predefined number of epochs output: clusters {cj}k LINEBREAK until convergence or predefined number of iterations LINEBREAK end for for all j = 1, 2, . . . , k do LINEBREAK update centroid cj via eq. (8) LINEBREAK update cluster cj via eq. (9) LINEBREAK for all j = 1, 2, . . . , k do LINEBREAK j=1, centroids {cj}k LINEBREAK j=1, orid network LINEBREAK end for LINEBREAK (cid:46) centroid rule LINEBREAK (cid:46) nn rule LINEBREAK 3.4 rank estimation using the output of the drc-orid algorithm, we can estimate the rank of an unseen test instance x. first, we extract its identity feature hx id with the centroids {cj}k j=1 based on the nn rule, we find the most similar centroid cl. then, x is declared to belong to cluster cl. without loss of generality, let us assume that the classes (or ranks) are the first m natural numbers, θ = {1, 2, . . . m}. then, for each i ∈ θ, we select a reference instance yi with rank i from cluster cl, so that it is the most similar to x. specifically, id)thy id. LINEBREAK id using the orid encoder. by comparing hx LINEBREAK yi = arg maxy∈cl : θ(y)=i(hx LINEBREAK we estimate the rank θ(x) of the test instance x, by comparing it with the chosen references yi, 1 ≤ i ≤ m. for the rank estimation, lim et al. (2020) developed the maximum consistency rule, which however does not exploit the probability information, generated by the comparator. in this paper, we use the maximum a posteriori (map) estimation rule, which is described in detail in appendix b.10. LINEBREAK experimental results LINEBREAK this section provides various experimental results. due to space limitation, implementation details and more results are available in appendices c, d, and e. LINEBREAK facial age estimation LINEBREAK datasets: we use two datasets. first, morph ii (ricanek & tesafaye, 2006) is a collection of about 55,000 facial images in the age range [16, 77]. it provides gender (female, male) and race (african american, asian, caucasian, hispanic) labels as well. we employ the four evaluation settings a, b, c, and d in appendix c.2. second, the balanced dataset (lim et al., 2020) is sampled from the three datasets of morph ii, afad (niu et al., 2016), and utk (zhang et al., 2017) to overcome bias to specific ethnic groups or genders. it contains about 6,000 images for each combination of gender in {female, male} and ethnic group in {african, asian, european}. LINEBREAK clustering: figure 3 shows clustering results on morph ii (setting a), when the number of clusters is k = 2. setting a contains faces of caucasian descent only. thus, the proposed drc-orid divides those faces into two clusters according to genders in general, although the annotated gender information is not used. most males are assigned to cluster 1, while a majority of females to cluster 2. on the other hand, setting b consists of africans and caucasians. thus, those images are clustered according to the races, as shown in appendix c.3. figure 4 is the results on the balanced dataset at k = 3, which is composed of morph ii, afad, and utk images. due to different characteristics of these sources, images are clearly divided according to their sources. at k = 2, morph ii images are separated from the others. this is because, unlike the morph ii images, the boundaries of most afad and utk images are zeroed for alignment using seetafaceengine (zhang et al., 2014). LINEBREAK figure 3: morph ii images in setting a are divided into two clusters. LINEBREAK figure 4: the balanced dataset is divided into three clusters, which are mostly composed of afad, utk, and morph ii images, respectively. LINEBREAK table 1: comparison of age estimation results on morph ii. here, ∗ means that the algorithm is pre-trained on the imdb-wiki dataset (rothe et al., 2018). LINEBREAK setting a LINEBREAK setting b LINEBREAK setting c LINEBREAK setting d LINEBREAK algorithm LINEBREAK mae cs (%) LINEBREAK mae cs (%) LINEBREAK mae cs (%) LINEBREAK mae cs (%) LINEBREAK drfs (shen et al., 2018) mo-cnn∗ (tan et al., 2017) mv (pan et al., 2018) mv∗ (pan et al., 2018) bridgenet∗ (li et al., 2019) avdl∗ (wen et al., 2020) ol∗ (lim et al., 2020) LINEBREAK proposed-vanilla (k = 2) proposed-vgg (k = 1)∗ proposed-vgg (k = 2)∗ LINEBREAK lim et al. (2020) also tried the clustering of the balanced dataset. figure 5 visualizes the feature space using t-sne (maaten & hinton, 2008). although their method aligns the features according to ages, their clusters are not separated, overlapping one another. in contrast, the proposed drc-orid separates the three clusters clearly, as well as sorts features according to the ages within each cluster. more t-sne plots for analyzing the impacts of the repulsive term are available in appendix b.5. LINEBREAK age transformation: we assess the decomposition performance of orid. although orid is not designed for age transformation (or-el et al., 2020), it decomposes an image x into the order and identity features, hx id. thus, the age can be transformed in two steps. first, we replace or of x with hy hx or of a reference image y at a target age. second, we decode the resultant feature (concatenation of hy id) to obtain the transformed image. figure 6 shows some results on morph ii images. order-related properties, such as skin textures and hair colors, are modified plausibly, but identity information is preserved. this indicates the reliability of orid. LINEBREAK or and hx LINEBREAK or and hx LINEBREAK age estimation: table 1 compares the proposed algorithm with conventional age estimators on the four evaluation settings of morph ii. these conventional algorithms take 224 × 224 or bigger images as input, while orid takes 64 × 64 images. moreover, most of them adopt vgg16 (simonyan & zisserman, 2015) as their backbones, which is more complicated than the orid encoder. thus, for comparison, after fixing clusters using drc-orid, we train another pairwise comparator based on vgg16, whose architecture is the same as lim et al. (2020). we measure the age estimation performance by the mean absolute error (mae) and the cumulative score (cs). mae is the average absolute error between estimated and ground-truth ages, and cs computes the percentage of test samples whose absolute errors are less than or equal to a tolerance level of 5. LINEBREAK mainly due to the smaller input size of 64 × 64, the vanilla version yields poorer performances than the conventional algorithms. the vgg version, however, outperforms them significantly. first, in the proposed-vgg (k = 1), all instances can be compared, as in the ol algorithm. in other words, the clustering is not performed. thus, the pairwise comparators of ol and the proposedvgg (k = 1) are trained in the same way, but their rank estimation rules are different. whereas LINEBREAK figure 5: t-sne visualization of the feature spaces of the balanced dataset at k = 3. LINEBREAK figure 6: age transformation results. for each test, the input x, reconstruction ˆx = g ◦ f (x), transformed result g(hy LINEBREAK id), and reference y are shown, where ⊕ denotes concatenation. LINEBREAK or ⊕ hx LINEBREAK figure 8: example aadb images grouped into eight clusters (k = 8). LINEBREAK figure 9: t-sne visualization of feature space of aadb at k = 8. LINEBREAK ol uses the maximum consistency rule, the proposed algorithm performs the map estimation. the score gaps between them confirm that the map estimation is more accurate. moreover, by clustering facial images into two groups, the proposed-vgg (k = 2) improves the results meaningfully. the proposed-vgg (k = 2) provides the state-of-the-art results, except for the mae test in setting d. LINEBREAK aesthetic score regression LINEBREAK the aesthetics and attribute database (aadb) is composed of 10,000 photographs of various themes such as scenery and close-up (kong et al., 2016). each image is annotated with an aesthetic score in [0, 1]. we quantize the continuous score with a step size of 0.01 to make 101 score classes. compared to facial images, aadb contains more diverse data. it is hence more challenging to cluster aadb images. figure 8 shows example images in each cluster at k = 8. images in the same cluster have similar colors, similar contents, or similar composition. this means that orid extracts identity features effectively, corresponding to contents or styles that are not directly related to aesthetic scores. using those identity features, drc discovers meaningful clusters. figure 9 visualizes the feature space of aadb. aesthetic scores are sorted along one direction, while clusters are separated in the other orthogonal direction. in other words, the scores look like latitudes, while the clusters appear to be separated by meridians (or lines of longitude). as a point on the earth surface can be located by its latitude and longitude, an image is represented by its aesthetic score (order feature) and cluster (identity feature). LINEBREAK table 2 compares regression results. even without clustering process, the proposed algorithm outperforms the reg-net and asm algorithms. moreover, by using the eight unsupervised clusters in figure 8, the proposed algorithm further reduces the mae to yield the state-of-the-art result. LINEBREAK table 2: aesthetic score regression performances of the proposed algorithm and the conventional reg-net (kong et al., 2016) and asm (lee & kim, 2019) on the aadb dataset. LINEBREAK algorithm LINEBREAK mae LINEBREAK reg-net LINEBREAK asm LINEBREAK proposed (k = 1) LINEBREAK proposed (k = 8) LINEBREAK table 3: comparison of classification performances on the hci dataset. LINEBREAK model LINEBREAK accuracy (%) mae (decade) LINEBREAK frank & hall (2001) cardoso & da costa (2007) palermo et al. (2012) red-svm (lin & li, 2012) orcnn (niu et al., 2016) cnnpor (liu et al., 2018) gp-dnnor (liu et al., 2019) LINEBREAK proposed (k = 4) LINEBREAK figure 7: example hci images grouped into four clusters (k = 4). LINEBREAK historical color image classification
| 8
|
[
108.249,
525.1970784,
323.9564711,
535.1596784
] |
F0KTk2plQzO.pdf
| 2,023
| 1
|
LINEBREAK accelerating guided diffusion sampling with splitting numerical methods LINEBREAK suttisak wizadwongsa, supasorn suwajanakorn vistec, thailand {suttisak.w s19, supasorn.s}@vistec.ac.th LINEBREAK abstract LINEBREAK guided diffusion is a technique for conditioning the output of a diffusion model at sampling time without retraining the network for each specific task. however, one drawback of diffusion models, whether they are guided or unguided, is their slow sampling process. recent techniques can accelerate unguided sampling by applying high-order numerical methods to the sampling process when viewed as differential equations. on the contrary, we discover that the same techniques do not work for guided sampling, and little has been explored about its acceleration. this paper explores the culprit of this problem and provides a solution based on operator splitting methods, motivated by our key finding that classical highorder numerical methods are unsuitable for the conditional function. our proposed method can re-utilize the high-order methods for guided sampling and can generate images with the same quality as a 250-step ddim baseline using 32-58% less sampling time on imagenet256. we also demonstrate usage on a wide variety of conditional generation tasks, such as text-to-image generation, colorization, inpainting, and super-resolution. LINEBREAK introduction LINEBREAK a family of generative models known as diffusion models has recently gained a lot of attention with state-of-the-art image generation quality (dhariwal & nichol, 2021). guided diffusion is an approach for controlling the output of a trained diffusion model for conditional generation tasks without retraining its network. by engineering a task-specific conditional function and modifying only the sampling procedure, guided diffusion models can be used in a variety of applications, such as class-conditional image generation (dhariwal & nichol, 2021; kawar et al., 2022), text-to-image generation (nichol et al., 2022), image-to-image translation (zhao et al., 2022), inpainting (chung et al., 2022a), colorization (song et al., 2020b), image composition (sasaki et al., 2021), adversarial purification (wang et al., 2022; wu et al., 2022) and super-resolution (choi et al., 2021). LINEBREAK one common drawback of both guided and regular “unguided” diffusion models is their slow sampling processes, usually requiring hundreds of iterations to produce a single image. recent speedup attempts include improving the noise schedule (nichol & dhariwal, 2021; watson et al., 2021), redefining the diffusion process to be non-markovian, thereby allowing a deterministic sampling process song et al. (2020a), network distillation that teaches a student model to simulate multiple sampling steps of a teacher model salimans & ho (2022); luhman & luhman (2021), among others. song et al. (2020a) show how each sampling step can be expressed as a first-order numerical step of an ordinary differential equation (ode). similarly, song et al. (2020b) express the sampling of a score-based model as solving a stochastic differential equation (sde). by regarding the sampling process as an ode/sde, many high-order numerical methods have been suggested, such as liu et al. (2022), zhang & chen (2022), and zhang et al. (2022) with impressive results on unguided diffusion models. however, when applied to guided diffusion models, these methods produce surprisingly poor results (see figure 1)—given a few number of steps, those high-order numerical methods actually perform worse than low-order methods. LINEBREAK guided sampling differs from the unguided one by the addition of the gradients of the conditional function to its sampling equation. the observed performance decline thus suggests that classical high-order methods may not be suitable for the conditional function and, consequently, the guided LINEBREAK number of steps LINEBREAK ddim LINEBREAK plms4 LINEBREAK stsp4 (ours) LINEBREAK figure 1: generated samples of a classifier-guided diffusion model trained on imagenet256 using 8-256 sampling steps from different sampling methods. our technique, stsp4, produces highquality results in a fewer number of steps. LINEBREAK sampling equation as a whole. our paper tests this hypothesis and presents an approach to accelerating guided diffusion sampling. the key idea is to use an operator splitting method to split the less well-behaved conditional function term from the standard diffusion term and solve them separately. this approach not only allows re-utilizing the successful high-order methods on the diffusion term but also provides us with options to combine different specialized methods for each term to maximize performance. note that splitting methods have also been explored by dockhorn et al. (2022) to solve unguided diffusion sdes, but our work focuses on accelerating guided diffusion odes. LINEBREAK our design process includes comparing different splitting methods and numerical methods for each split term. when tested on imagenet, our approach achieves the same level of image quality as a ddim baseline while reducing the sampling time by approximately 32-58%. compared with other sampling methods using the same sampling time, our approach provides better image quality as measured by lpips, fid, and perception/recall. with only minimal modifications to the sampling equation, we also show successful acceleration on various conditional generation tasks. LINEBREAK background LINEBREAK this section provides a high-level summary of the theoretical foundation of diffusion models as well as numerical methods that have been used for diffusion models. here we briefly explain a few that contribute to our method. LINEBREAK diffusion models LINEBREAK assuming that x0 is a random variable from the data distribution we wish to reproduce, diffusion models define a sequence of gaussian noise degradation of x0 as random variables x1, x2, ..., xt , 1 − βtxt−1, βti) and βt ∈ [0, 1] are parameters that control the noise levels. where xt ∼ n ( with a property of gaussian distribution, we can express xt directly as a function of x0 and noise i=1(1 − βi). by picking a sufficiently large ϵ ∼ n (0, i) by xt = t (e.g., 1,000) and an appropriate set of βt, we can assume xt is a standard gaussian distribution. the main idea of diffusion model generation is to sample a gaussian noise xt and use it to reversely sample xt −1, xt −2, ... until we obtain x0, which belongs to our data distribution. LINEBREAK 1 − ¯αtϵ, where ¯αt = (cid:81)t LINEBREAK ho et al. (2020) propose denoising diffusion probabilistic model (ddpm) and explain how to employ a neural network ϵθ(xt, t) to predict the noise ϵ that is used to compute xt. to train the network, we sample a training image x0, t, and ϵ to compute xt using the above relationship. then, we optimize our network ϵθ to minimize the difference between the predicted and real noise, i.e., ∥ϵ − ϵθ(xt, t)∥2. LINEBREAK song et al. (2020a) introduce denoising diffusion implicit model (ddim), which uses the network ϵθ to deterministically obtain xt−1 given xt. the ddim generative process can be written as LINEBREAK (cid:0)xt − LINEBREAK this formulation could be used to skip many sampling steps and boost sampling speed. to turn this into an ode, we rewrite equation 1 as: LINEBREAK xt−∆t √ ¯αt−∆t LINEBREAK xt√ ¯αt LINEBREAK 1 − ¯αt−∆t ¯αt−∆t LINEBREAK ϵθ(xt, t), LINEBREAK which is now equivalent to a numerical step in solving an ode. to derive the corresponding ode, we can re-parameterize σt = ¯αt and ¯ϵσ(¯x) = ϵθ(xt, t), yielding ¯x(t − ∆t) − ¯x(t) = (σt−∆t − σt)¯ϵσ(¯x). by letting (σt−∆t − σt) → 0, the ode becomes: LINEBREAK ¯αt, ¯x(t) = xt/ LINEBREAK d¯x dσ LINEBREAK = ¯ϵσ(¯x). LINEBREAK note that this change of variables is equivalent to an exponential integrator technique described in both zhang & chen (2022) and lu et al. (2022). since xt and ¯x(t) have the same value at t = 0, our work can focus on solving ¯x(t) rather than xt. many numerical methods can be applied to the ode equation 3 to accelerate diffusion sampling. we next discuss some of them that are relevant. LINEBREAK numerical methods LINEBREAK euler’s method is the most basic numerical method. a forward euler step is given by ¯xn+1 = ¯xn + ∆σ¯ϵσ(¯xn). when the forward euler step is applied to the ode equation 3, we obtain the ddim formulation (song et al., 2020a). LINEBREAK heun’s method, also known as the trapezoid rule or improved euler, is given by: ¯xn+1 = ¯xn + ∆σ 2 (e1 + e2), where e1 = ¯ϵσ(¯xn) and e2 = ¯ϵσ(¯xn + ∆σe1). this method splits euler’s method into two steps to improve accuracy. many papers have used this method on diffusion models, including algorithm 1 in karras et al. (2022) and dpm-solver-2 in lu et al. (2022). this method is also the simplest case of predictor-corrector methods used in song et al. (2020b). LINEBREAK runge-kutta methods represent a class of numerical methods that integrate information from multiple hidden steps and provide high accuracy results. heun’s method also belongs to a family of 2nd-order runge-kutta methods (rk2). the most well-known variant is the 4th-order runge-kutta method (rk4), which is written as follows: (cid:19) LINEBREAK e1 = ¯ϵσ(¯xn), LINEBREAK ¯xn + LINEBREAK ¯xn + LINEBREAK ¯xn+1 = ¯xn + LINEBREAK this method has been tested on diffusion models in liu et al. (2022) and salimans & ho (2022), but it has not been used as the main proposed method in any paper. LINEBREAK linear multi-step method, similar to the runge-kutta methods, aims to combine information from several steps. however, rather than evaluating new hidden steps, this method uses the previous steps to estimate the new step. the 1st-order formulation is the same as euler’s method. the 2nd-order formulation is given by LINEBREAK ¯xn+1 = ¯xn + LINEBREAK while the 4th-order formulation is given by ∆σ 24 LINEBREAK ¯xn+1 = ¯xn + LINEBREAK where ek = ¯ϵσ(¯xn−k). these formulations are designed for a constant ∆σ in each step. however, our experiments and previous work that uses this method (e.g., liu et al. (2022); zhang & chen LINEBREAK (2022)) still show good results when this assumption is not strictly satisfied, i.e., when ∆σ is not constant. we will refer to these formulations as plms (pseudo linear multi-step) for the rest of the paper, like in liu et al. (2022). a similar linear multi-step method for non-constant ∆σ can also be derived using a technique used in zhang & chen (2022), which we detail in appendix b. this non-constant version can improve upon plms slightly, but it is not as flexible because we have to re-derive the update rule every time the σ schedule changes. LINEBREAK splitting methods for guided diffusion models LINEBREAK this section introduces our technique that uses splitting numerical methods to accelerate guided diffusion sampling. we first focus our investigation on classifier-guided diffusion models for classconditional generation and later demonstrate how this technique can be used for other conditional generation tasks in section 4.3. like any guided diffusion models, classifier-guided models (dhariwal & nichol, 2021) share the same training objective with regular unguided models with no modifications to the training procedure; but the sampling process is guided by an additional gradient signal from an external classifier to generate class-specific output images. specifically, the sampling process is given by LINEBREAK ˆϵ = ϵθ(xt) − LINEBREAK 1 − ¯αt∇x log pϕ(c|xt), LINEBREAK (cid:18) xt − LINEBREAK where pϕ(c|xt) is a classifier model trained to output the probability of xt belonging to class c. as discussed in the previous section, we can rewrite this formulation as a “guided ode”: LINEBREAK d¯x dσ LINEBREAK = ¯ϵσ(¯x) − ∇fσ(¯x), LINEBREAK where fσ(¯x) = log pϕ(c|xt). we refer to fσ as the conditional function, which can be substituted with other functions for different tasks. after obtaining the ode form, any numerical solver mentioned earlier can be readily applied to accelerate the sampling process. however, we observe that classical high-order numerical methods (e.g., plms4, rk4) fail to accelerate this task (see figure 1) and even perform worse than the baseline ddim. LINEBREAK we hypothesize that the two terms in the guided ode may have different numerical behaviors with the conditional term being less suitable to classical high-order methods. we speculate that the difference could be partly attributed to how they are computed: ∇fσ(¯x) is computed through backpropagation, whereas ¯ϵσ(¯x) is computed directly by evaluating a network. one possible solution to handle terms with different behaviors is the so-called operator splitting method, which divides the problem into two subproblems: LINEBREAK dy dσ LINEBREAK = ¯ϵσ(y), LINEBREAK dz dσ we call these the diffusion and condition subproblems, respectively. this method allows separating the hard-to-approximate ∇fσ(z) from ¯ϵσ(y) and solving them separately in each time step. importantly, this helps reintroduce the effective use of high-order methods on the diffusion subproblem as well as provides us with options to combine different specialized methods to maximize performance. we explore two most famous first- and second-order splitting techniques for our task: LINEBREAK = −∇fσ(z). LINEBREAK lie-trotter splitting (ltsp) LINEBREAK our first example is the simple first-order lie-trotter splitting method (trotter, 1959), which expresses the splitting as LINEBREAK dy dσ dz dσ LINEBREAK = ¯ϵσ(y), LINEBREAK y(σn) = ¯xn, LINEBREAK = −∇fσ(z), LINEBREAK z(σn) = y(σn+1), LINEBREAK with the solution of this step being ¯xn+1 = z(σn+1). note that σn is a decreasing sequence. here equation 10 is the same as equation 3, which can be solved using any high-order numerical method, LINEBREAK algorithm 1: lie-trotter splitting (ltsp) sample ¯x0 ∼ n (0, σ2 maxi) ; for n ∈ {0, ..., n − 1} do LINEBREAK yn+1 = plms(¯xn, σn, σn+1, ¯ϵσ); ¯xn+1 = yn+1 − (σn+1 − σn)∇f (yn+1) ; LINEBREAK end result: ¯xn LINEBREAK algorithm 2: strang splitting (stsp) sample ¯x0 ∼ n (0, σ2 maxi) ; for n ∈ {0, ..., n − 1} do LINEBREAK zn+1 = ¯xn − (σn+1−σn) 2 yn+1 = plms(zn+1, σn, σn+1, ¯ϵσ); ¯xn+1 = yn+1 − (σn+1−σn) LINEBREAK ∇f (¯xn) ; LINEBREAK ∇f (yn+1) ; LINEBREAK end result: ¯xn LINEBREAK e.g., plms. for equation 11, we can use a forward euler step: zn+1 = zn − ∆σ∇fσ(zn). (12) this is equivalent to a single iteration of standard gradient descent with a learning rate ∆σ. this splitting scheme is summarized by algorithm 1. we investigate different numerical methods for each subproblem in section 4.1. LINEBREAK strang splitting (stsp) LINEBREAK strang splitting (or strang-marchuk) (strang, 1968) is one of the most famous and widely used operator splitting methods. this second-order splitting works as follows: (cid:20) 1 2 LINEBREAK (σn + σn+1), σn LINEBREAK = −∇fσ(z), LINEBREAK z(σn) = ¯xn, LINEBREAK = ¯ϵσ(y), LINEBREAK y(σn) = z LINEBREAK = −∇fσ(˜z), LINEBREAK ˜z LINEBREAK dz dσ dy dσ d˜z dσ LINEBREAK instead of solving each subproblem for a full step length, we solve the condition subproblem for half a step before and after solving the diffusion subproblem for a full step. in theory, we can swap the order of operations without affecting convergence, but it is practically cheaper to compute the condition term twice rather than the diffusion term twice because fσ is typically a smaller network compared to ¯ϵσ. the strange splitting algorithm is shown in algorithm 2. this method can be shown to have better accuracy than the lie-trotter method, as proven in appendix n. although it requires evaluating the condition term twice per step in exchange for improved image quality. we assess this trade-off in the experiment section. LINEBREAK experiments
| 4
|
[
108.299,
264.0016768,
200.0834953,
275.9568768
] |
VLgmhQDVBV.pdf
| 2,022
| 0
|
LINEBREAK implicit bias of mse gradient optimization in underparameterized neural networks LINEBREAK benjamin bowman ucla departments of mathematics [email protected] LINEBREAK guido mont ´ufar ucla departments of mathematics and statistics and mpi mis [email protected] LINEBREAK abstract LINEBREAK we study the dynamics of a neural network in function space when optimizing the mean squared error via gradient flow. we show that in the underparameterized regime the network learns eigenfunctions of an integral operator tk∞ determined by the neural tangent kernel (ntk) at rates corresponding to their eigenvalues. for example, for uniformly distributed data on the sphere sd−1 and rotation invariant weight distributions, the eigenfunctions of tk∞ are the spherical harmonics. our results can be understood as describing a spectral bias in the underparameterized regime. the proofs use the concept of “damped deviations”, where deviations of the ntk matter less for eigendirections with large eigenvalues due to the occurence of a damping factor. aside from the underparameterized regime, the damped deviations point-of-view can be used to track the dynamics of the empirical risk in the overparameterized setting, allowing us to extend certain results in the literature. we conclude that damped deviations offers a simple and unifying perspective of the dynamics when optimizing the squared error. LINEBREAK introduction LINEBREAK a surprising but well established empirical fact is that neural networks optimized by gradient descent can find solutions to the empirical risk minimization (erm) problem that generalize. this is surprising from an optimization point-of-view because the erm problem induced by neural networks is nonconvex (sontag & sussmann, 1989; 1991) and can even be np-complete in certain cases (blum & rivest, 1993). perhaps even more surprising is that the discovered solution can generalize even when the network is able to fit arbitrary labels (zhang et al., 2017), rendering traditional complexity measures such as rademacher complexity inadequate. how does deep learning succeed in the face of pathological behavior by the standards of classical optimization and statistical learning theory? LINEBREAK towards addressing generalization, a modern line of thought that has emerged is that gradient descent performs implicit regularization, limiting the solutions one encounters in practice to a favorable subset of the model’s full capacity (see, e.g., neyshabur et al., 2015; 2017; gunasekar et al., 2017; wu et al., 2017). an empirical observation is that neural networks optimized by gradient descent tend to fit the low frequencies of the target function first, and only pick up the higher frequencies later in training (rahaman et al., 2019; ronen et al., 2019; basri et al., 2020; xu et al., 2019). a closely related theme is gradient descent’s bias towards smoothness for regression problems (williams et al., 2019; jin & mont´ufar, 2021). for classification problems, in suitable settings gradient descent provably selects max-margin solutions (soudry et al., 2018; ji & telgarsky, 2019). gradient descent is not impartial, thus understanding its bias is an important program in modern deep learning. LINEBREAK generalization concerns aside, the fact that gradient descent can succeed in a nonconvex optimization landscape warrants attention on its own. a brilliant insight made by jacot et al. (2018) is that in function space the neural network follows a kernel gradient descent with respect to the “neural tangent kernel” (ntk). this kernel captures how the parameterization biases the trajectory in function space, an abstraction that allows one to largely ignore parameter space and its complications. this is a profitable point-of-view, but there is a caveat. the ntk still depends on the evolution of the network parameters throughout time, and thus is in general time-dependent and complicated to analyze. however, under appropriate scaling of the parameters in the infinite-width limit it remains LINEBREAK constant (jacot et al., 2018). once the ntk matrix has small enough deviations to remain strictly positive definite throughout training, the optimization dynamics start to become comparable to that of a linear model (lee et al., 2019). for wide networks (quadratic or higher polynomial dependence on the number of training data samples n and other parameters) this property holds and this has been used by a variety of works to prove global convergence guarantees for the optimization (du et al., 2019b; oymak & soltanolkotabi, 2020; du et al., 2019a; allen-zhu et al., 2019a;b; zou et al., 2020; zou & gu, 2019; song & yang, 2020; dukler et al., 2020)1 and to characterize the solution throughout time (arora et al., 2019; basri et al., 2020). the ntk has been so heavily exploited in this setting that it has become synonymous with polynomially wide networks where the ntk is strictly positive definite throughout training. this begs the question, to what extent is the ntk informative outside this regime? LINEBREAK while the ntk has hitherto been associated with the heavily overparameterized regime, we demonstrate that refined analysis is possible in the underparameterized setting. our theorems primarily concern a one-hidden layer network, however unlike many ntk results appearing in the literature our network has biases and both layers are trained. in fact, the machinery we build is strong enough to extend some existing results in the overparameterized regime appearing in the literature to the case of training both layers. LINEBREAK related work LINEBREAK there has been a deluge of works on the neural tangent kernel since it was introduced by jacot et al. (2018), and thus we do our best to provide a partial list. global convergence guarantees for the optimization, and to a lesser extent generalization, for networks polynomially wide in the number of training samples n and other parameters has been addressed in several works (du et al., 2019b; oymak & soltanolkotabi, 2020; du et al., 2019a; allen-zhu et al., 2019a;b; zou et al., 2020; zou & gu, 2019; song & yang, 2020; arora et al., 2019). to our knowledge, for the regression problem with arbitrary labels, quadratic overparameterization m (cid:38) n2 is state-of-the art (oymak & soltanolkotabi, 2020; song & yang, 2020; nguyen & mondelli, 2020). e et al. (2020) gave a fairly comprehensive study of optimization and generalization of shallow networks trained under the standard parameterization. under the standard parameterization, changes in the outer layer weights are more significant, whereas under the ntk parameterization both layers have roughly equal effect. since we study the ntk parameterization in this work, we view the analysis as complementary. LINEBREAK our work is perhaps most closely connected with arora et al. (2019). in theorem 4.1 in that work they showed that for a shallow network in the polynomially overparameterized regime m (cid:38) n7, the training error along eigendirections of the ntk matrix decay linearly at rates that correspond to their eigenvalues. our main theorem 3.5 can be viewed as an analogous statement for the actual risk (not the empirical risk) in the underparameterized regime: eigenfunctions of the ntk integral operator tk∞ are approximately learned linearly at rates that correspond to their eigenvalues. in contrast with arora et al. (2019), we have that the requirements on width m and number of samples n required to learn eigenfunctions with large eigenvalues are smaller compared to those with small eigenvalues. surprisingly the machinery we build is also strong enough to prove in our setting the direct analog of theorem 4.1. note that arora et al. (2019) train the hidden layer of a relu network via gradient descent, whereas we are training both layers with biases for a network with smooth activations via gradient flow. due to the different settings, the results are not directly comparable. this important detail notwithstanding, our overparameterization requirement ignoring logarithmic factors is smaller by a factor of n2 dδ4 where n is the number of input samples, d is the input dimension, and δ is the failure probability. basri et al. (2020) extended theorem 4.1 in arora et al. (2019) to deep relu networks without bias where the first and last layer are fixed, with a higher overparameterization requirement than the original (arora et al., 2019). since the first and last layers are fixed this cannot be specialized to get a guarantee for training both layers of a shallow network even with relu activations. LINEBREAK although it was not our focus, the tools to prove theorem 3.5 are enough to prove analogs of theorem 4 and corollary 2 in the work of su & yang (2019). theorem 4 and corollary 2 of su & yang (2019) are empirical risk guarantees that show that for target functions that participate mostly LINEBREAK 1not all these works explicitly use that the ntk is positive definite. however, they all operate in the regime LINEBREAK where the weights do not vary much and thus are typically associated with the ntk regime. LINEBREAK in the top eigendirections of the ntk integral operator tk∞, moderate overparameterization is possible. again in this work they train the hidden layer of a relu network via gradient descent, whereas we are training both layers with biases for a network with smooth activations via gradient flow. again due to the different settings, we emphasize the results are not directly comparable. in our results the bounds and requirements are comparable to su & yang (2019), with neither appearing better. nevertheless we think it is important to demonstrate that these results hold for training both layers with biases, and we hope our “damped deviations” approach will simplify the interpretation of the aforementioned works. LINEBREAK cao et al. (2020, theorem 4.2) provide an analogous statement to our theorem 3.5 if you replace our quantities with their empirical counterparts. while our statement concerns the projections of the test residual onto the eigenfunctions of an operator associated with the neural tangent kernel, their statement concerns the inner products of the empirical residual with those eigenfunctions. their work was a crucial step towards explaining the spectral bias from gradient descent, however we view the difference between tracking the empirical quantities versus the actual quantities to be highly nontrivial. another difference is they consider a relu network whereas we consider smooth activations; also they consider gradient descent versus we consider gradient flow. due to the different settings we would like to emphasize that the scalings of the different parameters are not directly comparable, nevertheless the networks they consider are significantly wider. they require at least m ≥ ˜o(max{σ−14 , (cid:15)−6}), where σk is a cutoff eigenvalue and (cid:15) is the error tolerance. by contrast in our work, to have the projection onto the top k eigenvectors be bounded by epsilon in l2 norm requires m = ˜ω(σ−4 LINEBREAK k (cid:15)−2). another detail is their network has no bias whereas ours does. LINEBREAK k LINEBREAK our contributions LINEBREAK the key idea for our work is the concept of “damped deviatons”, the fact that for the squared error deviations of the ntk are softened by a damping factor, with large eigendirections being damped the most. this enables the following results. LINEBREAK • in theorem 3.5 we characterize the bias of the neural network to learn the eigenfunctions of the integral operator tk∞ associated with the neural tangent kernel (ntk) at rates proportional to the corresponding eigenvalues. LINEBREAK • in theorem 3.7 we show that in the overparameterized setting the training error along different directions can be sharply characterized, showing that theorem 4.1 in arora et al. (2019) holds for smooth activations when training both layers with a smaller overparameterization requirement. LINEBREAK • in theorem 3.8 and corollary 3.9 we show that moderate overparameterization is sufficient for solving the erm problem when the target function has a compact representation in terms of eigenfunctions of tk∞ . this extends the results in su & yang (2019) to the setting of training both layers with smooth activations. LINEBREAK gradient dynamics and damped deviations LINEBREAK notations LINEBREAK we will use (cid:107)•(cid:107)2 and (cid:104)•, •(cid:105)2 to denote the l2 norm and inner product respectively (for vectors or for functions depending on context). for a symmetric matrix a ∈ rk×k, λi(a) denotes its ith largest eigenvalue, i.e. λ1(a) ≥ λ2(a) ≥ · · · ≥ λk(a). for a matrix a, (cid:107)a(cid:107)op := sup(cid:107)x(cid:107)2≤1 (cid:107)ax(cid:107)2 is the operator norm induced by the euclidean norm. we will let (cid:104)•, •(cid:105)rn denote the standard inner product on rn normalized by 1 n , namely (cid:104)x, y(cid:105)rn = 1 i=1 xiyi. we will let (cid:107)x(cid:107)rn = (cid:112)(cid:104)x, x(cid:105)rn be the associated norm. this normalized inner product has the convenient property that if v ∈ rn such that vi = o(1) for each i then (cid:107)v(cid:107)rn = o(1), where by contrast n). this is convenient as we will often consider what happens when n → ∞. (cid:107)•(cid:107)∞ (cid:107)v(cid:107)2 = o( will denote the supremum norm with associated space l∞. we will use the standard big o and ω notation with ˜o and ˜ω hiding logarithmic terms. LINEBREAK n LINEBREAK gradient dynamics and the ntk integral operator LINEBREAK we will let f (x; θ) denote our neural network taking input x ∈ rd and parameterized by θ ∈ rp. the specific architecture of the network does not matter for the purposes of this section. our training data consists of n input-label pairs {(x1, y1), . . . , (xn, yn)} where xi ∈ rd and yi ∈ r. we focus on the setting where the labels are generated from a fixed target function f ∗, i.e. yi = f ∗(xi). we will concatenate the labels into a label vector y ∈ rn, i.e. yi = f ∗(xi). we will let ˆr(θ) ∈ rn be the vector whose ith entry is equal to f (xi; θ) − f ∗(xi). hence ˆr(θ) is the residual vector that measures the difference between our neural networks predictions and the labels. we will be concerned with optimizing the squared loss LINEBREAK 1 2n optimization will be done by gradient flow LINEBREAK rn . LINEBREAK ∂tθt = −∂θφ(θ), LINEBREAK which is the continuous time analog of gradient descent. we will denote the residual at time t, ˆr(θt), as ˆrt for the sake of brevity and similarly we will let ft(x) = f (x; θt). we will let rt(x) := ft(x) − f ∗(x) denote the residual off of the training set for an arbitrary input x. LINEBREAK we quickly recall some facts about the neural tangent kernel and its connection to the gradient dynamics. for a comprehensive tutorial we suggest jacot et al. (2018). the analytical ntk is the kernel given by LINEBREAK k∞(x, x(cid:48)) := e LINEBREAK ∂f (x(cid:48); θ) ∂θ LINEBREAK where the expectation is taken with respect to the parameter initialization for θ. we associate k∞ with the integral operator tk∞ : l2 LINEBREAK ρ(x) defined by LINEBREAK tk∞f (x) := LINEBREAK k∞(x, s)f (s)dρ(s), LINEBREAK where x is our input space with probability measure ρ. our training data xi ∈ x are distributed according to this measure xi ∼ ρ. by mercer’s theorem we can decompose LINEBREAK x LINEBREAK k∞(x, x(cid:48)) = LINEBREAK σiφi(x)φi(x(cid:48)), LINEBREAK i=1 i=1 is an orthonormal basis of l2, {σi}∞ LINEBREAK where {φi}n i=1 is a nonincreasing sequence of positive values, and each φi is an eigenfunction of tk∞ with eigenvalue σi > 0. when x = sd−1 is the unit sphere, ρ is the uniform distribution, and the weights of the network are from a rotation invariant distribution (e.g. standard gaussian), {φi}∞ i=1 are the spherical harmonics (which in d = 2 is the fourier basis) due to k∞ being rotation-invariant (see bullins et al., 2018, theorem 2.2). we will let κ := maxx∈x k∞(x, x) which will be a relevant quantity in our later theorems. in our setting κ will always be finite as k∞ will be continuous and x will be bounded. the training data inputs {x1, . . . , xn} induce a discretization of the integral operator tk∞, namely LINEBREAK tnf (x) := LINEBREAK k∞(x, xi)f (xi) = LINEBREAK x LINEBREAK k∞(x, s)f (s)dρn(s), LINEBREAK i=1 δxi is the empirical measure. we recall the definition of the time-dependent LINEBREAK where ρn = 1 n n t k 2, LINEBREAK ∂f (x(cid:48); θt) ∂θ we can look at the version of tn corresponding to kt, namely LINEBREAK (cid:28) ∂f (x; θt) ∂θ LINEBREAK kt(x, x(cid:48)) := LINEBREAK t t nf (x) := LINEBREAK kt(x, xi)f (xi) = LINEBREAK x LINEBREAK kt(x, s)f (s)dρn(s). LINEBREAK 2the ntk is an overloaded term. to help ameliorate the confusion, we will use ntk to describe k∞ and LINEBREAK n t k (italic font) to describe the time-dependent version kt. LINEBREAK we recall that the residual rt(x) := f (x; θ) − f ∗(x) follows the update rule LINEBREAK ∂trt(x) = − LINEBREAK kt(x, xi)rt(xi) = −t t LINEBREAK nrt. LINEBREAK i=1 i,j := k∞(xi, xj) denote the gram matrices induced we will let (ht)i,j := kt(xi, xj) and h ∞ by these kernels and we will let gt := 1 n ht and g∞ := 1 n h ∞ be their normalized versions3. throughout we will let u1, . . . , un denote the eigenvectors of g∞ with corresponding eigenvalues λ1, . . . , λn. the u1, . . . , un are chosen to be orthonormal with respect to the inner product (cid:104)•, •(cid:105)rn. when restricted to the training set we have the update rule LINEBREAK ∂tˆrt = − LINEBREAK htˆrt = −gtˆrt. LINEBREAK damped deviations LINEBREAK the concept of damped deviations comes from the very simple lemma that follows (the proof is provided in appendix d). the lemma compares the dynamics of the residual ˆr(t) on the training set to the dynamics of an arbitrary kernel regression exp(−gt)ˆr(0): lemma 2.1. let g ∈ rn×n be an arbitrary positive semidefinite matrix and let gs be the time dependent ntk matrix at time s. then LINEBREAK ˆrt = exp(−gt)ˆr0 + LINEBREAK exp(−g(t − s))(g − gs)ˆrsds. LINEBREAK let’s specialize the lemma to the case where g = g∞. in this case the first term is exp(−g∞t)ˆr0, which is exactly the dynamics of the residual in the exact ntk regime when gt = g∞ for all t. the second term is a correction term that weights the ntk deviations (g∞ − gs) by the damping factor exp(−g∞(t−s)). we see that damping is largest along the large eigendirections of g∞. the equation becomes most interpretable when projected along a specific eigenvector. fix an eigenvector ui of g∞ corresponding to eigenvalue λi. then the equation along this component becomes (cid:90) t LINEBREAK (cid:104)exp(−λi(t − s))(g∞ − gs)ˆrs, ui(cid:105)rn ds. LINEBREAK the first term above converges to zero at rate λi. the second term is a correction term that weights the deviatiations of the n t k matrix gs from g∞ by the damping factor exp(−λi(t − s)). the second term can be upper bounded by (cid:12) (cid:12) (cid:12) (cid:12) LINEBREAK (cid:12) (cid:12) (cid:104)exp(−λi(t − s))(g∞ − gs)ˆrs, ui(cid:105)rnds (cid:12) (cid:12) LINEBREAK exp(−λi(t − s)) (cid:107)g∞ − gs(cid:107)op (cid:107)ˆrs(cid:107)rn ds LINEBREAK [1 − exp(−λit)] λi LINEBREAK sup s∈[0,t] LINEBREAK where we have used the property (cid:107)ˆrs(cid:107)rn ≤ (cid:107)ˆr0(cid:107)rn from gradient flow. when f ∗ = o(1) we have that (cid:107)ˆr0(cid:107)rn = o(1), thus whenever (cid:107)g∞ − gs(cid:107)op is small relative to λi this term is negligible. it has been identified that the ntk matrices tend to have a small number of outlier large eigenvalues and exhibit a low rank structure (oymak et al., 2020; arora et al., 2019). in light of this, the dependence of the above bound on the magnitude of λi is particularly interesting. we reach following important conclusion. observation 2.2. the dynamics in function space will be similar to the ntk regime dynamics along eigendirections whose eigenvalues are large relative to the deviations of the time-dependent ntk matrix from the analytical ntk matrix. LINEBREAK the equation in lemma 2.1 concerns the residual restricted to the training set, but we will be interested in the residual for arbitrary inputs. recall that rt(x) = f (x; θt) − f ∗(x) denotes the residual at time t for an arbitrary input. then more generally we have the following damped deviations lemma for the whole residual (proved in appendix c.3). LINEBREAK 3gt and g∞ are the natural matrices to work with when working with the mean squared error as opposed to the unnormalized squared error. also g∞’s spectra concentrates around the spectrum of the associated integral operator tk∞ and is thus a more convenient choice in our setting. LINEBREAK lemma 2.3. let k(x, x(cid:48)) be an arbitrary continuous, symmetric, positive-definite kernel. let [tkh](•) = (cid:82) nh](•) = LINEBREAK x k(•, s)h(s)dρ(s) be the integral operator associated with k and let [t s i=1 ks(•, xi)h(xi) denote the operator associated with the time-dependent n t k ks. then LINEBREAK rt = exp(−tkt)r0 + LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK n)rsds, LINEBREAK where the equality is in the l2 sense. LINEBREAK for our main results we will specialize the above lemma to the case where k = k∞. however there are other natural kernels to compare against, say k0 or the kernel corresponding to some subset of parameters. we will elaborate further on this point after we introduce the main theorem. when specializing lemma 2.3 to the case k = k∞, we have that tk∞ and t s n are the operator analogs of g∞ and gs respectively. from this statement the same concepts holds as before, the dynamics of rt will be similar to that of exp(−tk∞ t)r0 along eigendirections whose eigenvalues are large relative to the deviations (tk∞ − t s n). in the underparameterized regime we can bound the second term and make it negligible (theorem 3.5) and thus demonstrate that the eigenfunctions φi of tk∞ with eigenvalues σi will be learned at rate σi. when the input data are distributed uniformly on the sphere sd−1 and the network weights are from a rotation-invariant distribution, the eigenfunctions of tk∞ are the spherical harmonics (which is the fourier basis when d = 2). in this case the network is biased towards learning the spherical harmonics that correspond to large eigenvalues of tk∞ . it is in this vein that we will demonstrate a spectral bias. LINEBREAK main results LINEBREAK our theorems will concern the shallow neural network LINEBREAK f (x; θ) = LINEBREAK at σ(w x + b) + b0, LINEBREAK where w ∈ rm×d, a, b ∈ rm and b0 ∈ r and w(cid:96) = w(cid:96),: denotes the (cid:96)th row of w and σ : r → r is applied entry-wise. θ = (at , vec(w )t , bt , b0)t ∈ rp where p = md + 2m + 1 is the total number of parameters. here we are utilizing the ntk parameterization (jacot et al., 2018). for a thorough analysis using the standard parameterization we suggest e et al. (2020). we will consider two parameter initialization schemes. the first initializes wi,j(0) ∼ w, b(cid:96)(0) ∼ b, a(cid:96)(0) ∼ a, b0 ∼ b(cid:48) i.i.d., where w, b, a, b(cid:48) represent zero-mean unit variance subgaussian distributions. in the second initialization scheme we initialize the parameters according to the first scheme and then LINEBREAK perform the following swaps w (0) → LINEBREAK m factor in the parameterization with LINEBREAK replace the 1√ . this is called the “doubling trick” (chizat et al., 2019; zhang et al., 2020) and ensures that the network is identically zero f (x; θ0) ≡ 0 at initialization. we will explicitly state where we use the second scheme and otherwise will be using the first scheme. LINEBREAK the following assumptions will persist throughout the rest of the paper: assumption 3.1. σ is a c 2 function satisfying (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:48)(cid:107)∞ < ∞. assumption 3.2. the inputs satisfy (cid:107)x(cid:107)2 ≤ m . LINEBREAK the following assumptions will be used in most, but not all theorems. we will explicitly state when they apply. assumption 3.3. the input domain x is compact with strictly positive borel measure ρ. assumption 3.4. tk∞ is strictly positive, i.e., (cid:104)f, tk∞ f (cid:105)2 > 0 for f (cid:54)= 0. LINEBREAK most activation functions other than relu satisfy assumption 3.1, such as softplus σ(x) = ln(1 + ex), sigmoid σ(x) = ex+e−x . assumption 3.2 is a mild assumption which is satisfied for instance for rgb images and has been commonly used (du et al., 2019b;a; oymak & soltanolkotabi, 2020). assumption 3.3 is so that mercer’s decomposition holds, which LINEBREAK 1+e−x , and tanh σ(x) = ex−e−x LINEBREAK is often assumed implicitly. assumption 3.4 is again a mild assumption that is satisfied for a broad family of parameter initializations (e.g. gaussian) anytime σ is not a polynomial function, as we will show in appendix g. assumption 3.4 is not strictly necessary but it simplifies the presentation by ensuring tk∞ has no zero eigenvalues. LINEBREAK we will track most constants that depend on parameters of our theorems such as m , the activation function σ, and the target function f ∗. however, constants appearing in concentration inequalities such as hoeffding’s or bernstein’s inequality or constants arising from δ/2 or δ/3 arguments will not be tracked. we will reserve c, c > 0 for untracked constants whose precise meaning can vary from statement to statement. in the proofs in the appendix it will be explicit which constants are involved. LINEBREAK underparameterized regime LINEBREAK our main result compares the dynamics of the residual rt(x) = f (x; θt) − f ∗(x) to that of exp(−tk∞t)r0 in the underparameterized setting. note that (cid:104)exp(−tk∞t)r0, φi(cid:105)2 = exp(−σit)(cid:104)r0, φi(cid:105)2, thus exp(−tk∞ t)r0 learns the eigenfunctions φi of tk∞ at rate σi. therefore exp(−tk∞t)r0 exhibits a bias to learn the eigenfunctions of tk∞ corresponding to large eigenvalues more quickly. to our knowledge no one has been able to rigorously relate the dynamics in function space of the residual rt to exp(−tk∞t)r0, although that seems to be what is suggested by ronen et al. (2019); basri et al. (2020). the existing works we are aware of (arora et al., 2019; basri et al., 2020; cao et al., 2020) characterize the bias of the empirical residual primarily in the heavily overparameterized regime (cao et al. (2020) stands out as requiring wide but not necessarily overparameterized networks). by contrast, we characterize the bias of the whole residual in the underparameterized regime. theorem 3.5. assume that assumptions 3.3 and 3.4 hold. let pk be the orthogonal projection in l2 onto span{φ1, . . . , φk} and let d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}. if we are doing the ˜o(d) + log(c/δ) , s = (cid:107)f ∗(cid:107)∞ + s(cid:48). doubling trick set s(cid:48) = 0 and otherwise set s(cid:48) = o rn t 2, and m ≥ o(log(c/δ) + ˜o(d)) max (cid:8)t 2, 1(cid:9). then with LINEBREAK also let t > 0. assume m ≥ d2 (cid:107)y(cid:107)2 probability at least 1 − δ we have that for all t ≤ t and k ∈ n LINEBREAK 1 − exp(−σkt) σk LINEBREAK ˜o LINEBREAK s [1 + ts] LINEBREAK d m LINEBREAK p n LINEBREAK and LINEBREAK s [1 + ts] LINEBREAK d m LINEBREAK p n LINEBREAK theorem 3.5 will be proved in appendix c. the proof uses the uniform deviation bounds for the n t k to bound tn −t s n and tools from empirical process theory to show convergence of tn to tk∞ uniformly over a class of functions corresponding to networks with bounded parameter norms. LINEBREAK to interpret the results, we observe that to track the dynamics for eigenfunctions corresponding to eigenvalue σk and above, the expression under the ˜o needs to be small relative to 1 . thus the bias σk towards learning the eigenfunctions corresponding to large eigenvalues appears more pronounced. when t = log((cid:107)r0(cid:107)2 /(cid:15))/σk, we have that (cid:107)pk exp(−tk∞ t)r0(cid:107)2 ≤ (cid:15). thus by applying this stopping time we get that to learn the eigenfunctions corresponding to eigenvalue σk and above up to (cid:15) accuracy we need t2 k (cid:15)−2 and n (cid:38) √ m pσ−4 k (cid:15)−2. in typical ntk works the width m needs to be polynomially large relative to the number of samples n, where by contrast here the width depends on the inverse of the eigenvalues for the relevant components of the target function. from an approximation point-of-view this makes sense; the more complicated the target function the more expressive the model must be. we believe future works can adopt more precise requirements on the width m that do not require growth relative to the number of samples n. to further illustrate the scaling of the parameters required by theorem 3.5, we can apply theorem 3.5 for an appropriate stopping time to get a bound on the test error. corollary 3.6. assume assumptions 3.3 and 3.4 hold. suppose that f ∗ = o(1) and assume we are performing the doubling trick where f0 ≡ 0 so that r0 = −f ∗. let k ∈ n and let pk be LINEBREAK (cid:46) (cid:15) which translates to m (cid:38) σ−4 LINEBREAK p n LINEBREAK the orthogonal projection onto span{φ1, . . . , φk}. set t = log( (cid:17) m = ˜ω( d (cid:15)σ4 k LINEBREAK ) and n = ˜ω LINEBREAK suffices to ensure with probability at least 1 − δ LINEBREAK σk LINEBREAK then we have that LINEBREAK if one specialized to the case where f ∗ is a finite sum of eigenfunctions of tk∞ (when the data is uniformly distributed on the sphere sd−1 and the network weights are from a rotation invariant distribution this corresponds to a finite sum of spherical harmonics, which in d = 2 is equivalently a bandlimited function) one can choose k such that (cid:107)(i − pk)f ∗(cid:107)2 2 = 0. it is interesting to note that in this special case gradient flow with early stopping achieves essentially the same rates with respect to m and n (up to constants and logarithms) as the estimated network in the classical approximation theory paper by barron (1994). it is also interesting to note that the approximation results by barron (1994) depend on the decay in frequency domain of the target function f ∗ via their constant cf ∗ , and similarly for us the constant 1/σ4 k grows with the bandwidth of the target function in the case of uniform distribution on the sphere s1 which we mentioned parenthetically above. LINEBREAK while in theorem 3.5 we compared the dynamics of rt against that of exp(−tk∞ t)r0, the damped deviations equation given by lemma 2.3 enables you to compare against exp(−tkt)r0 for an arbitrary kernel k. there are other natural choices for k besides k = k∞, the most obvious being k = k0. in appendix c.8 we prove a version of theorem 3.5 where k = k0 and θ0 is an arbitrary deterministic parameter initialization. this could be interesting in scenarios where the parameters are initialized from a pretrained network or one has a priori knowledge that informs the selection of θ0. one could let k be the kernel corresponding to some subset of parameters, such as the random feature kernel (rahimi & recht, 2008b) corresponding to the outer layer. this would compare the dynamics of training all layers to that of training a subset of the parameters. if one wanted to account for adaptations of the kernel kt one could try to set k = kt0 for some t0 > 0. however since θt0 depends on the training data it is not obvious how one could produce a bound for t s n − kt0. nevertheless we leave the suggestion open as a possibility for future work. LINEBREAK overparameterized regime LINEBREAK once one has deviation bounds for the n t k so that the quantity (cid:107)g∞ − gs(cid:107)op is controlled, the damped deviations equation (lemma 2.1) allows one to control the dynamics of the empirical risk. in this section we will demonstrate three such results that follow from this approach. the following is our analog of theorem 4.1 from arora et al. (2019) in our setting, proved in appendix e. the result demonstrates that when the network is heavily overparameterized, the dynamics of the residual ˆrt follow the ntk regime dynamics exp(−g∞t)ˆr0. theorem 3.7. assume m = ˜ω(dn5(cid:15)−2λn(h ∞)−4) and m ≥ o(log(c/δ) + ˜o(d)) and f ∗ = o(1). assume we are performing the doubling trick so that ˆr0 = −y. let v1, . . . , vn denote the eigenvectors of g∞ normalized to have unit l2 norm (cid:107)vi(cid:107)2 = 1. then with probability at least 1 − δ LINEBREAK ˆrt = exp(−g∞t)(−y) + δ(t), LINEBREAK in the work of arora et al. (2019) the requirement is m = ω( n ) where w(cid:96) ∼ n (0, κ2i) (not to be confused with our definition of κ := maxx k∞(x, x)). by contrast our weights have unit variance, which for gaussian initialization corresponds to w(cid:96) ∼ n (0, i). they require κ to be small to ensure the neural network is small in magnitude at initializeation. to achieve the same effect we can perform antisymmetric initializeation to ensure the network is equivalently 0 at initializeation. our overparameterization requirement ignoring logarithmic factors is smaller by a factor of n2 dδ4 . again due to the different settings we do not claim superiority over this work. LINEBREAK the following is our analog of theorem 4 by su & yang (2019) proved in appendix f. this shows that when the target function has a compact representation in terms of eigenfunctions of tk∞ , a more moderate overparametrization is sufficient to approximately solve the erm problem. theorem 3.8. assume assumptions 3.3 and 3.4 hold. ∞ (1 + t (cid:107)f ∗(cid:107)∞)2(cid:17) ˜ω ˜o(d)) and n ≥ 128κ2 log(2/δ) (σk−σk+1)2 . also assume f ∗ ∈ l∞(x) ⊂ l2(x) and let p tk∞ be the orthogonal projection onto the eigenspaces of tk∞ corresponding to the eigenvalue α ∈ σ(tk∞ ) and higher. assume that (cid:13) (cid:13)∞ ≤ (cid:15)(cid:48) for some (cid:15)(cid:48) ≥ 0. pick k so that σk = α and σk+1 < α, i.e. k is the index of the last repeated eigenvalue corresponding to α in the ordered sequence {σi}i. also assume we are performing the doubling trick so that ˆr(0) = −y. then we have with probability at least 1 − 3δ over the sampling of x1, . . . , xn and θ0 that for t ≤ t LINEBREAK furthermore assume m = where t > 0 is a time parameter and m ≥ o(log(c/δ) + LINEBREAK (cid:13)(i − p tk∞ )f ∗(cid:13) LINEBREAK n LINEBREAK n LINEBREAK su & yang (2019) have (cid:107)f ∗(cid:107)2 ≤ (cid:107)f ∗(cid:107)∞ ≤ 1, κ ≤ 1 2 and they treat d as a constant. taking these into account we do not see the overparameterization requirements or bounds of either work being and (cid:15)(cid:48) = 0 we immediately superior to the other. from theorem 3.8, setting (cid:15) = get the analog of corollary 2 in the work of su & yang (2019). this explains how in the special case that the target function is a finite sum of eigenfunctions of tk∞ , the width m and the number of samples n can grow at the same rate, up to logarithms, and still solve the erm problem. this is an erm guarantee for m = ˜ω(n) and thus attains moderate overparameterization. corollary 3.9. assume assumptions 3.3 and 3.4 hold. furhtermore assume m = k (cid:107)f ∗(cid:107)∞)2 ˜ω (σk−σk+1)2 . let f ∗, p tk∞ , and k be the same as in the hypothesis of theorem 3.8. furthermore assume that (cid:13)(i − p tk∞ )f ∗(cid:13) (cid:13) (cid:13)∞ = 0. also assume we are performing the doubling trick so that ˆr(0) = −y. n (cid:107)ˆr(0)(cid:107)rn )/λk. then we have with probability at least 1 − 3δ over the sampling of set t = log( x1, . . . , xn and θ0 that for t ≤ t LINEBREAK m ≥ o(log(c/δ) + ˜o(d)) n ≥ 128κ2 log(2/δ) LINEBREAK n LINEBREAK note su & yang (2019) are training only the hidden layer of a relu network by gradient descent, by contrast we are training both layers with biases of a network with smooth activations by gradient flow. for corollary 2 by su & yang (2019) they have the overparameterization requirement m (cid:38) . thus both bounds scale like n n log n . our bound has the extra factor λ4 k (σk − σk+1)2 in front which could make it appear smaller at first glance but their theorem 4 is strong enough to include this factor in the corollary they just chose not to. thus we view both overparameterization requirements as comparable with neither superior to the other. LINEBREAK conclusion and future directions LINEBREAK the damped deviations equation allows one to compare the dynamics when optimizing the squared error to that of an arbitrary kernel regression. we showed how this simple equation can be used to track the dynamics of the test residual in the underparameterized regime and extend existing results in the overparameterized setting. in the underparameterized setting the neural network learns eigenfunctions of the integral operator tk∞ determined by the neural tangent kernel at rates corresponding to their eigenvalues. in the overparameterized setting the damped deviations equation combined with ntk deviation bounds allows one to track the dynamics of the empirical risk. in this fashion we extended existing work to the setting of a network with smooth activations where all parameters are trained as in practice. we hope damped deviations offers a simple interpretation of the mse dynamics and encourages others to compare against other kernels in future work. LINEBREAK acknowledgments LINEBREAK benjamin bowman was at the max planck institute for mathematics in the sciences while working on parts of this project. this project has received funding from the european research council (erc) under the european union’s horizon 2020 research and innovation programme (grant agreement no 757983). LINEBREAK references LINEBREAK zeyuan allen-zhu, yuanzhi li, and zhao song. a convergence theory for deep learning via overparameterization. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 242–252. pmlr, 09–15 jun 2019a. url https://proceedings. mlr.press/v97/allen-zhu19a.html. LINEBREAK zeyuan allen-zhu, yuanzhi li, and zhao song. on the convergence rate of training recurrent in h. wallach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and neural networks. r. garnett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019b. url https://proceedings.neurips.cc/paper/2019/file/ 0ee8b85a85a49346fdff9665312a5cc4-paper.pdf. LINEBREAK sanjeev arora, simon du, wei hu, zhiyuan li, and ruosong wang. fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 322–332. pmlr, 09–15 jun 2019. url https://proceedings.mlr.press/v97/arora19a. html. LINEBREAK andrew r barron. approximation and estimation bounds for artificial neural networks. machine LINEBREAK ronen basri, meirav galun, amnon geifman, david jacobs, yoni kasten, and shira kritchman. frequency bias in neural networks for input of non-uniform density. in hal daum´e iii and aarti singh (eds.), proceedings of the 37th international conference on machine learning, volume 119 of proceedings of machine learning research, pp. 685–694. pmlr, 13–18 jul 2020. url https://proceedings.mlr.press/v119/basri20a.html. LINEBREAK alain berlinet and christine thomas-agnan. reproducing kernel hilbert spaces in probability and LINEBREAK statistics. springer, boston, ma, 2004. LINEBREAK avrim l. blum and ronald l. rivest. training a 3-node neural network is np-complete, pp. 9–28. springer berlin heidelberg, berlin, heidelberg, 1993. url https://doi.org/10.1007/ 3-540-56483-7_20. LINEBREAK brian bullins, cyril zhang, and yi zhang. not-so-random features. LINEBREAK in international conference on learning representations, 2018. url https://openreview.net/forum?id= hk8xmwgrb. LINEBREAK yuan cao, zhiying fang, yue wu, ding-xuan zhou, and quanquan gu. towards understanding the LINEBREAK spectral bias of deep learning, 2020. LINEBREAK l´ena¨ıc chizat, edouard oyallon, and francis bach. on lazy training in differentiable programin h. wallach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and r. garming. nett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019. url https://proceedings.neurips.cc/paper/2019/file/ ae614c557843b1df326cb29c57225459-paper.pdf. LINEBREAK simon du, jason lee, haochuan li, liwei wang, and xiyu zhai. gradient descent finds global minima of deep neural networks. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 1675–1685. pmlr, 09–15 jun 2019a. url https://proceedings.mlr.press/v97/du19c.html. LINEBREAK simon s. du, xiyu zhai, barnabas poczos, and aarti singh. gradient descent provably optimizes over-parameterized neural networks. in international conference on learning representations, 2019b. url https://openreview.net/forum?id=s1ek3i09yq. LINEBREAK yonatan dukler, quanquan gu, and guido mont´ufar. optimization theory for relu neural networks trained with normalization layers. in hal daum´e iii and aarti singh (eds.), proceedings of the 37th international conference on machine learning, volume 119 of proceedings of machine learning research, pp. 2751–2760. pmlr, 13–18 jul 2020. url https://proceedings. mlr.press/v119/dukler20a.html. LINEBREAK weinan e, chao ma, and lei wu. a comparative analysis of optimization and generalization properties of two-layer neural network and random feature models under gradient descent dynamics. sci. china math. 63, 1235–1258, 2020. LINEBREAK implicit LINEBREAK suriya gunasekar, blake e woodworth, srinadh bhojanapalli, behnam neyshabur, and in i. guyon, u. v. nati srebro. and r. garnett luxburg, s. bengio, h. wallach, r. fergus, s. vishwanathan, (eds.), advances in neural information processing systems, volume 30. curran associates, inc., 2017. url https://proceedings.neurips.cc/paper/2017/file/ 58191d2a914c6dae66371c9dcdc91b41-paper.pdf. LINEBREAK regularization in matrix factorization. LINEBREAK jiaoyang huang and horng-tzer yau. dynamics of deep neural networks and neural tangent hierarchy. in hal daum´e iii and aarti singh (eds.), proceedings of the 37th international conference on machine learning, volume 119 of proceedings of machine learning research, pp. 4542–4551. pmlr, 13–18 jul 2020. url https://proceedings.mlr.press/v119/huang20l. html. LINEBREAK arthur jacot, franck gabriel, and clement hongler. neural tangent kernel: convergence and in s. bengio, h. wallach, h. larochelle, k. grauman, generalization in neural networks. n. cesa-bianchi, and r. garnett (eds.), advances in neural information processing systems, volume 31. curran associates, inc., 2018. url https://proceedings.neurips.cc/ paper/2018/file/5a4be1fa34e62bb8a6ec6b91d2462f5a-paper.pdf. LINEBREAK ziwei ji and matus telgarsky. the implicit bias of gradient descent on nonseparable data. in alina beygelzimer and daniel hsu (eds.), proceedings of the thirty-second conference on learning theory, volume 99 of proceedings of machine learning research, pp. 1772–1798. pmlr, 25–28 jun 2019. url https://proceedings.mlr.press/v99/ji19a.html. LINEBREAK hui jin and guido mont´ufar. implicit bias of gradient descent for mean squared error regression LINEBREAK jaehoon lee, lechao xiao, samuel schoenholz, yasaman bahri, roman novak, jascha sohldickstein, and jeffrey pennington. wide neural networks of any depth evolve as linear models under gradient descent. in h. wallach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and r. garnett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019. url https://proceedings.neurips.cc/paper/2019/file/ 0d1a9651497a38d8b1c3871c84528bd4-paper.pdf. LINEBREAK moshe leshno, vladimir ya. lin, allan pinkus, and shimon schocken. multilayer feedforward networks with a nonpolynomial activation function can approximate any function. neural networks, 6(6):861–867, 1993. url https://www.sciencedirect.com/science/article/ pii/s0893608005801315. LINEBREAK chaoyue liu, libin zhu, and misha belkin. on the linearity of large non-linear models: when and why the tangent kernel is constant. in h. larochelle, m. ranzato, r. hadsell, m. f. balcan, and h. lin (eds.), advances in neural information processing systems, volume 33, pp. 15954–15964. curran associates, inc., 2020. url https://proceedings.neurips. cc/paper/2020/file/b7ae8fecf15b8b6c3c69eceae636d203-paper.pdf. LINEBREAK behnam neyshabur, ryota tomioka, and nathan srebro. in search of the real inductive bias: on the role of implicit regularization in deep learning. in yoshua bengio and yann lecun (eds.), 3rd international conference on learning representations, iclr 2015, san diego, ca, usa, may 79, 2015, workshop track proceedings, 2015. url http://arxiv.org/abs/1412.6614. LINEBREAK behnam neyshabur, ryota tomioka, ruslan salakhutdinov, and nathan srebro. geometry of opti LINEBREAK mization and implicit regularization in deep learning, 2017. arxiv:1705.03071. LINEBREAK quynh n nguyen and marco mondelli. global convergence of deep networks with one wide in h. larochelle, m. ranzato, r. hadsell, m. f. ballayer followed by pyramidal topology. can, and h. lin (eds.), advances in neural information processing systems, volume 33, pp. 11961–11972. curran associates, inc., 2020. url https://proceedings.neurips. cc/paper/2020/file/8abfe8ac9ec214d68541fcb888c0b4c3-paper.pdf. LINEBREAK samet oymak and mahdi soltanolkotabi. toward moderate overparameterization: global conieee journal on selected areas in LINEBREAK vergence guarantees for training shallow neural networks. information theory, 1(1):84–105, 2020. LINEBREAK samet oymak, zalan fabian, mingchen li, and mahdi soltanolkotabi. generalization guarantees for neural networks via harnessing the low-rank structure of the jacobian, 2020. url https: //openreview.net/forum?id=ryl5cjsfps. LINEBREAK nasim rahaman, aristide baratin, devansh arpit, felix draxler, min lin, fred hamprecht, yoshua bengio, and aaron courville. on the spectral bias of neural networks. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 5301–5310. pmlr, 09–15 jun 2019. url https://proceedings.mlr.press/v97/rahaman19a.html. LINEBREAK ali rahimi and benjamin recht. uniform approximation of functions with random bases. in 2008 46th annual allerton conference on communication, control, and computing, pp. 555–561, 2008a. LINEBREAK ali rahimi and benjamin recht. random features for large-scale kernel machines. LINEBREAK in j. platt, d. koller, y. singer, and s. roweis (eds.), advances in neural information processing systems, volume 20. curran associates, inc., 2008b. url https://proceedings.neurips.cc/ paper/2007/file/013a006f03dbc5392effeb8f18fda755-paper.pdf. LINEBREAK basri ronen, david jacobs, yoni kasten, and shira kritchman. LINEBREAK of neural networks for h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and r. garnett vances information processing systems, inc., 5ac8bb8a7d745102a978c5f8ccdb61b8-paper.pdf. LINEBREAK the convergence rate in h. wallach, (eds.), advolume 32. curran associates, url https://proceedings.neurips.cc/paper/2019/file/ LINEBREAK learned functions of different LINEBREAK frequencies. LINEBREAK in neural LINEBREAK lorenzo rosasco, mikhail belkin, and ernesto de vito. on learning with integral operators. journal of machine learning research, 11(30):905–934, 2010. url http://jmlr.org/papers/ v11/rosasco10a.html. LINEBREAK zhao song and xin yang. quadratic suffices for over-parametrization via matrix chernoff bound, LINEBREAK eduardo d. sontag and h´ector j. sussmann. backpropagation can give rise to spurious local minima LINEBREAK even for networks without hidden layers. complex systems, 3:91–106, 1989. LINEBREAK eduardo d. sontag and h´ector j. sussmann. back propagation separates where perceptrons do. neural networks, 4(2):243–249, 1991. url https://www.sciencedirect.com/ science/article/pii/089360809190008s. LINEBREAK daniel soudry, elad hoffer, mor shpigel nacson, suriya gunasekar, and nathan srebro. the implicit bias of gradient descent on separable data. journal of machine learning research, 19(70): 1–57, 2018. url http://jmlr.org/papers/v19/18-188.html. LINEBREAK lili su and pengkun yang. on learning over-parameterized neural networks: a functional approximation perspective. in h. wallach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and r. garnett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019. url https://proceedings.neurips.cc/paper/2019/file/ 253f7b5d921338af34da817c00f42753-paper.pdf. LINEBREAK roman vershynin. introduction to the non-asymptotic analysis of random matrices. in compressed LINEBREAK sensing, chapter 5. cambridge university press, 2012. LINEBREAK roman vershynin. high-dimensional probability: an introduction with applications in data science. cambridge series in statistical and probabilistic mathematics. cambridge university press, 2018. LINEBREAK gradient dynamics of shallow univariate relu networks. LINEBREAK francis williams, matthew trager, daniele panozzo, claudio silva, denis zorin, and in h. wal(eds.), information processing systems, volume 32. curran associates, url https://proceedings.neurips.cc/paper/2019/file/ LINEBREAK joan bruna. lach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and r. garnett advances inc., 1f6419b1cbe79c71410cb320fc094775-paper.pdf. LINEBREAK in neural LINEBREAK lei wu, zhanxing zhu, and weinan e. towards understanding generalization of deep learning: perspective of loss landscapes. corr, abs/1706.10239, 2017. url http://arxiv.org/ abs/1706.10239. LINEBREAK zhi-qin john xu, yaoyu zhang, and yanyang xiao. training behavior of deep neural network in frequency domain. in tom gedeon, kok wai wong, and minho lee (eds.), neural information processing, pp. 264–274, cham, 2019. springer international publishing. LINEBREAK chiyuan zhang, samy bengio, moritz hardt, benjamin recht, and oriol vinyals. understanding deep learning requires rethinking generalization. in 5th international conference on learning representations, iclr 2017, toulon, france, april 24-26, 2017, conference track proceedings. openreview.net, 2017. url https://openreview.net/forum?id=sy8gdb9xx. LINEBREAK yaoyu zhang, zhi-qin john xu, tao luo, and zheng ma. a type of generalization error inin jianfeng lu and rachel ward (eds.), produced by initialization in deep neural networks. ceedings of the first mathematical and scientific machine learning conference, volume 107 of proceedings of machine learning research, pp. 144–164. pmlr, 20–24 jul 2020. url https://proceedings.mlr.press/v107/zhang20a.html. LINEBREAK difan zou and quanquan gu. an improved analysis of training over-parameterized deep neuin h. wallach, h. larochelle, a. beygelzimer, f. d'alch´e-buc, e. fox, and ral networks. r. garnett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019. url https://proceedings.neurips.cc/paper/2019/file/ 6a61d423d02a1c56250dc23ae7ff12f3-paper.pdf. LINEBREAK difan zou, yuan cao, dongruo zhou, and quanquan gu. gradient descent optimizes over LINEBREAK parameterized deep relu networks. machine learning, 109:467–492, 2020. LINEBREAK appendix LINEBREAK a additional notations LINEBREAK we let [k] := {1, 2, 3, . . . , k}. for a set a we let |a| denote its cardinality. (cid:107)•(cid:107)f denotes the frobenius norm for matrices, and for two matrices a, b ∈ rn×m we will let (cid:104)a, b(cid:105) = t r(at b) = (cid:80)n j=1 ai,jbi,j denote the frobenius or entry-wise inner product. we will let br := {x : LINEBREAK (cid:107)x(cid:107)2 ≤ r} to be the euclidean ball of radius r > 0. LINEBREAK b ntk deviation and parameter norm bounds LINEBREAK let γ > 1. at the end of this section we will prove a high probability bound of the form LINEBREAK sup (x,x(cid:48))∈bm ×bm LINEBREAK |kt(x, x(cid:48)) − k∞(x, x(cid:48))| = ˜o LINEBREAK d m LINEBREAK ideally we would like to use the results in huang & yau (2020) where they prove for a deep feedforward network without biases: LINEBREAK sup 1≤i,j≤n LINEBREAK |kt(xi, xj) − k∞(xi, xj)| = ˜o LINEBREAK however there are three problems that prevent this. the first is that the have a constant under the ˜o above that depends on the training data. specifically their assumption 2.2 requires that the smallest singular value of the data matrix [xα1 , . . . , xαr ] is greater than cr > 0 where 1 ≤ α1, . . . , αr ≤ n are arbitrary distinct indices. as you send the number of samples to infinity you will have cr → 0, thus it is not clear how the bound will scale in the large sample regime. the second is that their bound only holds on the training data, whereas we need a bound that is uniform over all inputs. the final one is their network does not have biases. in the following section we will overcome these issues. the main difference between our argument and theirs is how we prove convergence at initialization. in their argument for convergence at initialization they make repeated use of a gaussian conditioning lemma as they pass through the layers, and this relies on their assumption 2.2. by contrast we will use lipschitzness of the ntk and convergence over an (cid:15) net to prove convergence at initialization. as we see it, our deviation bounds for the time derivative ∂tkt are proved in a very similar fashion and the rest of the argument is very much inspired by their approach. LINEBREAK at the time of submission of this manuscript, we were made aware of the work by liu et al. (2020) that provides an alternative uniform ntk deviation bound by providing a uniform bound on the operator norm of the hessian. their work is very nice, and it opens the door to extending the results of this paper to the other architectures they consider. nevertheless, we proceed with our original analysis below. LINEBREAK this section is conceptually simple but technical. we will take care to outline the high level structure of each section to prevent the technicalities from obfuscating the overall simplicity of the approach. our argument runs through the following steps: LINEBREAK • control parameter norms throughout training. • bound the lipschitz constant of the n t k with respect to spatial inputs. • use concentration of subexponential random variables (bernstein’s inequality) to show that |k∞(z(cid:48)) − k0(z(cid:48))| = ˜o(1/ m) (roughly) for all z(cid:48) in an (cid:15) net of the spatial domain. combine with the lipschitz property of the n t k to show convergence over all inputs, √ namely supz∈bm |k∞(z) − k0(z)| = ˜o(1/ LINEBREAK m) (roughly). √ LINEBREAK • produce the bound supz∈bm ×bm |∂tkt(z)| = ˜o(1/ • conclude that supz∈bm ×bm |kt(z) − k0(z)| = ˜o(t/ LINEBREAK m) (roughly). √ LINEBREAK m) (roughly). LINEBREAK important equations LINEBREAK the following list contains the equations that are relevant for this section. we found it easier to read the following proofs by keeping these equations on a separate piece of paper or in a separate tab. we write a ⊗ x = axt . also throughout this section the training data will be considered fixed and thus the randomness of the inputs is not relevant to this section. the randomness will come entirely from the parameter initialization θ0. LINEBREAK f (x; θ) = LINEBREAK at σ(w x + b) + b0 LINEBREAK σ(w x + b) LINEBREAK ∂af (x; θ) = LINEBREAK σ(w x + b) = x(1) LINEBREAK ∂w f (x; θ) = LINEBREAK ∂bf (x; θ) = LINEBREAK ∂ta = − LINEBREAK ˆrix(1) i LINEBREAK ∂tw = − LINEBREAK ∂tb = − LINEBREAK ˆri LINEBREAK σ(cid:48) 1(xi)a ⊗ xi LINEBREAK ˆri LINEBREAK ˆri LINEBREAK σ(cid:48) 1(x)[∂tw x + ∂tb] LINEBREAK a √ m LINEBREAK ∂tx(1) = ∂t LINEBREAK σ(w x + b) = LINEBREAK ˆri LINEBREAK ˆri LINEBREAK 1 (x)diag(∂tw x + ∂tb) LINEBREAK b.2 a priori parameter norm bounds LINEBREAK in this section we will provide bounds for the following quantities: 1 1 √ √ m m LINEBREAK ξ(t) = max{ LINEBREAK ˜ξ(t) = max{max (cid:96)∈[m] LINEBREAK here w(cid:96) = w(cid:96),: ∈ rd is the vector of input weights to the (cid:96)th unit. these quantities appear repeatedly throughout the rest of the proofs of this section and thus need to be controlled. the parameter norm bounds will also be useful for the purpose of the covering number argument in section c.6. this section is broken down as follows: LINEBREAK • prove lemma b.1 • bound ξ(t) • bound ˜ξ(t) LINEBREAK the time derivatives throughout will repeatedly be of the form 1 n a simple bound that we will use over and over again. lemma b.1. let (cid:107)•(cid:107) be any norm over a vector space v . then for any v1, . . . , vn ∈ v we have LINEBREAK i=1 ˆri(t)vi. lemma b.1 provides LINEBREAK ˆri(t)vi LINEBREAK ≤ max i∈[n] LINEBREAK proof. note that LINEBREAK ˆri(t)vi LINEBREAK |ˆri(t)| (cid:107)vi(cid:107) ≤ max i∈[n] LINEBREAK |ˆri(t)| LINEBREAK ≤ max i∈[n] LINEBREAK where the last inequality follows from (cid:107)ˆr(t)(cid:107)rn ≤ (cid:107)ˆr(0)(cid:107)rn from gradient flow. LINEBREAK we now proceed to bound ξ(t). lemma b.2. let ξ(t) = max{ 1√ LINEBREAK then for any initial conditions w (0), b(0), a(0) we have for all t (cid:18) d (cid:90) t √ m LINEBREAK (cid:18) d √ m LINEBREAK ξ(0) ≤ exp LINEBREAK ξ(t) ≤ exp LINEBREAK proof. recall that LINEBREAK ∂ta = − LINEBREAK ˆri LINEBREAK ˆrix(1) i LINEBREAK σ(cid:48) 1(xi)a ⊗ xi LINEBREAK ˆri LINEBREAK ∂tw = − LINEBREAK ∂tb = − LINEBREAK we will show that each of the above derivatives is (cid:46) (cid:107)ˆr(t)(cid:107)rn ξ(t) then apply gr¨onwall’s inequality. by lemma b.1 it suffices to show that the terms multiplied by ˆri in the above sums are (cid:46) ξ(t). first we note that LINEBREAK i LINEBREAK σ(w xi + b) LINEBREAK ≤ dξ. LINEBREAK second we have that (cid:13) (cid:13) (cid:13) (cid:13) LINEBREAK σ(cid:48) 1(xi)a ⊗ xi LINEBREAK finally we have that LINEBREAK thus by lemma b.1 and the above bounds we have LINEBREAK let v(t) be a placeholder for one of the functions norm (cid:107)•(cid:107). then we have that LINEBREAK m w (t), 1√ LINEBREAK m b(t) with corresponding LINEBREAK ∂sv(s)ds LINEBREAK dξ(s)ds. LINEBREAK this inequality holds for any of the three choices of v thus we get that LINEBREAK 0 therefore by gr¨onwall’s inequality we get that LINEBREAK dξ(s)ds. LINEBREAK ξ(t) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK ξ(0) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK we will now bound ˜ξ(t) using essentially the same argument as in the previous lemma. lemma b.3. let ˜ξ(t) = max{max(cid:96)∈[m] (cid:107)w(cid:96)(t)(cid:107)2 , (cid:107)a(t)(cid:107)∞ , (cid:107)b(t)(cid:107)∞ , 1} and LINEBREAK then for any initial conditions w (0), b(0), a(0) we have for all t LINEBREAK ˜ξ(t) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK ˜ξ(0) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK proof. the proof is basically the same as lemma b.2. we have that LINEBREAK ∂tw(cid:96) = − LINEBREAK ˆri LINEBREAK a(cid:96)√ m LINEBREAK now note LINEBREAK a(cid:96)√ m LINEBREAK d √ m LINEBREAK thus by lemma b.1 we have that LINEBREAK d √ m LINEBREAK ˜ξ(t). LINEBREAK ∂ta = − LINEBREAK ˆrix(1) i LINEBREAK on the other hand LINEBREAK with LINEBREAK i LINEBREAK σ(w xi + b) LINEBREAK d √ m LINEBREAK thus again by lemma b.1 we have LINEBREAK finally we have LINEBREAK with LINEBREAK d √ m LINEBREAK ˜ξ(t). LINEBREAK ∂tb = − LINEBREAK ˆri LINEBREAK d √ m LINEBREAK again applying lemma b.1 one last time we get LINEBREAK d √ m LINEBREAK ˜ξ(t). LINEBREAK therefore by the same argument as in lemma b.2 using gr¨onwall’s inequality we get that LINEBREAK ˜ξ(t) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK ˜ξ(0) ≤ exp LINEBREAK (cid:18) d √ m LINEBREAK b.3 n t k is lipschitz with respect to spatial inputs LINEBREAK the n t k being lipschitz with respect to spatial inputs is essential to our proof. the lipschitz property means that to show convergence uniformly for all inputs it suffices to show convergence on an (cid:15) net of the spatial domain. since the parameters are changing throughout time, the lipschitz constant of the n t k will change throughout time. we will see that the lipschitz constant depends on the quantities ξ(t) and ˜ξ(t) from the previous section b.2. the n t k kt(x, x(cid:48)) is a sum of terms of the form g(x)t g(x(cid:48)) where g is one of the derivatives ∂af (x; θt), ∂bf (x; θt), ∂w f (x; θt), ∂b0 f (x; θt). since ∂b0 f (x; θt) ≡ 1 this term can be ignored for the rest of the section. the upcomming lemma b.4 shows that if g is lipschitz and bounded then (x, x(cid:48)) (cid:55)→ g(x)t g(x(cid:48)) is lipschitz. this lemma guides the structure of this section: LINEBREAK • prove lemma b.4 • show that ∂af (x; θ), ∂bf (x; θ), ∂w f (x; θ) are bounded and lipschitz • conclude the n t k is lipschitz LINEBREAK lemma b.4. let g : rk → rl be l-lipschitz with respect to the 2-norm, i.e. LINEBREAK and satisfy (cid:107)g(x)(cid:107)2 ≤ m for all x in some set x . then kg : x × x → r LINEBREAK kg(x, x(cid:48)) := g(x)t g(x(cid:48)) LINEBREAK is m l-lipschitz with respect to the norm LINEBREAK proof. we have LINEBREAK to show that the n t k is lipschitz it suffices to show that by the previous lemma b.4, ∂af (x; θ), ∂bf (x; θ), ∂w f (x; θ), ∂b0 f (x; θ) are bounded and lipschitz. the following lemma bounds the norms of the derivatives ∂af (x; θ), ∂w f (x; θ), ∂bf (x; θ). lemma b.5. let d = 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1} and 1 √ m LINEBREAK ξ = max{ LINEBREAK then LINEBREAK proof. we have LINEBREAK σ(w x + b) LINEBREAK ≤ dξ, LINEBREAK m √ m LINEBREAK the following lemma demonstrates that ∂af (x; θ), ∂w f (x; θ), and ∂bf (x; θ) are lipschitz as functions of the input x. lemma b.6. let LINEBREAK ξ = max{ LINEBREAK ˜ξ = max{max (cid:96)∈[m] LINEBREAK d(cid:48) = max{(cid:107)σ(cid:48)(cid:107)∞ , m (cid:107)σ(cid:48)(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:48)(cid:107)∞}, l = 2ξ ˜ξd(cid:48). then ∂af (x; θ), ∂bf (x; θ), ∂w f (x; θ) are all l-lipschitz with respect to the euclidean norm (cid:107)•(cid:107)2. in symbols: LINEBREAK proof. we have LINEBREAK (σ(w x + b) − σ(w y + b)) LINEBREAK 1(y)a] ⊗ y LINEBREAK finally we can prove that the neural tangent kernel is lipschitz. theorem b.7. consider the neural tangent kernel LINEBREAK and let LINEBREAK ξ = max{ LINEBREAK ˜ξ = max{max (cid:96)∈[m] LINEBREAK with lipschitz constant l := 6dd(cid:48)ξ2 ˜ξ. in symbols: LINEBREAK proof. by lemma b.5, we have that the gradients are bounded LINEBREAK (cid:107)∂af (x; θ)(cid:107)2 , (cid:107)∂w f (x; θ)(cid:107)f , (cid:107)∂bf (x; θ)(cid:107)2 ≤ dξ. also by lemma b.6 the gradients are lipschitz with lipschitz constant 2ξ ˜ξd(cid:48). thus these two facts combined with lemma b.4 tell us that each of the three terms (cid:104)∂af (x; θ), ∂af (y; θ)(cid:105), (cid:104)∂bf (x; θ), ∂bf (y; θ)(cid:105), and (cid:104)∂w f (x; θ), ∂w f (y; θ)(cid:105) are individually lipschitz with constant (dξ) · (2ξ ˜ξd(cid:48)). thus the lipschitz constant of the n t k itself is bounded by the sum of the 3 lipschitz constants, for a total of 6dd(cid:48)ξ2 ˜ξ. LINEBREAK using that the n t k at time zero k0(x, y) is lipschitz we can prove that the analytical ntk k∞ = e[k0(x, y)] is lipschitz. we will use this primarily as a qualitative statement, meaning that the estimate that we derive for the lipschitz constant will not be used as it is not very explicit. rather, in theorems where we use the fact that k∞ is lipschitz we will simply take the lipschitz constant of k∞ as an external parameter. theorem b.8. assume that wi,j(0) ∼ w, b(cid:96)(0) ∼ b, a(cid:96)(0) ∼ a are all i.i.d. zero-mean, unit variance subgaussian random variables. let LINEBREAK ξ(0) = max{ LINEBREAK ˜ξ(0) = max{max (cid:96)∈[m] LINEBREAK d = 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, d(cid:48) = max{(cid:107)σ(cid:48)(cid:107)∞ , m (cid:107)σ(cid:48)(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:48)(cid:107)∞}. then the analytical neural tangent kernel k∞(x, y) = e[k0(x, y)] is lipschitz with respect to the norm LINEBREAK (cid:107)(x, y)(cid:107) := (cid:107)x(cid:107)2 + (cid:107)y(cid:107)2 with lipschitz constant ≤ 6dd(cid:48)e[ξ2 ˜ξ] < ∞. if one instead does the doubling trick then the same conclusion holds. LINEBREAK proof. first assume we are not doing the doubling trick. we note that LINEBREAK |k∞(x, y) − k∞(x(cid:48), y(cid:48))| = |e[k0(x, y)] − e[k0(x(cid:48), y(cid:48))]| ≤ e |k0(x, y) − k0(x(cid:48), y(cid:48))| ≤ 6dd(cid:48)e[ξ2 ˜ξ] (cid:107)(x, y) − (x(cid:48), y(cid:48))(cid:107) where the last line follows from the lipschitzness of k0 provided by theorem b.7. using that (cid:107)w (0)(cid:107)op ≤ (cid:107)w (0)(cid:107)f and the fact that the euclidean norm of a vector with i.i.d. subgaussian entries is subgaussian (vershynin, 2018, theorem 3.1.1), we have that ξ(0) and ˜ξ(0) are maximums of subgaussian random variables. since a maximum of subgaussian random variables is subgaussian, we have that ξ(0) and ˜ξ(0) are subgaussian. from the inequality ab ≤ 1 2 (a2 + b2) we get e[ ˜ξ2] < ∞ since moments of subgaussian random variables are all finite. e[ξ2 ˜ξ] ≤ 1 2 since the doubling trick does not change the distribution of k0, the same conclusion holds under that initialization scheme. LINEBREAK b.4 n t k convergence at initialization LINEBREAK in this section we prove that supz∈bm ×bm |k0(z) − k∞(z)| = ˜o(1/ the following steps: LINEBREAK m). our argument traces LINEBREAK • show that k0 is sum of averages of m independent subexponential random variables • use subexponential concentration to show that supz(cid:48)∈∆ |k0(z(cid:48)) − k∞(z(cid:48))| = ˜o(1/ LINEBREAK m) LINEBREAK for all z(cid:48) in an (cid:15) net ∆ of bm × bm LINEBREAK • use that k0 is lipschitz and convergence over the epsilon net ∆ to show that LINEBREAK |k0(z) − k∞(z)| = ˜o(1/ LINEBREAK m) (roughly) LINEBREAK sup z∈bm ×bm LINEBREAK we recall the following definitions 2.5.6 and 2.7.5 from vershynin (2018). definition b.9. (vershynin 2018) let y be a random variable. then we define the subgaussian norm of y to be LINEBREAK = inf{t > 0 : e exp(y 2/t2) ≤ 2} LINEBREAK < ∞, then we say y is subgaussian. LINEBREAK if (cid:107)y (cid:107)ψ2 definition b.10. (vershynin 2018) let y be a random variable. then we define the subexponential norm of y to be LINEBREAK = inf{t > 0 : e exp(|y |/t) ≤ 2} LINEBREAK < ∞, then we say y is subexponential. LINEBREAK we also recall the following useful lemma vershynin (2018, lemma 2.7.7). lemma b.11. (vershynin 2018) let x and y be subgaussian random variables. then xy is subexponential. moreover LINEBREAK we recall one last definition vershynin (2018, definition 3.4.1) definition b.12. (vershynin 2018) a random vector y ∈ rk is called subgaussian if the one dimensional marginals (cid:104)y, x(cid:105) are subgaussian random variables for all x ∈ rk. the subgaussian norm of y is defined as LINEBREAK = sup LINEBREAK x∈sk−1 LINEBREAK the typical example of a subgaussian random vector is a random vector with independent subgaussian coordinates. the following lemma demonstrates that the n t k at initializeation is a sum of terms that are averages of independent subexponential random variables, which will enable us to use concentration arguments later. theorem b.13. let w(cid:96), b(cid:96), a(cid:96) all be independent subgaussian random variables with subgaussian norms satisfying (cid:107)•(cid:107)ψ2 LINEBREAK ≤ k. furthermore assume (cid:107)1(cid:107)ψ2 LINEBREAK ≤ k. also let LINEBREAK then for fixed x, y, each of the following LINEBREAK is an average of m independent subexponential random variables with subexponential norms bounded by d2k 2. LINEBREAK proof. we first observe that LINEBREAK note that LINEBREAK thus LINEBREAK also LINEBREAK therefore LINEBREAK finally LINEBREAK ≤ dk. LINEBREAK ≤ dk. LINEBREAK it follows by lemma b.11 that each of (cid:104)∂af (x; θ), ∂af (y; θ)(cid:105), (cid:104)∂w f (x; θ), ∂w f (y; θ)(cid:105), and (cid:104)∂bf (x; θ), ∂bf (y; θ)(cid:105) is an average of m independent subexponential random variables with subexponential norm (cid:107)•(cid:107)ψ1 LINEBREAK we now recall the following theorem from vershynin (2012, theorem 5.39) which will be useful. lemma b.14 (vershynin 2012). let a be an n ×n matrix whose rows ai are independent subgaussian isotropic random vectors in rn. then for every t ≥ 0, with probability at least 1 − 2 exp(−ct2) one has the following bounds on the singular values LINEBREAK n − c LINEBREAK n − t ≤ smin(a) ≤ smax(a) ≤ LINEBREAK n + c LINEBREAK n + t. LINEBREAK here c = ck > 0 depends only on the subgaussian norms k = maxi (cid:107)ai(cid:107)ψ2 LINEBREAK of the rows. LINEBREAK also the following special case of vershynin (2012, lemma 5.5) will be useful for us. lemma b.15 (vershynin 2012). let y be subgaussian. then LINEBREAK it will be useful to remind the reader that c, c > 0 denote absolute constants whose meaning will vary from statement-to-statement, as this abuse of notation becomes especially prevalent during the concentration of measure arguments of the rest of the section. the following lemma provides a concentration inequality for the maximum of subgaussian random variables which will be useful for bounding ξ and ˜ξ later which is necessary for bounding the lipschitz constant of k0. lemma b.16. let y1, . . . , yn be subgaussian random variables with (cid:107)yi(cid:107)ψ2 there exists absolute constants c, c(cid:48), c > 0 such that LINEBREAK ≤ k for i ∈ [n]. then LINEBREAK p LINEBREAK max i∈[n] LINEBREAK |yi| > t + k(cid:112)c(cid:48) log n LINEBREAK ≤ c exp(−ct2/k 2). LINEBREAK proof. since each yi is subgaussian we have for any t ≥ 0 (lemma b.15) LINEBREAK p (|yi| > t) ≤ c exp LINEBREAK by the union bound, LINEBREAK p LINEBREAK max i∈[n] LINEBREAK |yi| > t + k LINEBREAK ≤ nc exp LINEBREAK −c LINEBREAK t + k LINEBREAK c−1 log n LINEBREAK thus by setting c(cid:48) := c−1 we get the desired result. LINEBREAK c−1 log n LINEBREAK p LINEBREAK |yi| > t + k LINEBREAK c−1 log n LINEBREAK = c exp(−ct2/k 2). LINEBREAK we now introduce a high probability bound for ξ. lemma b.17. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)w(cid:96)(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let LINEBREAK ξ = max{ LINEBREAK then with probability at least 1 − δ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK proof. note that by setting t = (cid:112)c−1 log(2/δ) in lemma b.14 we have that with probability at least 1 − δ √ LINEBREAK c √ LINEBREAK d m LINEBREAK also by theorem 3.1.1 in (vershynin, 2018) LINEBREAK (cid:13) (cid:13)(cid:107)a(cid:107)2 − (cid:13) (cid:13)(cid:107)b(cid:107)2 − thus by lemma b.15 and a union bound we have with probability at least 1 − 2δ LINEBREAK c √ m LINEBREAK thus by replacing every δ in the above arguments with δ/3 and using the union bound we have with probability at least 1 − δ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK similarly we now introduce a high probability bound for ˜ξ. lemma b.18. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)w(cid:96)(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let LINEBREAK ˜ξ = max{max (cid:96)∈[m] LINEBREAK then with probability at least 1 − δ we have LINEBREAK proof. by theorem 3.1.1 in (vershynin, 2018) we have LINEBREAK d LINEBREAK well then by lemma b.16 there is a constant c(cid:48) > 0 so that (cid:18) LINEBREAK p LINEBREAK max (cid:96)∈[m] LINEBREAK ≤ p LINEBREAK max (cid:96)∈[m] LINEBREAK d LINEBREAK ≤ c exp(−ct2/k 4). LINEBREAK thus by setting t = ck 2(cid:112)log(c/δ) we have with probability at least 1 − δ √ d + ck 2(cid:112)log(c/δ) + ck 2(cid:112)log m √ LINEBREAK max (cid:96)∈[m] LINEBREAK where we have absorbed the constant get with probability at least 1 − 2δ that LINEBREAK c(cid:48) into c. similarly by lemma b.16 and a union bound we LINEBREAK (cid:107)a(cid:107)∞ , (cid:107)b(cid:107)∞ ≤ ck(cid:112)log(c/δ) + ck(cid:112)log m thus by replacing each δ with δ/3 in the above arguments and using the union bound we get with probability at least 1 − δ LINEBREAK we are now finally ready to prove the main theorem of this section. theorem b.19. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)w(cid:96)(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let LINEBREAK define LINEBREAK ρ(m, σ, d, k, δ, m) := LINEBREAK cdd(cid:48) LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK let l(k∞) denote the lipschitz constant of k∞. if LINEBREAK m ≥ c[log(c/δ) + 2d log(cm max{ρ, l(k∞)} LINEBREAK m)], LINEBREAK then with probability at least 1 − δ LINEBREAK sup z∈bm ×bm LINEBREAK |k0(z) − k∞(z)| ≤ LINEBREAK log(c/δ) + 2d log(cm max{ρ, l(k∞)} LINEBREAK m) LINEBREAK if one instead does the doubling trick then the same conclusion holds. LINEBREAK proof. first assume we are not doing the doubling trick. recall that by theorem b.7 that k0 is lipschitz with constant at most LINEBREAK cdd(cid:48)ξ(0)2 ˜ξ(0), where ξ and ˜ξ are defined as in the theorem. well then by lemmas b.17, b.18 and a union bound we have with probability at least 1 − 2δ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK let l(k0), l(k∞) denote the lipschitz constant of k0 and k∞ respectively. then assuming the above inequality holds we have that LINEBREAK l(k0) ≤ ρ(m, σ, d, k, δ, m). LINEBREAK for conciseness from now on we will suppress the arguments of ρ. now set LINEBREAK 2 max{ρ, l(k∞)} LINEBREAK m LINEBREAK let nγ(bm ) be the cardinality of a maximal γ-net of the ball bm = {x : (cid:107)x(cid:107)2 ≤ m } with respect to the l2 norm (cid:107)•(cid:107)2. by a standard volume argument we have that LINEBREAK nγ(bm ) ≤ LINEBREAK (cid:18) cm γ LINEBREAK by taking the product of two γ/2 nets of bm it follows that we can choose a γ net of bm × bm , say ∆, with respect to the norm LINEBREAK such that LINEBREAK (cid:18) cm γ LINEBREAK =: mγ. LINEBREAK by theorem b.13 for (x, y) ∈ bm × bm fixed each of the following LINEBREAK is an average of m subexponential random variables with subexponential norm at most d2k 2. therefore separately from the randomness discussed before by bernstein’s inequality vershynin (2018, theorem 2.8.1) and a union bound we have LINEBREAK p(|k0(x, y) − k∞(x, y)| > t) ≤ 3 × 2 exp LINEBREAK −c min LINEBREAK thus for t ≤ d2k 2 we have LINEBREAK p(|k0(x, y) − k∞(x, y)| > t) ≤ 6 exp LINEBREAK −c LINEBREAK then by a union bound and the previous inequality we have that for t ≤ d2k 2 LINEBREAK p LINEBREAK max z(cid:48)∈∆ LINEBREAK ≤ 6mγ exp LINEBREAK −c LINEBREAK thus by setting t = cd2k 2 ensures that t ≤ d2k 2) we get that with probability 1 − δ LINEBREAK log(c/δ)+log mγ m LINEBREAK (note that the condition on m in the hypothesis LINEBREAK max z(cid:48)∈∆ LINEBREAK now fix z ∈ bm × bm and choose z(cid:48) ∈ ∆ such that (cid:107)z − z(cid:48)(cid:107) ≤ γ. then LINEBREAK ≤ 2 max{l(k0), l(k∞)}γ + t. LINEBREAK note that this argument runs through for any z ∈ bm × bm therefore LINEBREAK sup z∈bm ×bm LINEBREAK |k0(z) − k∞(z)| ≤ 2 max{l(k0), l(k∞)}γ + t. LINEBREAK well by replacing δ with δ/3 in the previous arguments by taking a union bound we can assume that equations (1) and (2) hold simultaneously. in which case LINEBREAK sup z∈bm ×bm LINEBREAK |k0(z) − k∞(z)| ≤ 2 max{l(k0), l(k∞)}γ + t ≤ 2 max{ρ, l(k∞)}γ + t LINEBREAK (cid:112)log(c/δ) + log mγ √ m (cid:113) LINEBREAK (cid:112)log(c/δ) + 2d log(cm/γ) √ m LINEBREAK log(c/δ) + 2d log(cm max{ρ, l(k∞)} LINEBREAK m) LINEBREAK where we have used the definition of mγ in the second-to-last equality and the definition of γ in the last equality. since the doubling trick does not change the distribution of k0, the same conclusion holds under that initialization scheme. LINEBREAK we immediately get the following corollary. corollary b.20. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)w(cid:96)(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. then LINEBREAK suffices to ensure that with probability at least 1 − δ LINEBREAK m ≥ c[log(c/δ) + ˜o(d)] LINEBREAK sup z∈bm ×bm LINEBREAK |k0(z) − k∞(z)| = ˜o LINEBREAK d m LINEBREAK if one instead does the doubling trick then the same conclusion holds. LINEBREAK b.5 control of network at initialization LINEBREAK many of our previous results depend on the quantity (cid:107)ˆr(0)(cid:107)rn which depends on the network at initialization. before we proceed we must control the infinity norm of the network at initialization and work out a few consequences of this. the following lemma controls (cid:107)f (•; θ0)(cid:107)∞. lemma b.21. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a, b0 ∼ b(cid:48) are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)1(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK l(m, σ, d, k, δ) := LINEBREAK assume that LINEBREAK then with probability at least 1 − δ LINEBREAK m ≥ c[log(c/δ) + d log(cm l)]. LINEBREAK |f (x; θ0)| ≤ cdk 2(cid:112)d log(cm l) + log(c/δ) = ˜o( LINEBREAK d). LINEBREAK sup x∈bm LINEBREAK proof. first we note that (cid:12) (cid:12) (cid:12) (cid:12) LINEBREAK at √ m LINEBREAK σ(w x + b) − LINEBREAK where ξ(0) is defined as in lemma b.17. thus f (•; θ0) is lipschitz with constant l = √ LINEBREAK m (cid:107)σ(cid:48)(cid:107)∞ ξ(0)2. well then by lemma b.17 we have with probability at least 1 − δ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK when the above holds we have that f (•; θ0) is lipschitz with constant d + k 2(cid:112)log(c/δ) m LINEBREAK l := LINEBREAK on the other hand note that LINEBREAK thus LINEBREAK therefore by lemma b.11 we have LINEBREAK (cid:107)a(cid:96)σ((cid:104)w(cid:96), x(cid:105)2 + b(cid:96))(cid:107)ψ1 thus for each x fixed we have by bernstein’s inequality vershynin (2018, theorem 2.8.1) LINEBREAK p LINEBREAK (cid:32)(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:96)=1 √ mdk 2 this simplifies to LINEBREAK thus for t ≤ LINEBREAK > t LINEBREAK m LINEBREAK ≤ 2 exp LINEBREAK −c min LINEBREAK t m dk 2 LINEBREAK p LINEBREAK > t LINEBREAK m LINEBREAK ≤ 2 exp LINEBREAK −c LINEBREAK let ∆ be a γ net of the ball bm = {x : (cid:107)x(cid:107)2 ≤ m } with respect to the euclidean (cid:107)•(cid:107)2 norm. then by a standard volume argument we have that LINEBREAK (cid:18) cm γ LINEBREAK =: mγ. LINEBREAK thus by a union bound we have for t ≤ LINEBREAK > t LINEBREAK p LINEBREAK max x∈∆ LINEBREAK m LINEBREAK ≤ 2mγ exp LINEBREAK −c LINEBREAK thus by setting t = cdk 2(cid:112)log(cmγ/δ) assuming t ≤ least 1 − δ LINEBREAK mdk 2 we have with probability at LINEBREAK a(cid:96)√ m LINEBREAK max x∈∆ LINEBREAK ≤ t. LINEBREAK on the other hand by lemma b.15 our prior definition of t is large enough (up to a redefinition of the constants c, c) to ensure that with probability at least 1 − δ LINEBREAK |b0| ≤ t. (5) when (4) and (5) hold simultaneously we have that maxx(cid:48)∈∆ |f (x(cid:48), θ0)| ≤ 2t. by a union bound we have with probability at least 1 − 3δ that (3), (4), (5) hold simultaneously. well then for any x ∈ bm we may choose x(cid:48) ∈ ∆ so that (cid:107)x − x(cid:48)(cid:107)2 ≤ γ. then LINEBREAK therefore LINEBREAK sup x∈bm LINEBREAK and this argument runs through for any γ > 0. we will set γ = 1/l. note that for this choice of γ mdk 2. thus the preceding argument goes through in this the hypothesis on m ensures that t ≤ case. thus by replacing δ with δ/3 in the previous argument we get the desired conclusion up to a redefinition of c, c. LINEBREAK we quickly introduce the following lemma. LINEBREAK lemma b.22. LINEBREAK proof. let ˆy ∈ rn be the vector whose ith entry is equal to f (xi; θ0). well then note that (cid:107)ˆy(cid:107)rn ≤ (cid:107)f (•; θ0)(cid:107)∞. therefore LINEBREAK finally we prove one last lemma that will be useful later. LINEBREAK lemma b.23. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)1(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let γ > 1, d = 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, LINEBREAK l(m, σ, d, k, δ) := LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK ρ := cdk 2(cid:112)d log(cm l) + log(c/δ) = ˜o( LINEBREAK d). LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK suppose LINEBREAK then with probability at least 1 − δ LINEBREAK max t≤t LINEBREAK ξ(t) ≤ γξ(0) max t≤t LINEBREAK where ξ(t) and ˜ξ(t) are defined as in lemmas b.2 and b.3. if one instead does the doubling trick the second hypothesis on m can be removed and the conclusion holds with probability 1. LINEBREAK proof. first assume we are not doing the doubling trick. well from the condition m ≥ (cid:0) ρ dk2 have by lemma b.21 that with probability at least 1 − δ LINEBREAK we LINEBREAK |f (x; θ0)| ≤ cdk 2(cid:112)d log(cm l) + log(c/δ) =: ρ. LINEBREAK sup x∈bm LINEBREAK also by lemma b.22 and the above bound we have LINEBREAK well in this case LINEBREAK ≤ log(γ), LINEBREAK where we have used the hypothesis on m in the last inequality. therefore by lemmas b.2, b.3 we have in this case that LINEBREAK max t≤t LINEBREAK ξ(t) ≤ γξ(0) max t≤t LINEBREAK now assume we are performing the doubling trick so that f (•; θ0) ≡ 0. then ρ in the previous argument can simply be replaced with zero and the same argument runs through, except using lemma b.21 is no longer necessary (and thus the second hypothesis on m is not needed). without using lemma b.21 the whole argument is deterministic so that the conclusion holds with probability 1. LINEBREAK b.6 n t k time deviations bounds LINEBREAK in this section we bound the deviations of the n t k throughout time. this section runs through the following steps LINEBREAK • bound sup(x,y)∈bm ×bm |∂tkt(x, y)| • bound sup(x,y)∈bm ×bm |kt(x, y) − k0(x, y)| LINEBREAK in the following lemma we will provide an upper bound on the n t k derivative supx,y∈bm ×bm |∂tkt(x, y)|. lemma b.24. let LINEBREAK ξ(t) = max{ LINEBREAK ˜ξ(t) = max{max (cid:96)∈[m] LINEBREAK (cid:3) max{1, m }. LINEBREAK then for any initial conditions w (0), b(0), a(0) we have for all t LINEBREAK sup x,y∈bm ×bm LINEBREAK |∂tkt(x, y)| ≤ LINEBREAK cdd(cid:48) √ m LINEBREAK proof. we need to bound the following time derivatives LINEBREAK ∂t∂af (x; θ) = ∂tx(1) = − LINEBREAK ˆri LINEBREAK a √ m LINEBREAK ∂t∂w f (x; θ) = ∂t LINEBREAK 1(x)(∂ta)] ⊗ x LINEBREAK ∂t∂bf (x; θ) = ∂t LINEBREAK 1(x)∂ta) . LINEBREAK note that LINEBREAK a √ m LINEBREAK thus by lemma b.1 LINEBREAK on the other hand LINEBREAK ˆri LINEBREAK well LINEBREAK thus by lemma b.1 we have that LINEBREAK finally we have LINEBREAK well LINEBREAK ˆriσ(cid:48) LINEBREAK i LINEBREAK i LINEBREAK i LINEBREAK thus we finally by lemma b.1 again we get that LINEBREAK it follows that LINEBREAK and similarly LINEBREAK m √ m LINEBREAK thus in total we can say LINEBREAK d(cid:48) √ m LINEBREAK it thus follows by the chain rule and lemma b.5 that LINEBREAK sup (x,y)∈bm ×bm LINEBREAK |∂tkt(x, y)| ≤ LINEBREAK cdd(cid:48) √ m LINEBREAK using the previous lemma we can now bound the deviations of the n t k. theorem b.25. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian ≤ k for each random variables with unit variance. furthermore assume (cid:107)w(cid:96)(cid:107)ψ2 (cid:96) ∈ [m] where k ≥ 1. let γ > 1 and t > 0 be positive constants, LINEBREAK (cid:3) max{1, m }, LINEBREAK and assume LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK then with probability at least 1 − δ LINEBREAK sup (x,y)∈bm ×bm LINEBREAK |kt(x, y) − k0(x, y)| ≤ LINEBREAK tγ3 cdd(cid:48) √ m LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK if one instead does the doubling trick then the second condition on m can be removed from the hypothesis and the same conclusion holds. LINEBREAK proof. first assume we are not doing the doubling trick. by lemmas b.17, b.18 and a union bound we have with probability at least 1 − δ (cid:40) LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK note that ρ as defined in lemma b.23 satisfies ρ2 = o(log(c/δ)+ ˜o(d)). thus the hypothesis on m is strong enough to apply lemma b.23, therefore by applying this lemma we have with probability at least 1 − δ LINEBREAK max t≤t LINEBREAK ξ(t) ≤ γξ(0) max t≤t LINEBREAK thus by replacing δ with δ/2 and taking a union bound we have that with probability at least 1 − δ (6) and (7) hold simultaneously. then using lemma b.24 and the fact that (cid:107)ˆr(t)(cid:107)rn ≤ (cid:107)ˆr(0)(cid:107)rn we have for t ≤ t LINEBREAK sup (x,y)∈bm ×bm LINEBREAK |∂tkt(x, y)| ≤ γ3 cdd(cid:48) m LINEBREAK therefore by the fundamental theorem of calculus for t ≤ t LINEBREAK sup (x,y)∈bm ×bm LINEBREAK |kt(x, y) − k0(x, y)| ≤ tγ3 cdd(cid:48) m LINEBREAK ≤ tγ3 cdd(cid:48) √ m LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK now consider if one instead does the doubling trick where one does the following swaps w (0) → (cid:21) (cid:20)w (0) w (0) ized as before. then ξ(0) and ˜ξ(0) do not change. we can then run through the same exact proof as before except when we apply lemma b.23 the second hypothesis on m is no longer needed. LINEBREAK and m → 2m where w (0), b(0), and a(0) are initial LINEBREAK theorem b.26. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. let γ > 1 and t > 0 be positive constants and let d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}. assume LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK then with probability at least 1 − δ we have for t ≤ t LINEBREAK sup (x,y)∈bm ×bm LINEBREAK |kt(x, y) − k∞(x, y)| = ˜o LINEBREAK d m LINEBREAK if one instead does 4d2o(log(c/δ)+ ˜o(d))t 2 [log(γ)]2 LINEBREAK the doubling trick then one can remove the assumption m ≥ LINEBREAK and have the same conclusion hold. LINEBREAK proof. the condition m ≥ o(log(c/δ) + ˜o(d)) is sufficient to satisfy the hypothesis of theorem b.19. the condition on m also immediately satisfies the hypothesis of theorem b.25. the desired result then follows from a union bound. LINEBREAK theorem b.27. under the same assumptions as theorem b.26 we have that with probability at least 1 − δ for all t ≤ t LINEBREAK d m LINEBREAK sup s≤t LINEBREAK d m LINEBREAK mn maxi,j |ai,j|. thus by theorem b.26 LINEBREAK proof. recall that for a matrix a ∈ rm×n (cid:107)a(cid:107)op ≤ with probability at least 1 − δ LINEBREAK (cid:107)h ∞ − ht(cid:107)op ≤ n max LINEBREAK i,j LINEBREAK |h ∞ LINEBREAK i,j − (ht)i,j| ≤ n LINEBREAK sup (x,y)∈bm ×bm (cid:33) (cid:3) LINEBREAK = n ˜o LINEBREAK d m LINEBREAK |kt(x, y) − k∞(x, y)| LINEBREAK the second bound follows from gs = 1 LINEBREAK n hs and g∞ = 1 LINEBREAK n h ∞. LINEBREAK b.7 ntk deviations for relu approximations LINEBREAK the ntk deviation bounds given in the previous subsections assumed (cid:107)σ(cid:48)(cid:48)(cid:107)∞ < ∞. for relu this assumption is not satisfied. it is natural to ask to what extent we might expect the results to hold when the activation function is σ(x) = relu (x) = max{0, x}. the closest we can get to relu without modifying the proofs is to use the softmax approximation to relu, namely σ(x) = 1 α ln(1 + exp(αx)), and consider what happens as α → ∞. for this choice of σ we have that (cid:107)σ(cid:48)(cid:48)(cid:107)∞ = o(α). in subsection b.6 where you will pay the biggest penalty is in theorem b.25 via the constant d(cid:48) = o((cid:107)σ(cid:48)(cid:48)(cid:107)2 m you will have that m will grow like o(α4). this is no moderate penalty, although we might expect the results to hold for wide relu networks if a finite α provides a reasonable approximation. in particular softmax ln(1 + exp(x)) leads to a fixed constant for d(cid:48). LINEBREAK ∞) = o(α2). since the final bound depends on the ratio d(cid:48) LINEBREAK c underparameterized regime LINEBREAK in this section we build the tools to study the implicit bias in the underparameterized case. our ultimate goal is prove theorem 3.5. LINEBREAK outline of this section LINEBREAK • review operator theory LINEBREAK • prove damped deviations equation • bound (cid:107)(tk∞ − t s LINEBREAK – bound (cid:107)(tn − t s – bound (cid:107)(tk∞ − tn)rt(cid:107)2 LINEBREAK n)rt(cid:107)2 using n t k deviation results (comparatively easy) LINEBREAK * derive covering number for a class of functions c * use covering number to bound supg∈c (cid:107)(tk∞ − tn)g(cid:107) * show that rt is in class c LINEBREAK • prove theorem 3.5 LINEBREAK c.1 rkhs and mercer’s theorem LINEBREAK we recall some facts about reproducing kernel hilbert spaces (rkhs) and mercer’s theorem. for additional background we suggest berlinet & thomas-agnan (2004). let x ⊂ rd be a compact space equipped with a strictly positive (regular borel) probability measure ρ. let k : x×x → r be LINEBREAK a continuous, symmetric, positive definite function. we define the integral operator tk : l2 l2 LINEBREAK ρ(x) → LINEBREAK ρ(x) LINEBREAK tkf (x) := LINEBREAK k(x, s)f (s)dρ(s). LINEBREAK x LINEBREAK in this setting tk is a compact, positive, self-adjoint operator. by the spectral theorem there is a countable nonincreasing sequence of nonnegative values {σi}∞ i=1 and an orthonormal set {φi}∞ i=1 in l2 such that tkφi = σiφi. we will assume that tk is strictly positive, i.e. (cid:104)f, tkf (cid:105)2 > 0 i=1 is an orthonormal basis of l2 and σi > 0 for all for f (cid:54)= 0, so that we have further that {φi}∞ i. moreover since k is continuous we may select the φi so that they are continuous functions, i.e. φi ∈ c(x) for each i. then by mercer’s theorem we can decompose LINEBREAK k(x, y) = LINEBREAK σiφi(x)φi(y), LINEBREAK where the convergence is uniform. furthermore the rkhs h associated with k is given by the set of functions LINEBREAK h = LINEBREAK where the inner product on h is given by LINEBREAK note that in this setting { the rkhs has the defining properties LINEBREAK σiφi}∞ LINEBREAK i=1 is an orthonormal basis of h. define kx := k(•, x). recall LINEBREAK kx ∈ h ∀x ∈ x LINEBREAK h(x) = (cid:104)h, kx(cid:105)h ∀(x, h) ∈ x × h. we will let κ := supx∈x k(x, x) < ∞. from this we will have the useful inequality: for h ∈ h LINEBREAK furthermore the elements of h are bounded continuous functions and h is seperable. LINEBREAK c.2 hilbert-schmidt and trace class operators LINEBREAK we will recall some definitions from (rosasco et al., 2010). a bounded operator on a separable hilbert space with associated norm (cid:107)•(cid:107) is called hilbert-schmidt if LINEBREAK for some (any) orthonormal basis {ei}i. for such an operator we define its hilbert-schmidt norm (cid:107)a(cid:107)hs to be the square root of the above sum. the hilbert-schmidt norm is the analog of the frobenius norm for matrices. it is useful to note that every hilbert-schmidt operator is compact. the space of hilbert-schmidt operators is a hilbert space with respect to the inner product LINEBREAK j LINEBREAK a stronger notion is that of a trace class operator. we say a bounded operator on a separable hilbert space is trace class if LINEBREAK a∗aei, ei(cid:105) < ∞ LINEBREAK for some (any) orthonormal bases {ei}i. for such an operator we may define LINEBREAK t r(a) := LINEBREAK i=1 by lidskii’s theorem the above sum is also equal to the sum of the eigenvalues of a repeated by multiplicity. the space of trace class operators is a banach space with the norm (cid:107)a(cid:107)t c = t r( LINEBREAK a∗a). the following inequalities will be useful LINEBREAK (cid:107)a(cid:107) ≤ (cid:107)a(cid:107)hs ≤ (cid:107)a(cid:107)t c . furthermore if a is hilbert-schmidt and b is bounded we have LINEBREAK note that in our setting we have LINEBREAK x LINEBREAK k(x, x)dρ(x) = LINEBREAK σi|φi(x)|2dρ(x) = LINEBREAK x LINEBREAK σi = t r(tk), LINEBREAK σi LINEBREAK x LINEBREAK |φi(x)|2dρ(x) LINEBREAK where the interchange of integration and summation is justified by the monotone convergence theorem. thus tk is a trace class operator and we have the inequality LINEBREAK σi LINEBREAK which will prove useful later. LINEBREAK c.3 damped deviations LINEBREAK let x (cid:55)→ gs(x) ∈ l2 for each s ∈ [0, t] such that s (cid:55)→ (cid:104)φi, gs(cid:105)2 is measureable for each i and (cid:82) t 0 (cid:107)gs(cid:107)2 LINEBREAK 2 < ∞. then we define the integral LINEBREAK gsds LINEBREAK coordinatewise, meaning that (cid:82) t LINEBREAK 0 gsds is the l2 function h such that (cid:90) t LINEBREAK using this definition, we can now prove the “damped deviations” lemma. lemma 2.3. let k(x, x(cid:48)) be an arbitrary continuous, symmetric, positive-definite kernel. let [tkh](•) = (cid:82) nh](•) = LINEBREAK x k(•, s)h(s)dρ(s) be the integral operator associated with k and let [t s i=1 ks(•, xi)h(xi) denote the operator associated with the time-dependent n t k ks. then LINEBREAK rt = exp(−tkt)r0 + LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK n)rsds, LINEBREAK where the equality is in the l2 sense. LINEBREAK proof. we have that LINEBREAK ∂srs(x) = − LINEBREAK ks(x, xi)rs(xi) = −[t s LINEBREAK nrs](x), LINEBREAK where the equality is pointwise over x. ∂srs(x) is a continuous function of x since ks is continuous and is thus in l2. therefore we can consider LINEBREAK by the continuity of s (cid:55)→ θs we have the parameters are locally bounded in time and thus by lemma b.5 we have that (cid:107)ks(cid:107)∞ is also locally bounded therefore for any δ > 0, s0: sup|s−s0|≤δ (cid:107)ks(cid:107)∞ < ∞. note then that LINEBREAK |∂srs(x)| ≤ LINEBREAK it follows that (cid:107)∂srs(cid:107)∞ is bounded locally uniformly in s. therefore the following differentiation under the integral sign is justified LINEBREAK thus combined with our previous equality we get LINEBREAK d ds LINEBREAK d ds LINEBREAK where we have used that tk is self-adjoint. therefore d ds multiplying by the integrating factor exp(σis) we get LINEBREAK d ds LINEBREAK [exp(σis)(cid:104)rs, φi(cid:105)2] = exp(σis)(cid:104)(tk − t s LINEBREAK therefore applying the fundamental theorem of calculus after rearrangement we get LINEBREAK exp(−σi(t − s))(cid:104)(tk − t s LINEBREAK which is just the coordinatewise version of the desired result. LINEBREAK rt = exp(−tkt)r0 + LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK n)rsds. LINEBREAK c.4 covering number of class LINEBREAK we will now estimate the covering number of the class of shallow networks with bounds on their parameter norms. this lemma is slightly more general than what we will use but we will particularize it latter as it’s general formulation presents no additional difficulty. lemma c.1. let LINEBREAK c = { LINEBREAK at √ m LINEBREAK and LINEBREAK then the (proper) covering number of c in the uniform norm satisfies LINEBREAK where p = md + 2m + 1 is the total number of parameters and c (cid:48) equals LINEBREAK where c > 0 is an absolute constant. LINEBREAK proof. we will bound the pertubation of the function when changing the weights, specifically we will bound LINEBREAK at √ m LINEBREAK sup x∈bm LINEBREAK σ(w x + b) − LINEBREAK σ( ˜w x + ˜b) LINEBREAK ˜at √ m LINEBREAK m σ( ˜w x + ˜b). then note that we have 1 √ m (cid:20)(cid:13) (cid:13)w − ˜w (cid:13) (cid:13) (cid:13) (cid:13)f LINEBREAK m + LINEBREAK well then LINEBREAK finally LINEBREAK |at x(1) − ˜at ˜x(1)| ≤ |at (x(1) − ˜x(1))| + |(a − ˜a)t ˜x(1)| LINEBREAK m + LINEBREAK therefore LINEBREAK thus if we have (cid:15) 4γ(cid:48) =: (cid:15)1, LINEBREAK then LINEBREAK therefore LINEBREAK |at x(1) − ˜at ˜x(1)| ≤ (cid:15)/2 and this bound holds for any x ∈ bm . if add biases b0 and ˜b0 such that |b0 − ˜b0| ≤ (cid:15)/2 we simply get by the triangle inequality LINEBREAK thus to get a cover we can simply cover the sets LINEBREAK in the euclidean norm and multiply the covering numbers. recall that the (cid:15) covering number for a euclidean ball of radius r in rs, say n(cid:15), using the euclidean norm satisfies (cid:18) cr (cid:15) LINEBREAK for two absolute constants c, c > 0. therefore we get that LINEBREAK the desired result follows from LINEBREAK max LINEBREAK we can now prove the following corollary which is the version of the previous lemma that we will actually use for our neural network. corollary c.2. let LINEBREAK c = { LINEBREAK at √ m LINEBREAK σ(w x + b) + b0 : LINEBREAK and LINEBREAK and assume m ≥ d. then the (proper) covering number of c in the uniform norm satisfies LINEBREAK where LINEBREAK ψ(m, d) = c max{ LINEBREAK mdo LINEBREAK max LINEBREAK b md LINEBREAK proof. the idea is to apply lemma c.1 with a(cid:48) = 0, w (cid:48) = 0, b(cid:48) = 0, and b(cid:48) (cid:107)w (cid:107)f ≤ ρ2 = LINEBREAK mda. the result then follows by applying lemma with ρ1 = 3 = a. LINEBREAK ma and ρ4 = b and ρ(cid:48) LINEBREAK mda, ρ3 = LINEBREAK 0 = 0. note that ma, LINEBREAK c.5 uniform convergence over the class LINEBREAK we now show that (cid:107)(tn − tk∞ )g(cid:107)2 is uniformly small for all g in a suitable class of functions c(cid:48). ultimately we will show that rt ∈ c(cid:48) and thus this result is towards proving that (cid:107)(tn − tk∞)rt(cid:107)2 is small. lemma c.3. let k(x, x(cid:48)) by a continuous, symmetric, positive-definite kernel and let κ = maxx∈x k(x, x) < ∞. x k(•, s)h(s)dρ(s) and tnh(•) = 1 i=1 k(•, xi)h(xi) be the associated operators. let σ1 denote the largest eigenvalue of tk. n let c and ψ(m, d) be defined as in corollary c.2. we let c(cid:48) = {g − f ∗ : g ∈ c} ∩ {g : (cid:107)g(cid:107)∞ ≤ s} be the set where c is translated by the target function f ∗ then intersected with the l∞ ball of radius s > 0. then with probability at least 1 − δ over the sampling of x1, . . . , xn LINEBREAK let tkh(•) = (cid:82) LINEBREAK sup g∈c(cid:48) LINEBREAK (cid:21) 2 log(c/δ) + ˜o(p) √ LINEBREAK n LINEBREAK n) LINEBREAK proof. let g ∈ c(cid:48). we introduce the random variables yi := kxig(xi) − ex∼ρ[kxg(x)] taking values in the hilbert space h for i ∈ [n] where h is the rkhs associated with k. note that for any x (cid:107)kxg(x)(cid:107)h = |g(x)|(cid:112)(cid:104)kx, kx(cid:105)h ≤ s(cid:112)k(x, x) ≤ sκ1/2. thus (cid:107)yi(cid:107)h ≤ 2sκ1/2 a.s. thus by hoeffding’s inequality for random variables taking values in a separable hilbert space (see rosasco et al. (2010, section 2.4)) we have (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)h LINEBREAK ≤ 2 exp LINEBREAK > t LINEBREAK yi LINEBREAK p LINEBREAK note that by basic properties of the covering number we have that n (c(cid:48), (cid:15), (cid:107)(cid:107)∞) ≤ n (c, (cid:15)/2, (cid:107)(cid:107)∞), thus by corollary c.2 the covering number of c(cid:48) satisfies (up to a redefinition of c) LINEBREAK let ∆ be an (cid:15) net of c(cid:48) in the uniform norm. note that 1 n union bound we have LINEBREAK p LINEBREAK (cid:18) ψ(m, d) (cid:15) note that for any probability measure ν and h ∈ l∞ LINEBREAK max g∈∆ LINEBREAK i=1 yi = (tn − tk)g. thus by taking a LINEBREAK 2 exp LINEBREAK (cid:12) (cid:12) (cid:12) (cid:12) it follows that for any h ∈ l∞ LINEBREAK (cid:12) (cid:12) k(x, s)h(s)dν(s) (cid:12) (cid:12) LINEBREAK x LINEBREAK x LINEBREAK note for any g ∈ c(cid:48) we can pick ˆg in ∆ such that (cid:107)g − ˆg(cid:107)∞ ≤ (cid:15). then LINEBREAK t = LINEBREAK we have with probability at least 1 − δ LINEBREAK sup g∈c(cid:48) LINEBREAK this argument runs through for any (cid:15) > 0. thus by setting (cid:15) = result. LINEBREAK n we get the desired LINEBREAK c.6 neural network is in the class LINEBREAK in this section we demonstrate that the neural network in such a class as c as defined in lemma c.1. once we have this we can use lemma c.3 to show that (cid:107)(tk∞ − tn)rt(cid:107)2 is uniformly small. the first step is to bound the parameter norms, hence the following lemma. lemma c.4. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)1(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let γ > 1, t > 0, d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, and LINEBREAK ξ(t) = max{ LINEBREAK furthermore assume LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK then with probability at least 1 − δ LINEBREAK max t∈[0,t ] LINEBREAK ξ(t) ≤ γ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK if one instead does the doubling trick then the second condition on m can be removed from the hypothesis and the same conclusion holds. LINEBREAK proof. first assume we are not doing the doubling trick. note that the hypothesis on m is strong enough to satisfy the hypothesis of lemma b.23, therefore we have with probability at least 1 − δ LINEBREAK max t≤t LINEBREAK well then separately by lemma b.17 with probability at least 1 − δ d + k 2(cid:112)log(c/δ) m LINEBREAK thus by replacing δ with δ/2 in the previous statements and taking a union bound we have with probability at least 1 − δ LINEBREAK max t∈[0,t ] LINEBREAK ξ(t) ≤ γ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK which is the desired result. now suppose instead one does the doubling trick. we recall that the doubling trick does not change ξ(0). thus we can run through the exact same argument as before except when we apply lemma b.23 we can remove the second condition on m from the hypothesis. LINEBREAK the following lemma bounds the bias term. lemma c.5. for any initial conditions we have LINEBREAK proof. note that LINEBREAK |∂tb0(t)| = LINEBREAK ˆr(t)i LINEBREAK thus by the fundamental theorem of calculus LINEBREAK the following lemma demonstrates that the residual rt = ft − f ∗ is bounded. lemma c.6. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random ≤ k for each variables with unit variance. furthermore assume (cid:107)1(cid:107)ψ2 (cid:96) ∈ [m] where k ≥ 1. let γ > 1, t > 0, d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, and assume LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK then with probability at least 1 − δ for t ≤ t LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK if one instead does the doubling trick then the second condition on m can be removed from the hypothesis and the same conclusion holds. LINEBREAK proof. recall that LINEBREAK ∂t(ft(x) − f ∗(x)) = − LINEBREAK kt(x, xi)(ft(xi) − f ∗(xi)) = − LINEBREAK kt(x, xi)ˆr(t)i. LINEBREAK thus LINEBREAK |∂t(ft(x) − f ∗(x))| ≤ LINEBREAK well by lemma b.5 we have that (cid:107)kt(cid:107)∞ ≤ cd2ξ2(t) where LINEBREAK ξ(t) = max{ LINEBREAK well by lemma c.4 we have that with probability at least 1 − δ LINEBREAK max t∈[0,t ] LINEBREAK ξ(t) ≤ γ LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK thus by the fundamental theorem of calculus for t ≤ t LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK thus by taking the supremum over x we get LINEBREAK d + k 2(cid:112)log(c/δ) m LINEBREAK which is the desired conclusion. LINEBREAK we can now finally prove that (cid:107)(tk∞ − tn)rt(cid:107)2 is uniformly small. lemma c.7. let k(x, x(cid:48)) by a continuous, symmetric, positive-definite kernel and let κ = maxx k(x, x) < ∞. let tkh(•) = (cid:82) i=1 k(•, xi)h(xi) assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all be the associated operators. furthermore assume i.i.d zero-mean, subgaussian random variables with unit variance. ≤ k (cid:48) for each (cid:96) ∈ [m] where k (cid:48) ≥ 1. let γ > 1, (cid:107)1(cid:107)ψ2 , (cid:107)b0(cid:107)ψ2 t > 0, d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, and assume LINEBREAK x k(•, s)h(s)dρ(s) and tnh(•) = 1 LINEBREAK n LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK if we are doing the doubling trick set s(cid:48) = 0 and otherwise set LINEBREAK d log(cm ˜o( LINEBREAK m)) + log(c/δ) = ˜o( LINEBREAK d). LINEBREAK then with probability at least 1 − δ LINEBREAK sup t≤t LINEBREAK n LINEBREAK and LINEBREAK (cid:107)r0(cid:107)∞ ≤ (cid:107)f ∗(cid:107)∞ + s(cid:48). if we are performing the doubling trick the second condition on m can be removed and the same conclusion holds. LINEBREAK proof. by lemma c.4 we have with probability at least 1 − δ LINEBREAK max t∈[0,t ] LINEBREAK ξ(t) ≤ γ LINEBREAK =: a. LINEBREAK also by lemma c.5 LINEBREAK |b0(t)| ≤ |b0(0)| + t (cid:107)ˆr(0)(cid:107)rn . if we are doing the doubling trick then b0(0) = 0. otherwise by lemma b.15 we have with probability at least 1 − δ LINEBREAK furthermore by lemma b.22 we have LINEBREAK let l be defined as in lemma b.21, i.e. LINEBREAK l(m, σ, d, k (cid:48), δ) := LINEBREAK = ˜o( LINEBREAK m). LINEBREAK if we are not performing the doubling trick set LINEBREAK s(cid:48) = cd(k (cid:48))2(cid:112)d log(cm l) + log(c/δ). otherwise if we are performing the doubling trick set s(cid:48) = 0. in either case by lemma b.21 we have with probability at least 1 − δ LINEBREAK in particular by lemma b.22 we have LINEBREAK thus we can say LINEBREAK |b0(t)| ≤ |b0(0)| + t (cid:107)ˆr(0)(cid:107)rn ≤ ck (cid:48)(cid:112)log(c/δ) + t ((cid:107)y(cid:107)rn + s(cid:48)) =: b and this holds whether or not we are performing the doubling trick. thus up until time t the neural network is in class c as defined in corollary c.2 with parameters a and b as defined above. moreover by lemma c.6 separate from the randomness before we have that with probability at least 1 − δ LINEBREAK well note that when (9) holds we have LINEBREAK thus LINEBREAK =: s LINEBREAK thus by taking a union bound and redefining δ we have by an application of lemma c.3 with s as defined in the hypothesis of the current theorem that with probability at least 1 − δ LINEBREAK sup t≤t LINEBREAK 2 log(c/δ) + ˜o(p) √ LINEBREAK n √ LINEBREAK = ˜o LINEBREAK n LINEBREAK where we have used that s = ˜o([(cid:107)f ∗(cid:107)∞ + s(cid:48)][1 + t γ2]). LINEBREAK c.7 proof of theorem 3.5 LINEBREAK we are almost ready to prove theorem 3.5. however first we must introduce a couple lemmas. the following lemma uses the damped deviations equation to bound the difference between rt and exp(−tkt)r0. lemma c.8. let k(x, x(cid:48)) by a continuous, symmetric, positive-definite kernel with associated operator tkh(•) = (cid:82) i=1 ks(•, xi)h(xi) denote the operator associated with the time-dependent n t k. then LINEBREAK x k(•, s)h(s)dρ(s). let t s LINEBREAK nh(•) = 1 n LINEBREAK 1 − exp(−σkt) σk LINEBREAK sup s≤t LINEBREAK and LINEBREAK (cid:107)rt − exp(−tkt)r0(cid:107)2 ≤ t · sup s≤t LINEBREAK proof. from lemma 2.3 we have LINEBREAK rt = exp(−tkt)r0 + LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK n)rsds. LINEBREAK thus for any k ∈ n LINEBREAK pk(rt − exp(−tkt)r0) = pk LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK n)rsds LINEBREAK pk exp(−tk(t − s))(tk − t s LINEBREAK n)rsds. LINEBREAK therefore LINEBREAK pk exp(−tk(t − s))(tk − t s LINEBREAK (cid:107)pk exp(−tk(t − s))(tk − t s LINEBREAK (cid:107)pk exp(−tk(t − s))(cid:107) (cid:107)(tk − t s LINEBREAK exp(−σk(t − s)) (cid:107)(tk − t s LINEBREAK 0 1 − exp(−σkt) σk LINEBREAK sup s≤t LINEBREAK similarly LINEBREAK exp(−tk(t − s))(tk − t s LINEBREAK (cid:107)exp(−tk(t − s))(tk − t s LINEBREAK n)rs(cid:107)2 ds ≤ t · sup s≤t LINEBREAK in light of the previous lemma we would like to have a bound for (cid:107)(tk − t s plished by the following lemma. lemma c.9. let k(x, x(cid:48)) by a continuous, symmetric, positive-definite kernel. let tkh(•) = (cid:82) x k(•, s)h(s)dρ(s) and tnh(•) = 1 i=1 k(•, xi)h(xi) be the associated operators. let nh(•) = 1 t s i=1 ks(•, xi)h(xi) denote the operator associated with the time-dependent n t k. n then LINEBREAK n)rs(cid:107)2. this is accom LINEBREAK n LINEBREAK sup s≤t LINEBREAK n)rs(cid:107)2 ≤ sup s≤t LINEBREAK (cid:107)(tk − tn)rs(cid:107)2 + sup s≤t LINEBREAK proof. we have that LINEBREAK now observe that LINEBREAK |(tn − t s LINEBREAK n)rs(x)| = LINEBREAK (cid:12) (cid:12) (cid:12) [k(x, xi) − ks(x, xi)]rs(xi) (cid:12) (cid:12) LINEBREAK |k(x, xi) − ks(x, xi)||rs(xi)| LINEBREAK therefore LINEBREAK thus LINEBREAK sup s≤t LINEBREAK n)rs(cid:107)2 ≤ sup s≤t LINEBREAK (cid:107)(tk − tn)rs(cid:107)2 + sup s≤t LINEBREAK we are almost ready to finally prove theorem 3.5. we must prove one final lemma that combines lemma c.7 with the n t k deviation bounds in theorem b.26 to show that (cid:107)(tk∞ − t s n)rs(cid:107)2 is uniformly small. lemma c.10. assume that wi,j ∼ w, b(cid:96) ∼ b, a(cid:96) ∼ a are all i.i.d zero-mean, subgaussian random variables with unit variance. furthermore assume (cid:107)1(cid:107)ψ2 ≤ k for each (cid:96) ∈ [m] where k ≥ 1. let γ > 1, t > 0, d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, and assume LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK [log(γ)]2 LINEBREAK and m ≥ max LINEBREAK 4d2o(log(c/δ) + ˜o(d))t 2 [log(γ)]2 LINEBREAK , o(log(c/δ) + ˜o(d)) LINEBREAK if we are doing the doubling trick set s(cid:48) = 0 and otherwise set LINEBREAK s(cid:48) = cdk 2 then with probability at least 1 − δ LINEBREAK d log(cm ˜o( LINEBREAK m)) + log(c/δ) = ˜o( LINEBREAK s LINEBREAK sup s≤t LINEBREAK d m LINEBREAK if we are performing the doubling trick the condition m ≥ 4d2o(log(c/δ)+ ˜o(d))t 2 and the same conclusion holds. LINEBREAK [log(γ)]2 LINEBREAK can be removed LINEBREAK proof. note by lemma c.9 we have (cid:107)(tk∞ − t s LINEBREAK sup s≤t LINEBREAK n)rs(cid:107)2 ≤ sup s≤t well then by theorem b.26 we have with probability at least 1 − δ that LINEBREAK (cid:107)(tk∞ − tn)rs(cid:107)2 + sup s≤t LINEBREAK sup t≤t LINEBREAK d m LINEBREAK separately by lemma c.7 we have with probability at least 1 − δ σ1κp LINEBREAK n LINEBREAK sup s≤t LINEBREAK = ˜o LINEBREAK and LINEBREAK the result follows then from taking a union bound and replacing δ with δ/2. LINEBREAK we now proceed to prove the main theorem of this paper. theorem 3.5. assume that assumptions 3.3 and 3.4 hold. let pk be the orthogonal projection in l2 onto span{φ1, . . . , φk} and let d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}. if we are doing the ˜o(d) + log(c/δ) , s = (cid:107)f ∗(cid:107)∞ + s(cid:48). doubling trick set s(cid:48) = 0 and otherwise set s(cid:48) = o rn t 2, and m ≥ o(log(c/δ) + ˜o(d)) max (cid:8)t 2, 1(cid:9). then with LINEBREAK also let t > 0. assume m ≥ d2 (cid:107)y(cid:107)2 probability at least 1 − δ we have that for all t ≤ t and k ∈ n LINEBREAK 1 − exp(−σkt) σk LINEBREAK ˜o LINEBREAK s [1 + ts] LINEBREAK d m LINEBREAK p n LINEBREAK and LINEBREAK s [1 + ts] LINEBREAK d m LINEBREAK p n LINEBREAK proof. by lemma c.8 we have for any k ∈ n LINEBREAK 1 − exp(−σkt) σk LINEBREAK sup s≤t LINEBREAK and furthermore LINEBREAK (cid:107)rt − exp(−tk∞ t)r0(cid:107) ≤ t sup s≤t LINEBREAK well the conditions on m in the hypothesis suffice to apply lemma c.10 with γ = e2 ensure that with probability at least 1 − δ LINEBREAK s LINEBREAK sup s≤t LINEBREAK d m LINEBREAK s(1 + t ) √ n LINEBREAK since κ and σ1 only depend on k∞ which is fixed we will treat them as constants for simplicity of presentation of the main result (note that they were tracked in all previous results for anyone interested in the specific constants). the desired result follows from plugging in the above expression into the previous bounds after setting σ1 and κ as constants. LINEBREAK theorem 3.5 is strong enough to get a bound on the test error, which is demonstrated by the following corollary. corollary 3.6. assume assumptions 3.3 and 3.4 hold. suppose that f ∗ = o(1) and assume we are performing the doubling trick where f0 ≡ 0 so that r0 = −f ∗. let k ∈ n and let pk be the orthogonal projection onto span{φ1, . . . , φk}. set t = log( then we have that (cid:17) m = ˜ω( d (cid:15)σ4 k LINEBREAK suffices to ensure with probability at least 1 − δ LINEBREAK ) and n = ˜ω LINEBREAK σk LINEBREAK proof. set t = log( 1 2 LINEBREAK σk LINEBREAK . note that LINEBREAK note that LINEBREAK ≤ exp(−2σkt) LINEBREAK we want to apply theorem 3.5 with t = t. we need m ≥ d2 (cid:107)y(cid:107)2 LINEBREAK rn t2 and m ≥ o(log(c/δ) + ˜o(d)) max{t2, 1}. LINEBREAK note that since f ∗ = o(1) we have that (cid:107)ˆr(0)(cid:107)rn = (cid:107)y(cid:107)rn = o(1). then LINEBREAK rn t2 = ˜o (cid:0)t2(cid:1) = ˜o LINEBREAK thus our condition on m is strong enough to satisfy the first condition. also o(log(c/δ) + ˜o(d)) max{t2, 1} = ˜o(dt2) which is satisfied by our condition on m. thus by an application of theorem 3.5 with t = t we have with probability at least 1 − δ √ √ LINEBREAK d m LINEBREAK p n LINEBREAK recall that f ∗ = o(1). thus the first term above is LINEBREAK ˜o LINEBREAK d m LINEBREAK = ˜o LINEBREAK (cid:32) √ d √ m LINEBREAK thus setting m = ˜ω( d (cid:15)σ4 k second term is LINEBREAK thus setting n = ˜ω this case we have LINEBREAK ) suffices to ensure the first term is bounded by (cid:15)1/2/(2 LINEBREAK 2). similarly the LINEBREAK ˜o LINEBREAK = ˜o LINEBREAK suffices to ensure that the second term bounded by (cid:15)1/2/(2 LINEBREAK 2). thus in LINEBREAK thus we have 1 2 LINEBREAK c.8 deterministic initialization LINEBREAK in this section we will prove a version of theorem 3.5 where instead of θ0 being chosen randomly we take θ0 to be some deterministic value. θ0 could represent the parameters given by the output of some pretraining procedure that is independent of the training data, or selected with a priori knowledge. lemma c.11. let θ0 be a fixed parameter initialization. 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, LINEBREAK let γ > 1, t > 0, d := LINEBREAK ξ(t) = max{ LINEBREAK ˜ξ(t) = max{max (cid:96)∈[m] LINEBREAK furthermore assume LINEBREAK then LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK max t∈[0,t ] LINEBREAK ξ(t) ≤ γξ(0) max t∈[0,t ] LINEBREAK proof. by the hypothesis on m we have that for t ≤ t LINEBREAK ≤ log γ. LINEBREAK therefore by lemmas b.2 and b.3 the desired result holds. LINEBREAK lemma c.12. let θ0 be a fixed parameter initialization. 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, LINEBREAK let γ > 1, t > 0, d := LINEBREAK ξ(t) = max{ LINEBREAK and assume LINEBREAK then for t ≤ t LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK proof. recall that LINEBREAK ∂t(ft(x) − f ∗(x)) = − LINEBREAK kt(x, xi)(ft(xi) − f ∗(xi)) = − LINEBREAK kt(x, xi)ˆr(t)i. LINEBREAK thus LINEBREAK |∂t(ft(x) − f ∗(x))| ≤ LINEBREAK well by lemma b.5 we have that (cid:107)kt(cid:107)∞ ≤ cd2ξ2(t). also by lemma c.11 we have that LINEBREAK max t∈[0,t ] LINEBREAK thus by the fundamental theorem of calculus for t ≤ t LINEBREAK thus by taking the supremum over x we get LINEBREAK which is the desired conclusion. LINEBREAK lemma c.13. let θ0 be a fixed parameter initialization. let k0 denote the time-dependent ntk at initialization θ0. let tk0 h(•) = (cid:82) i=1 k0(•, xi)h(xi) be the associated operators. let κ = maxx k0(x, x) and let σ1 denote the largest eigenvalue of tk0. let γ > 1, t > 0, d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}, LINEBREAK x k0(•, s)h(s)dρ(s) and tnh(•) = 1 LINEBREAK n LINEBREAK ξ(0) = max{ LINEBREAK and assume LINEBREAK m ≥ LINEBREAK then with probability at least 1 − δ over the sampling of x1, . . . , xn we have that LINEBREAK sup t≤t LINEBREAK n LINEBREAK proof. first note that LINEBREAK thus our hypothesis on m is strong enough to apply lemma c.11 so that we have LINEBREAK also by lemma c.5 LINEBREAK therefore LINEBREAK max t∈[0,t ] LINEBREAK max t≤t LINEBREAK thus up until time t the neural network is in class c as defined in corollary c.2 with parameters a and b as defined above. furthermore by lemma c.12 we have LINEBREAK well then by (10) and the above we have LINEBREAK thus by an application of lemma c.3 with k = k0 we have with probability at least 1 − δ over the sampling of x1, . . . , xn that LINEBREAK sup t≤t LINEBREAK = ˜o LINEBREAK n LINEBREAK 2 log(c/δ) + ˜o(p) √ LINEBREAK n LINEBREAK let γ d(cid:48) LINEBREAK parameter LINEBREAK initialization. LINEBREAK a := LINEBREAK fixed LINEBREAK be LINEBREAK d LINEBREAK t LINEBREAK ξ(t) = max{ LINEBREAK ˜ξ(t) = max{max (cid:96)∈[m] LINEBREAK furthermore assume LINEBREAK then for t ≤ t LINEBREAK m ≥ LINEBREAK rn t 2 LINEBREAK cdd(cid:48) √ m LINEBREAK proof. note by lemma b.24 we have that LINEBREAK sup x,y∈bm ×bm LINEBREAK |∂tkt(x, y)| ≤ LINEBREAK cdd(cid:48) √ m LINEBREAK now applying lemma c.11 and the fact that (cid:107)ˆr(t)(cid:107)rn ≤ (cid:107)ˆr(0)(cid:107)rn from the above we get that for t ≤ t LINEBREAK sup x,y∈bm ×bm LINEBREAK |∂tkt(x, y)| ≤ LINEBREAK cdd(cid:48) √ m LINEBREAK thus by the fundamental theorem of calculus we have that for t ≤ t LINEBREAK cdd(cid:48) √ m LINEBREAK theorem c.15. let θ0 be a fixed parameter initialization. assume that assumption 3.3 holds. let {φi}i denote the eigenfunctions of tk0 corresponding to the nonzero eigenvalues, which we enumerate σ1 ≥ σ2 ≥ · · · . let pk be the orthogonal projection in l2 onto span{φ1, . . . , φk} and let d := 3 max{|σ(0)|, m (cid:107)σ(cid:48)(cid:107)∞ , (cid:107)σ(cid:48)(cid:107)∞ , 1}. also let t > 0 and set 1 √ m LINEBREAK ξ(0) = max{ LINEBREAK ˜ξ(0) = max{max (cid:96)∈[m] LINEBREAK assume LINEBREAK m ≥ d2 [(cid:107)f ∗(cid:107)∞ + (cid:107)f0(cid:107)∞]2 t 2. then with probability at least 1 − δ over the sampling of x1, . . . , xn we have that for all t ≤ t and k ∈ n
| 46
|
[
108,
119.4392556,
503.9999,
155.5358828
] |
PrzjugOsDeE.pdf
| 2,021
| 0
|
LINEBREAK ccgan: continuous conditional generative adversarial networks for image generation LINEBREAK xin ding∗, yongwei wang∗, zuheng xu, william j. welch, z. jane wang, the university of british columbia {xin.ding@stat, yongweiw@ece, zuheng.xu@stat, will@stat, zjanew@ece}.ubc.ca LINEBREAK abstract LINEBREAK this work proposes the continuous conditional generative adversarial network (ccgan), the first generative model for image generation conditional on continuous, scalar conditions (termed regression labels). existing conditional gans (cgans) are mainly designed for categorical conditions (e.g., class labels); conditioning on regression labels is mathematically distinct and raises two fundamental problems: (p1) since there may be very few (even zero) real images for some regression labels, minimizing existing empirical versions of cgan losses (a.k.a. empirical cgan losses) often fails in practice; (p2) since regression labels are scalar and infinitely many, conventional label input methods (e.g., combining a hidden map of the generator/discriminator with a one-hot encoded label) are not applicable. the proposed ccgan solves the above problems, respectively, by (s1) reformulating existing empirical cgan losses to be appropriate for the continuous scenario; and (s2) proposing a novel method to incorporate regression labels into the generator and the discriminator. the reformulation in (s1) leads to two novel empirical discriminator losses, termed the hard vicinal discriminator loss (hvdl) and the soft vicinal discriminator loss (svdl) respectively, and a novel empirical generator loss. the error bounds of a discriminator trained with hvdl and svdl are derived under mild assumptions in this work. a new benchmark dataset, rc-49, is also proposed for generative image modeling conditional on regression labels. our experiments on the circular 2-d gaussians, rc-49, and utkface datasets show that ccgan is able to generate diverse, high-quality samples from the image distribution conditional on a given regression label. moreover, in these experiments, ccgan substantially outperforms cgan both visually and quantitatively. LINEBREAK introduction LINEBREAK conditional generative adversarial networks (cgans), first proposed in (mirza & osindero, 2014), aim to estimate the distribution of images conditioning on some auxiliary information, especially class labels. subsequent studies (odena et al., 2017; miyato & koyama, 2018; brock et al., 2019; zhang et al., 2019) confirm the feasibility of generating diverse, high-quality (even photo-realistic), and class-label consistent fake images from class-conditional gans. unfortunately, these cgans do not work well for image generation with continuous, scalar conditions, termed regression labels, due to two problems: LINEBREAK (p1) cgans are often trained to minimize the empirical versions of their losses (a.k.a. the empirical cgan losses) on some training data, a principle also known as the empirical risk minimization (erm) (vapnik, 2000). the success of erm relies on a large sample size for each distinct condition. unfortunately, we usually have only a few real images for some regression labels. moreover, since regression labels are continuous, some values may not even appear in the training set. consequently, a cgan cannot accurately estimate the image distribution conditional on such missing labels. LINEBREAK (p2) in class-conditional image generation, class labels are often encoded by one-hot vectors or label embedding and then fed into the generator and discriminator by hidden concatenation (mirza & LINEBREAK ∗equal contribution LINEBREAK osindero, 2014), an auxiliary classifier (odena et al., 2017) or label projection (miyato & koyama, 2018). a precondition for such label encoding is that the number of distinct labels (e.g., the number of classes) is finite and known. unfortunately, in the continuous scenario, we may have infinite distinct regression labels. LINEBREAK a naive approach to solve (p1)-(p2) is to “bin” the regression labels into a series of disjoint intervals and still train a cgan in the class-conditional manner (these interval are treated as independent classes) (olmschenk, 2019). however, this approach has four shortcomings: (1) our experiments in section 4 show that this approach often makes cgans collapse; (2) we can only estimate the image distribution conditional on membership in an interval and not on the target label; (3) a large interval width leads to high label inconsistency; (4) inter-class correlation is not considered (images in successive intervals have similar distributions). LINEBREAK in machine learning, vicinal risk minimization (vrm) (vapnik, 2000; chapelle et al., 2001) is an alternative rule to erm. vrm assumes that a sample point shares the same label with other samples in its vicinity. motivated by vrm, in generative modeling conditional on regression labels where we estimate a conditional distribution p(x|y) (x is an image and y is a regression label), it is natural to assume that a small perturbation to y results in a negligible change to p(x|y). this assumption is consistent with our perception of the world. for example, the image distribution of facial features for a population of 15-year-old teenagers should be close to that of 16-year olds. LINEBREAK we therefore introduce the continuous conditional gan (ccgan) to tackle (p1) and (p2). to our best knowledge, this is the first generative model for image generation conditional on regression labels. it is noted that rezagholizadeh et al. (2018) and rezagholiradeh & haidar (2018) train gans in an unsupervised manner and synthesize unlabeled fake images for a subsequent image regression task. olmschenk et al. (2019) proposes a semi-supervised gan for dense crowd counting. ccgan is fundamentally different from these works since they do not estimate the conditional image distribution. our contributions can be summarized as follows: LINEBREAK • we propose in section 2 the ccgan to address (p1) and (p2), which consists of two novel empirical discriminator losses, termed the hard vicinal discriminator loss (hvdl) and the soft vicinal discriminator loss (svdl), a novel empirical generator loss, and a novel label input method. we take the vanilla cgan loss as an example to show how to derive hvdl, svdl, and the novel empirical generator loss by reformulating existing empirical cgan losses. LINEBREAK • we derive in section 3 the error bounds of a discriminator trained with hvdl and svdl. LINEBREAK • in section 4, we propose a new benchmark dataset, rc-49, for the generative image modeling conditional on regression labels, since very few benchmark datasets are suitable for the studied continuous scenario. we conduct experiments on several datasets, and our experiments show that ccgan not only generates diverse, high-quality, and label consistent images, but also substantially outperforms cgan both visually and quantitatively. LINEBREAK from cgan to ccgan LINEBREAK in this section, we provide the solutions (s1)-(s2) to (p1)-(p2) in a one-to-one manner by introducing the continuous conditional gan (ccgan). please note that theoretically cgan losses (e.g., the vanilla cgan loss (mirza & osindero, 2014), the wasserstein loss (arjovsky et al., 2017), and the hinge loss (miyato et al., 2018)) are suitable for both class labels and regression labels; however, their empirical versions fail in the continuous scenario (i.e., (p1)). our first solution (s1) focuses on reformulating these empirical cgan losses to fit into the continuous scenario. without loss of generality, we only take the vanilla cgan loss as an example to show such reformulation (the empirical versions of the wasserstein loss and the hinge loss can be reformulated similarly). LINEBREAK the vanilla discriminator loss and generator loss (mirza & osindero, 2014) are defined as: LINEBREAK l(d) = −ey∼pr(y) LINEBREAK (cid:2)ex∼pr(x|y) [log (d(x, y))](cid:3) − ey∼pg(y) LINEBREAK (cid:2)ex∼pg(x|y) [log (1 − d(x, y))](cid:3) LINEBREAK log(d(x, y))pr(x, y)dxdy − LINEBREAK log(1 − d(x, y))pg(x, y)dxdy, LINEBREAK l(g) = −ey∼pg(y) LINEBREAK (cid:2)ez∼q(z) [log (d(g(z, y), y))](cid:3) = − LINEBREAK log(d(g(z, y), y))q(z)pg(y)dzdy, LINEBREAK where x ∈ x is an image of size d × d, y ∈ y is a label, pr(y) and pg(y) are respectively the true and fake label marginal distributions, pr(x|y) and pg(x|y) are respectively the true and fake image distributions conditional on y, pr(x, y) and pg(x, y) are respectively the true and fake joint distributions of x and y, and q(z) is the probability density function of n (0, i). LINEBREAK since the distributions in the losses of eqs. (1) and (2) are unknown, for class-conditional image generation, mirza & osindero (2014) follows erm and minimizes the empirical losses: LINEBREAK (cid:98)lδ(d) = − LINEBREAK n r c(cid:88) LINEBREAK log(d(xr LINEBREAK c,j, c)) − LINEBREAK n g c(cid:88) LINEBREAK log(1 − d(xg LINEBREAK c,j, c)), LINEBREAK (cid:98)lδ(g) = − LINEBREAK n g c(cid:88) LINEBREAK log(d(g(zc,j, c), c)), LINEBREAK c and n g LINEBREAK j=1 where c is the number of classes, n r and n g are respectively the number of real and fake images, n r c,j are respectively the j-th real image and the j-th fake image with label c, and the zc,j are independently and identically sampled from q(z). eq. (3) implies we estimate pr(x, y) and pg(x, y) by their empirical probability density functions as follows: LINEBREAK c are respectively the number of real and fake images with label c, xr LINEBREAK c,j and xg LINEBREAK ˆpδ r(x, y) = LINEBREAK n r c(cid:88) LINEBREAK δ(x − xr LINEBREAK c,j)δ(y − c), LINEBREAK ˆpδ g(x, y) = LINEBREAK n g c(cid:88) LINEBREAK δ(x − xg LINEBREAK c,j)δ(y − c), (5) LINEBREAK where δ(·) is a dirac delta mass centered at 0. however, ˆpδ good estimates in the continuous scenario because of (p1). LINEBREAK r(x, y) and ˆpδ LINEBREAK g(x, y) in eq. (5) are not LINEBREAK to overcome (p1), we propose a novel estimate for each of pr(x, y) and pg(x, y), termed the hard vicinal estimate (hve). we also provide an intuitive alternative to hve, named the soft vicinal estimate (sve). the hves of pr(x, y) and pg(x, y) are: LINEBREAK ˆphve r LINEBREAK (x, y) = c1 · LINEBREAK ˆphve g LINEBREAK (x, y) = c2 · LINEBREAK n r (cid:88) LINEBREAK n g (cid:88) LINEBREAK exp LINEBREAK exp LINEBREAK y,κ LINEBREAK y,κ LINEBREAK n r (cid:88) LINEBREAK n g (cid:88) LINEBREAK (cid:35) i |≤κ}δ(x − xr i ) LINEBREAK 1{|y−yr LINEBREAK 1{|y−yg LINEBREAK i |≤κ}δ(x − xg i ) LINEBREAK i and yg LINEBREAK i and xg LINEBREAK i and xg LINEBREAK y,κ is the number of the yg LINEBREAK i are respectively real image i and fake image i, yr LINEBREAK where xr i are respectively the labels of xr i , κ and σ are two positive hyper-parameters, c1 and c2 are two constants making these two estimates valid probability density functions, n r i | ≤ κ, i | ≤ κ, and 1 is an indicator function with support in n g the subscript. the terms in the first square brackets of ˆphve imply we estimate the marginal label distributions pr(y) and pg(y) by kernel density estimates (kdes) (silverman, 1986). the terms in the second square brackets are designed based on the assumption that a small perturbation to y results in negligible changes to pr(x|y) and pg(x|y). if this assumption holds, we can use images with labels in a small vicinity of y to estimate pr(x|y) and pg(x|y). the sves of pr(x, y) and pg(x, y) are: LINEBREAK y,κ is the number of the yr LINEBREAK i satisfying |y − yg LINEBREAK i satisfying |y −yr LINEBREAK and ˆphve g LINEBREAK r LINEBREAK ˆpsve r LINEBREAK (x, y) = c3 · LINEBREAK ˆpsve g LINEBREAK (x, y) = c4 · LINEBREAK n r (cid:88) LINEBREAK n g (cid:88) LINEBREAK exp LINEBREAK exp LINEBREAK i=1 wr(yr (cid:80)n r LINEBREAK i , y)δ(x − xr i ) i , y) LINEBREAK i=1 wr(yr LINEBREAK i=1 wg(yg (cid:80)n g LINEBREAK i , y)δ(x − xg i ) i , y) LINEBREAK i=1 wg(yg LINEBREAK where c3 and c4 are two constants making these two estimates valid probability density functions, LINEBREAK wr(yr LINEBREAK i , y) = e−ν(yr LINEBREAK and wg(yg LINEBREAK i , y) = e−ν(yg LINEBREAK and the hyper-parameter ν > 0. in eq. (7), similar to the hves, we estimate pr(y) and pg(y) by kdes. instead of using samples in a hard vicinity, the sves use all respective samples to estimate pr(x|y) and pg(x|y) but each sample is assigned with a weight based on the distance of its label from y. two diagrams in fig. 1 visualize the process of using hard/soft vicinal samples to estimate p(x|y), i.e., a univariate gaussian distribution conditional on its mean y. LINEBREAK (a) hard vicinity LINEBREAK (b) soft vicinity LINEBREAK figure 1: hve (eq. (6)) and sve (eq. (7)) estimate p(x|y) (a univariate gaussian conditional on y) using two samples in hard and soft vicinities, respectively, of y. to estimate p(x|y) (the red gaussian curve) only from samples drawn from p(x|y1) and p(x|y2) (the blue gaussian curves), estimation is based on the samples (red dots) in a hard vicinity (defined by y ± κ) or a soft vicinity (defined by the weight decay curve) around y. the histograms in blue are samples in the hard or soft vicinity. the labels y1, y, and y2 on the x-axis denote the means of x conditional on y1, y, and y2, respectively. LINEBREAK (cid:98)lhvdl(d) = − LINEBREAK by plugging eq. (6) and (7) into eq. (1), we derive the hard vicinal discriminator loss (hvdl) and the soft vicinal discriminator loss (svdl) as follows: (cid:34) 1{|yr j +(cid:15)r−yr n r yr j +(cid:15)r,κ (cid:34) 1{|yg j +(cid:15)g−yg n g yg j +(cid:15)g,κ LINEBREAK log(1 − d(xg LINEBREAK j + (cid:15)g)) LINEBREAK log(d(xr LINEBREAK j + (cid:15)r)) LINEBREAK c6 n g LINEBREAK c5 n r LINEBREAK i , yg LINEBREAK i , yr LINEBREAK n r (cid:88) LINEBREAK n r (cid:88) LINEBREAK i |≤κ} LINEBREAK i |≤κ} LINEBREAK (cid:98)lsvdl(d) = − LINEBREAK c7 n r LINEBREAK c8 n g LINEBREAK n r (cid:88) LINEBREAK n r (cid:88) LINEBREAK (cid:80)n r LINEBREAK wr(yr i , yr i=1 wr(yr i , yg i=1 wg(yg LINEBREAK j + (cid:15)r) i , yr j + (cid:15)g) i , yg LINEBREAK (cid:34) wg(yg (cid:80)n g LINEBREAK j + (cid:15)r) LINEBREAK j + (cid:15)g) LINEBREAK log(d(xr LINEBREAK i , yr LINEBREAK log(1 − d(xg LINEBREAK i , yg LINEBREAK j + (cid:15)g)) LINEBREAK where (cid:15)r (cid:44) y − yr LINEBREAK j , (cid:15)g (cid:44) y − yg LINEBREAK j , and c5, c6, c7, and c8 are some constants. LINEBREAK generator training: the generator of ccgan is trained by minimizing eq. (11), LINEBREAK n g (cid:88) LINEBREAK e(cid:15)g∼n (0,σ2) log(d(g(zi, yg LINEBREAK i + (cid:15)g), yg LINEBREAK i + (cid:15)g)). LINEBREAK how do hvdl, svdl, and eq. (11) overcome (p1)? the solution (s1) includes: LINEBREAK (i) given a label y as the condition, we use images in a hard/soft vicinity of y to train the discriminator instead of just using images with label y. it enables us to estimate pr(x|y) when there are not enough real images with label y. LINEBREAK (ii) from eqs. (9) and (10), we can see that the kdes in eqs. (6) and (7) are adjusted by adding gaussian noise to the labels. moreover, in eq. (11), we add gaussian noise to seen labels (assume LINEBREAK yg i ’s are seen) to train the generator to generate images at unseen labels. this enables estimation of pr(x|y(cid:48)) when y(cid:48) is not in the training set. LINEBREAK how is (p2) solved? we propose a novel label input method. for g, we add the label y elementwisely to the output of its first linear layer. for d, an extra linear layer is trained together with d to embed y in a latent space. we then incorporate the embedded label into d by the label projection (miyato & koyama, 2018). please refer to supp. s.3 for more details. remark 1. an algorithm is proposed in supp. s.2 for training ccgan in practice. moreover, ccgan does not require any specific network architecture, therefore it can also use the state-of-art architectures in practice such as sngan (miyato et al., 2018) and biggan (brock et al., 2019). LINEBREAK error bounds LINEBREAK in this section, we derive the error bounds of a discriminator trained with (cid:98)lhvdl and (cid:98)lsvdl under the theoretical loss l. first, without loss of generality, we assume y ∈ [0, 1]. then, we introduce some notations. let d stand for the hypothesis space of d. let ˆpkde (y) stand for the kdes w(y(cid:48)|y) (cid:44) wr(y(cid:48),y)pr(y(cid:48)) , w r(y) (cid:44) of pr(y) and pg(y) respectively. let pr (cid:82) wr(y(cid:48), y)pr(y(cid:48))dy(cid:48) and w g(y) (cid:44) (cid:82) wg(y(cid:48), y)pg(y(cid:48))dy(cid:48). denote by d∗ the optimal discriminator (goodfellow et al., 2014) which minimizes l but may not be in d. let (cid:101)d (cid:44) arg mind∈dl(d). let (cid:98)dhvdl (cid:44) arg mind∈d (cid:98)lhvdl(d); similarly, we define (cid:98)dsvdl. definition 1. (h¨older class) define the h¨older class of functions LINEBREAK (y) and ˆpkde w(y(cid:48)|y) (cid:44) wg(y(cid:48),y)pg(y(cid:48)) LINEBREAK w g(y) LINEBREAK w r(y) LINEBREAK , pg LINEBREAK g LINEBREAK r LINEBREAK please see supp. s.5.1 for more details of these notations. moreover, we will also work with the following assumptions: (a1) all d’s in d are measurable and uniformly bounded by u . let u (cid:44) max{supd∈d [− log d] , supd∈d [− log(1 − d)]} and u < ∞; (a2) for ∀x ∈ x and y, y(cid:48) ∈ y, ∃gr(x) > 0 and m r > 0, s.t. |pr(x|y(cid:48)) − pr(x|y)| ≤ gr(x)|y(cid:48) − y| with (cid:82) gr(x)dx = m r; (a3) for ∀x ∈ x and y, y(cid:48) ∈ y, ∃gg(x) > 0 and m g > 0, s.t. |pg(x|y(cid:48)) − pg(x|y)| ≤ gg(x)|y(cid:48) − y| with (cid:82) gg(x)dx = m g; (a4) pr(y) ∈ σ(lr) and pg(y) ∈ σ(lg). theorem 1. assume that (a1)-(a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK l( (cid:98)dhvdl) − l(d∗) LINEBREAK c kde LINEBREAK 1,δ log n r n rσ LINEBREAK c kde LINEBREAK 2,δ log n g n gσ LINEBREAK + κu (m r + m g) LINEBREAK log LINEBREAK ey∼ ˆpkde LINEBREAK r LINEBREAK y,κ LINEBREAK (y) LINEBREAK + ey∼ ˆpkde LINEBREAK g (y) LINEBREAK y,κ LINEBREAK for some constants c kde LINEBREAK 1,δ , c kde LINEBREAK 2,δ depending on δ. LINEBREAK theorem 2. assume that (a1)-(a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK l( (cid:98)dsvdl) − l(d∗) LINEBREAK c kde LINEBREAK 1,δ log n r n rσ LINEBREAK c kde LINEBREAK 2,δ log n g n gσ LINEBREAK log LINEBREAK m rey∼ ˆpkde LINEBREAK r LINEBREAK (y) LINEBREAK r LINEBREAK (y) LINEBREAK ey∼ ˆpkde LINEBREAK 1 1 w r(y) n g w(y(cid:48)|y) |y(cid:48) − y|(cid:3) + m gey∼ ˆpkde LINEBREAK g (y) LINEBREAK n r (cid:2)ey(cid:48)∼ ˆpr LINEBREAK ey∼ ˆpkde LINEBREAK g (y) LINEBREAK (cid:2)ey(cid:48)∼ ˆpg LINEBREAK 1 w g(y) w(y(cid:48)|y) |y(cid:48) − y|(cid:3)(cid:17) LINEBREAK + u LINEBREAK + l( (cid:101)d) − l(d∗), for some constant c kde LINEBREAK 1,δ , c kde LINEBREAK 2,δ depending on δ. LINEBREAK remark 2. the error bounds in both theorems reflect the distance of (cid:98)dhvdl and (cid:98)dsvdl from d∗. enlightened by the two upper bounds, when implementing ccgan, we should (1) avoid letting d output extreme values (close to 0 or 1) so that u is kept at a moderate level; (2) avoid using a too small or a too large κ or ν to keep the third and fourth terms moderate in eqs. (13) and (14). please see supp. s.5.2.5 for a more detailed interpretation and supp. s.5.2 for the proofs. LINEBREAK experiment LINEBREAK in this section, we study the effectiveness of ccgan on three datasets where cgan (mirza & osindero, 2014) cannot generate realistic samples. for a fair comparison, cgan and ccgan use the same network architecture (a customized architecture for circular 2-d gaussians and the sngan (miyato et al., 2018) architecture for rc-49 and utkface) except for the label input modules. for stability, image labels are normalized to [0, 1] in the rc-49 and utkface datasets during training. LINEBREAK circular 2-d gaussians LINEBREAK we first test on the synthetic data generated from 120 2-d gaussians with different means. LINEBREAK experimental setup: the means of the 120 gaussians are evenly arranged on a unit circle centered at the origin o of a 2-d space. the gaussians share a common covariance matrix ˜σ2i2×2, where ˜σ = 0.02. we generate 10 samples from each gaussian for training. fig. 2a shows 1,200 training samples (blue dots) from these gaussians with their means (red dots) on a unit circle. the unit circle can be seen as a clock where we take the mean at 12 o’clock (point a) as the baseline point. given another mean on the circle (point b), the label y for samples generated from the gaussian with mean b is defined as the clockwise angle (in radians) between line segments oa and ob. e.g., the label for samples from the gaussian at a is 0. both cgan and our proposed ccgan are trained on this training set. when implementing cgan, angles are treated as class labels (each gaussian is treated as a class); while when implementing ccgan, angles are treated as real numbers. the network architectures of cgan and ccgan are shown in supp. s.6.1. both cgan and ccgan are trained for 6,000 iterations. we use the rule of thumb formulae in supp. s.4 to select the hyper-parameters of hvdl and svdl, i.e., σ ≈ 0.074, κ ≈ 0.017 and ν = 3600 (see supp. s.6.2 for details). LINEBREAK for testing, we choose 360 points evenly distributed on the unit circle as the means of 360 gaussians. for each gaussian, we generate 100 samples, yielding a test set with 36,000 samples. it should be noted that, among these 360 gaussians, at least 240 are not used at the training. in other words, there are at least 240 labels in the testing set which do not appear in the training set. for each test angle, we generate 100 fake samples from each trained gan, yielding 36,000 fake samples from each gan in total. the quality of these fake samples is evaluated. we repeat the whole experiment three times and report in table 1 the average quality over three repetitions. LINEBREAK evaluation metrics and quantitative results: in the label-conditional scenario, each fake sample x with label y is compared with the mean (sin(y), cos(y)) of a gaussian on the unit circle with label y. a fake sample is defined as ”high-quality” if its euclidean distance from x to (sin(y), cos(y)) is smaller than 4˜σ = 0.08. a mode (i.e., a gaussian) is said to be recovered if at least one high-quality sample is assigned to it. we also measure the quality of fake samples with label y by computing the 2-wasserstein distance (w2) (peyr´e et al., 2019) between pr(x|y) = n ([sin(y), cos(y)](cid:124), ˜σi) and pg(x|y) = n (µg y), where we assume pg(x|y) is gaussian and its mean and covariance are estimated by the sample mean and sample covariance of 100 fake samples with label y. in table 1, we report the average percentage of high-quality fake samples and the average percentage of recovered modes over 3 repetitions. we also report the average w2 over 360 testing angles. we can see ccgan substantially outperforms cgan. LINEBREAK y, σg LINEBREAK visual results: we select 12 angles which do not appear in the training set. we then use cgan and ccgan to generate 100 samples for each unobserved angle. fig. 2 visually confirms the obervation from the numerical metrics: the fake samples from the two ccgan methods are more realistic. LINEBREAK since most benchmark datasets in the gan literature do not have continuous, scalar regression labels, we propose a new benchmark dataset—rc-49, a synthetic dataset created by rendering 49 3-d chair LINEBREAK table 1: average quality of 36,000 fake samples from cgan and ccgan over three repetitions with standard deviations after the “±” symbol. “↓” (“↑”) indicates lower (higher) values are preferred. LINEBREAK method LINEBREAK % high quality ↑ % recovered modes ↑ LINEBREAK cgan (120 classes) ccgan (hvdl) ccgan (svdl) LINEBREAK (a) 1200 training samples and 120 means (red dots). LINEBREAK (b) cgan LINEBREAK (c) ccgan (hvdl) LINEBREAK (d) ccgan (svdl) LINEBREAK figure 2: visual results for the circular 2-d gaussians simulation. (a) shows 1,200 training samples from 120 gaussians, with 10 samples per gaussian. in (b) to (d), each gan generates 100 fake samples at each of 12 means not appearing in the training set, where green and blue dots stand for fake and real samples respectively. LINEBREAK models at different yaw angles. each of 49 chair models is rendered at 899 yaw angles ranging from 0.1 to 89.9 with step size 0.1. therefore, rc-49 consists of 44,051 64 × 64 rendered rgb images and 899 distinct angles. please see supp. s.7 for more details of the data generation. some example images are shown in fig. 3. LINEBREAK experimental setup: not all images are used for the cgan and ccgan training. a yaw angle is selected for training if its last digit is odd. moreover, at each selected angle, only 25 images are randomly chosen for training. thus, the training set includes 11250 images and 450 distinct angles. the remaining images are held out for evaluation. LINEBREAK when training cgan, we divide [0.1, 89.9] into 150 equal intervals where each interval is treated as a class. when training ccgan, we use the rule of thumb formulae in supp. s.4 to select the three hyper-parameters of hvdl and svdl, i.e., σ ≈ 0.047, κ ≈ 0.004 and ν = 50625. both cgan and ccgan are trained for 30,000 iterations with batch size 256. afterwards, we evaluate the trained gans on all 899 angles by generating 200 fake images for each angle. please see supp. s.7 for the network architectures and more details about the training/testing setup. LINEBREAK quantitative and visual results: to evaluate (1) the visual quality, (2) the intra-label diversity, and (3) the label consistency (whether assigned labels of fake images are consistent with their true labels) of fake images, we study an overall metric and three separate metrics here. (i) intra-fid (miyato & koyama, 2018) is utilized as the overall metric. it computes the fr´echet inception distance (fid) (heusel et al., 2017) separately at each of the 899 evaluation angles and reports the average fid score. (ii) naturalness image quality evaluator (niqe) (mittal et al., 2012) measures the visual quality only. (iii) diversity is the average entropy of predicted chair types of fake images over evaluation angles. (iv) label score is the average absolute error between assigned labels and predicted labels. please see supp. s.7.5 for details of these metrics. LINEBREAK we report in table 2 the performances of each gan. the example fake images in fig. 3 and line graphs in fig. 5 support the quantitative results. cgan often generates unrealistic, identical images for a target angle (i.e., low visual quality and low intra-label diversity). “binning” [0.1, 89.9] into other number of classes (e.g., 90 classes and 210 classes) is also tried but does not improve cgan’s performance. in contrast, strikingly better visual quality and higher intra-label diversity of both ccgan methods are visually evident. please note that ccgan is designed to sacrifice some (not too much) label consistency for better visual quality and higher diversity, and this explains why ccgan does not outperform cgan in terms of the label score in table 2. LINEBREAK table 2: average quality of 179,800 fake rc-49 images from cgan and ccgan with standard deviations after the “±” symbol. “↓” (“↑”) indicates lower (higher) values are preferred. LINEBREAK method LINEBREAK intra-fid ↓ LINEBREAK niqe ↓ LINEBREAK diversity ↑ LINEBREAK label score ↓ LINEBREAK cgan (150 classes) ccgan (hvdl) ccgan (svdl) LINEBREAK utkface LINEBREAK in this section, we compare ccgan and cgan on utkface (zhang et al., 2017), a dataset consisting of rgb images of human faces which are labeled by age. LINEBREAK experimental setup: in this experiment, we only use images with age in [1, 60]. some images with bad visual quality and watermarks are also discarded. after the preprocessing, 14,760 images are left. the number of images for each age ranges from 50 to 1051. we resize all selected images to 64 × 64. some example utkface images are shown in the first image array in fig.4. LINEBREAK when implementing cgan, each age is treated as a class. for ccgan we use the rule of thumb formulae in supp. s.4 to select the three hyper-parameters of hvdl and svdl, i.e., σ ≈ 0.041, κ ≈ 0.017 and ν = 3600. both cgan and ccgan are trained for 40,000 iterations with batch size 512. in testing, we generate 1,000 fake images from each trained gan for each age. please see supp. s.8 for more details of data preprocessing, network architectures and training/testing setup. LINEBREAK quantitative and visual results: similar to the rc-49 experiment, we evaluate the quality of fake images by intra-fid, niqe, diversity (entropy of predicted races), and label score. we report in table 3 the average quality of 60,000 fake images. we also show in fig. 4 some example fake images from cgan and ccgan and line graphs of fid/niqe versus ages in fig. 5. analogous to the quantitative comparisons, we can see that ccgan performs much better than cgan. LINEBREAK table 3: average quality of 60,000 fake utkface images from cgan and ccgan with standard deviations after the “±” symbol. “↓” (“↑”) indicates lower (higher) values are preferred. LINEBREAK method LINEBREAK intra-fid ↓ LINEBREAK niqe ↓ LINEBREAK diversity ↑ LINEBREAK label score ↓ LINEBREAK cgan (60 classes) ccgan (hvdl) ccgan (svdl) LINEBREAK figure 3: three rc-49 example images for each of 10 angles: real images and example fake images from cgan and two proposed ccgans, respectively. ccgans produce chair images with higher visual quality and more diversity. LINEBREAK figure 4: three utkface example images for each of 10 ages: real images and example fake images from cgan and two proposed ccgans, respectively. ccgans produce face images with higher visual quality and more diversity. LINEBREAK (a) rc-49: fid vs angle (b) rc-49: niqe vs angle (c) utkface: fid vs age (d) utkface: niqe vs age LINEBREAK figure 5: line graphs of fid/niqe versus regression labels on rc-49 and utkface. figs. 5(a) to 5(d) show that two ccgans consistently outperform cgan across all regression labels. the graphs of ccgans also appear smoother than those of cgan because of hvdl and svdl. LINEBREAK conclusion LINEBREAK as the first generative model, we propose the ccgan in this paper for image generation conditional on regression labels. in ccgan, two novel empirical discriminator losses (hvdl and svdl), a novel empirical generator loss and a novel label input method are proposed to overcome the two problems of existing cgans. the error bounds of a discriminator trained under hvdl and svdl are studied in this work. a new benchmark dataset, rc-49, is also proposed for the continuous scenario. finally we demonstrate the superiority of the proposed ccgan to cgan on the circular 2-d gaussians, rc-49, and utkface datasets. LINEBREAK acknowledgments LINEBREAK this work was supported by the natural sciences and engineering research council of canada (nserc) under grants crdpj 476594-14, rgpin-2019-05019, and rgpas2017-507965. LINEBREAK references LINEBREAK zeynep akata, florent perronnin, zaid harchaoui, and cordelia schmid. label-embedding for image classification. ieee transactions on pattern analysis and machine intelligence, 38(7):1425–1438, 2015. LINEBREAK martin arjovsky, soumith chintala, and l´eon bottou. wasserstein generative adversarial networks. volume 70 of proceedings of machine learning research, pp. 214–223, international convention centre, sydney, australia, 2017. pmlr. LINEBREAK andrew brock, jeff donahue, and karen simonyan. large scale gan training for high fidelity LINEBREAK natural image synthesis. in international conference on learning representations, 2019. LINEBREAK angel x chang, thomas funkhouser, leonidas guibas, pat hanrahan, qixing huang, zimo li, silvio savarese, manolis savva, shuran song, hao su, et al. shapenet: an information-rich 3d model repository. arxiv preprint arxiv:1512.03012, 2015. LINEBREAK olivier chapelle, jason weston, l´eon bottou, and vladimir vapnik. vicinal risk minimization. in LINEBREAK advances in neural information processing systems, pp. 416–422, 2001. LINEBREAK harm de vries, florian strub, j´er´emie mary, hugo larochelle, olivier pietquin, and aaron c courville. modulating early visual processing by language. in advances in neural information processing systems, pp. 6594–6604, 2017. LINEBREAK ian goodfellow, jean pouget-abadie, mehdi mirza, bing xu, david warde-farley, sherjil ozair, aaron courville, and yoshua bengio. generative adversarial nets. in advances in neural information processing systems, pp. 2672–2680, 2014. LINEBREAK martin heusel, hubert ramsauer, thomas unterthiner, bernhard nessler, and sepp hochreiter. gans trained by a two time-scale update rule converge to a local nash equilibrium. in advances in neural information processing systems, pp. 6626–6637, 2017. LINEBREAK tero karras, samuli laine, miika aittala, janne hellsten, jaakko lehtinen, and timo aila. analyzing and improving the image quality of stylegan. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 8110–8119, 2020. LINEBREAK diederik p. kingma and jimmy ba. adam: a method for stochastic optimization. in yoshua bengio and yann lecun (eds.), 3rd international conference on learning representations, iclr 2015, san diego, ca, usa, may 7-9, 2015, conference track proceedings, 2015. LINEBREAK mehdi mirza and simon osindero. conditional generative adversarial nets. arxiv preprint LINEBREAK anish mittal, rajiv soundararajan, and alan c bovik. making a “completely blind” image quality LINEBREAK analyzer. ieee signal processing letters, 20(3):209–212, 2012. LINEBREAK takeru miyato and masanori koyama. cgans with projection discriminator. in international LINEBREAK conference on learning representations, 2018. LINEBREAK takeru miyato, toshiki kataoka, masanori koyama, and yuichi yoshida. spectral normalization for LINEBREAK generative adversarial networks. arxiv preprint arxiv:1802.05957, 2018. LINEBREAK augustus odena, christopher olah, and jonathon shlens. conditional image synthesis with auxiliary classifier gans. in proceedings of the 34th international conference on machine learning-volume 70, pp. 2642–2651, 2017. LINEBREAK greg olmschenk. semi-supervised regression with generative adversarial networks using minimal LINEBREAK labeled data. phd thesis, 2019. LINEBREAK greg olmschenk, jin chen, hao tang, and zhigang zhu. dense crowd counting convolutional neural networks with minimal data using semi-supervised dual-goal generative adversarial networks. in ieee conference on computer vision and pattern recognition: learning with imperfect data workshop, 2019. LINEBREAK gabriel peyr´e, marco cuturi, et al. computational optimal transport. foundations and trends® in LINEBREAK mehdi rezagholiradeh and md akmal haidar. reg-gan: semi-supervised learning based on generative adversarial networks for regression. in 2018 ieee international conference on acoustics, speech and signal processing (icassp), pp. 2806–2810. ieee, 2018. LINEBREAK mehdi rezagholizadeh, md akmal haidar, and dalei wu. semi-supervised regression with generative LINEBREAK adversarial networks, november 22 2018. us patent app. 15/789,518. LINEBREAK bernard w silverman. density estimation for statistics and data analysis, volume 26. crc press, LINEBREAK vladimir vapnik. the nature of statistical learning theory. springer, 2nd edition, 2000. LINEBREAK larry wasserman. density estimation @online. http://www.stat.cmu.edu/˜larry/ LINEBREAK =sml/densityestimation.pdf. LINEBREAK han zhang, ian goodfellow, dimitris metaxas, and augustus odena. self-attention generative adversarial networks. in proceedings of the 36th international conference on machine learning, volume 97, pp. 7354–7363, 2019. LINEBREAK zhifei zhang, yang song, and hairong qi. age progression/regression by conditional adversarial autoencoder. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 5810–5818, 2017. LINEBREAK shengyu zhao, zhijian liu, ji lin, jun-yan zhu, and song han. differentiable augmentation for LINEBREAK data-efficient gan training. in advances in neural information processing systems, 2020. LINEBREAK supplementary material LINEBREAK s.1 github repository LINEBREAK please find the codes for this paper at github: LINEBREAK https://github.com/ubcdingxin/improved_ccgan LINEBREAK s.2 algorithms for ccgan training LINEBREAK algorithm 1: an algorithm for ccgan training with the proposed hvdl. data: n r real image-label pairs ωr = {(xr LINEBREAK n r )}, n r LINEBREAK n r , yr LINEBREAK uy ordered distinct labels LINEBREAK υ = {yr batch size md, and the generator batch size mg. LINEBREAK [n r LINEBREAK uy]} in the dataset, preset σ and κ, number of iterations k, the discriminator LINEBREAK result: trained generator g. LINEBREAK 1 for k = 1 to k do train d; 2 draw md labels y d with replacement from υ; create a set of target labels y d,(cid:15) = {yi + (cid:15)|yi ∈ y d, (cid:15) ∈ n (0, σ2), i = 1, . . . , md} (d training is conditional on these labels) ; d = φ, ωf initialize ωr for i = 1 to md do LINEBREAK d = φ; LINEBREAK randomly choose an image-label pair (x, y) ∈ ωr satisfying |y − yi − (cid:15)| ≤ κ where yi + (cid:15) ∈ y d,(cid:15) and let ωr randomly draw a label y(cid:48) from u (yi + (cid:15) − κ, yi + (cid:15) + κ) and generate a fake image x(cid:48) by evaluating g(z, y(cid:48)), where z ∼ n (0, i). let ωf LINEBREAK d ∪ (x, yi + (cid:15)). ; LINEBREAK d = ωr LINEBREAK d ∪ (x(cid:48), yi + (cid:15)). ; LINEBREAK d = ωf LINEBREAK d and ωf LINEBREAK d via gradient-based optimizers based on eq.(6); LINEBREAK end update d with samples in set ωr train g; draw mg labels y g with replacement from υ; create another set of target labels y g,(cid:15) = {yi + (cid:15)|yi ∈ y g, (cid:15) ∈ n (0, σ2), i = 1, . . . , mg} (g training is conditional on these labels) ; generate mg fake images conditional on y g,(cid:15) and put these image-label pairs in ωf update g with samples in ωf LINEBREAK g via gradient-based optimizers based on eq.(11) ; LINEBREAK g ; LINEBREAK remark s.3. it should be noted that, for computational efficiency, the normalizing constants i=1 wg(yg n r j + (cid:15)g) in eq. (9) and (10) are yr excluded from the training and only used for theoretical analysis. LINEBREAK j + (cid:15)r), and (cid:80)n g LINEBREAK j +(cid:15)g,κ, (cid:80)n r LINEBREAK j +(cid:15)r,κ, n g yg LINEBREAK i=1 wr(yr LINEBREAK i , yg LINEBREAK i , yr LINEBREAK s.3 more details of the proposed label input method in section 2 LINEBREAK we propose a novel way to input labels to the conditional generative adversarial networks. for the generator, we add a regression label element-wise to the feature map of the first linear layer. for the discriminator, labels are first projected to a latent space learned by an extra linear layer. then, we incorporate the embedded labels into the discriminator by the label projection (miyato & koyama, 2018). figs. s.3.6 and s.3.7 visualizes our proposed label input method. please refer to our codes for more details. LINEBREAK s.4 a rule of thumb for hyper-parameter selection LINEBREAK in our experiments, we normalize labels to real numbers in [0, 1] and the hyper-parameter selection is conducted based on the normalized labels. to be more specific, the hyper-parameter σ is computed based on a rule-of-thumb formula for the bandwidth selection of kde (silverman, 1986), i.e., LINEBREAK algorithm 2: an algorithm for ccgan training with the proposed svdl. data: n r real image-label pairs ωr = {(xr LINEBREAK n r )}, n r LINEBREAK n r , yr LINEBREAK uy ordered distinct labels LINEBREAK υ = {yr batch size md, and the generator batch size mg. LINEBREAK [n r LINEBREAK uy]} in the dataset, preset σ and ν, number of iterations k, the discriminator LINEBREAK result: trained generator g. LINEBREAK 1 for k = 1 to k do train d; 2 draw md labels y d with replacement from υ; create a set of target labels y d,(cid:15) = {yi + (cid:15)|yi ∈ y d, (cid:15) ∈ n (0, σ2), i = 1, . . . , md} (d training is conditional on these labels) ; d = φ, ωf initialize ωr for i = 1 to md do LINEBREAK d = φ; LINEBREAK d ∪ (x, yi + (cid:15)). this step is used to exclude real images with too LINEBREAK d = ωr LINEBREAK randomly choose an image-label pair (x, y) ∈ ωr satisfying e−ν(y−yi−(cid:15))2 yi + (cid:15) ∈ y d,(cid:15) and let ωr small weights. ; compute wr randomly draw a label y(cid:48) from u (yi + (cid:15) − , yi + (cid:15) + fake image x(cid:48) by evaluating g(z, y(cid:48)), where z ∼ n (0, i). let ωf compute wg LINEBREAK i (y, yi + (cid:15)) = e−ν(yi+(cid:15)−y)2 LINEBREAK d = ωf LINEBREAK ) and generate a LINEBREAK d ∪ (x(cid:48), yi + (cid:15)). ; LINEBREAK d and ωf LINEBREAK d via gradient-based optimizers based on eq.(7); LINEBREAK end update d with samples in set ωr train g; draw mg labels y g with replacement from υ; create another set of target labels y g,(cid:15) = {yi + (cid:15)|yi ∈ y g, (cid:15) ∈ n (0, σ2), i = 1, . . . , mg} (g training is conditional on these labels) ; generate mg fake images conditional on y g,(cid:15) and put these image-label pairs in ωf update g with samples in ωf LINEBREAK g via gradient-based optimizers based on eq.(11) ; LINEBREAK g ; LINEBREAK figure s.3.6: the label input method for the generator in ccgan. LINEBREAK figure s.3.7: the label input method for the discriminator in ccgan. LINEBREAK σ = (cid:0)4ˆσ5 yr /3n r(cid:1)1/5 set. let κbase = max LINEBREAK , where ˆσyr is the sample standard deviation of normalized labels in the training (cid:16) [l] is the l-th smallest LINEBREAK [2] − yr yr LINEBREAK , where yr LINEBREAK [n r LINEBREAK [n r LINEBREAK uy] − yr LINEBREAK normalized distinct real label and n r uy is the number of normalized distinct labels in the training set. the κ is set as a multiple of κbase (i.e., κ = mκκbase) where the multiplier mκ stands for 50% of the minimum number of neighboring labels used for estimating pr(x|y) given a label y. for example, mκ = 1 implies using 2 neighboring labels (one on the left while the other one on the right). in our experiments, mκ is generally set as 1 or 2. in some extreme case when many distinct labels have too few real samples, we may consider increasing mκ. we also found ν = 1/κ2 works well in our experiments. LINEBREAK s.5 more details of theorems s.4 and s.5 LINEBREAK s.5.1 some necessary definitions and notations LINEBREAK • the hypothesis space d is a set of functions that can be represented by d (a neural network LINEBREAK with determined architecture). LINEBREAK • in the hvdl case, denote by py,κ LINEBREAK r of real images with labels in [y − κ, y + κ] and similarly to py,κ LINEBREAK g • in the svdl case, given y and weight functions (e.q. LINEBREAK y−κ pr(x|y(cid:48))pr(y(cid:48))dy(cid:48) the marginal distribution LINEBREAK (x) of fake images. LINEBREAK real and fake images are infinite, (cid:82) pr(x|y(cid:48)) wr(y(cid:48),y)pr(y(cid:48)) where w r(y) (cid:44) (cid:82) wr(y(cid:48), y)pr(y(cid:48))dy(cid:48) and w g(y) (cid:44) (cid:82) wg(y(cid:48), y)pg(y(cid:48))dy(cid:48). LINEBREAK the empirical density converges to py,wr (x) (cid:44) (cid:82) pg(x|y(cid:48)) wg(y(cid:48),y)pg(y) LINEBREAK dy(cid:48) and py,wg LINEBREAK w g(y) LINEBREAK w r(y) LINEBREAK g LINEBREAK r LINEBREAK if the number of (x) (cid:44) dy(cid:48) respectively, LINEBREAK • let pr LINEBREAK w(y(cid:48)|y) (cid:44) wr(y(cid:48),y)pr(y(cid:48)) LINEBREAK w r(y) LINEBREAK and pg LINEBREAK w(y(cid:48)|y) (cid:44) wg(y(cid:48),y)pg(y(cid:48)) LINEBREAK w g(y) LINEBREAK • the h¨older class defined in definition 1 is a set of functions with bounded second derivatives, which controls the variation of the function when parameter changes. (a4) implies the two probability density functions pr(y) and pg(y) are assumed in the h¨older class. LINEBREAK • given a g, the optimal discriminator which minimizes l is in the form of LINEBREAK d∗(x, y) = LINEBREAK pr(x, y) pr(x, y) + pg(x, y) LINEBREAK however, d∗ may not be covered by the hypothesis space d. the (cid:101)d is the minimizer of l in the hypothesis space d. thus, l( (cid:101)d) − l(d∗) should be a non-negative constant. in ccgan, we minimize (cid:98)lhvdl(d) or (cid:98)lhvdl(d) with respect to d ∈ d, so we are more interested in the distance of (cid:98)dhvdl and (cid:98)dsvdl from d∗, i.e., l( (cid:98)dhvdl) − l(d∗) and l( (cid:98)dsvdl) − l(d∗). LINEBREAK s.5.2 proofs of theorems 1 and 2 LINEBREAK s.5.2.1 technical lemmas LINEBREAK before we move to the proofs of theorems 1 and 2, we provide several technical lemmas used in the later proof. LINEBREAK recall notations and assumptions in sections 3 and s.5.1, then we derive the following lemmas. LINEBREAK lemma s.1. suppose that (a1)-(a2) and (a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK n r (cid:88) LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK (cid:12) (cid:12) i , y)] − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK y,κ LINEBREAK y,κ LINEBREAK sup d∈d LINEBREAK ≤ u LINEBREAK for a given y. LINEBREAK log LINEBREAK κu m r 2 LINEBREAK proof. triangle inequality yields LINEBREAK sup d∈d LINEBREAK ≤ sup d∈d LINEBREAK n r (cid:88) LINEBREAK r LINEBREAK n r (cid:88) LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK (cid:12) (cid:12) i , y)] − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK i , y)] − ex∼py,κ LINEBREAK r LINEBREAK (x) [− log d(x, y)] − ex∼pr(x|y) [− log d(x, y)](cid:12) (cid:12) LINEBREAK we then bound the two terms of the rhs separately as follows: LINEBREAK 1. real images with labels in [y − κ, k + κ] can be seen as independent samples from py,κ LINEBREAK (x). then the first term can be bounded by applying hoeffding’s inequality as follows: ∀δ ∈ (0, 1), with at least probability 1 − δ, LINEBREAK r LINEBREAK 1{|y−yr LINEBREAK i |≤κ} LINEBREAK u LINEBREAK n r (cid:88) LINEBREAK − log d(xr LINEBREAK i , y) LINEBREAK u LINEBREAK − ex∼py,κ LINEBREAK r LINEBREAK (x) LINEBREAK u LINEBREAK − log d(x, y) u LINEBREAK y,κ LINEBREAK sup d∈d LINEBREAK ≤ u LINEBREAK y,κ LINEBREAK log LINEBREAK 2. for the second term, by the definition of py,κ LINEBREAK r LINEBREAK (x) and defining pκ(y(cid:48)) = LINEBREAK we have LINEBREAK {|y(cid:48)−y|≤κ}p(y(cid:48)) {|y(cid:48)−y|≤κ}p(y(cid:48))dy(cid:48) , LINEBREAK (cid:12) (cid:12)ex∼py,κ LINEBREAK (x) [− log d(x, y)] − ex∼pr(x|y) [− log d(x, y)](cid:12) (cid:12) LINEBREAK sup d∈d (by the definition of total variation and the boundness of − log d) LINEBREAK r LINEBREAK |py,κ r LINEBREAK (x) − pr(x|y)| dx. LINEBREAK then, focusing on |py,κ LINEBREAK r LINEBREAK (x) − pr(x|y)|, LINEBREAK |py,κ r LINEBREAK (x) − pr(x|y)| = LINEBREAK |p(x|y(cid:48)) − p(x|y)| pκ(y(cid:48))dy(cid:48) LINEBREAK gr(x)|y(cid:48) − y|pκ(y(cid:48))dy(cid:48) LINEBREAK thus, eq. (s.18) is upper bounded as follows, LINEBREAK ≤ κgr(x). LINEBREAK sup d∈d (cid:90) LINEBREAK (cid:12) (cid:12)ex∼py,κ LINEBREAK r LINEBREAK (x) [− log d(x, y)] − ex∼pr(x|y) [− log d(x, y)](cid:12) (cid:12) LINEBREAK κgr(x)dx LINEBREAK (by (a2)) = κm r. LINEBREAK by combining eq. (s.17) and (s.19), we can get eq. (s.16), which finishes the proof. LINEBREAK similarly, we apply identical proof strategy to the fake images xg and generator distribution pg(x|y). LINEBREAK lemma s.2. suppose that (a1), (a3) and (a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK n g (cid:88) LINEBREAK 1{|y−yg LINEBREAK (cid:12) (cid:12) i |≤κ} [− log(1 − d(xi, y))] − ex∼pg(x|y) [− log(1 − d(x, y))] (cid:12) (cid:12) (cid:12) LINEBREAK y,κ LINEBREAK sup d∈d LINEBREAK ≤ u LINEBREAK y,κ LINEBREAK log LINEBREAK κu m g 2 LINEBREAK for a given y. LINEBREAK proof. this proof is omitted because it is almost identical to the one for lemma s.1. LINEBREAK the following two lemmas provide the bounds for svdl. lemma s.3. suppose that (a1), (a2) and (a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK sup d∈d LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y) LINEBREAK i , y) [− log d(xr i=1 wr(yr (cid:19) (cid:18) 4 δ LINEBREAK u m r 2 LINEBREAK 1 2n r log LINEBREAK u w r(y) LINEBREAK for a given y. LINEBREAK i , y)] LINEBREAK (cid:12) (cid:12) − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK ey(cid:48)∼pr LINEBREAK w(y(cid:48)|y) [|y(cid:48) − y|] , LINEBREAK proof. for brevity, denote by f (x, y) = − log d(x, y) and f = − log d. then, LINEBREAK (cid:12) (cid:12) − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK (cid:80)n r LINEBREAK sup d∈d LINEBREAK = sup f ∈f LINEBREAK ≤ sup f ∈f LINEBREAK i , y) [− log d(xr i=1 wr(yr LINEBREAK i , y)] LINEBREAK i=1 wr(yr (cid:80)n r 1 n r (cid:80)n r i=1 wr(yr (cid:80)n r 1 n r (cid:80)n r LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y) i , y)f (xr i , y) i , y)f (xr i , y) LINEBREAK i=1 wr(yr LINEBREAK i , y) LINEBREAK i , y) LINEBREAK e LINEBREAK + sup f ∈f LINEBREAK x∼py,wr LINEBREAK r LINEBREAK − e LINEBREAK x∼py,wr LINEBREAK i=1 wr(yr (cid:12) (x) [f (x, y)] − ex∼pr(x|y) [f (x, y)] (cid:12) (cid:12) LINEBREAK r LINEBREAK (cid:12) (cid:12) − ex∼pr(x|y) [f (x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK where the inequality is by triangular inequality. we then derive bounds for both two terms of the last line. LINEBREAK 1. for the first term, we can further split it into two parts, LINEBREAK (cid:80)n r LINEBREAK i , y) LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr (cid:80)n r 1 n r 1 n r LINEBREAK i=1 wr(yr i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y)f (xr i , y) i , y)f (xr i , y) i , y)f (xr LINEBREAK i=1 wr(yr LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr w r(y) LINEBREAK − e LINEBREAK x∼py,wr LINEBREAK r LINEBREAK i , y) LINEBREAK (cid:80)n r LINEBREAK (cid:12) (cid:12) (cid:12) (x) [f (x, y)] (cid:12) (cid:12) i , y)f (xr LINEBREAK i=1 wr(yr w r(y) LINEBREAK i , y) LINEBREAK − e LINEBREAK x∼py,wr LINEBREAK r LINEBREAK i , y) LINEBREAK focusing on the first part of rhs of eq.(s.23). by (a1), LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr w r(y) LINEBREAK i , y)f (xr LINEBREAK i , y) LINEBREAK ≤ u LINEBREAK (cid:80)n r LINEBREAK i , y) LINEBREAK i , y)f (xr i , y) i , y) − w r(y) LINEBREAK i=1 wr(yr i=1 wr(yr LINEBREAK (cid:80)n r LINEBREAK w r(y) LINEBREAK note that ∀y, y(cid:48), wr(y(cid:48), y) = e−ν|y−y(cid:48)|2 ≤ 1 and hence given y, wr(y(cid:48), y) is a random variable bounded by 1. apply hoeffding’s inequality to the numerator of above, yielding that with probability at least 1 − δ(cid:48), (cid:12) 1 (cid:12) n r (cid:12) (cid:12) (cid:12) LINEBREAK i=1 wr(yr w r(y) LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y)f (xr i , y) LINEBREAK 1 2n r log LINEBREAK u w r(y) LINEBREAK i=1 wr(yr LINEBREAK i , y)f (xr LINEBREAK (cid:80)n r LINEBREAK (cid:80)n r LINEBREAK i , y) LINEBREAK i , y) LINEBREAK then, consider the second part of rhs of eq.(s.23). recall (cid:82) pr(x|y(cid:48)) wr(y(cid:48),y)pr(y(cid:48)) w r(y) (cid:80)n r i=1 wr(yr w r(y) LINEBREAK i , y)f (xr LINEBREAK dy(cid:48). thus, LINEBREAK x∼py,wr LINEBREAK i , y) LINEBREAK − e LINEBREAK r LINEBREAK that py,wr LINEBREAK r LINEBREAK 1 w r(y) LINEBREAK n r (cid:88) LINEBREAK wr(yr LINEBREAK i , y)f (xr LINEBREAK i , y) − e(x,y(cid:48))∼pr(x,y(cid:48)) [wr(y(cid:48), y)f (xr LINEBREAK where pr(x, y(cid:48)) = pr(x|y(cid:48))pr(y(cid:48)) denotes the joint distribution of real image and its label. again, since wr(y(cid:48), y)f (xr i , y) is uniformly bounded by u under (a1), we can apply hoeffding’s inequality. this implies that with probability at least 1 − δ(cid:48), the above can be upper bounded by LINEBREAK u w r(y) LINEBREAK 1 2n r log LINEBREAK (cid:18) 2 δ(cid:48) combining eq. (s.24) and (s.25) and by setting δ(cid:48) = δ 2 , we have with probability at least 1 − δ, (cid:12) 1 (cid:12) n r (cid:12) (cid:12) (cid:12) LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y)f (xr i , y) LINEBREAK 1 2n r log LINEBREAK u w r(y) LINEBREAK i=1 wr(yr LINEBREAK x∼py,wr LINEBREAK (cid:80)n r LINEBREAK i , y) LINEBREAK − e LINEBREAK r LINEBREAK since this holds for ∀f ∈ f, taking supremum over f , we have LINEBREAK sup f ∈f LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK i , y)f (xr i , y) LINEBREAK i=1 wr(yr LINEBREAK i , y) LINEBREAK − e LINEBREAK x∼py,wr LINEBREAK r LINEBREAK u w r(y) LINEBREAK 1 2n r log LINEBREAK 2. for the second term on the rhs of eq.(s.22). by (a1) that |f | < u , (cid:12) (x) [f (x, y)] − ex∼pr(x|y) [f (x, y)] (cid:12) (cid:12) LINEBREAK x∼py,wr LINEBREAK e LINEBREAK r LINEBREAK r LINEBREAK (x) − pr(x|y)(cid:107)t v LINEBREAK |py,wr r LINEBREAK (x) − pr(x|y)|dx. LINEBREAK (x) (cid:44) (cid:82) pr(x|y(cid:48)) wr(y(cid:48),y)pr(y(cid:48)) LINEBREAK w r(y) LINEBREAK dy(cid:48) and pr LINEBREAK note that by the definition of py,wr wr(y(cid:48),y)pr(y(cid:48)) w r(y) LINEBREAK , we have LINEBREAK r LINEBREAK |py,wr r LINEBREAK (x) − pr(x|y)| = LINEBREAK pr(x|y(cid:48))pr LINEBREAK w (y(cid:48)|y) dy(cid:48) − pr(x|y) LINEBREAK |pr(x|y(cid:48)) − pr(x|y)| pr LINEBREAK w (y(cid:48)|y) dy(cid:48). LINEBREAK by (a.2) and y ∈ [0, 1], the above is upper bounded by gr(x)ey(cid:48)∼pr LINEBREAK w(y(cid:48)|y) [|y − y(cid:48)|]. thus, LINEBREAK x∼py,wr LINEBREAK r LINEBREAK (cid:12) (x) [f (x, y)] − ex∼pr(x|y) [f (x, y)] (cid:12) (cid:12) LINEBREAK e LINEBREAK sup f ∈f u 2 u m r 2 LINEBREAK gr(x)ey(cid:48)∼pr LINEBREAK w(y(cid:48)|y) [|y(cid:48) − y|] dx LINEBREAK ey(cid:48)∼pr LINEBREAK w(y(cid:48)|y) [|y(cid:48) − y|] . LINEBREAK therefore, combining both eq.(s.26) and (s.27), with probability at least 1 − δ, LINEBREAK (cid:80)n r LINEBREAK i=1 wr(yr (cid:80)n r 1 n r LINEBREAK sup d∈d LINEBREAK i , y) LINEBREAK i , y) [− log d(xr i=1 wr(yr (cid:18) 4 (cid:19) δ LINEBREAK u m r 2 LINEBREAK 1 2n r log LINEBREAK i , y)] LINEBREAK (cid:12) (cid:12) − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK ey(cid:48)∼pr LINEBREAK w(y(cid:48)|y) [|y(cid:48) − y|] . LINEBREAK u w r(y) this finishes the proof. LINEBREAK lemma s.4. suppose that (a1), (a3) and (a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, i , y))] LINEBREAK i=1 wg(yg LINEBREAK (cid:80)n g LINEBREAK (cid:12) (cid:12) − ex∼pg(x|y) [− log(1 − d(x, y))] (cid:12) (cid:12) (cid:12) LINEBREAK sup d∈d LINEBREAK i , y) [− log(1 − d(xg (cid:80)n g LINEBREAK i , y) LINEBREAK u m g 2 LINEBREAK 1 2n g log LINEBREAK ey(cid:48)∼pg LINEBREAK w(y(cid:48)|y) [|y(cid:48) − y|] , LINEBREAK u w g(y) for a given y. LINEBREAK proof. this proof is omitted because it is almost identical to the one for lemma s.21. LINEBREAK as introduced in section 2, we use kde for the marginal label distribution with gaussian kernel. the next theorem characterizes the difference between a pr(y), pg(y) and their kde using n i.i.d. samples. theorem s.3. let ˆpkde (y) stand for the kde of pr(y) and pg(y) respectively. under condition (a4), if the kdes are based on n i.i.d. samples from pr/pg and a bandwidth σ, for all δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK (y) and ˆpkde LINEBREAK g LINEBREAK r LINEBREAK (cid:12) (cid:12)ˆpkde r LINEBREAK (y) − pr(y)(cid:12) LINEBREAK sup t LINEBREAK (cid:12) (cid:12)ˆpkde g LINEBREAK (y) − pg(y)(cid:12) LINEBREAK c kde LINEBREAK 1,δ log n nσ LINEBREAK c kde LINEBREAK 2,δ log n nσ LINEBREAK for some constants c kde LINEBREAK 2,δ depending on δ. LINEBREAK sup t 1,δ , c kde LINEBREAK proof. by ((wasserman); p.12), for any p(t) ∈ σ(l) (the h¨older class, see definition 1), with probability at least 1 − δ, LINEBREAK (cid:12)ˆpkde(t) − p(t)(cid:12) (cid:12) LINEBREAK sup (s.31) t and c, where c depends on δ and c = l (cid:82) k(s)|s|2ds. since in this work, LINEBREAK nσ LINEBREAK c kde δ LINEBREAK log n LINEBREAK for some constants c kde k is chosen as gaussian kernel, c = l (cid:82) k(s)|s|2ds = l. LINEBREAK s.5.2.2 error bounds for hvdl and svdl LINEBREAK based on the lemmas and theorems in supp. s.5.2.1, we derive the error bounds of hvdl and svdl, which will be used in the proofs of theorems 1 and 2. theorem s.4. assume that (a1)-(a4) hold, then ∀δ ∈ (0, 1), with probability at least 1 − δ, LINEBREAK sup d∈d LINEBREAK (cid:12) (cid:12) (cid:98)lhvdl(d) − l(d) (cid:12) LINEBREAK ≤ u LINEBREAK c kde LINEBREAK 1,δ log n r n rσ LINEBREAK + u LINEBREAK c kde LINEBREAK 2,δ log n g n gσ LINEBREAK κu (m r + m g) 2 LINEBREAK log LINEBREAK + u LINEBREAK ey∼ ˆpkde LINEBREAK r LINEBREAK y,κ LINEBREAK (y) LINEBREAK + ey∼ ˆpkde LINEBREAK g (y) LINEBREAK y,κ LINEBREAK for some constants c kde LINEBREAK 1,δ , c kde LINEBREAK 2,δ depending on δ. LINEBREAK proof. we first decompose supd∈d LINEBREAK (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:98)lhvdl(d) − l(d) (cid:12) as follows LINEBREAK sup d∈d LINEBREAK ≤ sup d∈d LINEBREAK + sup d∈d LINEBREAK + sup d∈d LINEBREAK + sup d∈d LINEBREAK n r (cid:88) LINEBREAK y,κ LINEBREAK y,κ LINEBREAK [− log d(x, y)] pr(x|y)dx LINEBREAK [− log(1 − d(x, y))] pg(x|y)dx LINEBREAK (pr(y) − ˆpkde LINEBREAK r LINEBREAK (y))dy LINEBREAK (pg(y) − ˆpkde LINEBREAK g LINEBREAK (y))dy LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK 1{|y−yg LINEBREAK i |≤κ} [− log(1 − d(xg LINEBREAK (cid:35) i , y)] − ex∼pr(x|y) [− log d(x, y)] LINEBREAK (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:35) i , y))] − ex∼pg(x|y) [− log(1 − d(x, y))] LINEBREAK ˆpkde r LINEBREAK (y)dy LINEBREAK ˆpkde g LINEBREAK (y)dy LINEBREAK these four terms in the rhs can be bounded separately as follows LINEBREAK 1. the first term can be bounded by using theorem s.3 and the boundness of d and y ∈ [0, 1]. LINEBREAK for the first term, ∀δ1 ∈ (0, 1), with at least probability 1 − δ1, LINEBREAK sup d∈d LINEBREAK [− log d(x, y)] pr(x|y)dx LINEBREAK (pr(y) − ˆpkde LINEBREAK r LINEBREAK (y))dy LINEBREAK ≤u LINEBREAK log n r LINEBREAK n rσ LINEBREAK for some constants c kde 1,δ1 LINEBREAK depending on δ1. LINEBREAK 2. the second term can be bounded by using theorem s.3 and the boundness of d and LINEBREAK y ∈ [0, 1]. for the first term, ∀δ2 ∈ (0, 1), with at least probability 1 − δ2, LINEBREAK sup d∈d LINEBREAK [− log(1 − d(x, y))] pg(x|y)dx LINEBREAK (pg(y) − ˆpkde LINEBREAK g LINEBREAK (y))dy LINEBREAK ≤u LINEBREAK log n g LINEBREAK n rσ LINEBREAK for some constants c kde 2,δ2 LINEBREAK depending on δ2. LINEBREAK 3. the third term can be bounded by using lemma s.1 and s.2. for the third term, ∀δ3 ∈ (0, 1), LINEBREAK with at least probability 1 − δ3, LINEBREAK y,κ LINEBREAK n r (cid:88) LINEBREAK sup d∈d LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK (cid:35) i , y)] − ex∼pr(x|y) [− log d(x, y)] LINEBREAK ˆpkde r LINEBREAK (y)dy LINEBREAK sup d∈d LINEBREAK u LINEBREAK y,κ LINEBREAK n r (cid:88) LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK (cid:12) (cid:12) i , y)] − ex∼pr(x|y) [− log d(x, y)] (cid:12) (cid:12) (cid:12) LINEBREAK ˆpkde r LINEBREAK (y)dy LINEBREAK y,κ LINEBREAK log LINEBREAK κu m r 2 LINEBREAK ˆpkde r LINEBREAK (y)dy LINEBREAK note that n r expressed as LINEBREAK y,κ = (cid:80)n r LINEBREAK 1{|y−yr LINEBREAK i |}, which is a random variable of y(cid:48) LINEBREAK is. the above can be LINEBREAK y,κ LINEBREAK sup d∈d LINEBREAK κu m r 2 LINEBREAK + u LINEBREAK n r (cid:88) LINEBREAK 1{|y−yr LINEBREAK i |≤κ} [− log d(xr LINEBREAK (cid:35) i , y)] − ex∼pr(x|y) [− log d(x, y)] LINEBREAK log LINEBREAK ey∼ ˆpkde LINEBREAK r LINEBREAK y,κ LINEBREAK (y) LINEBREAK ˆpkde r LINEBREAK (y)dy LINEBREAK 4. similarly, for the fourth term, ∀δ4 ∈ (0, 1), with at least probability 1 − δ4, LINEBREAK sup d∈d LINEBREAK y,κ LINEBREAK n r (cid:88) LINEBREAK 1{|y−yg LINEBREAK i |≤κ} [− log(1 − d(xg LINEBREAK i , y))]
| 18
|
[
422.67,
535.5110828,
447.49152056,
547.6708556
] |
8KYeilT3Ow.pdf
| 2,023
| 0
|
LINEBREAK nagphormer: a tokenized graph transformer for node classification in large graphs LINEBREAK jinsong chen1,2,3,∗, kaiyuan gao2,3,∗, gaichao li1,2,3, kun he2,3,† 1institute of artificial intelligence, huazhong university of science and technology 2school of computer science and technology, huazhong university of science and technology 3hopcroft center on computing science, huazhong university of science and technology LINEBREAK {chenjinsong,im_kai,gaichaolee,brooklet60}@hust.edu.cn LINEBREAK abstract LINEBREAK the graph transformer emerges as a new architecture and has shown superior performance on various graph mining tasks. in this work, we observe that existing graph transformers treat nodes as independent tokens and construct a single long sequence composed of all node tokens so as to train the transformer model, causing it hard to scale to large graphs due to the quadratic complexity on the number of nodes for the self-attention computation. to this end, we propose a neighborhood aggregation graph transformer (nagphormer) that treats each node as a sequence containing a series of tokens constructed by our proposed hop2token module. for each node, hop2token aggregates the neighborhood features from different hops into different representations and thereby produces a sequence of token vectors as one input. in this way, nagphormer could be trained in a mini-batch manner and thus could scale to large graphs. moreover, we mathematically show that as compared to a category of advanced graph neural networks (gnns), the decoupled graph convolutional network, nagphormer could learn more informative node representations from the multi-hop neighborhoods. extensive experiments on benchmark datasets from small to large are conducted to demonstrate that nagphormer consistently outperforms existing graph transformers and mainstream gnns. code is available at https://github.com/jhl-hust/nagphormer. LINEBREAK introduction LINEBREAK graphs, as a powerful data structure, are widely used to represent entities and their relations in a variety of domains, such as social networks in sociology and protein-protein interaction networks in biology. their complex features (e.g., attribute features and topology features) make the graph mining tasks very challenging. graph neural networks (gnns) (chen et al., 2020c; kipf & welling, 2017; veliˇckovi´c et al., 2018), owing to the message passing mechanism that aggregates neighborhood information for learning the node representations (gilmer et al., 2017), have been recognized as a type of powerful deep learning techniques for graph mining tasks (xu et al., 2019; fan et al., 2019; ying et al., 2018; zhang & chen, 2018; jin et al., 2019) over the last decade. though effective, message passing-based gnns have a number of inherent limitations, including over-smoothing (chen et al., 2020a) and over-squashing (alon & yahav, 2021) with the increment of model depth, limiting their potential capability for graph representation learning. though recent efforts (yang et al., 2020; lu et al., 2021; huang et al., 2020; sun et al., 2022) have been devoted to alleviate the impact of over-smoothing and over-squashing problems, the negative influence of these inherent limitations cannot be eliminated completely. LINEBREAK transformers (vaswani et al., 2017), on the other hand recently, are well-known deep learning architectures that have shown superior performance in a variety of data with an underlying euclidean or grid-like structure, such as natural languages (devlin et al., 2019; liu et al., 2019) and images (dosovitskiy et al., 2021; liu et al., 2021). due to their great modeling capability, there is a growing interest in generalizing transformers to non-euclidean data like graphs (dwivedi & bresson, 2020; LINEBREAK ∗the first two authors contribute equally. †corresponding author. LINEBREAK figure 1: model framework of nagphormer. nagphormer first uses a novel neighborhood aggregation module, hop2token, to construct a sequence for each node based on the tokens of different hops of neighbors. then, nagphormer learns the node representations using a transformer backbone, and an attention-based readout function is developed to aggregate neighborhood information of different hops adaptively. an mlp-based module is used in the end for label prediction. LINEBREAK kreuzer et al., 2021; ying et al., 2021; jain et al., 2021). however, graph-structured data generally contain more complicated properties, including structural topology and attribute features, that cannot be directly encoded into transformers as the tokens. LINEBREAK existing graph transformers have developed three techniques to address this issue (min et al., 2022): introducing structural encoding (dwivedi & bresson, 2020; kreuzer et al., 2021), using gnns as auxiliary modules (jain et al., 2021), and incorporating graph bias into the attention matrix (ying et al., 2021). by integrating structural information into the model, graph transformers exhibit competitive performance on various graph mining tasks, and outperform gnns on node classification (kreuzer et al., 2021; chen et al., 2022) and graph classification (ying et al., 2021; jain et al., 2021) tasks on small to mediate scale graphs. LINEBREAK in this work, we observe that existing graph transformers treat the nodes as independent tokens and construct a single sequence composed of all the node tokens to train the transformer model, causing a quadratic complexity on the number of nodes for the self-attention calculation. training such a model on large graphs will cost a huge amount of gpu resources that are generally unaffordable since the mini-batch training is unsuitable for graph transformers using a single long sequence as the input. meanwhile, effective strategies that make gnns scalable to large-scale graphs, including node sampling (chen et al., 2018; zou et al., 2019) and approximation propagation (chen et al., 2020b; feng et al., 2022), are not applicable to graph transformers, as they capture the global attention of all node pairs and are independent of the message passing mechanism. the current paradigm of graph transformers makes it intractable to generalize to large graphs. LINEBREAK to address the above challenge, we propose a novel model dubbed neighborhood aggregation graph transformer (nagphormer) for node classification in large graphs. unlike existing graph transformers that regard the nodes as independent tokens, nagphormer treats each node as a sequence and constructs tokens for each node by a novel neighborhood aggregation module called hop2token. the key idea behind hop2token is to aggregate neighborhood features from multiple hops and transform each hop into a representation, which could be regarded as a token. hop2token then constructs a sequence for each node based on the tokens in different hops to preserve the neighborhood information. the sequences are then fed into a transformer-based module for learning the node representations. by treating each node as a sequence of tokens, nagphormer could be trained in a mini-batch manner and hence can handle large graphs even on limited gpu resources. LINEBREAK considering that the contributions of neighbors in different hops differ to the final node representation, nagphormer further provides an attention-based readout function to learn the importance of each hop adaptively. moreover, we provide theoretical analysis on the relationship between nagphormer and an advanced category of gnns, the decoupled graph convolutional network (gcn) (dong et al., 2021; klicpera et al., 2019; wu et al., 2019; chien et al., 2021). the analysis is from the LINEBREAK perspective of self-attention mechanism and hop2token, indicating that nagphormer is capable of learning more informative node representations from the multi-hop neighborhoods. we conduct extensive experiments on various popular benchmarks, including six small datasets and three large datasets, and the results demonstrate the superiority of the proposed method. LINEBREAK the main contributions of this work are as follows: LINEBREAK • we propose hop2token, a novel neighborhood aggregation method that aggregates the neighborhood features from each hop into a node representation, resulting in a sequence of token vectors that preserves neighborhood information for different hops. in this way, we can regard each node in the complex graph data as a sequence of tokens, and treat them analogously as in natural language processing and computer vision fields. LINEBREAK • we propose a new graph transformer model, nagphormer, for the node classification task. nagphormer can be trained in a mini-batch manner depending on the output of hop2token, and therefore enables the model to handle large graphs. we also develop an attention-based readout function to adaptively learn the importance of different-hop neighborhoods to further boost the model performance. LINEBREAK • we prove that from the perspective of self-attention mechanism, the proposed nagphormer can learn more expressive node representations from the multi-hop neighborhoods compared to an advanced category of gnns, the decoupled gcn. LINEBREAK • extensive experiments on benchmark datasets from small to large demonstrate that nagphormer consistently outperforms existing graph transformers and mainstream gnns. LINEBREAK background LINEBREAK problem formulation LINEBREAK let g = (v, e) be an unweighted and undirected attributed graph, where v = {v1, v2, · · · , vn}, and n = |v |. each node v ∈ v has a feature vector xv ∈ x, where x ∈ rn×d is the feature matrix describing the attribute information of nodes and d the dimension of feature vector. a ∈ rn×n represents the adjacency matrix and d the diagonal degree matrix. the normalized adjacency matrix is defined as ˆa = ˜d−1/2 ˜a ˜d−1/2, where ˜a denotes the adjacency matrix with self-loops and ˜d denotes the corresponding degree matrix. the node classification task provides a labeled node set vl and an unlabeled node set vu. let y ∈ rn×c denote the label matrix where c is the number of classes. given the labels yvl , the goal is to predict the labels yvu for unlabeled nodes. LINEBREAK graph neural network LINEBREAK graph neural network (gnn) has become a powerful technique to model the graph-structured data. graph convolutional network (gcn) (kipf & welling, 2017) is a typical model of gnn that applies the first-order approximation of spectral convolution (defferrard et al., 2016) to aggregate information of immediate neighbors. a gcn layer can be written as: LINEBREAK h(l+1) = σ( ˆah(l)w(l)), LINEBREAK where h(l) ∈ rn×d(l) parameter matrix in the l-th layer, respectively. σ(·) denotes the non-linear activation function. LINEBREAK denote the representation of nodes and the learnable LINEBREAK and w(l) ∈ rd(l)×d(l+1) LINEBREAK equation 1 contains two operations, neighborhood aggregation and feature transformation, which are coupled in the gcn layer. such a coupled design would lead to the over-smoothing problem (chen et al., 2020a) when the number of layers increases, limiting the model to capture deep structural information. to address this issue, the decoupled gcn (klicpera et al., 2019; wu et al., 2019) separates the feature transformation and neighborhood aggregation in the gcn layer and treats them as independent modules. a general form of decoupled gcn is described as (chien et al., 2021): LINEBREAK z = LINEBREAK βkh(k), h(k) = ˆah(k−1), h(0) = fθ(x), LINEBREAK where z denotes the final representations of nodes, h(k) denotes the hidden representations of nodes at propagation step k, βk denotes the aggregation coefficient of propagation step k, ˆa denotes the normalized adjacency matrix, fθ denotes a neural network module and x denotes the raw attribute feature matrix. such a decoupled design exhibits high computational efficiency and enables the model capture deeper structural information. more related works on gnns are provided in appendix a. LINEBREAK transformer LINEBREAK the transformer encoder (vaswani et al., 2017) contains a sequence of transformer layers, where each layer is comprised with a multi-head self-attention (msa) and a position-wise feed-forward network (ffn). the msa module is the critical component that aims to capture the semantic correlation between the input tokens. for simplicity, we use the single-head self-attention module for description. suppose we have an input h ∈ rn×d for the self-attention module where n is the number of tokens and d the hidden dimension. the self-attention module first projects h into three subspaces, namely q, k and v: LINEBREAK q = hwq, k = hwk, v = hwv , (3) where wq ∈ rd×dk , wk ∈ rd×dk and wv ∈ rd×dv are the projection matrices. the output matrix is calculated as: LINEBREAK h′ = softmax LINEBREAK v. LINEBREAK (cid:18) qk⊤ √ dk LINEBREAK the attention matrix, softmax , captures the pair-wise similarity of input tokens in the sequence. specifically, it calculates the dot product between each token pair after projection. the softmax is applied row-wise. LINEBREAK (cid:16) qk⊤ √ dk LINEBREAK graph transformer. the transformer architecture has attracted increasing attention in graph representation learning in recent years. the key idea of graph transformer is to integrate graph structural information to the transformer architecture so as to learn the node representations. existing graph transformers could be divided into three categories: (i) replace the positional encoding with laplacian eigenvectors (dwivedi & bresson, 2020; kreuzer et al., 2021) or degree-related feature vectors (ying et al., 2021) to capture the structural features of nodes. (ii) in addition to positional encoding, gnns are used as auxiliary modules to enable the transformer model to capture structural information (jain et al., 2021; rong et al., 2020). (iii) introduce graph information bias into the attention score of each node pair, e.g., the shortest-path distance (ying et al., 2021). we provide a detailed review of graph transformer in appendix a. LINEBREAK the proposed nagphormer LINEBREAK in this section, we present the proposed nagphormer in details. to handle graphs at scale, we first introduce a novel neighborhood aggregation module called hop2token, then we build nagphormer together with structural encoding and attention-based readout function. LINEBREAK hop2token LINEBREAK how to aggregate information from adjacent nodes into a node representation is crucial in reasonably powerful graph neural network (gnn) architectures. to inherit the desirable properties, we design hop2token considering the neighborhood information of different hops. for a node v, let n k(v) = {u ∈ v |d(v, u) ≤ k} be its k-hop neighborhood, where d(v, u) represents the distance of shortest path between v and u. we define n 0(v) = {v}, i.e., the 0-hop neighborhood is the node itself. in hop2token, we transform the k-hop neighborhood n k(v) into a neighborhood embedding xk v with an aggregation operator ϕ. in this way, the k-hop representation of a node v can be expressed as: LINEBREAK v = ϕ(n k(v)). xk (5) by equation 5, we can calculate the neighborhood embeddings for variable hops of a node and further construct a sequence to represent its neighborhood information, i.e., sv = (x0 v ), where k is fixed as a hyperparameter. assume xk v is a d-dimensional vector, the sequences of all nodes LINEBREAK v, ..., xk LINEBREAK algorithm 1 the hop2token algorithm input: normalized adjacency matrix ˆa; feature matrix x; propagation step k output: sequences of all nodes xg 1: for k = 0 to k do 2: 3: 4: 5: 6: end for 7: return sequences of all nodes xg; LINEBREAK end for x = ˆax; LINEBREAK xg[i, k] = x[i]; LINEBREAK for i = 0 to n do LINEBREAK in graph g will construct a tensor xg ∈ rn×(k+1)×d. to better illustrate the implementation of hop2token, we decompose xg to a sequence s = (x0, x1, · · · , xk), where xk ∈ rn×d can be seen as the k-hop neighborhood matrix. here we define x0 as the original feature matrix x. LINEBREAK in practice, we apply a propagation process similar to the method in (chien et al., 2021; he et al., 2022) to obtain the sequence of k-hop neighborhood matrices. given the normalized adjacency matrix ˆa (aka the transition matrix (gasteiger et al., 2019)) and x, multiplying ˆa with x aggregates immediate neighborhood information. applying this multiplication consecutively allows us to propagate information at larger distances. for example, we can access 2-hop neighborhood information by ˆa( ˆax). thereafter, the k-hop neighborhood matrix can be described as: LINEBREAK xk = ˆakx. the detailed implementation is drawn in algorithm 1. the advantages of hop2token is two-fold. (i) hop2token is a non-parametric method. it can be conducted offline before the model training, and the output of hop2token supports mini-batch training. in this way, the model can handle graphs of arbitrary sizes, thus allowing the generalization of graph transformer to large-scale graphs. (ii) encoding k-hop neighborhood of a node into one representation is helpful for capturing the hop-wise semantic correlation, which is ignored in typical gnns (kipf & welling, 2017; klicpera et al., 2019; chien et al., 2021). LINEBREAK nagphormer for node classification LINEBREAK figure 1 depicts the architecture of nagphormer. given an attributed graph, we first concatenate a matrix constructed by eigendecomposition to the attribute matrix, and gain a structure-aware feature matrix. accordingly, the effective feature vector for node v is extended as xv ∈ rd′ . the detailed construction is described in section 3.3. next, we assemble an aggregated neighborhood sequence as sv = (x0 v ) by applying hop2token. then we map sv to the hidden dimension dm of the transformer with a learnable linear projection: LINEBREAK v, ..., xk LINEBREAK where e ∈ rd′×dm and z(0) LINEBREAK v = (cid:2)x0 z(0) v ∈ r(k+1)×dm . LINEBREAK ve; x1 LINEBREAK ve; LINEBREAK · · · ; xk LINEBREAK v e(cid:3) , LINEBREAK then, we feed the projected sequence into the transformer encoder. the building blocks of the transformer contain multi-head self-attention (msa) and position-wise feed-forward network (ffn). we follow the implementation of the vanilla transformer encoder described in (vaswani et al., 2017), while layernorm (ln) is applied before each block (xiong et al., 2020). and the ffn consists of two linear layers with a gelu non-linearity: (cid:16) LINEBREAK z′(ℓ) LINEBREAK v = msa LINEBREAK ln LINEBREAK z(ℓ) LINEBREAK v = ffn LINEBREAK ln LINEBREAK z′(ℓ) v LINEBREAK + z′(ℓ) v LINEBREAK where ℓ = 1, . . . , l implies the ℓ-th layer of the transformer. LINEBREAK in the end, a novel readout function is applied to the output of the transformer encoder. through several transformer layers, the corresponding output z(ℓ) v contains the embeddings for all neighborhoods LINEBREAK of node v. it requires a readout function to aggregate the information of different neighborhoods into one embedding. common readout functions include summation and mean (hamilton et al., 2017). however, these methods ignore the importance of different neighborhoods. inspired by gat (veliˇckovi´c et al., 2018), we propose an attention-based readout function to learn such importance by computing the attention coefficients between 0-hop neighborhood (i.e., the node itself) and every other neighborhood. for detailed implementation, please refer to section 3.3. the time and space complexity of nagphormer are o(n(k + 1)2d) and o(b(k + 1)2 + b(k + 1)d + d2l), respectively (n: number of nodes, k: number of hops, d: dimension of feature vector, l: number of layers, b: batch size). the detailed complexity analysis is provided in appendix b.
| 5
|
[
107.502,
604.3750784,
505.93291028,
708.2058556
] |
sAJDi9lD06L.pdf
| 2,023
| 1
|
LINEBREAK holistic adversarially robust pruning LINEBREAK qi zhao and christian wressnegger kastel security research labs, karlsruhe institute of technology, germany LINEBREAK abstract LINEBREAK neural networks can be drastically shrunk in size by removing redundant parameters. while crucial for the deployment on resource-constraint hardware, oftentimes, compression comes with a severe drop in accuracy and lack of adversarial robustness. despite recent advances, counteracting both aspects has only succeeded for moderate compression rates so far. we propose a novel method, harp, that copes with aggressive pruning significantly better than prior work. for this, we consider the network holistically. we learn a global compression strategy that optimizes how many parameters (compression rate) and which parameters (scoring connections) to prune specific to each layer individually. our method fine-tunes an existing model with dynamic regularization, that follows a step-wise incremental function balancing the different objectives. it starts by favoring robustness before shifting focus on reaching the target compression rate and only then handles the objectives equally. the learned compression strategies allow us to maintain the pre-trained model’s natural accuracy and its adversarial robustness for a reduction by 99 % of the network’s original size. moreover, we observe a crucial influence of non-uniform compression across layers. the implementation of harp is publicly available at https://intellisec.de/research/harp. LINEBREAK introduction LINEBREAK deep neural networks (dnns) yield remarkable performances in classification tasks in various domains (he et al., 2016; cakir & dogdu, 2018; schroff et al., 2015; li et al., 2022) but are vulnerable to input manipulation attacks such as adversarial examples (szegedy et al., 2014). small perturbations to benign inputs can cause worst-case errors in prediction. to date, the most promising defensive approach against this sort of attacks is adversarial training as introduced by madry et al. (2018) and further refined ever since (shafahi et al., 2019; zhang et al., 2019; wang et al., 2020). it introduces adversarial examples into the training process, diminishing the generalization gap between natural performance and adversarial robustness. however, there is evidence indicating that higher robustness requires over-parameterized networks that have wider layers and higher structural complexity (madry et al., 2018; zhang et al., 2019; wu et al., 2021), rendering the task of combining both objectives—compression and robustness—inherently difficult. LINEBREAK neural network pruning (han et al., 2016; yang et al., 2017; he et al., 2017), for instance, has been proven to be an extraordinary valuable tool for compressing neural networks. the model can be reduced to a fraction of its size by removing redundancy at different structural granularity (li et al., 2017; mao et al., 2017; kollek et al., 2021). however, pruning inflicts a certain recession in model accuracy (han et al., 2016) and adversarial robustness (timpl et al., 2021) that is unavoidable the stronger the model is compressed. the aim of adversarial robust pruning hence is to maintain the accuracy and robustness of an already adversarially pre-trained model as good as possible. despite great efforts (ye et al., 2019; sehwag et al., 2020; madaan et al., 2020; özdenizci & legenstein, 2021; lee et al., 2022), this dual objective has only been achieved for moderate compression so far. LINEBREAK in this paper, we start from the hypothesis that effective adversarially robust pruning requires a nonuniform compression strategy with learnable pruning masks, and propose our method harp. we follow the three-stage pruning pipeline proposed by han et al. (2015) to improve upon pre-trained models, where we jointly optimize score-based pruning masks and layer-wise compression rates during fine-tuning. as high robustness challenges the compactness objective (timpl et al., 2021), we employ a step-wise increasing weighted-control of the number of weights to be pruned, such that we can learn masks and rates simultaneously. our approach explores a global pruning strategy that allows for on-par natural accuracy with little robustness degradation only. LINEBREAK figure 1: overview of pruning weights of a vgg16 model for cifar-10 (left) and svhn (right) with pgd-10 adversarial training. solid lines show the natural accuracy of harp, hydra, robustadmm and bcs-p (cf. table 7). dashed lines represent the robustness against autoattack. LINEBREAK in summary, we make the following contributions: LINEBREAK • novel pruning technique for pre-trained models. we optimize how many parameters and which parameters to prune for each layer individually, resulting in a global but non-uniform pruning strategy. that is, the overall network is reduced by a predetermined rate governed by the target hardware’s limits, but layers are compressed varyingly strongly. we show that both aspects are needed for harp to take full effect (cf. section 4.1). LINEBREAK • significant improvement over related work. an overview of our method’s performance is presented in fig. 1 for a pgd-at trained vgg16 model learned on cifar-10 (left) and svhn (right), providing a first glimpse of the yield advances. no less importantly, we conduct experiments with small (cifar-10, svhn) as well as large-scale (imagenet) datasets across different robust training methods and various attacks (cf. section 4.2). LINEBREAK • importance of non-uniform pruning for adversarial robustness. we emphasize the superiority of non-uniform strategies (zhao et al., 2022) by extending existing adversarially robust pruning-techniques. we demonstrate that hydra (sehwag et al., 2020) and robust-admm (ye et al., 2019) yield better results when used with non-uniform strategies determined by erk (evci et al., 2020) and lamp (lee et al., 2021) (cf. section 4.3). LINEBREAK neural network pruning LINEBREAK removing redundant parameters reduces a network’s overall memory footprint and necessary computations, allowing for a demand-oriented adaptation of neural networks to resource-constrained environments (han et al., 2015; 2016; wen et al., 2016; huang et al., 2018; he et al., 2018; 2017; li et al., 2017; mao et al., 2017; molchanov et al., 2017). neural network pruning attempts to find a binary mask m (l) for each layer l of a network with l layers represented by its parameters θ and θ(l), respectively. the overall pruning-mask thus is denoted as m = (m (1), . . . , m (l), . . . , m (l)). these masks specify which parameters of the layer θ(l) to remove (zero out) and which to keep, yielding a reduced parameter set ˆθθ(l) = θ(l) is the hadamard product. based on this, we define the overall compression rate a as the ratio of parameters preserved after pruning, θ̸=0, to the number of parameters in the model, θ. compression rates for individual layers a(l) are defined analogously. note, that a network’s sparsity is defined inversely, meaning, a 99.9 % sparsity refers to a compression of 0.001. in further follow, we consider θ(l) where c(l) i LINEBREAK × o represent input and output channels, respectively, and k(l) is the kernel size. LINEBREAK m (l), where LINEBREAK and c(l) LINEBREAK c(l) o × LINEBREAK rc(l) LINEBREAK i × LINEBREAK k(l) LINEBREAK k(l) LINEBREAK han et al. (2015) propose a three stage pipeline for network pruning, starting with (1) training an over-parameterized network, followed by (2) removing redundancy per layer according to some pruning criterion, before (3) recovering network performance via fine-tuning. the actual pruning strategy, that decides on the pruning mask m , is obtained in the second step. while integrated approaches (pruning during model training) exist (e.g., vemparala et al., 2021; özdenizci & legenstein, 2021), the staged process remains most common (liu et al., 2019; sehwag et al., 2020; lee et al., 2022) as it allows to benefit from recent advantages in adversarial training (shafahi et al., 2019; zhang et al., 2019; wang et al., 2020) out-of-the-box. LINEBREAK holistic adversarially robust pruning LINEBREAK two aspects are crucial when pruning neural networks: how many and which parameters to prune. current state-of-the-art methods for adversarially robust pruning focus on the latter, allocating a fixed compression budget governed by the target hardware’s limits and using it uniformly for each layer (e.g., ye et al., 2019; sehwag et al., 2020). we argue that learning the optimal pruning amount—the compression rate per layer—is equally crucial. harp thus integrates measures for compression rates and scoring connections in an empirical min-max optimization problem based on adversarial training to learn a suitable pruning mask m for a pre-trained model θ: LINEBREAK min r,s LINEBREAK e (x,y) LINEBREAK ∼d LINEBREAK δ {lrobust (θ max LINEBREAK m , x + δ, y) } LINEBREAK · lhw (θ LINEBREAK m , at), LINEBREAK d LINEBREAK x, y { LINEBREAK lce (madry et al., 2018). the exact formulation of LINEBREAK the inner maximization generates adversarial examples from a benign input x with label y from by adding noise δ, and incorporates these when minimizing the training a distribution loss lrobust depends on the pre-trained model, for which we evaluate pgd-at (madry et al., 2018), trades-at (zhang et al., 2019), and martat (wang et al., 2020). simultaneously, the model is subject to a pruning mask m that involves two parameters: first, the compression quota r, which is a learnable representation of compression rates, and second, scores s for determining the importance of the network’s connections. in the following, we discuss harp’s global compression control and describe how pruning strategies are learned, before we elaborate on how to dynamically regularize the training process using γ by following a step-wise incremental function balancing the different objectives. LINEBREAK global compression control. the compression control is encoded as an additional loss term lhw , that considers compression for the entire network to reach a specific target compression at. however, it explicitly allows for layer-specific rates, yielding an overall non-uniform compression strategy: we measure the number of currently preserved (i.e., non-zero) weights across all l layers of the network, θ̸=0 = (cid:80)l ∥1, relative to the targeted total number of parameters at a compression rate at: (cid:27) LINEBREAK ˆθ(l) LINEBREAK w LINEBREAK lhw (ˆθ, at) := max LINEBREAK additionally, we clip rates that would exceed the targeted compression-rate. constraining the loss to positive values ensures to not encourage even lower compression rates that would potentially harm accuracy and robustness unnecessarily. LINEBREAK for learning the layer-specific compression rates, moreover, it is crucial that we constrain the reduction by a minimal compression amin = 0.1 at as we need to prevent a layer from been removed completely. we thus limit the layers’ compression a(l) to [amin, 1]. in order to better control learning r, which we refer of the optimal pruning rate in this range, we introduce a trainable parameter r(l) to as compression quota, and constrain it by an activation function g : r [amin, 1]. for the sake of the continuous derivability on r, we use the sigmoid function squeezed to the desired output range, yielding a layer-wise compression rate a(l) = g(r(l)), where g : r LINEBREAK sig(r) + amin. LINEBREAK amin) LINEBREAK connection importance. for learning the actual pruning mask, in turn, we introduce another learnable parameter s, the connection importance-score matrix, to rate each pruning connection. in weight pruning, s(l) originates rc(l) , and is assigned values from activation funci × × tion g. additionally, we use p (α(l), s(l)) to represent the function that determines the α-th percentile on layer l as the cutoff threshold for pruning parameters in accordance with compression a(l). due to the relation with s(l) (and therefore also with r(l) via rate a(l), that is: α(l) = 1 compression rate a(l)), the binary pruning mask m (l) is thus trainable and defined as: LINEBREAK c(l) o × LINEBREAK k(l) LINEBREAK k(l) LINEBREAK m (l) := LINEBREAK s>p (α(l),s(l)) LINEBREAK pruning the l-th layer can hence be expressed by the hadamard product of the mask and the model’s parameters θ yielding the pruned model parameters ˆθθ(l) = θ(l) LINEBREAK m (l). LINEBREAK learning pruning strategies. binarizing importance scores to obtain a pruning mask as described above is a non-differentiable operation and prevents us from performing gradient descent over the masks. we, thus, follow the “straight through estimation” (ste) strategy (hubara et al., 2016) as proposed by kusupati et al. (2020) to assign the updated gradients to the importance scores s(l) directly and proceed similarly for compression quotas r(l): LINEBREAK ∂ l ∂s(l) LINEBREAK ∂ l ∂r(l) LINEBREAK ∂ l ∂ ˆθθ(l) · LINEBREAK ∂ ˆθθ(l) ∂m (l) · LINEBREAK ∂m (l) ∂s(l) LINEBREAK ste!= LINEBREAK ∂ l ∂ ˆθθ(l) · LINEBREAK ∂ ˆθθ(l) ∂m (l) LINEBREAK ∂ l ∂ ˆθθ(l) · LINEBREAK ∂ ˆθθ(l) ∂m (l) · LINEBREAK ∂m (l) ∂g(r(l)) · LINEBREAK g′(r(l)) ste!= LINEBREAK ∂ l ∂ ˆθθ(l) · LINEBREAK ∂ ˆθθ(l) ∂m (l)⟩ · LINEBREAK g′(r(l)) LINEBREAK finally, also the initialization of the connection importance-scores is crucial. we follow the lead of sehwag et al. (2020) and initialize the scores proportional to the weights of the pre-trained model and use a scaling factor η = (cid:112)k/fan-in(l) with k = 6 and fan-in being the product of the receptive field size and the number of input channels. our initialization for pruning weights, hence, follows the order of weight magnitudes (ye et al., 2019): LINEBREAK s(l) LINEBREAK w = LINEBREAK θ(l) LINEBREAK max( LINEBREAK θ(l) | LINEBREAK c(l) i × LINEBREAK c(l) o LINEBREAK k(l) LINEBREAK k(l) LINEBREAK harp does not use a fixed ratio for pruning parameters, but learns the optimal compression rate per layer. however, for initializing the compression quota r, we first align with a uniform compression strategy that sets the same rate ainit on each layer and let the optimizer improve it (cf. appendix a.3 for more details). for the activation function g( · LINEBREAK ) defined above, we thus yield: (cid:19) (cid:18) ainit − LINEBREAK amin LINEBREAK r(l) = log LINEBREAK ainit LINEBREAK balancing pruning objectives. harp strives to strike a balance between natural accuracy, adversarial robustness and compactness. for this, we employ a step-wise incremental function to adapt the regularization parameter γ throughout the learning process. we start by favoring robustness before shifting focus on reaching the target compression rate and only then handle the objectives equally. fig. 2 shows the relation of γ and the two different losses, lhw , on the lrobust against pgd-10 and y-axis over the epochs on the x-axis, exemplarily for weight pruning vgg16 (learned on cifar-10) with a target compression at = 0.01, that is, removing 99 % of the parameters. the model starts off from the uniform strategy with ainit = 0.1, learning to be more robust while being only slightly penalized lhw . as the model has been adversarially preby trained, lrobust is low already. over time, we put more focus on lhw up until we have reached our target compression (γ = 0.11 in this example), causing it to decrease while lrobust increases. afterwards, the model aims for higher robustness under the found lhw penalty, balancing both objectives. in appendix a.1, we study the influence of different step sizes and elaborate on the progression of the model’s natural accuracy and adversarial robustness in appendix a.3. LINEBREAK figure 2: harp’s step-wise regularization of pruning objectives for vgg16 on cifar-10 with a target sparsity of 99 %. LINEBREAK evaluation
| 3
|
[
108.299,
137.1895888,
193.0156254,
149.1447888
] |
oj2yn1Q4Ett.pdf
| 2,022
| 1
|
LINEBREAK decentralized learning for overparameterized problems: a multi-agent kernel approximation approach LINEBREAK prashant khanduri†‡, haibo yang‡, mingyi hong†, jia liu‡, hoi-to wai , sijia liu⇧⇤ †university of minnesota, ‡the ohio state university, cuhk, ⇧michigan state university, ⇤mit-ibm watson ai lab, ibm research [email protected], [email protected], [email protected] [email protected], [email protected], [email protected] LINEBREAK abstract LINEBREAK this work develops a novel framework for communication-efficient distributed learning where the models to be learnt are overparameterized. we focus on a class of kernel learning problems (which includes the popular neural tangent kernel (ntk) learning as a special case) and propose a novel multi-agent kernel approximation technique that allows the agents to distributedly estimate the full kernel function, and subsequently perform distributed learning, without directly exchanging any local data or parameters. the proposed framework is a significant departure from the classical consensus-based approaches, because the agents do not exchange problem parameters, and consensus is not required. we analyze the optimization and the generalization performance of the proposed framework for the `2 loss. we show that with m agents and n total samples, when certain generalized inner-product (gip) kernels (resp. the random features (rf) kernel) are used, each agent needs to communicate real values) to achieve minimax optimal generalization performance. further, we show that the proposed algorithms can significantly reduce the communication complexity compared with state-of-the-art algorithms, for distributedly training models to fit uci benchmarking datasets. moreover, each agent needs to share about 200n/m bits to closely match the performance of the centralized algorithms, and these numbers are independent of parameter and feature dimension. LINEBREAK n pn /m LINEBREAK bits (resp. LINEBREAK o LINEBREAK o LINEBREAK introduction LINEBREAK recently, decentralized optimization has become a mainstay of the optimization research. in decentralized optimization, multiple local agents hold small to moderately sized private datasets, and collaborate by iteratively solving their local problems while sharing some information with other agents. most of the existing decentralized learning algorithms are deeply rooted in classical consensus-based approaches (tsitsiklis, 1984), where the agents repetitively share the local parameters with each other to reach an optimal consensual solution. however, the recent trend of using learning models in the overparameterized regime with very high-dimensional parameters (he et al., 2016; vaswani et al., 2017; fedus et al., 2021) poses a significant challenge to such parameter sharing approaches, mainly because sharing model parameters iteratively becomes excessively expensive as the parameter dimension grows. if the size of local data is much smaller than that of the parameters, perhaps a more efficient way is to directly share the local data. however, this approach raises privacy concerns, and it is rarely used in practice. therefore, a fundamental question of decentralized learning in the overparameterized regime is: LINEBREAK (q) for overparameterized learning problems, how to design decentralized algorithms that achieve the best optimization/generalization performance by exchanging minimum amount of information? we partially answer (q) in the context of distributed kernel learning (vert et al., 2004). we depart from the popular consensus-based algorithms and propose an optimization framework that does not require the local agents to share model parameters or raw data. we focus on kernel learning because: (i) kernel methods provide an elegant way to model non-linear learning problems with complex data LINEBREAK table 1: comparison of the total communication required per node by different algorithms for nonoverparameterized (nop) and overparameterized (op) regimes. please see appendix b for a detailed discussion of the algorithms. here n is entire sample size, ub on m denotes the upper bound on the number of 2 is a constant, and t denotes the total communication (iterations) nodes, m , d is the data dimension, rounds utilized by the distributed algorithms. LINEBREAK algorithm LINEBREAK kernel ub on m LINEBREAK communication (real values) op nop LINEBREAK dkrr-cm (lin et al., 2020) LINEBREAK any LINEBREAK dkrr-rf-cm (liu et al., 2021) rf decentralized-rf (richards et al., 2020) rf rf dkla/coke (xu et al., 2020) rf gip LINEBREAK algorithm 2 (this work) LINEBREAK n LINEBREAK o LINEBREAK n o 1 3 ) (n o any m LINEBREAK any m LINEBREAK o LINEBREAK o o o o o LINEBREAK (dt n ) (t pn ) (t pn ) (t pn ) n pn m n 2 m LINEBREAK (dt n ) (t n ) (t n ) (t n ) n 1+ m n 2 m LINEBREAK o LINEBREAK o o o o o LINEBREAK dependencies as simple linear problems (vert et al., 2004; hofmann et al., 2008), and (ii) kernelbased methods can be used to capture the behavior of a fully-trained deep network with large width (jacot et al., 2018; arora et al., 2019; 2020). LINEBREAK distributed implementation of kernel learning problems is challenging. current state-of-the-art algorithms for kernel learning either rely on sharing raw data among agents and/or imposing restrictions on the number of agents (zhang et al., 2015; lin et al., 2017; koppel et al., 2018; lin et al., 2020; hu et al., 2020; pradhan et al., 2021; predd et al., 2006). some recent approaches rely on specific random feature (rf) kernels to alleviate some of the above problems. these algorithms reformulate the (approximate) problem in the parameter domain and solve it by iteratively sharing the (potentially high-dimensional) parameters (bouboulis et al., 2017; richards et al., 2020; xu et al., 2020; liu et al., 2021). these algorithms suffer from excessive communication overhead, especially in the overparameterized regime where the number of parameters is larger than the data size n . for (n ), example, implementing the neural tangent kernel (ntk) with rf kernel requires at least 2, random features (parameter dimension) using relu activation (arora et al., 2019; han et al., 2021)1. for such problems, in this work, we propose a novel algorithmic framework for decentralized kernel learning. below, we list the major contributions of our work. LINEBREAK o LINEBREAK [gip kernel for distributed approximation] we define a new class of kernels suitable for distributed implementation, generalized inner-product (gip) kernel, that is fully characterized by the angle between a pair of feature vectors and their respective norms. many kernels of practical importance including the ntk can be represented as gip kernel. further, we propose a multi-agent kernel approximation method for estimating the gip and the popular rf kernels at individual agents. LINEBREAK [one-shot and iterative scheme] based on the proposed kernel approximation, we develop two optimization algorithms, where the first one only needs one-shot information exchange, but requires sharing data labels among the agents; the second one needs iterative information exchange, but does not need to share the data labels. a key feature of these algorithms is that neither the raw data features nor the (high-dimensional) parameters are exchanged among agents. LINEBREAK [performance of the approximation framework] we analyze the optimization and the generalization performance of the proposed approximation algorithms for `2 loss. we show that gip kernel (n pn /m ) requires communicating real values per agent to achieve minimax optimal generalization performance. importantly, the required communication is independent of the function class and the optimization algorithm. we validate the performance of our approximation algorithms on uci benchmarking datasets. LINEBREAK (n 2/m ) bits and the rf kernel requires communicating LINEBREAK o LINEBREAK o LINEBREAK in table 1, we compare the communication requirements of the proposed approach to popular distributed kernel learning algorithms. specifically, dkrr-cm (lin et al., 2020) relies on sharing data and is therefore not preferred in practical settings. for the rf kernel, the proposed algorithm outperforms other algorithms in both non-overparameterized and the overparameterized regimes when t > n/m . in the overparameterized regime, the gip kernel is more communication efficient compared to other algorithms. finally, note that since our analysis is developed using the multiagent-kernel-approximation, it does not impose any upper bound on the number of agents in the network. LINEBREAK 1to achieve approximation error ✏ = LINEBREAK o LINEBREAK notations: we use r, rd, and rn space, and real matrices of size n ⇥ [a, b]. LINEBREAK m to denote the sets of real numbers, d-dimensional euclidean ⇥ m, respectively. we use n to denote the set of natural numbers. (0, ⌃) is multivariate normal distribution with zero mean and covariance ⌃. uniform distribution n with support [a, b] is denoted by ) denotes the inner-product in euclidean ). the inner-product defines the usual norms in corresponding spaces. space (resp. hilbert space of matrix a denotes the operator norm induced by `2 vector norm. we denote by [a]i or norm [a](i) the ith element of a vector a. [a a. moreover, j denotes the (i a(:,i) is the ith column of a and [a]mk is the element corresponding to mth row and kth column. notation m LINEBREAK [e] is the indicator function of event e. LINEBREAK j)th element of vector a LINEBREAK [m ] denotes m LINEBREAK . finally, LINEBREAK a, b i LINEBREAK (resp. LINEBREAK a](i) LINEBREAK a k LINEBREAK a, b LINEBREAK ih LINEBREAK h LINEBREAK u LINEBREAK k LINEBREAK h LINEBREAK h LINEBREAK 2 problem statement
| 2
|
[
108.299,
580.0685888,
241.1173916,
606.953504
] |
Rhsu5qD36cL.pdf
| 2,021
| 1
|
LINEBREAK sequential density ratio estimation for simultaneous optimization of speed and accuracy LINEBREAK akinori f. ebihara1 1nec corporation 2riken center for advanced intelligence project (aip) [email protected] LINEBREAK taiki miyagawa1,2 LINEBREAK kazuyuki sakurai1 LINEBREAK hitoshi imaoka1 LINEBREAK abstract LINEBREAK classifying sequential data as early and as accurately as possible is a challenging yet critical problem, especially when a sampling cost is high. one algorithm that achieves this goal is the sequential probability ratio test (sprt), which is known as bayes-optimal: it can keep the expected number of data samples as small as possible, given the desired error upper-bound. however, the original sprt makes two critical assumptions that limit its application in real-world scenarios: (i) samples are independently and identically distributed, and (ii) the likelihood of the data being derived from each class can be calculated precisely. here, we propose the sprt-tandem, a deep neural network-based sprt algorithm that overcomes the above two obstacles. the sprt-tandem sequentially estimates the loglikelihood ratio of two alternative hypotheses by leveraging a novel loss function for log-likelihood ratio estimation (lllr) while allowing correlations up to n (∈ n) preceding samples. in tests on one original and two public video databases, nosaic mnist, ucf101, and siw, the sprt-tandem achieves statistically significantly better classification accuracy than other baseline classifiers, with a smaller number of data samples. the code and nosaic mnist are publicly available at https://github.com/taikimiyagawa/sprt-tandem. LINEBREAK introduction LINEBREAK the sequential probability ratio test, or sprt, was originally invented by abraham wald, and an equivalent approach was also independently developed and used by alan turing in the 1940s (good, 1979; simpson, 2010; wald, 1945). sprt calculates the log-likelihood ratio (llr) of two competing hypotheses and updates the llr every time a new sample is acquired until the llr reaches one of the two thresholds for alternative hypotheses (figure 1). wald and his colleagues proved that when sequential data are sampled from independently and identically distributed (i.i.d.) data, sprt can minimize the required number of samples to achieve the desired upper-bounds of false positive and false negative rates comparably to the neyman-pearson test, known as the most powerful likelihood test (wald & wolfowitz, 1948) (see also theorem (a.5) in appendix a). note that wald used the i.i.d. assumption only for ensuring a finite decision time (i.e., llr reaches a threshold within finite steps) and for facilitating llr calculation: the non-i.i.d. property does not affect other aspects of the sprt including the error upper bounds (wald, 1947). more recently, tartakovsky et al. verified that the non-i.i.d. sprt is optimal or at least asymptotically optimal as the sample size increases (tartakovsky et al., 2014), opening the possibility of potential applications of the sprt to non-i.i.d. data series. LINEBREAK about 70 years after wald’s invention, neuroscientists found that neurons in the part of the primate brain called the lateral intraparietal cortex (lip) showed neural activities reminiscent of the sprt (kira et al., 2015); when a monkey sequentially collects random pieces of evidence to make a binary choice, lip neurons show activities proportional to the llr. importantly, the time of the decision can be predicted from when the neural activity reaches a fixed threshold, the same as the sprt’s decision rule. thus, the sprt, the optimal sequential decision strategy, was re-discovered to be an LINEBREAK figure 1: conceptual figure explaining the sprt. the sprt calculates the log-likelihood ratio (llr) of two competing hypotheses and updates the llr every time a new sample (x(t) at time t) is acquired, until the llr reaches one of the two thresholds. for data that is easy to be classified, the sprt outputs an answer after taking a few samples, whereas for difficult data, the sprt takes in numerous samples in order to make a “careful” decision. for formal definitions and the optimality in early classification of time series, see appendix a. LINEBREAK algorithm explaining primate brains’ computing strategy. it remains an open question, however, what algorithm will be used in the brain when the sequential evidence is correlated, non-i.i.d. series. LINEBREAK the sprt is now used for several engineering applications (cabri et al., 2018; chen et al., 2017; kulldorff et al., 2011). however, its i.i.d. assumption is too crude for it to be applied to other real-world scenarios, including time-series classification, where data are highly correlated, and key dynamic features for classification often extend across more than one data point, violating the i.i.d. assumption. moreover, the llr of alternative hypotheses needs to be calculated as precisely as possible, which is infeasible in many practical applications. LINEBREAK in this paper, we overcome the above difficulties by using an sprt-based algorithm that treats data series as an n-th order markov process (sprt-tandem), aided by a sequential probability density ratio estimation based on deep neural networks. a novel loss function for log-likelihood ratio estimation (lllr) efficiently estimates the density ratio that let the sprt-tandem approach close to asymptotic bayes-optimality (i.e., appendix a.4). in other words, lllr optimizes classification speed and accuracy at the same time. the sprt-tandem can classify non-i.i.d. data series with user-defined model complexity by changing n (∈ n), the order of approximation, to define the number of past samples on which the given sample depends. by dynamically changing the number of samples used for classification, the sprt-tandem can maintain high classification accuracy while minimizing the sample size as much as possible. moreover, the sprt-tandem enables a user to flexibly control the speed-accuracy tradeoff without additional training, making it applicable to various practical applications. LINEBREAK we test the sprt-tandem on our new database, nosaic mnist (nmnist), in addition to the publicly available ucf101 action recognition database (soomro et al., 2012) and spoofing in the wild (siw) database (liu et al., 2018). two-way analysis of variance (anova, (fisher, 1925)) followed by a tukey-kramer multi-comparison test (tukey, 1949; kramer, 1956) shows that our proposed sprt-tandem provides statistically significantly higher accuracy than other fixed-length and variable-length classifiers at a smaller number of data samples, making wald’s sprt applicable even to non-i.i.d. data series. our contribution is fivefold: LINEBREAK 1. we invented a deep neural network-based algorithm, sprt-tandem, which enables wald’s LINEBREAK sprt on arbitrary sequential data without knowing the true llr. LINEBREAK 2. the sprt-tandem extends the sprt to non-i.i.d. data series without knowing the true LINEBREAK llr. LINEBREAK 3. with a novel loss, lllr, the sprt-tandem sequentially estimates llr to optimize speed LINEBREAK and accuracy simultaneously. LINEBREAK 4. the sprt-tandem can control the speed-accuracy tradeoff without additional training. 5. we introduce nosaic mnist, a novel early-classification database. LINEBREAK related work LINEBREAK the sprt-tandem has multiple interdisciplinary intersections with other fields of research: wald’s classical sprt, probability density estimation, neurophysiological decision making, and time-series LINEBREAK classification. the comprehensive review is left to appendix b, while in the following, we introduce the sprt, probability density estimation algorithms, and early classification of the time series. LINEBREAK sequential probability ratio test (sprt). the sprt, denoted by δ∗, is defined as the tuple of a decision rule and a stopping rule (tartakovsky et al., 2014; wald, 1947): definition 2.1. sequential probability ratio test (sprt). let λt as the llr at time t, and x (1,t ) as a sequential data x (1,t ) := {x(t)}t t=1. given the absolute values of lower and upper decision threshold, a0 ≥ 0 and a1 ≥ 0, sprt, δ∗, is defined as LINEBREAK where the decision rule d∗ and stopping time τ ∗ are LINEBREAK δ∗ = (d∗, τ ∗), LINEBREAK d∗(x (1,t )) = LINEBREAK if λτ ∗ ≥ a1 if λτ ∗ ≤ −a0 , LINEBREAK we review the proof of optimality in appendix a.4, while figure 1 shows an intuitive explanation. LINEBREAK probability density ratio estimation. instead of estimating numerator and denominator of a density ratio separately, the probability density ratio estimation algorithms estimate the ratio as a whole, reducing the degree of freedom for more precise estimation (sugiyama et al., 2010; 2012). two of the probability density ratio estimation algorithms that closely related to our work are the probabilistic classification (bickel et al., 2007; cheng & chu, 2004; qin, 1998) and density fitting approach (sugiyama et al., 2008; tsuboi et al., 2009) algorithms. as we show in section 4 and appendix e, the sprt-tandem sequentially estimates the llr by combining the two algorithms. LINEBREAK early classification of time series. to make decision time as short as possible, algorithms for early classification of time series can handle variable length of data (mori et al., 2018; mori et al., 2016; xing et al., 2009; 2012) to minimize high sampling costs (e.g., medical diagnostics (evans et al., 2015; griffin & moorman, 2001), or stock crisis identification (ghalwash et al., 2014)). leveraging deep neural networks is no exception in the early classification of time series (dennis et al., 2018; suzuki et al., 2018). long short-term memory (lstm) variants lstm-s/lstm-m impose monotonicity on classification score and inter-class margin, respectively, to speed up action detection (ma et al., 2016). early and adaptive recurrent label estimator (earliest) combines reinforcement learning and a recurrent neural network to decide when to classify and assign a class label (hartvigsen et al., 2019). LINEBREAK proposed algorithm: sprt-tandem LINEBREAK in this section, we propose the tandem formula, which provides the n -th order approximation of the llr with respect to posterior probabilities. the i.i.d. assumption of wald’s sprt greatly simplifies the llr calculation at the expense of the precise temporal relationship between data samples. on the other hand, incorporating a long correlation among multiple data may improve the llr estimation; however, calculating too long a correlation may potentially be detrimental in the following cases. first, if a class signature is significantly shorter than the correlation length in consideration, uninformative data samples are included in calculating llr, resulting in a late or wrong decision (campos et al., 2018). second, long correlations require calculating a long-range of backpropagation, prone to vanishing gradient problem (hochreiter et al., 2001). thus, we relax the i.i.d. assumption by keeping only up to the n -th order correlation to calculate the llr. LINEBREAK the tandem formula. here, we introduce the tandem formula, which computes the approximated llr, the decision value of the sprt-tandem algorithm. the data series is approximated as an n -th order markov process. for the complete derivation of the 0th (i.i.d.), 1st, and n -th order tandem formula, see appendix c. given a maximum timestamp t ∈ n, let x (1,t ) and y be a t=1 and a class label y ∈ {1, 0}, respectively, where x(t) ∈ rdx and sequential data x (1,t ) := {x(t)}t dx ∈ n. by using bayes’ rule with the n -th order markov assumption, the joint llr of data at a LINEBREAK timestamp t is written as follows: LINEBREAK log LINEBREAK log LINEBREAK (cid:18) p(y = 1|x(s−n ), ..., x(s)) p(y = 0|x(s−n ), ..., x(s)) LINEBREAK log LINEBREAK (cid:18) p(y = 1|x(s−n ), ..., x(s−1)) p(y = 0|x(s−n ), ..., x(s−1)) LINEBREAK − log LINEBREAK (see equation (84) and (85) in appendix c for the full formula). hereafter we use terms k-let or multiplet to indicate the posterior probabilities, p(y|x(1), ..., x(k)) = p(y|x (1,k)) that consider correlation across k data points. the first two terms of the tandem formula (equation (4)), n + 1let and n -let, have the opposite signs working in “tandem” adjusting each other to compute the llr. the third term is a prior (bias) term. in the experiment, we assume a flat prior or zero bias term, but a user may impose a non-flat prior to handling the biased distribution of a dataset. the tandem formula can be interpreted as a realization of the probability matching approach of the probability density estimation, under an n -th order markov assumption of data series. LINEBREAK neural network that calculates the sprt-tandem formula. the sprt-tandem is designed to explicitly calculate the n -th order tandem formula to realize sequential density ratio estimation, which is the critical difference between our sprt-tandem network and other architecture based on convolutional neural networks (cnns) and recurrent neural networks (rnn). figure 2 illustrates a conceptual diagram explaining a generalized neural network structure, in accordance with the 1st-order tandem formula for simplicity. the network consists of a feature extractor and a temporal integrator (highlighted by red and blue boxes, respectively). they are arbitrary networks that a user can choose depending on classification problems or available computational resources. the feature extractor and temporal integrator are separately trained because we find that this achieves better performance than the end-to-end approach (also see appendix d). the feature extractor outputs single-frame features (e.g., outputs from a global average pooling layer), which are the input vectors of the temporal integrator. the output vectors from the temporal integrator are transformed with a fully-connected layer into two-dimensional logits, which are then input to the softmax layer to obtain posterior probabilities. they are used to compute the llr to run the sprt (equation (2)). note that during the training phase of the feature extractor, the global average pooling layer is followed by a fully-connected layer for binary classification. LINEBREAK how to choose the hyperparameter n ? by tuning the hyperparameter n , a user can efficiently boost the model performance depending on databases; in section 5, we change n to visualize the model performance as a function of n . here, we provide two ways to choose n . one is to choose n based on the specific time scale, a concept introduced in appendix d, where we describe in detail how to guess on the best n depending on databases. the other is to use a hyperparameter tuning algorithm, such as optuna, (akiba et al., 2019) to choose n objectively. optuna has multiple hyperparameter searching algorithms, the default of which is the tree-structured parzen estimator (bergstra et al., 2011). note that tuning n is not computationally expensive, because n is only related to the temporal integrator, not the feature extractor. in fact, the temporal integrator’s training speed is much faster than that of the feature extractor: 9 mins/epoch vs. 10 hrs/epoch (n = 49, nvidia rtx2080ti, siw database). LINEBREAK lllr and multiplet cross-entropy loss LINEBREAK given a maximum timestamp t ∈ n and dataset size m ∈ n, let s := {(x (1,t ) i=1 be a sequential dataset. training our network to calculate the tandem formula involves the following loss functions in combination: (i) the loss for log likelihood ratio estimation (lllr), lllr, and (ii) multiplet cross-entropy loss, lmultiplet. the total loss, ltotal is defined as LINEBREAK , yi)}m LINEBREAK i LINEBREAK ltotal = lllr + lmultiplet . LINEBREAK figure 2: conceptual diagram of neural network for the sprt-tandem where the order of approximation n = 1. the feature extractor (red) extracts the feature vector for classification and outputs it to the temporal integrator (blue). note that the temporal integrator memorizes up to n preceding states in order to calculate the tandem formula (equation (4)). llr is calculated using the estimated probability densities that are output from the temporal integrator. we use ˆ· to highlight a quantity estimated by a neural network. trainable weight parameters are shared across the boxes with the same color in the figure. LINEBREAK loss for log-likelihood ratio estimation (lllr). LINEBREAK the sprt is bayes-optimal as long as the true llr is available; however, the true llr is often inaccessible under real-world scenarios. to empirically estimate the llr with the tandem formula, we propose the lllr LINEBREAK lllr = LINEBREAK yi − σ LINEBREAK log LINEBREAK ˆp(x(1) i ˆp(x(1) i LINEBREAK , ..., x(t) , ..., x(t) LINEBREAK i LINEBREAK i LINEBREAK where σ is the sigmoid function. we use ˆp to highlight a probability density estimated by a neural network. the lllr minimizes the kullback-leibler divergence (kullback & leibler, 1951) between the estimated and the true densities, as we briefly discuss below. the full discussion is given in appendix e due to page limit. LINEBREAK density fitting. first, we introduce kliep (kullback-leibler importance estimation procedure, sugiyama et al. (2008)), a density fitting approach of the density ratio estimation sugiyama et al. (2010). kliep is an optimization problem of the kullback-leibler divergence between p(x|y = 1) and ˆr(x)p(x|y = 0) with constraint conditions, where x and y are random variables corresponding to x (1,t) i LINEBREAK and yi, and ˆr(x) := ˆp(x|y = 1)/ˆp(x|y = 0) is the estimated density ratio. formally, LINEBREAK argmin ˆr LINEBREAK [kl(p(x|y = 1)||ˆr(x)p(x|y = 0))] = argmin LINEBREAK ˆr LINEBREAK dxp(x|y = 1) log(ˆr(x)) LINEBREAK with the constraints 0 ≤ ˆr(x) and (cid:82) dx ˆr(x)p(x|y = 0) = 1. the first constraint ensures the positivity of the estimated density ˆr(x)p(x|y = 0), while the second one is the normalization condition. applying the empirical approximation, we obtain the final optimization problem: LINEBREAK argmin ˆr LINEBREAK − log ˆr(x (1,t) LINEBREAK i LINEBREAK , with ˆr(x (1,t) LINEBREAK i LINEBREAK ) ≥ 0 and LINEBREAK ˆr(x (1,t) i LINEBREAK where i1 := {i ∈ [m ]|yi = 1}, i0 := {i ∈ [m ]|yi = 0}, m1 := |i1|, and m0 := |i0|. LINEBREAK stabilization. the original kliep (8), however, is asymmetric with respect to p(x|y = 1) and p(x|y = 0). to recover the symmetry, we add 1 )−1) to the objective and m0 ˆr(x (1,t) impose an additional constraint 1 )−1 = 1. besides, the symmetrized objective i m1 LINEBREAK − log(ˆr(x (1,t) LINEBREAK i LINEBREAK still has unbounded gradients, which cause instability in the training. therefore, we normalize the llrs with the sigmoid function, obtaining the lllr (6). we can also show that the constraints are effectively satisfied due to the sigmoid funciton. see appendix e for the details. LINEBREAK in summary, we have shown that the lllr minimizes the kullback-leibler divergence of the true and the estimated density and further stabilizes the training by restricting the value of llr. here we emphasize the contributions of the lllr again. the lllr enables us to conduct the stable llr estimation and thus to perform the sprt, the algorithm optimizing two objectives: stopping time and accuracy. in previous works (mori et al., 2018; hartvigsen et al., 2020), on the other hand, these two objectives are achieved with separate loss sub-functions. LINEBREAK compared to kliep, the proposed lllr statistically significantly boosts the performance of the sprt-tandem (appendix e.4). besides, experiment on multivariate gaussian with a simple toy-model also shows that the lllr minimize errors between the estimated and the true density ratio (appendix f). LINEBREAK multiplet cross-entropy loss. LINEBREAK to further facilitate training the neural network, we add binary cross-entropy losses, though the lllr suffices to estimate llr. we call them multiplet cross-entropy loss here, and defined as: LINEBREAK lmultiplet := LINEBREAK lk-let , LINEBREAK where LINEBREAK lk-let := LINEBREAK 1 m (t − n ) LINEBREAK t=k LINEBREAK (cid:16) − log ˆp(yi|x(t−k+1) LINEBREAK i LINEBREAK (cid:17) , ..., x(t) i ) LINEBREAK minimizing the multiplet cross-entropy loss is equivalent to minimizing the kullback-leibler divergence of the estimated posterior k-let ˆp(yi|x(t−k+1) i ) and the true posterior p(yi|x(t−k+1) i ) (shown in appendix g), which is a consistent objective with the lllr i and thus the multiplet loss accelerates the training. note also that the multiplet loss optimizes all the logits output from the temporal integrator, unlike the lllr. LINEBREAK , ..., x(t) LINEBREAK , ..., x(t) LINEBREAK i LINEBREAK experiments and results
| 5
|
[
108.299,
310.0406768,
273.2488603,
321.9958768
] |
Jnspzp-oIZE.pdf
| 2,021
| 0
|
LINEBREAK gauge equivariant mesh cnns anisotropic convolutions on geometric graphs LINEBREAK pim de haan∗ qualcomm ai research† university of amsterdam LINEBREAK maurice weiler∗ quva lab university of amsterdam LINEBREAK taco cohen qualcomm ai research LINEBREAK max welling qualcomm ai research university of amsterdam LINEBREAK abstract LINEBREAK a common approach to define convolutions on meshes is to interpret them as a graph and apply graph convolutional networks (gcns). such gcns utilize isotropic kernels and are therefore insensitive to the relative orientation of vertices and thus to the geometry of the mesh as a whole. we propose gauge equivariant mesh cnns which generalize gcns to apply anisotropic gauge equivariant kernels. since the resulting features carry orientation information, we introduce a geometric message passing scheme defined by parallel transporting features over mesh edges. our experiments validate the significantly improved expressivity of the proposed model over conventional gcns and other methods. LINEBREAK introduction LINEBREAK convolutional neural networks (cnns) have been established as the default method for many machine learning tasks like speech recognition or planar and volumetric image classification and segmentation. most cnns are restricted to flat or spherical geometries, where convolutions are easily defined and optimized implementations are available. the empirical success of cnns on such spaces has generated interest to generalize convolutions to more general spaces like graphs or riemannian manifolds, creating a field now known as geometric deep learning (bronstein et al., 2017). LINEBREAK a case of specific interest is convolution on meshes, the discrete analog of 2-dimensional embedded riemannian manifolds. mesh cnns can be applied to tasks such as detecting shapes, registering different poses of the same shape and shape segmentation. if we forget the positions of vertices, and which vertices form faces, a mesh m can be represented by a graph g. this allows for the application of graph convolutional networks (gcns) to processing signals on meshes. LINEBREAK ∗equal contribution †qualcomm ai research is an initiative of qualcomm technologies, inc. LINEBREAK figure 1: two local neighbourhoods around vertices p and their representations in the tangent planes tpm . the distinct geometry of the neighbourhoods is reflected in the different angles θpqi of incident edges from neighbours qi. graph convolutional networks apply isotropic kernels and can therefore not distinguish both neighbourhoods. gauge equivariant mesh cnns apply anisotropic kernels and are therefore sensitive to orientations. the arbitrariness of reference orientations, determined by a choice of neighbour q0, is accounted for by the gauge equivariance of the model. LINEBREAK however, when representing a mesh by a graph, we lose important geometrical information. in particular, in a graph there is no notion of angle between or ordering of two of a node’s incident edges (see figure 1). hence, a gcns output at a node p is designed to be independent of relative angles and invariant to any permutation of its neighbours qi ∈ n (p). a graph convolution on a mesh graph therefore corresponds to applying an isotropic convolution kernel. isotropic filters are insensitive to the orientation of input patterns, so their features are strictly less expressive than those of orientation aware anisotropic filters. LINEBREAK to address this limitation of graph networks we propose gauge equivariant mesh cnns (gem-cnn), which minimally modify gcns such that they are able to use anisotropic filters while sharing weights across different positions and respecting the local geometry. one obstacle in sharing anisotropic kernels, which are functions of the angle θpq of neighbour q with respect to vertex p, over multiple vertices of a mesh is that there is no unique way of selecting a reference neighbour q0, which has the direction θpq0 = 0. the reference neighbour, and hence the orientation of the neighbours, needs to be chosen arbitrarily. in order to guarantee the equivalence of the features resulting from different choices of orientations, we adapt gauge equivariant cnns (cohen et al., 2019b) to general meshes. the kernels of our model are thus designed to be equivariant under gauge transformations, that is, to guarantee that the responses for different kernel orientations are related by a prespecified transformation law. such features are identified as geometric objects like scalars, vectors, tensors, etc., depending on the specific choice of transformation law. in order to compare such geometric features at neighbouring vertices, they need to be parallel transported along the connecting edge.
| 1
|
[
107.641,
483.8270784,
505.7467626992,
625.5258182
] |
k8_yVW3Wqln.pdf
| 2,023
| 0
|
LINEBREAK systematic rectification of language models via dead-end analysis LINEBREAK meng cao∗,†,1, mehdi fatemi∗,2, jackie chi kit cheung1, samira shabanian2 1mila – qu´ebec ai institute & mcgill university 2microsoft research [email protected], [email protected] [email protected], [email protected] LINEBREAK abstract LINEBREAK with adversarial or otherwise normal prompts, existing large language models (llm) can be pushed to generate toxic discourses. one way to reduce the risk of llms generating undesired discourses is to alter the training of the llm. this can be very restrictive due to demanding computation requirements. other methods rely on rule-based or prompt-based token elimination, which are limited as they dismiss future tokens and the overall meaning of the complete discourse. here, we center detoxification on the probability that the finished discourse is ultimately considered toxic. that is, at each point, we advise against token selections proportional to how likely a finished text from this point will be toxic. to this end, we formally extend the dead-end theory from the recent reinforcement learning (rl) literature to also cover uncertain outcomes. our approach, called rectification, utilizes a separate but significantly smaller model for detoxification, which can be applied to diverse llms as long as they share the same vocabulary. importantly, our method does not require access to the internal representations of the llm, but only the token probability distribution at each decoding step. this is crucial as many llms today are hosted in servers and only accessible through apis. when applied to various llms, including gpt-3, our approach significantly improves the generated discourse compared to the base llms and other techniques in terms of both the overall language and detoxification performance.1 LINEBREAK introduction LINEBREAK large-scale transformer-based (vaswani et al., 2017) language models (lms) have shown tremendous progress and grown in importance across various nlp downstream tasks, often providing stateof-the-art performances over the last few years (devlin et al., 2019; yang et al., 2019; raffel et al., 2020; peters et al., 2018). despite their progress in learning linguistic knowledge, these models have been shown to capture and reproduce toxicity in the ever-larger pretraining datasets. in fact, they may even amplify toxicity (brown et al., 2020b; petroni et al., 2019; caliskan et al., 2017; gehman et al., 2020; zhao et al., 2017; jia & liang, 2017). these results are concerning, as these models are growing in popularity and being used in production by practitioners. LINEBREAK existing detoxification methods can be divided into two broad categories: retraining-based (also known as data-based) and decoding-based. retraining-based methods either retrain the lm on a filtered dataset where undesired text has been removed (raffel et al., 2020; gururangan et al., 2020), or have humans adversarially probe the system to generate unsafe content and then use these adversarial samples for further training (dinan et al., 2019; xu et al., 2020). these methods require updating the parameters of lms, which can be computationally expensive. retraining-based methods are also unsuitable for extremely llms that are usually released as a service. on the other hand, decoding-based methods function at inference time and do not change the lm’s weights. examples include plug and play language models (pplm; dathathri et al. (2020)), word-filtering (gehman LINEBREAK *equal contribution. listed alphabetically. †meng cao contributed to this work during his internship at microsoft research. 1warning: this paper contains examples with offensive and inappropriate language. LINEBREAK et al., 2020), test-time filtering (welbl et al., 2021) and the self-debiasing method of schick et al. (2021), which can be viewed as prompt-based token elimination. however, these methods neither foresee that the discourse may become toxic even if the current choice of the token is not harmful, nor can they correct the seemingly toxic discourse later on. LINEBREAK this work proposes a systematic approach, called rectification, to mitigate toxicity for llms. we extend the dead-end theory of fatemi et al. (2019; 2021) from the recent reinforcement learning (rl) literature and frame the detoxification task as an auxiliary rl problem separate from lm training. the core idea is that, during text generation, if a token causes the eventual discourse to be toxic with some level of certainty, then the probability of choosing that token should be reduced with the same level of certainty. building on our formal results, we construct a simple rl problem, whose value function is used to estimate an upper bound on the level of certainty. at inference time, we use the learned upper bound to truncate the target policy (i.e., lm). LINEBREAK there are three essential aspects of rectification that we should highlight: (i) there is no need to modify the lm’s parameters, (ii) the rectification model can be, in general, significantly smaller (hence easier to train) than the lm, and (iii) one rectification model can be used to detoxify various lms as long as they share the same vocabulary. we evaluate our method on the realtoxicityprompts benchmark. we demonstrate that our method can substantially mitigate toxicity using both automatic and human evaluation. compared with the regular gpt-2 xl, our method yields a relative reduction in toxicity probability by 78% (83.2% → 18.5%, as measured by perspective api), and it outperforms eight detoxification baselines. 2 LINEBREAK related work LINEBREAK studying and detecting toxic text generated by large pre-trained lms have grown in importance over the past few years (gehman et al., 2020; xu et al., 2021; welbl et al., 2021). however, there are many challenges when studying the toxicity of lm: first, there are different types of toxic content, such as profanity, identity attack, threat, etc. depending on the context, they may require different treatment. second, there is no widely accepted definition of toxicity for lms, as individual perceptions may vary due to different social backgrounds (zampieri et al., 2019; weng, 2021). in this work, we define toxic content as “rude, disrespectful, and unreasonable language”, following prior work on lm toxicity (gehman et al., 2020). lms trained on large corpora suffer from generating toxic content. for instance, it has recently been shown that lms can generate racist continuations conditioned on either synthetic or innocuous prompts (wallace et al., 2019; gehman et al., 2020). roller et al. (2021) study toxic lms within the scope of dialogue systems. xu et al. (2021) demonstrate that lms can also amplify social biases. reducing toxicity is of utmost importance as it will be passed on to downstream automated products and applications. such biases and toxicities may cause harms (e.g., of allocation or of representation) to the underrepresented groups (barocas et al., 2017; crawford, 2017; dixon et al., 2018; xu et al., 2021; welbl et al., 2021). LINEBREAK to alleviate the issue of toxicity in lms, multiple detoxification techniques have been proposed. retraining-based methods like raffel et al. (2020); gururangan et al. (2020); dinan et al. (2019); xu et al. (2020); lu et al. (2022) fine-tune the lm on a filtered corpus or adversarial dataset. these methods become impracticable when the target lm is extremely large. pplm (dathathri et al., 2020) controls the generation direction using the gradient of a simple discriminator. given a differentiable toxicity classifier, pplm can steer the lm away from generating toxic text. however, pplm is known to be computationally expensive and slow gehman et al. (2020); yang & klein (2021). selfdebiasing (sd) (schick et al., 2021) is a prompt-based detoxification method. it scales down the probability of the tokens generated under hand-crafted prompts that explicitly command the lm to generate a toxic continuation. similarly, liu et al. (2021) uses a toxic lm as an “anti-expert” and a non-toxic lm as an “expert” to boost the probability of non-toxic tokens. LINEBREAK formal methods LINEBREAK in order to delineate the language detoxification problem in a precise manner, we revisit and build from the basic ideas of dead-end theory (fatemi et al., 2019; 2021). here, we first describe pre LINEBREAK 2https://github.com/mcao516/rectification-lm.git LINEBREAK liminary concepts and notations and then present our formal results, from which we construct our algorithmic methods. we consider the standard reinforcement learning settings (sutton & barto, 2018; szepesv´ari, 2010), and formally contemplate a language generation procedure (ranzato et al., 2016) as a standard markov decision process (mdp; puterman (1994)). in particular, the generated language at step t = 0, 1, . . . is defined by a state s ∈ s, which is the concatenation of all the tokens prior to t. an action a ∈ a is comprehended as the selection of a new token a from the vocabulary a. a complete mdp is therefore defined by the tuple m = (s, a, t, p0, r, γ), where t : s × a × s (cid:55)→ [0, 1] is the (stochastic) transition function; p0 is the distribution of initial states, from which the language starts; r : s × a × s (cid:55)→ r is a real-value reward function that assigns a reward to each transition; and γ ∈ [0, 1] is a scalar discount factor. a policy π(s, a) defines the probability of token a being selected at the current state s. in the case of language generation, s0 ∈ s can be a prompt, a document or a begin-of-sentence token, depending on the tasks. after selecting each new token based on π, the discourse transitions to a new state, which is simply shaped by the augmentation of the new token to the last state. thus, in this case, t is a simple, deterministic function. however, we remark that a language may be generated as a dialogue or may involve other models; hence, t may be stochastic in general. the state-action value function qπ(s, a) evaluates the expected return of taking action a at state s and following policy π thereafter. the optimal . value function is defined as q∗(s, a) = maxπ qπ(s, a). for any mdp, q∗ is unique (bertsekas & tsitsiklis, 1996) and can be found as the fixed point of the bellman operator (bellman, 1954; 1957). LINEBREAK main results LINEBREAK consider an lm and define a terminal state as the last point of a generated discourse after including the last token. denote by st the set of all possible terminal states. we define an undesired terminal state as a terminal state known to be toxic with full certainty. remark that labeling a terminal state as (fully) undesired is often questionable since whether a generated discourse is toxic or not will depend on the broader linguistic and social context, including the longer passage beyond a sentence, the writer, the reader, their relationship, and the communicative intent. it is, therefore, more appropriate to look at toxicity as a probabilistic concept, where the probability of toxicity depends upon various aforementioned factors. more broadly, reaching an undesired terminal state from any point of a discourse occurs at some probabilistic degree, even if the dynamics of language generation remains deterministic. our goal is to minimize the probability of toxicity at any point in the course of text generation when possible. to this end, we appeal to dead-end theory (fatemi et al., 2019; 2021) and extend its fundamental concepts to systematically address the toxicity problem. LINEBREAK we define a β-dead-end as a state from which an undesired terminal state is bound to happen with probability at least β in some (possibly random) number of future tokens. let sd denote the set of all β-dead-ends. the probability level β encompasses all the various factors, including randomness in the generated future tokens (e.g., sampling), the uncertainty of labeling a terminal state as being toxic, or if the dynamics is stochastic. the new concept of β-dead-ends fundamentally captures a toxic situation where the generated text so far is hard to fix and will eventually become toxic, at least with probability β. we also assume that the generated text is finite: from any point, the future number of tokens is bounded, even if the length may be random and unknown. finally, in order for the formal expressions to become explicit and more transparent, we specifically distinguish between β-dead-end states and terminal states by asserting that sd ̸= st . LINEBREAK the core desired property here is the following: if selecting a token leads with some level of certainty to a β-dead-end, then we should reconsider selecting that token by capping its selection chance proportional to our knowledge of the outcome. that is, if some level of certainty can be identified that the eventual end-point will be undesired, this knowledge should directly be used to rectify language generation. formally, if at state s, the probability that token a leads to a β-dead-end or an immediate undesired termination is larger than λ ∈ [0, 1], then π is required to avoid selecting a at s with a similarly β-adjusted probability. that is: LINEBREAK d(s, a) + f β p β LINEBREAK d(s, a) ≥ λ =⇒ π(s, a) ≤ 1 − βλ. LINEBREAK d(s, a) and f β LINEBREAK where p β d(s, a) are respectively the probability of leading to a β-dead-end or an immediate termination that is flagged as undesired with probability more than β. this condition can be seen as a “soft” counterpart of the standard security condition (fatemi et al., 2019). note here that if transitions are deterministic, as they are if the action corresponds to the next token to generate and LINEBREAK the next state is just a concatenation of the selected token to the current state, then λ is either zero or one, depending on whether or not the next state is a β-dead-end. the stated policy cap is therefore reduced desirably to π(s, a) ≤ 1 − β if the next state is a β-dead-end and no cap otherwise. we, however, keep the theoretical exposition generic to accommodate stochastic transitions as well. LINEBREAK we formally define rectification as any method which aims to guarantee (1) by re-adjusting π(s, a) at each step. in the case of stochastic transitions, it is desired to hold (1) for maximum λ, meaning that the rectification holds with full knowledge and rigor. as a matter of course, the true value of λ as well as the probabilities in (1) are often unavailable. we therefore require a learning method that enables (1) directly from data. the following theorem fulfills this need and presents the core of our methodology (all the proofs are deferred to the appendix a). theorem 1. assign a reward of -1 to any transition to a flagged undesired terminal state and zero to all other transitions. let q∗ d denote the optimal value function under γ = 1 for the induced mdp. then π(s, a) ≤ 1 + q∗ LINEBREAK d(s, a) is a sufficient condition that implies (1) for all λ and any β. LINEBREAK remark that theorem 1 lifts any requirement to know or to guess λ, and it directly holds for the maximum λ. remark also that for a selected β, there will be only one q∗ d. thus, a rectification method only requires learning q∗ d to the lm of interest at each step of token selection. LINEBREAK d and then applying 1 + q∗ LINEBREAK we next extend proposition 1 of fatemi et al. (2021) to the case of β-dead-ends. importantly, the result presented by theorem 1 provides very desired guarantees, but it requires the optimal values to be known. the following result relaxes this requirement to some extent, asserting that reaching a certain level of approximation still provides similar guarantees as with theorem 1. theorem 2. let qd(s, a) be such that LINEBREAK 1. qd(s, a) ≤ −β for all s ∈ sd. LINEBREAK 2. qd satisfies monotonicity with respect to the bellman operator t ∗, i.e. LINEBREAK qd(s, a) ≤ (t ∗qd)(s, a). LINEBREAK for all (s, a), LINEBREAK 3. all values of qd(s, a) remain non-positive. LINEBREAK then, statement (1) still holds if qd is used in place of q∗ LINEBREAK d, i.e., if π(s, a) ≤ 1 + qd(s, a). LINEBREAK the third assumption of theorem 2 is easy to enforce simply by clipping the target values during training. the second assumption asserts that the approximated values of those states, which are not β-dead-end, are indeed not important to converge to q∗ d as long as they are not fully off-track in the bellman sense. the first assumption asserts that the approximated values of β-dead-end states can also be relatively inaccurate and only require to reach −β (they can even be under-estimated). in theorem 2, qd can represent an approximation of q∗ d. thus, broadly speaking, theorem 2 provides a formal ground for having a higher anticipation that utilizing a learned qd will still result in some significant level of rectification. LINEBREAK d)(s, a) = q∗ LINEBREAK besides allowing for approximation, theorem 2 authorizes a more important case. we observe that the true value of any policy π (not necessary optimal) satisfies the second assumption of theorem 2 (bertsekas & tsitsiklis, 1996). additionally, we have qπ d)(s, a) ≤ (t ∗q∗ d(s, a) ≤ −β and assumption 1 is satisfied as well. finally, it is easy to see that assumption 3 also holds for the true value of any policy. invoking theorem 2, we conclude that using the value of any known policy will also provide full rectification. of note, qπ d can be stronger than needed, which may compromise lm’s behaviour more than it is needed. however, this is naturally not an issue as the rectification level can be re-adjusted in practice. LINEBREAK d(s, a) also implied that the cap of 1 + qπ LINEBREAK d(s, a) ≤ −β then so is qπ LINEBREAK d(s, a). hence, if q∗ LINEBREAK d(s, a) ≤ (t ∗qπ LINEBREAK d(s, a) ≤ q∗ LINEBREAK algorithmic pipeline LINEBREAK our results formally frame the rectification problem as a rl problem with the goal of learning qd as an approximation of q∗ d with π being the policy that generated data. in this section, we discuss particular considerations, which are required in the case of lms. these considerations are due to the very large action-space (vocabulary) as well as inevitable inaccuracy originating from offline training of qd. LINEBREAK d or qπ LINEBREAK sarsa. consider an observed transition of the form (s, a, r, s′). as the action space is immense, there are always far too many actions at s′ which are not seen before. recall that the reward associated with qd is either 0 or −1. as a result the term maxa′ qd(s′, a′) in the bellman update almost surely gives rise to a value close to zero, resulting in a meaningless bootstrapping. to resolve this issue, we choose to use a sarsa-like update (sutton & barto, 2018), which bootstraps toward qd(s′, a′) with a′ being the observed action at s′ in the data. this way the algorithm targets to learn qπ d, with π being the average behavioural policy that generates the training data. as we discussed before, using qπ d is sound and it provides all the desired guarantees due to theorem 2. finally, similar to fatemi et al. (2019) we also truncate the bootstrap term to avoid value-overflow. the resulting loss function at training iteration j takes the following form (note also that γ = 1): LINEBREAK d rather than q∗ LINEBREAK lj(θj) δj LINEBREAK . = e(s,a,r,s′,a′)∼u (d) δ2 j . = r + clip (cid:8)qθj (s′, a′); [−1, 0](cid:9) − qθj (s, a) LINEBREAK where u (d) denotes uniform sampling from the offline data d, and θj is the parameter vector of rectification model at iteration j. in our implementation, we use a dqn format (mnih et al., 2015) by maintaining a target network qθ′, which is used for the middle term of (2) and is copied from qθ with a lower frequency. LINEBREAK instead of applying the cap 1 + qπ LINEBREAK threshold mechanism. d to the policy, if we use any function that decreases the value of 1 + qπ d ∈ [0, 1] then (1) still holds, but the cap becomes stronger. the simplest way to do this is to shift 1+qπ d by ϵ ∈ [0, 1) which gives us a new cap 1+qd(s, a)−ϵ. we refer to ϵ as the threshold because any action a whose value of 1 + qd(s, a) is below the threshold will be fully removed. in our experiments, we use a linear function 1+qd(s,a)−ϵ . compared to shifting, this has less effect on the high probability tokens, while still provides a way to tune the detoxification level. remark that making the cap stronger amplifies detoxification, but compromises optimality of lm more. as we will show later, this is reflected in the increase of perplexity. LINEBREAK top-k vs. top-p. nucleus sampling (holtzman et al., 2020), also called top-p sampling, chooses words from the smallest possible set of words whose cumulative probability exceeds the probability p. however, depending on the context, several synonyms could easily account for a significant fraction of the probability mass. as a result, top-p sampling often returns a small group of synonyms or related words. when rectification is used, it is necessary to have a diverse set of possible following tokens available so that the lm can still generate a meaningful discourse. as a result, we chose to use top-k sampling for text generation when rectification is applied. LINEBREAK experimental setup LINEBREAK language models LINEBREAK we conduct detoxification experiments with lms of various sizes: gpt-2, gpt-2 xl and gpt-3. gpt-2 is a transformer-based auto-regressive lm that contains 117m parameters. it is pretrained on 40gb of scraped web text using a causal language modeling (clm) objective. gpt-2 xl is a 1.5b parameter version of gpt-2 pretrained on the same corpus. gpt-3 (brown et al., 2020a) is a 175b parameters pretrained on a mix of commoncrawl 3, an expanded version of the webtext dataset (radford et al., 2019), books corpora, and english-language wikipedia. all gpt-2 and gpt2 xl experiments are carried out with the hugging face transformers library. for gpt-3, we use the da vinci-002 model in the openai api4. limited by the api, we can only access the top 100 log probabilities per decoding step5. therefore, we set the probability of other tokens to zero and renormalize the probabilities of the top 100 tokens. LINEBREAK 3commoncrawl: https://commoncrawl.org/the-data/ 4openai’s api: (https://openai.com/api/). 5by default, the api can return up to 5 log probabilities at each decoding step. by request, this project has LINEBREAK been granted to access 100 log probabilities. LINEBREAK evaluation benchmark LINEBREAK we follow previous work and use perspective api6, a widely used automated tool for toxicity evaluation. for a given sentence, the perspective api returns a score between 0 and 1, reflecting the probability of the sentence being toxic. in addition to the toxicity attribute, we also consider five other attributes that the api provides: severe toxicity, profanity, identity attack, threat and sexually explicit. following gehman et al. (2020), we classify a text as exhibiting a particular attribute if perspective api assigns more than 50% probability to the presence of that attribute. LINEBREAK for lm toxicity evaluation, we rely on the realtoxicityprompts (rtp) benchmark (gehman et al., 2020). rtp contains 100k human-written prompts (i.e., sentence prefixes) extracted from a corpus of english web text. the average length of the prompts is around 11 tokens. each prompt has a toxicity score between 0 and 1 evaluated using perspective api. among the 100k prompts in rtp, about 22% percent of them are toxic (score > 0.5). we evaluate lm toxicity in two settings, prompt-conditional and unconditional. for the prompt-conditional setting, the lm generates continuations up to 20 tokens conditioned on the prompts. then the continuations are evaluated using perspective api. for the unconditional setting, a begin-of-sentence token (i.e., <|endoftext|>) is given to the language model. LINEBREAK we use the two metrics proposed by gehman et al. (2020) for toxicity evaluation on rtp: 1) expected maximum toxicity measures the maximum toxicity score over 25 generations for a given prompt, averaging over all prompts; 2) probability of toxicity is the probability of generating a continuation with toxicity score ≥ 0.5 at least once over 25 generations. we also evaluate our method on the challenging subset of rtp, which contains 1,225 prompts that consistently bias lms toward generating toxic continuations. on the challenging subset, we calculate the empirical probability of the presence of different attributes. LINEBREAK baselines LINEBREAK retraining-based baselines retraining-based detoxification methods detoxify lm with further fine-tuning. comparing our approach to retraining-based methods only have limited value, as our method is based on the premise that fine-tuning llm is extremely computationally expensive, if not impossible. nonetheless, we consider three retraining-based baselines: domain-adaptive pretraining (dapt) (gururangan et al., 2020) and attribute conditioning (atcon) (keskar et al., 2019). LINEBREAK decoding-based baselines we are particularly interested in decoding-based methods because, similar to our method, they function at inference time and do not require updating the parameters of the lm. we compare our approach with the following four decoding-based methods: (1) word filtering (word filter) prevents the lm from generating banned words (sheng et al., 2019) by setting their probability to zero at each decoding step. (2) test-time filtering (test filter) (welbl et al., 2021) apply threshold-based rejection sampling to directly filter out generation with toxicity score above the threshold τ = 0.01. following welbl et al. (2021), we generate up to n = 4 continuations and stop the generation process once a continuation is accepted. if no continuation is accepted, we will use the lowest toxicity score continuation. (3) pplm (dathathri et al., 2020) controls the generation by shifting the hidden states of lm h by ∆h. ∆h is the sum of two gradients: one moves the generation in the direction of the desired attribute and the other ensuring that the output is still fluent. note that pplm requires at least two forward passes and one backward pass at each decoding step, which makes it computationally expensive. (4) self-debiasing (sd) (schick et al., 2021) leverages the internal knowledge of an lm to reduce the probability of toxicity in the model generation. specifically, sd first prepends a hand-crafted prompt to steer lm toward generating toxic text. an example prompt looks like this: “the following text contains sexually explicit language:”. then, on the second generation, the prompt will be removed, and the probabilities of tokens being generated in the first time are scaled down. because the tokens are most likely associated with the undesired attribute (i.e., toxicity). (5) dexpert (liu et al., 2021) combines the original lm with toxic lm (i.e., “anti-expert”) and non-toxic lm (i.e., “expert”) to promote tokens that are considered likely by the experts and unlikely by the anti-experts. see appendix b for more details about the baselines. LINEBREAK 6perspective api: https://perspectiveapi.com LINEBREAK exp. max. toxicity LINEBREAK toxicity prob. LINEBREAK toxic non-toxic unprompted LINEBREAK category LINEBREAK baseline LINEBREAK retraining-based LINEBREAK model LINEBREAK gpt-2 LINEBREAK dapt atcon LINEBREAK decoding-based LINEBREAK pplm word filter test filter sd (λ = 50) sd (λ = 100) dexpert LINEBREAK rect (ϵ = 0.1) rect (ϵ = 0.3) +test filter rect (ϵ = 0.4) +test filter LINEBREAK toxic non-toxic 32.3% LINEBREAK table 1: toxicity evaluation results on the rtp dataset. left: average of maximum toxicity scores over 25 generations (with standard deviations as subscripts); right: the empirical probability of a toxic continuation appears at least once over 25 generations. we use nucleus sampling holtzman et al. (2020) with p = 0.9 for all the baselines with the exception of pplm and sd, for which we use top-k sampling with k = 10 and 30 respectively. all models are evaluated on 10k prompts and 10k unprompted sentences. the lowest toxicity scores are marked in bold. rect stands for our rectification model. LINEBREAK training LINEBREAK reward model. a good reward model is essential to the success of rl training. for our task, we demand a reward model that can accurately capture toxicity in language. we follow dathathri et al. (2020) and train a bert-based toxicity classifier on the toxic comment classification challenge dataset 7 as our reward model. considering the imbalance of the dataset, we discard 30% of the non-toxic comments. we use 90% of the rest samples for the reward model training and 10% for validation. we train the model for 3 epochs with a batch size equal to 32. the classifier achieves an accuracy of 96.1% on the validation set. we observe that the classifier’s output scores are very polarized. more than 96% of texts are classified as toxic or non-toxic with either more than 0.9 or less than 0.1 probability. therefore, during rl training, we use 0.5 as a threshold and returns -1 reward when the predicted toxicity probability is greater than 0.5. LINEBREAK value function. we use gpt-2 (specifically, gpt-2-small) as the backbone of our qd network. we utilized the civilcomment dataset (borkan et al., 2019) for qd training. the dataset contains 1.8 million comments from the civil comments platform. we chose the civilcomment dataset because of its size and diversity in terms of covering different types of toxic behaviors. civilcomment is also highly unbalanced where only 5.9% of comments are toxic (score > 0.5). to combat this issue, we apply under-sampling to discard 90% of the non-toxic comments. for each comment in the dataset, we use the first 11 tokens as a prompt and discard the rest of the comment. then, we sample 10 continuations (up to 20 tokens) from the lm conditioned on the prompt. the continuations are scored using the reward model, and we only keep the least and most toxic continuations and concatenate them with the prompt for training. as a result, we have 312k demonstrations for training qd. more details about reward model and value function training can be found in appendix c. we also train qd using in-domain training data (i.e., prompts from realtoxicityprompts) and perspectiveapi rewards. more details and evaluation results can be found in appendix d. LINEBREAK results and discussion LINEBREAK automatic evaluation. table 1 shows the evaluation results on the rtp benchmark. as shown in the table, among all detoxification methods, our method achieves the lowest expected maximum toxicity score and toxicity probability for both toxic and non-toxic prompts. compared with the regular gpt-2 model, our rectification model significantly reduces toxicity probability by about 78% (83.2% → 18.5%). our method also outperforms two retraining-based baselines in mitigating toxi LINEBREAK 7https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge LINEBREAK model LINEBREAK toxicity LINEBREAK severe tox. LINEBREAK sex. expl. LINEBREAK threat LINEBREAK profanity LINEBREAK id. attack LINEBREAK average ppl LINEBREAK gpt-2 xl† +sd (λ = 50)† +sd (λ = 100)† +world filter† +test filter +pplm dapt† dapt + sd (λ = 10)† LINEBREAK gpt-3 +test filter LINEBREAK gpt-2 xl detoxification results LINEBREAK gpt-3 detoxification results LINEBREAK table 2: attribute probabilities for gpt-2 xl, gpt-3 and different detoxification methods on the challenging subset of rtp. we compute the empirical probability of generated continuations exhibiting undesired attributes to evaluate detoxification ability on this subset. we use beam search to generate continuations for each prompt with a beam size of 3, consistent with schick et al. (2021). for gpt-3, we use greedy search due to computational constraints. the rightmost column shows perplexity on wikitext-2 (merity et al., 2017). numbers highlighted blue represent the percentage of toxicity drop compared to the regular lm. results marked with † are taken from schick et al. (2021). LINEBREAK city. among all the baselines, test filter demonstrates impressive detoxification results despite its simplicity. however, it is worth pointing out that test filter needs to generate up to n = 4 times as many continuations in the worst case, and this often happens when the input prompt is toxic. we combine our method with test filter and achieve the best detoxification performance in the table (the last row). as we increase the value of threshold ϵ, the expected maximum toxicity score and probability decrease notably. this is not surprising since we are imposing a more strict security condition on the lm. however, if the threshold value becomes too large, the final policy could become trivial in the absence of available tokens. LINEBREAK following schick et al. (2021), we also evaluate our method on the challenging subset of rtp that contains 1k extremely toxic prompts. table 2 shows the evaluation results on the challenging subset. as shown in table 2, our approach consistently mitigates all types of toxicity and has the lowest average probability for all attributes. compared with gpt-2 xl, our method achieves better detoxification performance on gpt-3. we think this is because gpt-3 is able to generate more diverse tokens under toxic prompts. note that the rectification agent used for gpt-3 detoxification is also trained on data generated by gpt-2 xl. this shows that one rectification model can be used to detoxify various lms as long as they share the same vocabulary. for the threat type, our method falls behind test filter and sd. we speculate this is because the toxic comment classification challenge dataset we used for the reward model training contains only 0.3% of threat-type comments. as a result, the reward model cannot capture all threat content. to evaluate how different detoxification techniques undermine the language modeling ability of lm, we calculate perplexity on wikitext-2, as shown in the rightmost column in the table. compared to the baselines, our approach (ϵ = 0.1) only slightly increases lms perplexity. LINEBREAK human evaluation. we also conducted human evaluation, comparing our method (ϵ = 0.3) to the sd (λ = 100) baseline. we randomly sampled 150 prompts from the challenging subset of rtp for our evaluation. we showed participants the generation of our model and the comparison model, and asked them to make a pairwise preference judgment between the two based on three aspects: toxicity, grammar and coherence. LINEBREAK toxicity lose 15.3 LINEBREAK grammar lose 24.6 LINEBREAK coherence lose 26.6 LINEBREAK table 3: human evaluation by pairwise comparison on 150 prompts from the rtp challenging subset. win: percentage of outputs from our model that are preferred by the annotators over the baseline’s outputs, given the same prompt. LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK i got pissed off and opened my window and yelled at him to get the fuck out of my house,” she said.\n\n“he was threw it out the window,” he said.\n\n“it was just a piece of paper yelled at the guy,” he said.\n\n“he didn’t say anything back to me, so i yelled at him to leave,” she said.\n\n“he didn’t say anything, he just walked away. yelled at him to get the [bleep] out,” she said.\n\n“he came back a few minutes later and LINEBREAK the cabbie then drives away yelling: “ i’m going to kill you, bitch!” police say the driver of the car was arrested i don’t know what you’re talking about.”\n\n in the video, which was posted on i’m going home, i’m going home.”\n\n police said the driver of the car was not injured. i’m going to get you, i’m going to get you.”\n\n police say the driver of the car was i’m going to kill something,” according to police reports obtained by the daily news.\n\na witness LINEBREAK toxicity LINEBREAK table 4: examples of prompts selected in the challenging subset of realtoxicityprompts. continuations are generate using regular gpt-2 xl and its rect variant (+rect, ϵ = 0.1). all texts are generated using beam search with a beam size of 3. for rect, we show four continuations for each example where we apply our model at different stages of lm generation. specifically, the first continuation under +rect is generated by applying rectification at the beginning of the generation process, which is also the default setting. the rest continuations are generated when we apply rect after a few tokens (red colored) already generated by gpt-2 xl. the rightmost column shows the toxicity probability given by perspective api. LINEBREAK the two generations are presented in random order without model information. as shown in table 3, we find that continuations generated by our model are preferred more often by the human annotators compared to the baseline in terms of being less toxic. in terms of grammar and coherence, there are no discernible differences between the two approaches. LINEBREAK we use a common set of 50 samples for inter-annotator agreement evaluation. we ask three annotators to evaluate the common set. we report fleiss’s kappa (κ) to assess the reliability of agreement between annotators. for toxicity evaluation, we obtain a moderate agreement with κ = 0.484 (0.40 ≤ κ ≤ 0.60). we also report the percentage µ of annotators that annotate the majority class for the given an example. we get µ = 0.847 for our three-category annotation. more details about the human evaluation can be found in appendix e. LINEBREAK qualitative analysis. table 9 shows two examples selected from the challenging subset of realtoxicityprompts as well as continuations generated by regular gpt-2 xl and its variant with rect added on top. to demonstrate that our method can steer the generation direction at different stages, we first use gpt-2 xl to generate a few tokens (red colored in the table) and then apply rect. as we can see, rect is able to prevent toxic content from being generated in most cases. when rect is applied early on, the topic of the sentence will turn in a safe direction (“ask someone to get out” → “throw a paper out”). if rect is applied when the context is already very toxic, it still can reduce toxicity by, for example, removing vulgar words (“fuck” → “[beep]”). more examples can be found in appendix g. LINEBREAK conclusion LINEBREAK this work introduces the rectification method, for which we have extended the dead-end theory from rl literature to address uncertainty around undesired outcomes. this extension nicely covers a broad class of problems of particular interest in the space of language detoxification. the core idea here is to avoid toxic discourses by re-adjusting the probability of token selection proportional to the risk of ultimate toxicity when the discourse is finished. this is intrinsically different from rulebased or prompt-based token removal in that our method is farsighted and considers the possible continuum of the discourse and how the text may advance. importantly, our method does not require updating or accessing the lm internal representations. the rectification model can be significantly smaller than the lm, and it can be applied to various lms. we show that rectification vastly reduces toxic generations over eight baselines using both automatic and human evaluation, while it still maintains the language quality. finally, we note here that the present methodology is quite generic in the sense that it can be used to achieve various goals aside from detoxification. LINEBREAK acknowledgements LINEBREAK the authors thank nicolas le roux and adam trischler for their helpful feedback on this project. we are also thankful to the reviewers for their constructive comments. last but not least, we are grateful to the several individuals who helped with human evaluations presented in table 3. LINEBREAK references LINEBREAK solon barocas, kate crawford, aaron shapiro, and hanna wallach. the problem with bias: al LINEBREAK locative versus representational harms in machine learning. in sigcis conference, 2017. LINEBREAK richard e. bellman. the theory of dynamic programming. technical report p-550, the rand LINEBREAK corporation, 1954. LINEBREAK richard e. bellman. dynamic programming. princeton university press, 1957. LINEBREAK dimitri p. bertsekas and john n. tsitsiklis. neuro-dynamic programming. athena scientific, 1996. LINEBREAK daniel borkan, lucas dixon, jeffrey sorensen, nithum thain, and lucy vasserman. nuanced metrics for measuring unintended bias with real data for text classification. in companion proceedings of the 2019 world wide web conference, pp. 491–500, 2019. LINEBREAK tom brown, benjamin mann, nick ryder, melanie subbiah, jared d kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, sandhini agarwal, ariel herbert-voss, gretchen krueger, tom henighan, rewon child, aditya ramesh, daniel ziegler, jeffrey wu, clemens winter, chris hesse, mark chen, eric sigler, mateusz litwin, scott gray, benjamin chess, jack clark, christopher berner, sam mccanlanguage models are few-shot dlish, alec radford, ilya sutskever, and dario amodei. in h. larochelle, m. ranzato, r. hadsell, m.f. balcan, and h. lin (eds.), adlearners. vances in neural information processing systems, volume 33, pp. 1877–1901. curran associates, inc., 2020a. url https://proceedings.neurips.cc/paper/2020/file/ 1457c0d6bfcb4967418bfb8ac142f64a-paper.pdf. LINEBREAK tom brown, benjamin mann, nick ryder, melanie subbiah, jared d kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, et al. language models are few-shot learners. advances in neural information processing systems, 2020b. LINEBREAK aylin caliskan, joanna j bryson, and arvind narayanan. semantics derived automatically from LINEBREAK language corpora contain human-like biases. science, 356(6334):183–186, 2017. LINEBREAK kate crawford. the trouble with bias. keynote at neural information processing systems LINEBREAK sumanth dathathri, andrea madotto, janice lan, jane hung, eric frank, piero molino, jason yosinski, and rosanne liu. plug and play language models: a simple approach to controlled text generation. in international conference on learning representations, 2020. url https://openreview.net/forum?id=h1edeybkds. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep LINEBREAK bidirectional transformers for language understanding. in naacl, pp. 4171–4186, 2019. LINEBREAK emily dinan, samuel humeau, bharath chintagunta, and jason weston. build it break it fix it for in proceedings of the 2019 condialogue safety: robustness from adversarial human attack. ference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), pp. 4537–4546, hong kong, china, november 2019. association for computational linguistics. doi: 10.18653/v1/d19-1461. url https://aclanthology.org/d19-1461. LINEBREAK lucas dixon, john li, jeffrey sorensen, nithum thain, and lucy vasserman. measuring and mitigating unintended bias in text classification. in conference on ai, ethics, and society, 2018. LINEBREAK mehdi fatemi, shikhar sharma, harm van seijen, and samira ebrahimi kahou. dead-ends and secure exploration in reinforcement learning. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 1873–1881, long beach, california, usa, 2019. pmlr. LINEBREAK mehdi fatemi, taylor w killian, jayakumar subramanian, and marzyeh ghassemi. medical deadends and learning to identify high-risk states and treatments. in m ranzato, a beygelzimer, y dauphin, p s liang, and j wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 4856–4870. curran associates, inc., 2021. LINEBREAK samuel gehman, suchin gururangan, maarten sap, yejin choi, and noah a. smith. realtoxicityprompts: evaluating neural toxic degeneration in language models. in findings of the association for computational linguistics: emnlp 2020, pp. 3356–3369, online, november 2020. association for computational linguistics. doi: 10.18653/v1/2020.findings-emnlp.301. url https://aclanthology.org/2020.findings-emnlp.301. LINEBREAK suchin gururangan, ana marasovi´c, swabha swayamdipta, kyle lo, iz beltagy, doug downey, and noah a. smith. don’t stop pretraining: adapt language models to domains and tasks. in proceedings of the 58th annual meeting of the association for computational linguistics, pp. 8342–8360, online, july 2020. association for computational linguistics. doi: 10.18653/v1/ 2020.acl-main.740. url https://aclanthology.org/2020.acl-main.740. LINEBREAK ari holtzman, jan buys, li du, maxwell forbes, and yejin choi. the curious case of neural text degeneration. in international conference on learning representations, 2020. url https: //openreview.net/forum?id=ryggqyrfvh. LINEBREAK po-sen huang, huan zhang, ray jiang, robert stanforth, johannes welbl, jack rae, vishal maini, dani yogatama, and pushmeet kohli. reducing sentiment bias in language modin findings of the association for computational linguisels via counterfactual evaluation. tics: emnlp 2020, pp. 65–83, online, november 2020. association for computational linguistics. doi: 10.18653/v1/2020.findings-emnlp.7. url https://aclanthology.org/ 2020.findings-emnlp.7. LINEBREAK robin jia and percy liang. adversarial examples for evaluating reading comprehension systems. LINEBREAK pratik joshi, sebastin santy, amar budhiraja, kalika bali, and monojit choudhury. the state and fate of linguistic diversity and inclusion in the nlp world. in proceedings of the 58th annual meeting of the association for computational linguistics, pp. 6282–6293, online, july 2020. association for computational linguistics. doi: 10.18653/v1/2020.acl-main.560. url https: //aclanthology.org/2020.acl-main.560. LINEBREAK nitish shirish keskar, bryan mccann, lav r varshney, caiming xiong, and richard socher. ctrl: a conditional transformer language model for controllable generation. arxiv preprint arxiv:1909.05858, 2019. LINEBREAK alisa liu, maarten sap, ximing lu, swabha swayamdipta, chandra bhagavatula, noah a. smith, and yejin choi. dexperts: decoding-time controlled text generation with experts and antiexperts. in proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: long papers), pp. 6691–6706, online, august 2021. association for computational linguistics. doi: 10.18653/v1/2021.acl-long.522. url https://aclanthology.org/2021.acllong.522. LINEBREAK ilya loshchilov and frank hutter. decoupled weight decay regularization. in international conference on learning representations, 2019. url https://openreview.net/forum?id= bkg6ricqy7. LINEBREAK ximing lu, sean welleck, liwei jiang, jack hessel, lianhui qin, peter west, prithviraj ammanabrolu, and yejin choi. quark: controllable text generation with reinforced unlearning. arxiv preprint arxiv:2205.13636, 2022. LINEBREAK stephen merity, caiming xiong, james bradbury, and richard socher. pointer sentinel mixin international conference on learning representations, 2017. url https: LINEBREAK ture models. //openreview.net/forum?id=byj72udxe. LINEBREAK volodymyr mnih, koray kavukcuoglu, david silver, andrei a. rusu, joel veness, marc g. bellemare, alex graves, martin riedmiller, andreas k. fidjeland, georg ostrovski, stig petersen, charles beattie, amir sadik, ioannis antonoglou, helen king, dharshan kumaran, daan wierstra, shane legg, and demis hassabis. human-level control through deep reinforcement learning. nature, 518(7540):529–533, 2015. LINEBREAK matthew e. peters, mark neumann, mohit iyyer, matt gardner, christopher clark, kenton lee, and luke zettlemoyer. deep contextualized word representations. in proceedings of the 2018 conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long papers), pp. 2227–2237, new orleans, louisiana, june 2018. association for computational linguistics. doi: 10.18653/v1/n18-1202. url https://aclanthology.org/n18-1202. LINEBREAK fabio petroni, tim rockt¨aschel, sebastian riedel, patrick lewis, anton bakhtin, yuxiang wu, and alexander miller. language models as knowledge bases? in proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), pp. 2463–2473, hong kong, china, november 2019. association for computational linguistics. doi: 10.18653/v1/d19-1250. url https://aclanthology.org/d19-1250. LINEBREAK martin l. puterman. markov decision processes: discrete stochastic dynamic programming. john LINEBREAK alec radford, jeffrey wu, rewon child, david luan, dario amodei, and ilya sutskever. language models are unsupervised multitask learners. 2019. url https://openai.com/blog/ better-language-models/. LINEBREAK colin raffel, noam shazeer, adam roberts, katherine lee, sharan narang, michael matena, yanqi zhou, wei li, and peter j. liu. exploring the limits of transfer learning with a unified text-totext transformer. journal of machine learning research, 21(140):1–67, 2020. url http: //jmlr.org/papers/v21/20-074.html. LINEBREAK marc’aurelio ranzato, sumit chopra, michael auli, and wojciech zaremba. sequence level training with recurrent neural networks. in yoshua bengio and yann lecun (eds.), 4th international conference on learning representations, iclr 2016, san juan, puerto rico, may 2-4, 2016, conference track proceedings, 2016. url http://arxiv.org/abs/1511.06732. LINEBREAK stephen roller, emily dinan, naman goyal, da ju, mary williamson, yinhan liu, jing xu, myle ott, eric michael smith, y-lan boureau, and jason weston. recipes for building an openin proceedings of the 16th conference of the european chapter of the asdomain chatbot. sociation for computational linguistics: main volume, pp. 300–325, online, april 2021. association for computational linguistics. doi: 10.18653/v1/2021.eacl-main.24. url https: //aclanthology.org/2021.eacl-main.24. LINEBREAK maarten sap, dallas card, saadia gabriel, yejin choi, and noah a. smith. the risk of racial bias in hate speech detection. in proceedings of the 57th annual meeting of the association for computational linguistics, pp. 1668–1678, florence, italy, july 2019. association for computational linguistics. doi: 10.18653/v1/p19-1163. url https://aclanthology.org/p19-1163. LINEBREAK timo schick, sahana udupa, and hinrich sch¨utze. self-diagnosis and self-debiasing: a proposal for reducing corpus-based bias in nlp. transactions of the association for computational linguistics, 9:1408–1424, 12 2021. issn 2307-387x. doi: 10.1162/tacl a 00434. url https: //doi.org/10.1162/tacl_a_00434. LINEBREAK emily sheng, kai-wei chang, premkumar natarajan, and nanyun peng. the woman worked as in proceedings of the 2019 conference on a babysitter: on biases in language generation. empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), pp. 3407–3412, hong kong, china, LINEBREAK november 2019. association for computational linguistics. doi: 10.18653/v1/d19-1339. url https://aclanthology.org/d19-1339. LINEBREAK emma strubell, ananya ganesh, and andrew mccallum. energy and policy considerations for modern deep learning research. proceedings of the aaai conference on artificial intelligence, 34(09):13693–13696, apr. 2020. doi: 10.1609/aaai.v34i09.7123. url https://ojs.aaai. org/index.php/aaai/article/view/7123. LINEBREAK richard s sutton and andrew g barto. reinforcement learning: an introduction. mit press, 2018. LINEBREAK csaba szepesv´ari. algorithms for reinforcement learning. morgan & claypool, 2010. LINEBREAK ashish vaswani, noam shazeer, niki parmar, LINEBREAK jakob uszkoreit, llion jones, aidan n gomez, lukasz kaiser, and illia polosukhin. attention is all you need. in i. guyon, u. von luxburg, s. bengio, h. wallach, r. fergus, s. vishwanathan, and r. garnett (eds.), advances in neural information processing systems, volume 30. curran associates, inc., 2017. url https://proceedings.neurips.cc/paper/2017/file/ 3f5ee243547dee91fbd053c1c4a845aa-paper.pdf. LINEBREAK eric wallace, shi feng, nikhil kandpal, matt gardner, and sameer singh. universal adverin proceedings of the 2019 conference on sarial triggers for attacking and analyzing nlp. empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), pp. 2153–2162, hong kong, china, november 2019. association for computational linguistics. doi: 10.18653/v1/d19-1221. url https://aclanthology.org/d19-1221. LINEBREAK johannes welbl, amelia glaese, jonathan uesato, sumanth dathathri, john mellor, lisa anne hendricks, kirsty anderson, pushmeet kohli, ben coppin, and po-sen huang. challenges in findings of the association for computational linguisin detoxifying language models. tics: emnlp 2021, pp. 2447–2469, punta cana, dominican republic, november 2021. association for computational linguistics. doi: 10.18653/v1/2021.findings-emnlp.210. url https://aclanthology.org/2021.findings-emnlp.210. LINEBREAK lilian weng. reducing toxicity in language models. lilianweng.github.io, mar 2021. url https: LINEBREAK //lilianweng.github.io/posts/2021-03-21-lm-toxicity/. LINEBREAK albert xu, eshaan pathak, eric wallace, suchin gururangan, maarten sap, and dan klein. detoxifying language models risks marginalizing minority voices. in proceedings of the 2021 conference of the north american chapter of the association for computational linguistics: human language technologies, pp. 2390–2397, online, june 2021. association for computational linguistics. doi: 10.18653/v1/2021.naacl-main.190. url https://aclanthology.org/ 2021.naacl-main.190. LINEBREAK jing xu, da ju, margaret li, y-lan boureau, jason weston, and emily dinan. recipes for safety in LINEBREAK open-domain chatbots. arxiv preprint arxiv:2010.07079, 2020. LINEBREAK kevin yang and dan klein. fudge: controlled text generation with future discriminators. LINEBREAK in proceedings of the 2021 conference of the north american chapter of the association for computational linguistics: human language technologies, pp. 3511–3535, online, june 2021. association for computational linguistics. doi: 10.18653/v1/2021.naacl-main.276. url https: //aclanthology.org/2021.naacl-main.276. LINEBREAK zhilin yang, zihang dai, yiming yang, jaime carbonell, russ r salakhutdinov, and quoc v le. xlnet: generalized autoregressive pretraining for language understanding. advances in neural information processing systems, 2019. LINEBREAK marcos zampieri, shervin malmasi, preslav nakov, sara rosenthal, noura farra, and ritesh kumar. in proceedings of the 2019 predicting the type and target of offensive posts in social media. conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pp. 1415–1420, minneapolis, minnesota, june 2019. association for computational linguistics. doi: 10.18653/v1/n19-1144. url https://aclanthology.org/n19-1144. LINEBREAK jieyu zhao, tianlu wang, mark yatskar, vicente ordonez, and kai-wei chang. men also like shopping: reducing gender bias amplification using corpus-level constraints. in proceedings of the 2017 conference on empirical methods in natural language processing, pp. 2979–2989, copenhagen, denmark, september 2017. association for computational linguistics. doi: 10. 18653/v1/d17-1323. url https://aclanthology.org/d17-1323. LINEBREAK a extended formal results LINEBREAK in this section, we present further theoretical results, required for the formal claims of the paper. the proofs herein are largely inspired by those in fatemi et al. (2021). LINEBREAK lemma 1. if state s is a β-dead-end then q∗ LINEBREAK d(s, a) ≤ −β for all actions a. LINEBREAK proof. let s be a β-dead-end. the definition of β-dead-end asserts that with probability not less than β all trajectories from s will reach an undesired terminal state. by definition, γ = 1; hence, if the terminal state of any trajectory from s is flagged as undesired (thus, it incurs reward of -1), then the return of that trajectory will be precisely -1. further, the return of any other trajectory will be precisely zero. because trajectories with undesired terminal occur with probability at least β, it follows that the expected return over all trajectories starting from s is less than or equal to −β. that is, q∗ LINEBREAK d(s, a) ≤ −β. LINEBREAK lemma 2. let action a be applied at state s, and f β d(s, a) denotes the probability that the next state will be a terminal state that is flagged as undesired at least with probability β. let further p β d(s, a) denotes the probability of transitioning to a β-dead-end, i.e. p β t (s, a, s′). let md(s, a) be the probability that the next state is neither a β-dead-end nor immediate undesired termination, but the discourse ultimately reach an undesired terminal while all the actions are selected according to the greedy policy with respect to q∗ LINEBREAK d(s, a) = (cid:80) LINEBREAK s′∈sd LINEBREAK d. we have LINEBREAK d(s, a) ≤ −(cid:2)βp β q∗ LINEBREAK d(s, a) + f β LINEBREAK d(s, a) + md(s, a)(cid:3) LINEBREAK proof. bellman equation for a transition started from (s, a) reads as the following: LINEBREAK q∗ LINEBREAK d(s, a) = LINEBREAK s′ LINEBREAK t (s, a, s′)[rd(s, a, s′) + max a′ LINEBREAK q∗ LINEBREAK d(s′, a′)] LINEBREAK the next state s′ is either of the following: LINEBREAK 1. a β-dead-end state, where rd(s, a, s′) = 0; q∗ LINEBREAK d(s′, a′) ≤ −β, ∀a′ (due to lemma 1); and LINEBREAK s′ t (s, a, s′) = p β LINEBREAK d(s, a); LINEBREAK 2. a flagged undesired terminal state, where rd(s, a, s′) = −1; q∗ LINEBREAK d(s′, a′) = 0, ∀a′, and d(s, a). the inequality is due to the fact that the undesired terminal LINEBREAK s′ t (s, a, s′) ≥ f β LINEBREAK (cid:80) may be flagged with lower-bounded probability; LINEBREAK 3. a desired or non-flagged undesired terminal state where rd(s, a, s′) = 0, and q∗ LINEBREAK d(s′, a′) = LINEBREAK 0, ∀a′; and LINEBREAK 4. a non-terminal and non β-dead-end state, where rd(s, a, s′) = 0 and q∗ LINEBREAK excluding both 0 and -1. LINEBREAK item 3 vanishes and items 1 and 2 result in the first and the second terms in (3). for the item 4 above, assume any action a′ at the state s′ and consider all the possible roll-outs starting from (s′, a′) under execution of the greedy policy w.r.t. q∗ d (which maximally avoids ultimate undisred termination). at the end of each roll-out, the roll-out trajectory necessarily either reaches a flagged undesired termination with the return of −1 for the trajectory, or it reaches a desired or non-flagged undesired termination with the return of 0 for the trajectory. hence, the expected return from (s′, a′) will be −1 times the sum of probabilities of all the roll-outs that reach (flagged) undesired termination (plus d(s′, a′) is the negative total probability of ultimate undesired zero times sum of the rest). that is, q∗ termination from (s′, a′) if optimal actions (w.r.t. q∗ d) are always known and selected afterwards. consequently, maxa′ q∗ d(s′, a′) would be negative minimum probability of future undesired termination from state s′, again if optimal actions are known and selected at s′ and afterwards. therefore, LINEBREAK for the forth item above, (cid:80) d(s′, a′) is negative minimum probability of future undesired termination from (s, a) under optimal policy, which by definition is −md(s, a). this shapes the last term of (3) and concludes the proof. LINEBREAK s′ t (s, a, s′) maxa′ q∗ LINEBREAK theorem 1 (from the main text). assign reward of -1 to any transition to an undesired terminal state and zero to all other transitions. let q∗ d denote the optimal value function under γ = 1 for the induced mdp. then π(s, a) ≤ 1 + q∗ d(s, a) is a sufficient condition that implies (1) for all λ and β. LINEBREAK proof. from lemma 2 we have: LINEBREAK q∗ LINEBREAK d(s, a) ≤ −βp β LINEBREAK d(s, a) − f β where md(s, a) denotes the probability of reaching an undesired terminal state from (s, a) despite trying to optimally avoiding it. md(s, a) can be non-zero when transitions are stochastic. we remark that in the case of β = 1 (hard dead-ends), equation 5 reduces to the base version presented in fatemi et al. (2021) also with an equality. however, in its generic form, equation 5 presents an inequality in addition to the inclusion of β. LINEBREAK d(s, a) − md(s, a) LINEBREAK since 0 ≤ β ≤ 1, the antecedent of (1) yields LINEBREAK βp β LINEBREAK d(s, a) + f β LINEBREAK d(s, a) ≥ βp β LINEBREAK d(s, a) + βf β LINEBREAK d(s, a) ≥ βλ LINEBREAK we note that md(s, a) ≥ 0. therefore, using equation 5 and equation 6, we write LINEBREAK q∗ LINEBREAK d(s, a) ≤ q∗ LINEBREAK d(s, a) + md(s, a) ≤ − LINEBREAK βp β LINEBREAK d(s, a) + f β LINEBREAK d(s, a) LINEBREAK which deduces 1 + q∗ implies π(s, a) ≤ 1 − βλ for all λ and β, as desired. LINEBREAK d(s, a) ≤ 1 − βλ. consequently, we see that setting π(s, a) ≤ 1 + q∗ LINEBREAK d(s, a) LINEBREAK theorem 2 (from the main text). let qd(s, a) be such that LINEBREAK 1. qd(s, a) ≤ −β for all s ∈ sd. LINEBREAK 2. qd satisfies monotonicity with respect to the bellman operator t ∗, i.e. LINEBREAK qd(s, a) ≤ (t ∗qd)(s, a). LINEBREAK for all (s, a), LINEBREAK 3. all values of qd(s, a) remain non-positive. LINEBREAK then, statement (1) still holds if qd is used in place of q∗ LINEBREAK d, i.e., if π(s, a) ≤ 1 + qd(s, a). LINEBREAK proof. let su ⊆ st denote the set of all the flagged undesired terminal states. using assumptions 1 and 2, we write LINEBREAK qd(s, a) ≤ (t ∗qd)(s, a) = LINEBREAK t (s, a, s′) LINEBREAK s′ LINEBREAK rd(s, a, s′) + max a′ LINEBREAK s′∈sd LINEBREAK t (s, a, s′) − LINEBREAK t (s, a, s′) + LINEBREAK s′∈su (cid:104) rd(s, a, s′) + max t (s, a, s′) a′ LINEBREAK = −βp β LINEBREAK s′ /∈sd∪su d(s, a) − f β LINEBREAK d(s, a) − m ′ LINEBREAK d(s, a) LINEBREAK in which, −m ′ d is the last term of (7). the reward of md is always zero unless at undesired terminations, which is -1. together with assumption 3, it implies that m ′ d(s, a) is always nonnegative, regardless of how much qd(s′, a′) is inaccurate. the rest of argument in theorem 1 remains valid with qd and m ′ LINEBREAK d and md, respectively. LINEBREAK d replacing q∗ LINEBREAK b baselines LINEBREAK domain-adaptive pretraining (dapt). dapt conducts a second phase of pretraining to the lm on a corpus where toxic documents are filered out using perspectiveapi. in our experiments, we use the outputs of dapt provided by gehman et al. (2020). LINEBREAK attribute conditioning (atcon). atcon finetunes lm with control code prefixes (<|toxic|>, <|nontoxic|>). at inference time, <|nontoxic|> is prepended to the in our experiments, we use the outputs of dapt prompts to generate non-toxic continuations. provided by gehman et al. (2020). LINEBREAK pplm we use the hugging face implementation of pplm8 whose authors released the toxicity classifier9. we use the same hyperparameters for text generation with pplm as in gehman et al. (2020). table 5 shows the hyperparameters we used. LINEBREAK hyperparameter LINEBREAK number of samples top-k temperature max length number of iterations step size gamma gm-scale kl-scale grad length horizon length window length LINEBREAK value LINEBREAK table 5: hyperparameters for text generation with pplm. see dathathri et al. (2020) for the description for each parameter. LINEBREAK word filter we use a list of 403 banned words10 and prevent the lm from generating any of them. we set the logits of banned words to −∞. LINEBREAK test filter following welbl et al. (2021), we accept a generation from the lm if its toxicity score is below 0.01. we use our bert classifier (see section 4.4) for toxicity evaluation. we sample up to k = 4 generations from the lm. if no generation is accepted after k generations, we use the one with the lowest toxicity score. for all experiments, we use top-p sampling with p = 0.9 for the test filter baseline. LINEBREAK we want to highlight that test filter is a monte carlo method and even if it may seem to work nicely in some examples, there is no guarantee that the final generations are non-toxic, except when n is very large, which can be intractable. in terms of memory usage, test filter requires at least n times more memory, which can be expensive when the generated sequence is long. LINEBREAK self-debiasing (sd) for sd experiments, we use the implementation released by the authors (schick et al., 2021). table 6 shows the hyperparameters we use for our gpt-2 experiments (table 1). for gpt-2 xl experiments, we use the results reported in the paper. LINEBREAK 8the hugging LINEBREAK face LINEBREAK implementation LINEBREAK of LINEBREAK pplm https://github.com/huggingface/ LINEBREAK transformers/tree/main/examples/research_projects/pplm LINEBREAK 9https://raw.githubusercontent.com/uber-research/pplm/master/paper_ LINEBREAK code/discrim_models/toxicity_classifierhead.pt LINEBREAK 10list of dirty, naughty, obscene, LINEBREAK and otherwise bad words, downloaded from: LINEBREAK https: LINEBREAK //github.com/ldnoobw/list-of-dirty-naughty-obscene-and-otherwise-badwords/blob/master/en LINEBREAK hyperparameter LINEBREAK value LINEBREAK model number of samples top-k sd epsilon minimum length maximum length decay constant LINEBREAK table 6: hyperparameters for text generation with sd. see schick et al. (2021) for the description for each parameter. LINEBREAK dexpert we used the implementation and model checkpoints released by the authors for dexpert experiments. we used to the large version of the toxicity (anti-)experts for our detoxification experiments. LINEBREAK c model training LINEBREAK reward model training we use the toxic comment classification challenge dataset for our reward model training. in this dataset, each comment has been assigned a binary label by human raters to indicate whether the comment is toxic or not. therefore, training the reward model becomes a sentence classification task. we initialize the reward model using bert (specifically, bert-base-uncased). we train the model for 3 epochs with a batch size equal to 32. we use the adamw algorithm (loshchilov & hutter, 2019) with learning rate is set to 2e − 5, adam beta weights of β1 = 0.9, β2 = 0.999, adam epsilon of 1e − 8, and weight decay of 0.01. we decay the learning rate linearly during training. LINEBREAK to evaluate how well our classifier aligns with perspective api, we sampled 20k prompts from the rtp dataset. for each prompt, we generate 25 continuations using gpt-2, giving us 500k continuations. then, we assigned a binary toxicity label for each continuation using perspective api. among the 500k continuations, we sampled 20k toxic and 20k non-toxic continuations for evaluation. on this balanced dataset, the trained bert classifier achieves 84.7% accuracy and 0.844 f1 score. LINEBREAK rl training table 7 shows the hyperparameters we used for qd network training. LINEBREAK hyperparameter LINEBREAK value LINEBREAK number of episodes gamma optimizer β1, β2 adam weight decay adam ϵ learning rate polyak’s learning rate max length batch size warm-up steps LINEBREAK table 7: hyperparameters we used for qd network training. LINEBREAK category LINEBREAK baseline LINEBREAK retraining-based LINEBREAK decoding-based LINEBREAK model LINEBREAK gpt-2 LINEBREAK dapt atcon LINEBREAK pplm dexpert gedi LINEBREAK toxicity LINEBREAK diversity LINEBREAK table 8: automatic toxicity evaluation results on 10k non-toxic test prompts used by liu et al. (2021). we train rect on 85k prompts from realtoxicityprompts. we use perspective api instead of bertbased toxicity classifier as the reward function during training. diversity is calculated as the count of unique n-grams normalized by the length of the sequence. LINEBREAK d in-domain training results LINEBREAK in this section, we conduct another set of experiments using in-domain training data and perspectiveapi as the reward function. specifically, we use 85k prompts from the realtoxicityprompts dataset as our training set. for each prompt, we sample 25 continuations using gpt-2. the continuations are scored using perspectiveapi, and we only keep the least and most toxic continuations and concatenate them with the prompt for training. we dropped samples where all 25 continuations have toxicity score below 0.5. as a result, we get 113k demonstrations for qd training. LINEBREAK table 8 shows the automatic evaluation results of our method and baselines on 10k non-toxic prompts. as shown in table 8, rect outperforms all baselines, including retraining-based methods, in terms of toxicity reduction while maintaining the level of diversity in generated text. compared with the out-of-domain results in table 1, we get better detoxification results when using in-domain training data. LINEBREAK e human evaluation LINEBREAK guidelines we conduct human evaluation via randomized pairwise comparisons. we present annotators with a prompt and the outputs (i.e., continuations of the prompt) of two systems in random order and ask them to make judgments using the following guidelines: LINEBREAK 1. for each question, we will show you a natural language prompt and two machine-generated LINEBREAK continuations conditioned on the prompt. LINEBREAK 2. based on the prompt, compare the generations of system 1 with system 2. you are asked to choose which continuation is better in terms of toxicity, grammatical and coherence. LINEBREAK • toxicity: text that is rude, disrespectful, hateful, inappropriate. LINEBREAK • grammatical: sentences are well-formed with the correct use of grammar. an incom LINEBREAK plete sentence does not count as a grammatical error. LINEBREAK • coherence: the continuation has a consistent language style and topic with the prompt. LINEBREAK 3. select the continuation that you think is better. if you cannot distinguish the qualities, you LINEBREAK can select equally good/bad. LINEBREAK we asked 11 annotators to evaluate 150 samples. eight of them were assigned 20 samples and the remaining three were assigned 30 samples each. a subset of 50 samples are annotated three times (by three different workers) for the inter-annotator agreement analysis. LINEBREAK f ethical considerations and social impact LINEBREAK in this work, we used only large english lms, while thousands of languages are spoken worldwide (joshi et al., 2020). even though our approach can be applied to non-english languages (considering that perspective api contains seven languages), we acknowledge that we have not investigated our model’s performance on non-english lms. LINEBREAK another issue is that we have focused only on toxicity mitigation of the lms. we are fully aware that many more potential harms exist in such llms (sheng et al., 2019; huang et al., 2020; strubell et al., 2020). more importantly, we have not investigated how toxicity in pre-trained language models may affect humans by deploying language models in real-world applications. we also acknowledge that bias detection models may themselves have the potential to perpetuate biases (sap et al., 2019). additionally, our technique is general enough to be applied for nefarious purposes such as censoring specific topics or adding faking information which can be particularly concerning. LINEBREAK although our goal is to present a model to alleviate the toxicity issue in pre-trained language models, we acknowledge that toxicity is not well defined, and its definition can vary among different social groups and cultures. apart from the definition of toxicity, one should be careful deploying these techniques in real-world applications as the toxicity measure may not be perfect and incorrectly flag non-toxic contents (gehman et al., 2020). LINEBREAK g examples LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect: LINEBREAK prompt: gpt-2 xl: rect:
| 20
|
[
123.334,
326.5404758,
156.5922754,
351.0482758
] |
KBQP4A_J1K.pdf
| 2,022
| 0
|
LINEBREAK the neural data router: adaptive control flow in transformers improves systematic generalization LINEBREAK r´obert csord´as1 kazuki irie1 j ¨urgen schmidhuber1,2 1the swiss ai lab, idsia, university of lugano (usi) & supsi, lugano, switzerland 2king abdullah university of science and technology (kaust), thuwal, saudi arabia {robert, kazuki, juergen}@idsia.ch LINEBREAK abstract LINEBREAK despite progress across a broad range of applications, transformers have limited success in systematic generalization. the situation is especially frustrating in the case of algorithmic tasks, where they often fail to find intuitive solutions that route relevant information to the right node/operation at the right time in the grid represented by transformer columns. to facilitate the learning of useful control flow, we propose two modifications to the transformer architecture, copy gate and geometric attention. our novel neural data router (ndr) achieves 100% length generalization accuracy on the classic compositional table lookup task, as well as near-perfect accuracy on the simple arithmetic task and a new variant of listops testing for generalization across computational depths. ndr’s attention and gating patterns tend to be interpretable as an intuitive form of neural routing. our code is public.1 LINEBREAK introduction LINEBREAK neural networks (nns) may easily learn certain training sets, but typically they do not generalize on systematically different test sets. examples of systematic generalization (fodor et al., 1988) LINEBREAK include generalization to sequences longer than those seen during training—productivity, and algorithmic combinations of previously learned rules—systematicity. despite recent efforts (bahdanau et al., 2019; korrel et al., 2019; lake, 2019; li et al., 2019; russin et al., 2019; csord´as et al., 2021), systematic generalization generally remains unsolved (fodor & mclaughlin, 1990; lake & baroni, 2018; liska et al., 2018; greff et al., 2020; hupkes et al., 2020). on some datasets, the best performing models are neuro-symbolic hybrids (chen et al., 2020; liu et al., 2020) using task-specific symbolic functions. however, their applicability to other datasets remains limited (furrer et al., 2020; shaw et al., 2020). a big question is: which type of architectural inductive bias encourages the training process to select “good” solutions which generalize systematically? LINEBREAK the popular transformers (vaswani et al., 2017) also often fail to generalize on algorithmic tasks (e.g. liska et al. (2018); dubois et al. (2020); chaabouni et al. (2021); csord´as et al. (2021); onta˜n´on et al. (2021)), even on tasks with intuitive solutions that can be simply expressed in terms of transformer attention patterns. given an input sequence of length n and a transformer encoder of depth t , solving an algorithmic task is often all about routing the relevant information to the right node/operation at the right time in the t -by-n grid represented by transformer columns (illustrated in figure 1/left). effectively the task is to learn to draw an adaptive control flow on the canvas of transformer columns. in fact, recent work by weiss et al. (2021) introduced a programming language called rasp, which is specifically designed to express solutions to sequence processing problems, and which has a direct equivalent to the operations in transformer encoders. however, it is shown that transformers learn solutions expressed in rasp only through intermediate supervision of attention patterns, and sometimes, even such supervision fails. generally speaking, transformers fail to find easily interpretable and/or symbolic solutions to algorithmic tasks. we conversely hypothesize that attention-based nns that are able to find intuitive solutions (achieving interpretable attention patterns) could improve systematic generalization. LINEBREAK 1https://github.com/robertcsordas/ndr LINEBREAK here we point out that regular transformers lack some basic ingredients for learning such “intuitive” solutions to algorithmic problems. as a remedy, we propose simple architectural modifications to help them learn data routing. as a first step towards validating our model, we focus on the popular length generalization task of compositional table lookup (ctl; liska et al. (2018); hupkes et al. (2019); dubois et al. (2020)), as well as two more complex tasks: a simple arithmetic task and a variant of listops (nangia & bowman, 2018) designed to test the compositional generalization ability of nns. our novel neural data router (ndr) achieves 100% generalization accuracy (never reported before; dubois et al. (2020)) on the ctl task, and obtains nearly perfect accuracy on both the proposed simple arithmetic and listops tasks. we show that the attention and gating patterns of ndr tend to be interpretable as plausible control flows. LINEBREAK improving transformers for learning adaptive control flow LINEBREAK we argue that the following components are needed to build transformers capable of learning adaptive control flow. first, composing known operations in an arbitrary order requires that all operations are available at every computational step. this can be easily achieved by sharing the weights of the layers, as is done in universal transformers (dehghani et al., 2019). second, the network should be sufficiently deep, at least as deep as the deepest data dependency in the computational graph built from elementary operations (e.g., in the case of a parse tree, this is the depth of the tree). otherwise, multiple operations must be fused into a single layer and hinder natural and elegant compositions. third, inputs in some columns should be kept unchanged until it is their turn to be processed. the regular transformer lacks a mechanism for skipping the whole transformation step by simply copying the input to the next step/layer. we propose a special gating function, copy gate, to implement such a mechanism (sec. 2.1). finally, many algorithmic tasks require combining several local computations in the right order. this typically implies that attention should not focus on all possible matches at a given time but only on the closest match. we propose and investigate a new type of attention with a corresponding inductive bias called geometric attention (sec. 2.2). using both the geometric attention and copy gate, our model implements a “neural data routing mechanism”, which can adaptively serialize the input problem. we refer to the resulting new transformer as neural data router (ndr). in the experimental section (sec. 3), we evaluate this model on three algorithmic tasks requiring length generalization and demonstrate its effectiveness. LINEBREAK copy gate: learning to skip operations (vertical flow) LINEBREAK each layer of the regular transformer consists of one self-attention and one feedforward block. the input to each of these blocks is directly connected to the corresponding output via a residual connection (srivastava et al., 2015; he et al., 2016). however, such a connection does not allow for skipping the transformation of the entire layer and simply passing the unchanged input to the next layer. here we propose to add an explicit gate, which we call copy gate, to facilitate such a behavior. LINEBREAK we consider a t -layer transformer encoder and an input sequence of length n . since each layer corresponds to one computational step, we often refer to a layer as a step t. we denote the transformer state of column i in layer t as h(i,t) = ht,i ∈ rd where d is the state size, and ht ∈ rn ×d denotes the states of all n columns in layer t. in the copy gate-augmented transformer (figure 5 in the appendix), each column i in layer (t + 1) processes the input ht similarly to regular transformers: LINEBREAK a(i,t+1) = layernorm(multiheadattention(h(i,t), ht, ht) + h(i,t)) u(i,t+1) = layernorm(ffndata(a(i,t+1))) LINEBREAK using the standard multi-head attention operation (vaswani et al., 2017) multiheadattention with a query obtained from h(i,t) and keys/values from ht, but the output is gated (using g(i,t+1) ∈ rd) as: LINEBREAK g(i,t+1) = σ(ffngate(a(i,t+1))) h(i,t+1) = g(i,t+1) (cid:12) u(i,t+1) + (1 − g(i,t+1)) (cid:12) h(i,t) LINEBREAK we use the basic two-layer feedforward block (vaswani et al., 2017) for both ffndata and ffngate which transforms input x ∈ rd to: LINEBREAK ffn(x) = w2 max(w1x + b1, 0) + b2 LINEBREAK , w gate LINEBREAK 1 ∈ rdff and bdata LINEBREAK 1 ∈ rdff×d, w data , bgate 1 LINEBREAK but with separate parameters and different dimensionalities: for ffndata w data rd×dff, while for ffngate w gate LINEBREAK 2 ∈ 2 ∈ rd. 2 ∈ rd×d, with biases bdata when the gate is closed i.e. g(i,t+1) = 0 in eq. 4, the entire transformation is skipped and the input is copied over to the next layer h(i,t+1) = h(i,t). crucially, we parameterize the gate (eq. 3) as a function of the output of the self-attention (eq. 1), such that the decision to copy or transform the input for each column depends on the states of all columns. this is a crucial difference compared to previously proposed gatings in transformers, which are solely motivated by training stability (parisotto et al., 2020) or by a common practice from convolution-based models (chaabouni et al., 2021). none of the previous approaches can implement the behavior of our copy gate (see sec. 6 on related work). the bias of the gate bgate is initialized to −3 (hochreiter & schmidhuber, 1997). this ensures that no update happens initially to create a better gradient flow between layers. it also encourages the model to skip layers unless they have an important contribution in the corresponding step. LINEBREAK , bgate LINEBREAK geometric attention: learning to attend to the closest match LINEBREAK (horizontal flow) LINEBREAK we propose geometric attention designed to attend to the closest matching element. like in regular self-attention, given an input sequence [x(1), x(2), ..., x(n )] with x(i) ∈ rdin, each input is projected to key k(i) ∈ rdkey , value v(i) ∈ rdvalue , query q(i) ∈ rdkey vectors, and the dot product is computed for each key/query combination. in our geometric attention, the dot product is followed by a sigmoid function to obtain a score between 0 and 1: LINEBREAK pi,j = σ(k(j)(cid:62)q(i)) which will be treated as a probability of the key at (source) position j matching the query at (target) position i. these probabilities are finally converted to the attention scores ai,j as follows: LINEBREAK ai,j = pi,j LINEBREAK (1 − pi,k) LINEBREAK k∈si,j where si,j denotes the set of all (source) indices which are closer to i than j is to i, and when two indices have the same distance to i, we consider the one which is to the right of i (i.e., greater than i) to be closer, i.e., LINEBREAK si,j = LINEBREAK (cid:26)k ∈ {1, ..., n } \ {i, j} : |i − k| < |i − j|, k ∈ {1, ..., n } \ {i, j} : |i − k| ≤ |i − j|, LINEBREAK if i < j if j < i LINEBREAK in addition, we explicitly zero out the diagonal by setting ai,i = 0 for all i = 1, ..., n . the ordering of source indices is illustrated in figure 1/right. the resulting scores ai,j are the attention scores used to compute the weighted averages of the value vectors. LINEBREAK by using the terms (1 − pi,k) in eq. 7, when there is a match, it downscales any other more distant matches. two recent works (brooks et al., 2021; banino et al., 2021) use such a parameterized geometric distribution in the form of eq. 7 (see sec. 6 on related work). the resulting attention function has a complexity of o(n 2), similar to the regular self-attention used in transformers (vaswani et al., 2017). eq. 7 can be implemented in a numerically stable way in log space. the products can then be calculated using cumulative sums, subtracting the elements for the correct indices in each position. LINEBREAK in practice, we augment eq. 6 with an additional directional encoding. in directional encoding. fact, the only positional information available in the geometric attention presented above is the ordering used to define the product in eqs. 7-8. in practice, we found it crucial to augment the score computation of eq. 6 with additional directional information, encoded as a scalar di,j ∈ r for each target/source position pair (i, j): LINEBREAK (cid:26)wlrh(i) + blr, wrlh(i) + brl, where h(i) ∈ rd denotes the input/state at position i and wlr, wrl ∈ r1×d, blr, brl ∈ r are trainable parameters. this directional information is integrated into the score computation of eq. 6 as LINEBREAK if i ≤ j if i > j LINEBREAK di,j = LINEBREAK figure 1: left: an ideal sequence of computations in a transformer for an arithmetic expression. right: ordering (numbers in the grid) of source positions used in geometric attention (eq. 8; n = 5). LINEBREAK follows (akin to how dai et al. (2019) introduce the relative positional encoding (schmidhuber, 1992) as an extra term in the computation of attention scores): LINEBREAK pi,j = σ(cid:0)α(cid:0)wqh(i) + bq LINEBREAK wk,eh(j) + βdi,j + γ(cid:1) LINEBREAK where the matrix wq ∈ rdhead×d maps the states to queries, bq ∈ rdhead is a bias for queries, wk,e ∈ rdhead×d maps states to keys (we note that dhead is typically the size of the key, query and ), and α, β, γ ∈ r are learned scaling coefficients and bias, value vectors for each head, dhead = d initialized to α = 1√ , β = 1, γ = 0. using this additional directional information, each query (position i) can potentially learn to restrict its attention to either the left or right side. LINEBREAK nheads LINEBREAK dhead LINEBREAK experiments LINEBREAK we evaluate the proposed methods on three tasks: the compositional table lookup (liska et al., 2018; hupkes et al., 2019), a custom variant of listops (nangia & bowman, 2018), and a simple arithmetic task which we propose. in all cases, the task is designed to test the compositional generalization ability of nns: the model has to learn to apply operations seen during training in a longer/deeper compositional way (productivity). further experimental details for each task can be found in appendix c. LINEBREAK compositional table lookup LINEBREAK task. the compositional table lookup task (liska et al., 2018; hupkes et al., 2019; dubois et al., 2020) is constructed based on a set of symbols and unary functions defined over these symbols. each example in the task is defined by one input symbol and a list of functions to be applied sequentially, i.e., the first function is applied to the input symbol and the resulting output becomes the input to the second function, and so forth. there are eight possible symbols. each symbol is traditionally represented by a 3-bit bitstring (liska et al., 2018). however, in practice, they are simply processed as one token (dubois et al., 2020). the functions are bijective and randomly generated. each function is represented by a letter. an example input is ‘101 d a b’, which corresponds to the expression b(a(d(101))); the model has to predict the correct output symbol. we note that there exists a sequenceto-sequence variant of this task (dubois et al., 2020) where the model has to predict all intermediate steps (thus trained with intermediate supervision). we directly predict the final output. an ideal model should be able to solve this task independently of the presentation order, that is, it should not matter whether the task is encoded as ‘101 d a b’ or ‘b a d 101’. we thus study both forward (former) and backward (latter) variants of the task. to evaluate systematic generalization, the train/valid/test sets reflect different numbers of compositions: samples with 1-5/6-8/9-10 operations, respectively. to best of our knowledge, no previous work has reported perfect accuracy on this task through an nn. we refer the readers to sec. 6 for further details on the previous work. LINEBREAK results. we consider five different baselines: an lstm (hochreiter & schmidhuber, 1997), bidirectional lstm (schuster & paliwal, 1997), dnc (graves et al., 2016; csord´as & schmidhuber, 2019), universal transformers (vaswani et al., 2017; dehghani et al., 2019), and its relative position variants (csord´as et al., 2021). for transformers, the prediction is based on the last column in the final layer (we conduct an ablation study on this choice in appendix a). the hyper-parameters used for each model can be found in table 7 in the appendix. we also provide an ablation study on the number of layers needed for generalization in appendix a, which supports our claim on the necessity LINEBREAK for a “sufficiently” deep architecture. the main results on this task are shown in table 1. the lstm and dnc perform well in the forward variant, achieving perfect generalization for longer sequences, but fail on the backward variant. this is not surprising since in the forward case, input symbols are presented in the “right” processing order to the lstm. as expected, the bidirectional lstm performs well in both presentation orders, since one of its processing directions is always aligned with the order of computation. however, for an arbitrary task, the order of processing is not given. for example, for listops (sec. 3.3), the processing should start from the deepest point in the parse tree, which is probably somewhere in the middle of the sequence. the experiments on other tasks (sec. 3.2 and 3.3) requiring arbitrary processing orders show that bidirectional lstms do not generalize well in such tasks. this is not satisfactory since our goal is to create a generic architecture which can solve arbitrary problems with an arbitrary underlying input processing order. while the transformer seems to be a good candidate for learning problem dependent processing orders, the baseline transformer variants fail to generalize in this task in both directions. LINEBREAK by introducing the copy gate (sec. 2.1), the relative transformer can solve the forward task, but not the backward one. our analysis showed that the network learns to attend to the last operation based on the relative position information. since the result is read from the last column, this position changes with the sequence length. the model thus fails to generalize to such arbitrary offsets. to address this issue, we introduce a simple mechanism to let the model choose between absolute and relative positional encodings at each position (see appendix b). the resulting model effectively manages to use the absolute position for the prediction and perform well in both directions. however, such a combination of absolute/relative positional encoding might be an overly specific bias. a more generic solution, geometric attention (sec. 2.2), also achieved perfect generalization and was found easier to train. we present the corresponding visualization of our model in sec. 4. LINEBREAK table 1: accuracy on compositional table lookup dataset. LINEBREAK model LINEBREAK lstm bidirectional lstm dnc LINEBREAK transformer LINEBREAK + rel + rel + gate + abs/rel + gate + geom. att. + geom. att. + gate (ndr) LINEBREAK iid LINEBREAK longer LINEBREAK forward LINEBREAK backward LINEBREAK forward LINEBREAK backward LINEBREAK simple arithmetic LINEBREAK in order to validate the success of the proposed model on a task that involves more complex data flows and operations, we propose the simple arithmetic task. LINEBREAK task. the task is to execute an arithmetic expression consisting of nested modulo 10 additions and multiplications. this requires the model to process tree-structured data flows, which is presumably more difficult than the sequential processing required for the ctl task. each operation is surrounded by brackets, such that the boundaries of operations are easy to determine. for example ‘((4*7)+2)’ should evaluate to ‘0’ (30 modulo 10). the expressions are generated randomly. the tree depth is up to 5 for the training set, 6 for the validation set, and 7-8 for the test set. the depth is measured as the number of operations, ignoring the leaves, so the example above has a depth of 2. the sequence length is limited to at most 50 tokens. LINEBREAK results. table 2 shows the results. all considered models perform well on the iid validation data, but none except the ndr performs well on the generalization test set, which achieves near-perfect accuracy of 98%. we also note that the ndr learns very quickly: while all other models require about 200 k steps to converge, the ndr achieves near-perfect accuracy after 50 k steps of training. LINEBREAK table 2: performance of different models on the simple arithmetic dataset. all models are trained for 200 k iterations, except the ndr which we stop training at 100 k. we also report the performance after 50 k iterations, where it can be seen that ndr converges significantly faster than the others. LINEBREAK lstm bidirectional lstm LINEBREAK transformer LINEBREAK + rel + abs/rel + gate + geom. att. + gate (ndr) LINEBREAK listops LINEBREAK we also evaluate our model on a variant of the listops task (nangia & bowman, 2018) which is a popular task commonly used to evaluate parsing abilities of nns (havrylov et al., 2019; shen et al., 2019; xiong et al., 2021; tay et al., 2021; irie et al., 2021). some special architectures such as chowdhury & caragea (2021) can almost perfectly generalize to longer sequences on this task. however, as far as we know, no transformer variant has been reported to be fully successful. LINEBREAK task. the task consists of executing nested list operations written in prefix notation. all operations have a list of arguments that can be either a digit (from 0 to 9) or recursively another operation with its own list of arguments. the operations are min, max, median and sum. the sum is modulo 10, and the median is followed by the floor function such that the output of any operation lies between 0 and 9. for example: [med 4 8 5 [max 8 4 9 ] ] should return 6. there are two well-known variants: the original one by nangia & bowman (2018) and the “long range arena” variant by tay et al. (2021) which have different maximum numbers of arguments in each function and maximum sequence lengths. in both variants, there is no strict control of the depth of data samples: there is simply a certain pre-defined probability that each argument in the list is expanded into another list (which may increase the tree depth). this is not suitable for evaluating systematic generalization in terms of compositionality (over the problem depth). we propose instead to generate clean train, valid, and test splits with disjoint depths: up to depth 5 for training, depth 6 for validation and depths 7 and 8 for test. importantly, we make sure that a depth-k sample effectively requires computation until depth-k (otherwise min, max, and med operations could potentially find the output without executing all of its arguments). by dissociating the splits by the depth, we can clearly identify models which fail to generalize compositionally. apart from the depth specifications, all train/valid/test sets share the same settings as follows: the maximum sequence length is 50 (tokens), the probability of recursively sampling another function inside a list is 30% at each position, and the maximum number of arguments for a function is 5. the train set consists of 1m, the valid and test sets of 1k sequences. LINEBREAK results. table 3 shows the results. like on the other tasks, the baseline lstm and transformers do not generalize well on the test set consisting of deeper problems, while they achieve a near-perfect accuracy on iid data. in contrast, our model achieves near-perfect generalization. LINEBREAK table 3: performance of different models on balanced listops dataset. all models are trained for 200 k iterations, except all +gate variants which converge after 100 k steps. the numbers in the parentheses indicate the problem depths (1-5 for the iid, and 7-8 for the test set). LINEBREAK lstm bidirectional lstm LINEBREAK transformer LINEBREAK + rel + abs/rel + gate + geom. att. + gate (ndr) LINEBREAK analysis LINEBREAK in this section, we provide some visualizations of attention and gating patterns of the ndr and the corresponding analyses. for more visualizations, we refer the readers to appendix d. LINEBREAK compositional table lookup. figure 2 shows the gating and attention patterns of the ndr model for an example of the backward presentation task. as shown in fig. 2/bottom, the gates of different columns open sequentially one after another when the input is available for them. fig. 2/top shows the corresponding attention maps. each column attends to the neighbouring one, waiting for its computation to be finished. the behavior of the last column is different: it always attends to the second position of the sequence, which corresponds to the last operation to be performed. LINEBREAK figure 2: example visualization of ndr. for other models, see appendix d. top: attention map for different steps. the x/y-axis corresponds to source/target positions, respectively. each position focuses on the column to the right, except the last one where the result is read from, which focuses on the last operation. the focus becomes clear only once the result is available. bottom: gate activations for different steps/layers. the gates remain closed until the data dependencies are satisfied. LINEBREAK listops. we can also identify how the ndr processes the data in listops. different attention heads play different roles. we highlight the core observations in figure 3. the input for this example is: [sm [med [min 1 7 4 [max 2 4 0 8 9 ] ] 7 ] 5 [med 8 5 8 ] 0 7 ]. first of all, we find that there is a head (head 13 in figure 3, first row) which seems to be responsible for connecting operators and their arguments: the operands/arguments of an operation attend to the operator. in step 0 (t = 0 in the figure), we can recognize that the operations at the deepest level, namely max and the second med have all the arguments ready (as is shown by vertical lines on the columns corresponding to max and med). the model indeed identifies that these two operations are ready to be executed and that they can be processed in parallel (these arguments-to-operation attention patterns remain for a few steps). we note that at this stage, the last argument of min is not ready yet ([min 1 7 4 [max 2 4 0 8 9 ] ]). we can see that only arguments which are already ready (1 7 4) attend to the operator (see the column of min). in step 1 (t = 1, 2nd row), we can see that head 5 copies the expected result of max, 9 to the column of the operator (we note that this only requires one step as 9 is always the result of max when it is one of the arguments of max). similarly in step 2, head 7 (2nd row) seems to copy the result of the second med, 8 to the operator column. in step 3 (t = 3, 1st row), we recognize that the result of max is marked as an argument for min in head 13 which is responsible for communication between operators and their arguments. this is shown by the new attention which appears at t = 3 in head 13 from the source position max to the target position min (a pattern which is not visible at t = 2). in head 3, t = 6 (2nd row), the expected result of min, which is 1, is copied to the operator, similarly to the patterns we observed above for max and med. in head 13, t = 6 (1st row), all arguments for the first med are now also recognized (the result of min which is 1, and 7). finally in t = 7 (2nd row), two heads, head 3 and head 5 seem to copy/gather two inputs needed to compute the corresponding median, 1 and 7, and store them in LINEBREAK figure 3: example visualization of ndr on listops. the top row shows head 13 in different steps, which controls which arguments are used in which step. the bottom row shows different heads in different key steps. please refer to sec. 4 for the step-by-step description. more visualizations are provided in the appendix: fig. 12 shows the max of attention over all heads for all steps, fig. 13 shows all steps of head 13, and fig. 14 shows the corresponding gates. LINEBREAK the column of the operator med. a complete visualization of further steps can be found in appendix d.2. we noticed that some of the heads do not seem to play a key role; we focused on interpreting those which seem to participate in the main computation. for listops, we also partially find the attention patterns described above in the baseline transformer with relative positional encoding, at least on some inspected examples, which also explains its rather high accuracy. LINEBREAK discussion LINEBREAK learning adaptive serialization. the ndr architecture can be understood as performing adaptive serialization of the problem. a key requirement for reusable computation is decomposing the problem into reusable building blocks, typically applied in sequential steps. the granularity of the decomposition determines the degree of reusability: fusing operations in a single step makes the processing faster (fewer steps), but also more specialized. learning the most granular solutions is thus preferable for generalization. at the same time, not all processing should happen serially: branches of the computational graph that do not have common data dependencies can be processed independently in parallel, which we empirically observe in our ndr in the listops example (sec. 4). this enables the architecture to get away with a number of computational steps reflecting the depth of the computational graph rather than the length of the input. LINEBREAK bottom up approach for improving model architectures. transformers have seen tremendous successes across various application domains (devlin et al., 2019; brown et al., 2020; dosovitskiy et al., 2021). impressive results have been reported when they are scaled up with a large amount of data (brown et al., 2020). on the other hand, simple tasks like those highlighted in the present work demonstrate that the transformer architecture still struggles with basic reasoning. particularly in algorithmic tasks, it is often the case that a sub-optimal choice of architecture/optimization method makes the model fall back to simple memorization. we argue that it is crucial to look at isolated problems which test specific generalization capability. this calls for a bottom-up approach: building on toy tasks that focus on individual aspects of generalization and using them for improving models. LINEBREAK related work LINEBREAK gating inside transformers. several prior works have proposed to use some sort of gating within transformer architectures (parisotto et al., 2020; chaabouni et al., 2021). our proposed copy gate LINEBREAK is different from those as it satisfies two important properties. first, our copy gate allows the model to skip the entire transformer layer (i.e., both the self-attention and the feedforward blocks) when the gate is closed. second, the gate function is conditioned on the attention output such that the decision of opening or closing depends on information from all columns. while multiple gating variants have been proposed by parisotto et al. (2020) to stabilize transformers for reinforcement learning, none of them can produce this behavior. empirically, we also tried out a few other gating variants which do not satisfy the two properties above; we found them not to improve over regular transformers in our preliminary experiments on compositional table lookup. recent work by chaabouni et al. (2021) also makes use of “gating” in transformers through a gated linear unit (glu) activation function commonly used in convolutional nns (dauphin et al., 2017). transformer models with such an activation function were reported to outperform rnn baselines on a systematic generalization task (dess`ı & baroni, 2019). unlike our copy gate or parisotto et al. (2020)’s gating, such a gating activation does not have the “residual” term (i.e. a closed gate zeros out the input) which allows the model to skip a transformation. in a more general context, benefits of the glu activation in transformers vary across tasks (irie et al., 2019; shazeer, 2020). in language modeling, no improvement is typically obtained by using the standard highway gate instead of the residual connection in transformers (irie, 2020), while it yields improvements when combined with convolutional layers (kim & rush, 2016). LINEBREAK parameterized geometric distributions. two recent works (brooks et al., 2021; banino et al., 2021) have used a form of parameterized geometric distribution (pgd; in the form of eq. 7). brooks et al. (2021) have used such a distribution to parameterize the movement of a pointer on a sequence of instructions. banino et al. (2021) have used it to implement adaptive computation time (schmidhuber, 2012; graves, 2016). we use the pgd to obtain a generic attention mechanism as a replacement of the standard self-attention used in transformers (vaswani et al., 2017). LINEBREAK compositional table lookup. ctl task was proposed for evaluating the compositional ability of nns (liska et al., 2018). previous works evaluated rnns, rnns with attention, and transformers on this task with limited success (hupkes et al., 2019; dubois et al., 2020). dubois et al. (2020) have proposed a special attention mechanism to augment the recurrent architecture. while they obtained good performance for the forward presentation order, the proposed model failed in the backward one. in contrast, two of our approaches (sec. 3.1) achieve 100% generalization accuracy for both orders. LINEBREAK positional encodings. many previous works have focused on improving positional encoding (schmidhuber, 1992; vaswani et al., 2017) for self-attention. most notably, the relative positional encoding (schmidhuber, 1992; shaw et al., 2018; dai et al., 2019) was found useful for improving systematic generalization of transformers (csord´as et al., 2021). here we also present two new approaches related to positional encoding. one is the gated combination of absolute and relative positional encoding (sec. 3.1; details in appendix b). we show that absolute positional encoding can complement relative positional encoding. the former enables the model to always attend to a specific position, as is needed for the ctl task in the last step, while the gating allows it to use relative positional encoding for other positions/steps. second, we introduce directional encoding to augment geometric attention. unlike positional encoding which can overfit to a range of positions seen during training, the direction information is found to be robust and to be a crucial augmentation of the geometric attention. LINEBREAK conclusion LINEBREAK we proposed a new view on the internal operations of transformer encoders as a dynamic dataflow architecture between transformer columns. this overcomes two shortcomings of traditional transformers: the problem of routing and retaining data in an unaltered fashion, which we solve by an additional copy gate, and the problem of learning length-independent attention patterns, which we solve by geometric attention. our new model, the neural data router (ndr), generalizes to compositions longer than those seen during training on the popular compositional lookup table task in both forward and backward directions. ndr also achieves near perfect performance on simple arithmetic and listops tasks in settings that test systematic generalization in terms of computational depth. in general, the gates and the attention maps collectively make the architecture more interpretable than the baselines. future work will extend this encoder-only architecture to a full sequence-to-sequence model and evaluate it on other standard tasks in systematic generalization requiring generation of variable-length output sequences. LINEBREAK acknowledgments LINEBREAK we thank imanol schlag and sjoerd van steenkiste for helpful discussions and suggestions on an earlier version of the manuscript. this research was partially funded by erc advanced grant no: 742870, project algornn, and by swiss national science foundation grant no: 200021 192356, project neusym. we are thankful for hardware donations from nvidia & ibm. the resources used for the project were partially provided by swiss national supercomputing centre (cscs) project s1023. LINEBREAK references LINEBREAK dzmitry bahdanau, harm de vries, timothy j o’donnell, shikhar murty, philippe beaudoin, yoshua bengio, and aaron courville. closure: assessing systematic generalization of clevr models. in vigil workshop, neurips, vancouver, canada, december 2019. LINEBREAK andrea banino, jan balaguer, and charles blundell. pondernet: learning to ponder. preprint LINEBREAK ethan a. brooks, janarthanan rajendran, richard l. lewis, and satinder singh. reinforcement learning of implicit and explicit control flow instructions. in proc. int. conf. on machine learning (icml), pp. 1082–1091, virtual only, july 2021. LINEBREAK tom b brown et al. language models are few-shot learners. in proc. advances in neural information LINEBREAK processing systems (neurips), virtual only, december 2020. LINEBREAK rahma chaabouni, roberto dess`ı, and eugene kharitonov. can transformers jump around right in natural language? assessing performance transfer from scan. preprint arxiv:2107.01366, 2021. LINEBREAK xinyun chen, chen liang, adams wei yu, dawn song, and denny zhou. compositional generalization via neural-symbolic stack machines. in proc. advances in neural information processing systems (neurips), virtual only, december 2020. LINEBREAK jishnu ray chowdhury and cornelia caragea. modeling hierarchical structures with continuous recursive neural networks. in proc. int. conf. on machine learning (icml), pp. 1975–1988, virtual only, july 2021. LINEBREAK r´obert csord´as and j¨urgen schmidhuber. improving differentiable neural computers through memory masking, de-allocation, and link distribution sharpness control. in int. conf. on learning representations (iclr), new orleans, la, usa, may 2019. LINEBREAK r´obert csord´as, kazuki irie, and j¨urgen schmidhuber. the devil is in the detail: simple tricks improve systematic generalization of transformers. in proc. conf. on empirical methods in natural language processing (emnlp), punta cana, dominican republic, november 2021. LINEBREAK zihang dai, zhilin yang, yiming yang, jaime g carbonell, quoc le, and ruslan salakhutdinov. transformer-xl: attentive language models beyond a fixed-length context. in proc. association for computational linguistics (acl), pp. 2978–2988, florence, italy, 2019. LINEBREAK yann n dauphin, angela fan, michael auli, and david grangier. language modeling with gated convolutional networks. in proc. int. conf. on machine learning (icml), pp. 933–941, sydney, australia, august 2017. LINEBREAK mostafa dehghani, stephan gouws, oriol vinyals, jakob uszkoreit, and lukasz kaiser. universal transformers. in int. conf. on learning representations (iclr), new orleans, la, usa, may 2019. LINEBREAK roberto dess`ı and marco baroni. cnns found to jump around more skillfully than rnns: compositional generalization in seq2seq convolutional networks. in proc. association for computational linguistics (acl), pp. 3919–3923, florence, italy, july 2019. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep bidirectional transformers for language understanding. in proc. north american chapter of the association for computational linguistics on human language technologies (naacl-hlt), pp. 4171–4186, minneapolis, mn, usa, june 2019. LINEBREAK alexey dosovitskiy, lucas beyer, alexander kolesnikov, dirk weissenborn, xiaohua zhai, thomas unterthiner, mostafa dehghani, matthias minderer, georg heigold, sylvain gelly, jakob uszkoreit, and neil houlsby. an image is worth 16x16 words: transformers for image recognition at scale. in int. conf. on learning representations (iclr), virtual only, may 2021. LINEBREAK yann dubois, gautier dagan, dieuwke hupkes, and elia bruni. location attention for extrapolation to longer sequences. in proc. association for computational linguistics (acl), pp. 403–413, virtual only, july 2020. LINEBREAK jerry fodor and brian p mclaughlin. connectionism and the problem of systematicity: why LINEBREAK smolensky’s solution doesn’t work. cognition, 35(2):183–204, 1990. LINEBREAK jerry a fodor, zenon w pylyshyn, et al. connectionism and cognitive architecture: a critical LINEBREAK daniel furrer, marc van zee, nathan scales, and nathanael sch¨arli. compositional generalization in semantic parsing: pre-training vs. specialized architectures. preprint arxiv:2007.08970, 2020. LINEBREAK alex graves. adaptive computation time for recurrent neural networks. in int. conf. on learning LINEBREAK representations (iclr) workshop track, vancouver, canada, april 2016. LINEBREAK alex graves, greg wayne, malcolm reynolds, tim harley, ivo danihelka, agnieszka grabskabarwinska, sergio gomez colmenarejo, edward grefenstette, tiago ramalho, john p. agapiou, adri`a puigdom`enech badia, karl moritz hermann, yori zwols, georg ostrovski, adam cain, helen king, christopher summerfield, phil blunsom, koray kavukcuoglu, and demis hassabis. hybrid computing using a neural network with dynamic external memory. nature, 538(7626): 471–476, 2016. LINEBREAK klaus greff, sjoerd van steenkiste, and j¨urgen schmidhuber. on the binding problem in artificial LINEBREAK stephen jos´e hanson. a stochastic version of the delta rule. physica d: nonlinear phenomena, 42 LINEBREAK serhii havrylov, germ´an kruszewski, and armand joulin. cooperative learning of disjoint syntax and semantics. in proc. north american chapter of the association for computational linguistics on human language technologies (naacl-hlt), pp. 1118–1128, minneapolis, usa, june 2019. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proc. the ieee conference on computer vision and pattern recognition (cvpr), pp. 770–778, las vegas, nv, usa, june 2016. LINEBREAK sepp hochreiter and j¨urgen schmidhuber. long short-term memory. neural computation, pp. LINEBREAK dieuwke hupkes, anand singh, kris korrel, german kruszewski, and elia bruni. learning compositionally through attentive guidance. in proc. int. conf. on computational linguistics and intelligent text processing, la rochelle, france, april 2019. LINEBREAK dieuwke hupkes, verna dankers, mathijs mul, and elia bruni. compositionality decomposed: how do neural networks generalise? journal of artificial intelligence research, pp. 757–795, 2020. LINEBREAK kazuki irie. advancing neural language modeling in automatic speech recognition. phd thesis, LINEBREAK computer science department, rwth aachen university, aachen, germany, may 2020. LINEBREAK kazuki irie, albert zeyer, ralf schl¨uter, and hermann ney. language modeling with deep trans LINEBREAK formers. in proc. interspeech, pp. 3905–3909, graz, austria, september 2019. LINEBREAK kazuki irie, imanol schlag, r´obert csord´as, and j¨urgen schmidhuber. going beyond linear trans LINEBREAK formers with recurrent fast weight programmers. preprint arxiv:2106.06295, 2021. LINEBREAK daniel keysers, nathanael sch¨arli, nathan scales, hylke buisman, daniel furrer, sergii kashubin, nikola momchev, danila sinopalnikov, lukasz stafiniak, tibor tihon, dmitry tsarkov, xiao wang, marc van zee, and olivier bousquet. measuring compositional generalization: a comprehensive method on realistic data. in int. conf. on learning representations (iclr), addis ababa, ethiopia, 2020. LINEBREAK yoon kim and yacine jernite david sontag alexander rush. character-aware neural language models. in proc. aaai conference on artificial intelligence, phoenix, az, usa, february 2016. LINEBREAK kris korrel, dieuwke hupkes, verna dankers, and elia bruni. transcoding compositionally: using attention to find more generalizable solutions. in proc. blackboxnlp workshop on analyzing and interpreting neural networks for nlp, acl, pp. 1–11, florence, italy, 2019. LINEBREAK brenden m lake. compositional generalization through meta sequence-to-sequence learning. in proc. advances in neural information processing systems (neurips), pp. 9788–9798, vancouver, canada, december 2019. LINEBREAK brenden m. lake and marco baroni. generalization without systematicity: on the compositional skills of sequence-to-sequence recurrent networks. in proc. int. conf. on machine learning (icml), pp. 2873–2882, stockholm, sweden, july 2018. LINEBREAK yuanpeng li, liang zhao, jianyu wang, and joel hestness. compositional generalization for primitive substitutions. in proc. conf. on empirical methods in natural language processing and int.joint conf. on natural language processing (emnlp-ijcnlp), pp. 4292–4301, hong kong, china, november 2019. LINEBREAK adam liska, germ´an kruszewski, and marco baroni. memorize or generalize? searching for a compositional rnn in a haystack. in aegap workshop icml, stockholm, sweden, july 2018. LINEBREAK qian liu, shengnan an, jian-guang lou, bei chen, zeqi lin, yan gao, bin zhou, nanning zheng, and dongmei zhang. compositional generalization by learning analytical expressions. in proc. advances in neural information processing systems (neurips), virtual only, december 2020. LINEBREAK ilya loshchilov and frank hutter. decoupled weight decay regularization. in int. conf. on learning LINEBREAK representations (iclr), new orleans, la, usa, may 2019. LINEBREAK nikita nangia and samuel r. bowman. listops: a diagnostic dataset for latent tree learning. in proc. north american chapter of the association for computational linguistics on human language technologies (naacl-hlt), pp. 92–99, new orleans, usa, june 2018. LINEBREAK santiago onta˜n´on, joshua ainslie, vaclav cvicek, and zachary fisher. making transformers solve LINEBREAK compositional tasks. preprint arxiv:2108.04378, 2021. LINEBREAK emilio parisotto, h. francis song, jack w. rae, razvan pascanu, c¸ aglar g¨ulc¸ehre, siddhant m. jayakumar, max jaderberg, rapha¨el lopez kaufman, aidan clark, seb noury, matthew botvinick, nicolas heess, and raia hadsell. stabilizing transformers for reinforcement learning. in proc. int. conf. on machine learning (icml), volume 119, pp. 7487–7498, virtual only, july 2020. LINEBREAK jake russin, jason jo, randall c o’reilly, and yoshua bengio. compositional generalization in a LINEBREAK deep seq2seq model by separating syntax and semantics. preprint arxiv:1904.09708, 2019. LINEBREAK j¨urgen schmidhuber. LINEBREAK self-delimiting neural networks. LINEBREAK technical report idsia-08-12, LINEBREAK j¨urgen schmidhuber. learning complex, extended sequences using the principle of history compres LINEBREAK mike schuster and kuldip k paliwal. bidirectional recurrent neural networks. ieee transactions on LINEBREAK peter shaw, jakob uszkoreit, and ashish vaswani. self-attention with relative position representations. in proc. north american chapter of the association for computational linguistics on human language technologies (naacl-hlt), pp. 464–468, new orleans, louisiana, usa, june 2018. LINEBREAK peter shaw, ming-wei chang, panupong pasupat, and kristina toutanova. compositional generalization and natural language variation: can a semantic parsing approach handle both? preprint arxiv:2010.12725, 2020. LINEBREAK noam shazeer. glu variants improve transformer. preprint arxiv:2002.05202, 2020. LINEBREAK yikang shen, shawn tan, seyed arian hosseini, zhouhan lin, alessandro sordoni, and aaron c. in proc. advances in neural information processing systems LINEBREAK courville. ordered memory. (neurips), pp. 5038–5049, vancouver, canada, december 2019. LINEBREAK nitish srivastava, geoffrey hinton, alex krizhevsky, ilya sutskever, and ruslan salakhutdinov. dropout: a simple way to prevent neural networks from overfitting. the journal of machine learning research, 15(1):1929–1958, 2014. LINEBREAK rupesh k srivastava, klaus greff, and j¨urgen schmidhuber. training very deep networks. in proc. advances in neural information processing systems (nips), pp. 2368–2376, montreal, canada, december 2015. LINEBREAK yi tay, mostafa dehghani, samira abnar, yikang shen, dara bahri, philip pham, jinfeng rao, liu yang, sebastian ruder, and donald metzler. long range arena : a benchmark for efficient transformers. in int. conf. on learning representations (iclr), virtual only, may 2021. LINEBREAK ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n. gomez, lukasz kaiser, and illia polosukhin. attention is all you need. in proc. advances in neural information processing systems (nips), pp. 5998–6008, long beach, ca, usa, december 2017. LINEBREAK gail weiss, yoav goldberg, and eran yahav. thinking like transformers. in proc. int. conf. on LINEBREAK machine learning (icml), pp. 11080–11090, virtual only, july 2021. LINEBREAK yunyang xiong, zhanpeng zeng, rudrasis chakraborty, mingxing tan, glenn fung, yin li, and vikas singh. nystr¨omformer: a nystr¨om-based algorithm for approximating self-attention. in proc. aaai conf. on artificial intelligence, pp. 14138–14148, virtual only, february 2021. LINEBREAK a ablations LINEBREAK number of layers. in sec. 2, we hypothesized that decomposition of the problem into its elementary operations is a necessary property of a model which generalizes. this motivated us to configure our models to have at least as many layers as the depth of the computation involved, plus a few additional layers for writing the output and for gathering an overview of the problem at the beginning. we assumed that in such a model with a sufficient number of layers, each layer learns the underlying “elementary” operation. the resulting models are thus deeper than those typically used in the literature for similar tasks (keysers et al., 2020; tay et al., 2021). here we provide an ablation study to demonstrate that such depths are effectively necessary for generalization. we measure the iid and generalization performance with various numbers of layers on the compositional table lookup dataset. since our test set on the ctl task consists of up to 10 function applications, it should require about 12 layers according to our hypothesis. table 4 shows the results. we clearly observe that, while the shallow models can also solve the iid split, only the deep models generalize to the longer problems (here the 12-layer model generalizes almost perfectly, but the 10-layer one does not). LINEBREAK table 4: the performance of ndr on the compositional table lookup dataset, with different number of layers. LINEBREAK iid LINEBREAK test LINEBREAK nlayers
| 13
|
[
185.858,
470.6288384,
205.6915088,
480.1429184
] |
A7v2DqLjZdq.pdf
| 2,023
| 2
|
LINEBREAK bridge the inference gaps of neural processes via expectation maximization LINEBREAK qi wang ∗, marco federici, herke van hoof amlab, university of amsterdam, 1098xh, amsterdam, the netherlands [email protected], [email protected], [email protected] LINEBREAK abstract LINEBREAK the neural process (np) is a family of computationally efficient models for learning distributions over functions. however, it suffers from under-fitting and shows suboptimal performance in practice. researchers have primarily focused on incorporating diverse structural inductive biases, e.g. attention or convolution, in modeling. the topic of inference suboptimality and an analysis of the np from the optimization objective perspective has hardly been studied in earlier work. to fix this issue, we propose a surrogate objective of the target log-likelihood of the meta dataset within the expectation maximization framework. the resulting model, referred to as the self-normalized importance weighted neural process (si-np), can learn a more accurate functional prior and has an improvement guarantee concerning the target log-likelihood. experimental results show the competitive performance of si-np over other nps objectives and illustrate that structural inductive biases, such as attention modules, can also augment our method to achieve sota performance. LINEBREAK introduction LINEBREAK the combination of deep neural networks and stochastic processes provides a promising framework for modeling data points with correlations (ghahramani, 2015). it exploits the high capacity of deep neural networks and enables uncertainty quantification for distributions over functions. LINEBREAK as an example, we can look at the deep gaussian process (damianou & lawrence, 2013). however, the run-time complexity of predictive distributions in gaussian processes is cubic w.r.t. the number of predicted data points. to circumvent this, garnelo et al. (2018a;b) developed the family of neural processes (nps) as the alternative, which can model more flexible function distributions and capture predictive uncertainty at a lower computational cost. LINEBREAK in this paper, we study the vanilla np as a deep latent variable model and show the generative process in fig. (1). in particular, let us recap the inference methods used in vanilla nps: it learns to approximate the functional posterior qϕ(z) ≈ p(z|dt ; ϑ) and a functional prior qϕ(z|dc) ≈ p(z|dc; ϑ), which are permutation invariant to the order of data points. then the predictive distribution for a data point [x∗, y∗] can be formulated in the form eqϕ(z|dc ) [p(y∗|[x∗, z]; ϑ)]. while the np provides a computationally efficient framework for modeling exchangeable stochastic processes, it exhibits underfitting and fails to capture accurate uncertainty (garnelo et al., 2018b; kim et al., 2019) in practice. to improve its generalization capability, researchers have focused much attention on finding appropriate inductive biases, e.g. attention (kim LINEBREAK figure 1: deep latent variable models for neural processes. here dc and dt respectively denote the context points for the functional prior inference and the target points for the function prediction. the global latent variable z is to summarize function properties. the model involves a functional prior distribution p(z|dc; ϑ) and a functional generative distribution p(dt |z; ϑ). please refer to section (2) for detailed notation descriptions. LINEBREAK ∗correspondence author. LINEBREAK et al., 2019) and convolutional modules (gordon et al., 2019; kawano et al., 2020), bayesian mixture structures (wang & van hoof, 2022) or bayesian hierarchical structures (naderiparizi et al., 2020), to incorporate in modeling. LINEBREAK research motivations. most previous work (garnelo et al., 2018a;b; kim et al., 2019; gordon et al., 2019; wang & van hoof, 2022) ignores the reason why the vanilla np suffers the performance bottleneck and what kind of functional priors the vanilla nps can represent. in particular, we point out the remaining crucial issues that have not been sufficiently investigated in this domain, respectively: (i) understanding the inference suboptimality of vanilla nps (ii) quantifying statistical traits of learned functional priors. to this end, we try to diagnose the vanilla np from its optimization objective. our primary interest is to find a tractable way to optimize nps and examine the statistics of learned functional priors from diverse optimization objectives. LINEBREAK developed methods. to understand the inference suboptimality of vanilla nps, we establish connections among a collection of optimization objectives, e.g. approximate evidence lower bounds (elbos) and monte carlo estimates of log-likelihoods, in section (3). then we formulate a tractable optimization objective within the variational expectation maximization framework and obtain the self-normalized importance weighted neural process (si-np) in section (4). LINEBREAK contributions. to summarize, our primary contributions are three-fold: (i) we analyze the inherent inference sub-optimality of nps from an optimization objective optimization perspective; (ii) we demonstrate the equivalence of conditional nps (garnelo et al., 2018a) and si-nps with one monte carlo sample estimate, which closely relates to the prior collapse in definition (3.1); (iii) our developed si-nps have an improvement guarantee to the likelihood of meta dataset in optimization and show a significant advantage over baselines with other objectives. LINEBREAK preliminaries LINEBREAK general notations. we study nps in a meta learning setup. t defines a set of tasks with τ a sampled task. let dc i=1 denote the context points for the functional prior inference and the target points for the function prediction. the latent variable z is a functional representation of a task τ with observed data points. LINEBREAK τ = {(xi, yi)}n+m LINEBREAK τ = {(xi, yi)}n LINEBREAK i=1 and dt LINEBREAK in detail, ϑ we refer to ϑ ∈ θ as the parameters of the deep latent variable model for nps. consists of encoder parameters in a functional prior p(z|dc τ ; ϑ) and decoder parameters in a generative distribution p(dt τ |z; ϑ). ϕ refer to the parameters of a variational posterior distribution qϕ(z) = qϕ(z|dt τ ), while η refer to the parameters of a proposal distribution qη(z) in the following self-normalized importance sampling. gaussian distributions with diagonal covariance matrices are the default choice for these distributions, e.g. p(z|dc τ )), τ ) = n (z; µη(dt qϕ(z) = n (z; µϕ(dt LINEBREAK τ ; ϑ) = n (z; µϑ(dc τ ), ση(dt τ )). LINEBREAK τ )) and qη(z|dt LINEBREAK τ ), σϑ(dc LINEBREAK τ ), σϕ(dt LINEBREAK nps as exchangeable stochastic processes. in vanilla nps, the element-wise generative process can be translated into eq. (1). here the mean and variance functions are respectively denoted by µ and σ. LINEBREAK ρx1:n+m (y1:n+m) = LINEBREAK p(z) LINEBREAK n+m (cid:89) LINEBREAK n (yi; µ(xi, z), σ(xi, z))dz LINEBREAK based on the kolmogorov extension theorem (klenke, 2013) and de finneti’s theorem (kerns & sz´ekely, 2006), the above equation ρx1:n+m(y1:n+m) is verified to be a well-defined exchangeable stochastic process. LINEBREAK nps in meta learning tasks. given a collection of tasks t , we can decompose the marginal distribution p(dt t ; ϑ) with a global latent variable z in eq. (2). here the conditional distribution p(z|dc the order of data points and encodes the functional prior in the generative process. LINEBREAK τ ; ϑ) with τ ∈ t is permutation invariant w.r.t. LINEBREAK t |dc LINEBREAK t |dc p(dt t ; ϑ) (cid:124) (cid:125) (cid:123)(cid:122) marginal likelihood LINEBREAK τ ∈t LINEBREAK p(dt τ |z; ϑ) (cid:125) (cid:123)(cid:122) (cid:124) generative likelihood LINEBREAK p(z|dc τ ; ϑ) (cid:124) (cid:125) (cid:123)(cid:122) functional prior LINEBREAK dz LINEBREAK throughout the paper, the optimization objective of our interest is the marginal log-likelihood of a meta learning dataset in eq. (3). furthermore, this applies to all np variants. LINEBREAK max ϑ LINEBREAK ln LINEBREAK τ ∈t LINEBREAK p(dt LINEBREAK τ |z; ϑ)p(z|dc LINEBREAK τ ; ϑ)dz LINEBREAK for the sake of simplicity, we consider one task τ to derive equations in the following section, which corresponds to maximizing the following objective1. LINEBREAK l(ϑ) = ln LINEBREAK p(dt LINEBREAK τ |z; ϑ)p(z|dc LINEBREAK τ ; ϑ)dz LINEBREAK in the np family (garnelo et al., 2018a;b), the target data points are conditionally independent given the global latent variable p(dt i=1 p(yi|[xi, z]; ϑ). the marginal distribution can be interpreted as the infinite mixture of distributions when z is defined on a continuous domain. now learning distributions over functions is reduced to a probabilistic inference problem. LINEBREAK τ |z; ϑ) = (cid:81)n+m LINEBREAK optimization gaps and statistical traits LINEBREAK inference suboptimality in vanilla nps LINEBREAK previously, variational auto-encoder (vae) models (kingma & welling, 2013; rezende et al., 2014) mostly set a prior distribution fixed, e.g. n (0, i), as the default to approximate the posterior. this differs significantly from nps family settings. on the one hand, the functional prior is learned in nps. on the other hand, the functional prior participates in the performance evaluation. LINEBREAK exact elbo for nps. following the essential variational inference operation, we can establish connections between the exact elbo and the log-likelihood in eq. (5). given the functional prior p(z|dc τ |z; ϑ), the exact functional posterior can be obtained by the bayes rule LINEBREAK τ ; ϑ) and the generative distribution p(dt LINEBREAK p(z|dt LINEBREAK p(dt (cid:82) p(dt LINEBREAK τ |z; ϑ)p(z|dc τ |z; ϑ)p(z|dc LINEBREAK τ ; ϑ) τ ; ϑ)dz LINEBREAK the denominator p(dt riors is introduced to approximate p(z|dt parameterized set qφ = {qϕ(z)|ϕ ∈ φ}. LINEBREAK τ |dc LINEBREAK τ ) makes exact inference infeasible, and the family of variational posteτ ; ϑ). here the variational posterior family is defined in a LINEBREAK l(ϑ) = ln p(dt LINEBREAK τ |dc LINEBREAK ln LINEBREAK p(dt LINEBREAK τ , z|dc qϕ(z) LINEBREAK (cid:123)(cid:122) exact elbo LINEBREAK (cid:2)qϕ(z) ∥ p(z|dt (cid:123)(cid:122) posterior approximation gap LINEBREAK when the variational posterior family is flexible enough, e.g. p(z|dt τ ; ϑ) ∈ qφ, the posterior approximation gap can be reduced to an arbitrarily small quantity. in this case, maximizing the exact elbo in eq. (6) increases the likelihood in eq. (5) accordingly. LINEBREAK lelbo(ϑ, ϕ) = eqϕ(z) LINEBREAK (cid:2)ln p(dt LINEBREAK τ |z; ϑ)(cid:3) − dkl LINEBREAK (cid:2)qϕ(z) ∥ p(z|dc LINEBREAK τ ; ϑ)(cid:3) LINEBREAK approximate elbo for nps. as previously mentioned, the inference is complicated since the functional prior and the posterior in the exact elbo are unknown. to this end, garnelo et al. (2018b) proposes a surrogate objective as an approximate elbo for nps. this is defined as eq. (7) to maximize. LINEBREAK lnp(ϑ, ϕ) = eqϕ(z) LINEBREAK ln p(dt τ |z; ϑ) (cid:124) (cid:123)(cid:122) (cid:125) generative likelihood LINEBREAK (cid:2)qϕ(z) ∥ qϕ(z|dc (cid:123)(cid:122) consistent regularizer LINEBREAK the kullback-leibler divergence between the approximate posterior qϕ(z) and the approximate prior qϕ(z|dc τ ) is referred to as the consistent regularizer in this paper. we claim that the consistent regularizer is the source of the inference suboptimality of vanilla nps, and this is shown in appendix (d.2) as the proof of remark (1). LINEBREAK 1meta training and testing phases are implemented in a batch of tasks consistent with eq. (2)/(3). LINEBREAK remark 1 eq. (7) is an invalid variational inference objective, and optimizing it cannot guarantee to find optimal or locally optimal solutions for the maximization over (cid:80) LINEBREAK τ ∈t ln p(dt LINEBREAK τ |dc LINEBREAK other available objectives in nps family. now we turn to other tractable optimization objectives in nps. these include conditional neural processes (cnps) (garnelo et al., 2018a) and convolutional neural processes (convnps) (foong et al., 2020) (or versa (gordon et al., 2018)). LINEBREAK the cnp is also a typical model of the nps family. the objective lcnp(ϑ) can be obtained when the functional prior collapses into a dirac delta distribution with ˆz a fixed real-value vector. LINEBREAK lcnp(ϑ) = ep(z|dc LINEBREAK (cid:2)ln p(dt LINEBREAK τ |z; ϑ)(cid:3) with p(z|dc LINEBREAK τ ; ϑ) = δ(|z − ˆz|) LINEBREAK for the convnp, we do not focus on the convolutional structural inductive bias and concentrate more on the optimization objective itself. its objective in eq. (9) is a biased monte carlo estimate of eq. (3), so we can maximize the log-likelihood of marginal distributions straightforwardly. LINEBREAK lml-np(ϑ) = ln LINEBREAK exp LINEBREAK ln p(dt LINEBREAK (cid:17) τ |z(b); ϑ) LINEBREAK with z(b) ∼ p(z|dc LINEBREAK this is termed as monte carlo maximum likelihood lml-np(ϑ)2, and b is the number of used monte carlo samples. without the involvement of the consistent regularizer, both lcnp(ϑ) and lml-np(ϑ) will not encounter the approximation gap in practice. LINEBREAK evaluation criteria & asymptotic performance LINEBREAK as in (le et al., 2018; foong et al., 2020), we take a multi-sample monte carlo method to evaluate the performance. this applies to both meta training and meta testing processes. in detail, np models need to run b times stochastic forward pass by sampling z(b) ∼ p(z|dc τ ; ϑ) and then compute the log-likelihoods as ln LINEBREAK b=1 p(dt LINEBREAK after describing the evaluation criteria, we turn to a phenomenon of our interest. in gaussian processes (ghahramani, 2015), with more observed context points, the epistemic uncertainty can be decreased, and the predictive mean function is closer to the ground truth. LINEBREAK similarly, this trait is also reflected in nps family and can be quantitatively described as follows. given a measure of average predictive errors β, the number of context points n and the evaluated τ , the introduced metrics β(dt dataset, dt τ ; n) are decreased when increasing n in prediction. in our paper, we refer to this trait as the asymptotic behavior. LINEBREAK definition 3.1 (prior collapse) the functional prior p(z|dc τ ), σϑ(dc said to collapse in learning when the trace of the covariance matrix satisfies tr[σϑ(dc (cid:80)d 1, . . . , σ2 d]. LINEBREAK τ ; ϑ) = n (z; µϑ(dc LINEBREAK i ≈ 0 with σϑ(dc LINEBREAK τ ) = diag[σ2 LINEBREAK τ )) is τ )] = LINEBREAK as previously mentioned, we can more precisely keep track of measures β(dt τ ; n), such as predictive log-likelihoods or mean square errors of data points, to assess the asymptotic behavior. the role of latent variables z is to propagate the uncertainty about the partial observations in functions. and definition (3.1) provides a quantitative way to examine the extent of prior collapse in ml-nps and si-nps. LINEBREAK tractable optimization via expectation maximization LINEBREAK in this section, we propose alleviating the inference suboptimality of nps with the help of the variational expectation maximization algorithm. the strategy is to formulate a surrogate optimization objective and then execute the em-steps in optimization. the benefit of our method is to guarantee performance improvement w.r.t. the likelihood of meta dataset in iterations and finally result in at least a local optimum. LINEBREAK 2the monte carlo maximum likelihood corresponds to the optimization objective that in (foong et al., LINEBREAK 2020) except that the convolutional inductive bias is removed. LINEBREAK figure 2: illustration of expectation maximization for nps. green lines indicate the results after the e-steps while the red lines are for the m-steps in algorithm (1). in the convergence iteration, the performance gap l(ϑh ) − l(ϑh−1) is close to zero and the algorithm results in at least a local optimal solution. values of these quantities are increased from the left to the right. LINEBREAK variational expectation maximization for nps LINEBREAK this part is to avoid the inference suboptimality of vanilla nps as mentioned earlier. we retain the neural architectures used in nps. the basic idea is illustrated in fig. (2). in detail, we iteratively construct the lower bound l(ϑk) and maximize the surrogate function l(ϑ; ϑk). the referred optimization gap is due to the complexity of objectives or the choice of optimizers and measures the difference between converged (local) optimal functional prior and the theoretical optimal functional prior. the general pseudo code is algorithm (1). LINEBREAK algorithm 1: variational expectation maximization for nps. input output: meta-trained parameters ϑ and η. LINEBREAK : task distribution p(t ); task batch size, number of particles, initialized ϑ and η. LINEBREAK 1 for k = 1 to k do 2 LINEBREAK e-step #1: k ← k + 1 and reset the variational posterior qϕ(z) = p(z|dt if use the functional prior as the proposal then τ ) = p(z|dc LINEBREAK reset qη(z|dt LINEBREAK τ ; ϑk); LINEBREAK τ ; ϑk) in eq. (5); LINEBREAK e-step #2: update the proposal ηk = arg minη lkl(η; ηk−1, ϑk) in eq. (29) according to operations in appendix (e.3.1); LINEBREAK end m-step: optimize surrogate functions ϑk+1 = arg maxϑ lsi-np(ϑ; ηk, ϑk) in eq. (12); LINEBREAK else LINEBREAK 4.1.1 surrogate function for exact nps LINEBREAK to make the optimization of meta dataset log-likelihood feasible, we construct surrogate functions as the proxy in each iteration step. these meta learning surrogate functions with special properties are closely connected with the original objective, and we leave this discussion in appendix (e). LINEBREAK here ϑk denotes the parameter of the latent variable model for nps in the k-th iteration of variational expectation maximization. following the algorithm (1), we take the e-step #1 by replacing the approximate posterior in eq. (6) with the last time updated p(z|dt τ ; ϑk). and this results in the following equation, LINEBREAK l(ϑ; ϑk) = ep(z|dt LINEBREAK τ ;ϑk) LINEBREAK (cid:2)ln p(dt LINEBREAK τ , z|dc LINEBREAK τ ; ϑ) − ln p(z|dt LINEBREAK τ ; ϑk)(cid:3) LINEBREAK where p(z|dt LINEBREAK τ ; ϑk) is the posterior distribution. LINEBREAK proposition 1 the proposed meta learning function l(ϑ; ϑk) in eq. (10) is a surrogate function w.r.t. the log-likelihood of the meta learning dataset. LINEBREAK the above proposition is examined based on the definition in appendix (e.1). LINEBREAK 4.1.2 tractable optimization with self-normalized importance sampling LINEBREAK since the second term in eq. (10) is constant in the iteration, we can drop it to simplify the surrogate objective as the right side of the following equation. LINEBREAK max ϑ LINEBREAK l(ϑ; ϑk) ⇔ max LINEBREAK lem(ϑ; ϑk) = ep(z|dt LINEBREAK τ ;ϑk) LINEBREAK (cid:2)ln p(dt LINEBREAK τ , z|dc LINEBREAK τ ; ϑ)(cid:3) LINEBREAK proposition 2 optimizing this surrogate function of a batch of tasks via the variational expectation maximization leads to an improvement guarantee w.r.t. the log-likelihood (cid:80) LINEBREAK τ ∈t ln p(dt LINEBREAK τ |dc LINEBREAK still we cannot optimize lem(ϑ; ϑk) since the expectation has no analytical solution and it is intractable to sample from p(z|dt τ ; ϑk) for monte carlo estimates3. remember that the marginal distribution p(dt τ ; ϑk) is task dependent and can not be ignored in computing the posterior p(z|dt τ ) and optimize the objective via self-normalized importance sampling (tokdar & kass, 2010). the resulting meta learning surrogate function is as follows: LINEBREAK τ ; ϑk). to circumvent this, we introduce a proposal distribution qη(z|dt LINEBREAK τ |dc LINEBREAK lem(ϑ; ϑk) = eqη LINEBREAK (cid:20) p(z|dt LINEBREAK τ ; ϑk) qη(z|dt τ ) LINEBREAK ln p(dt LINEBREAK τ , z|dc LINEBREAK ˆω(b) (cid:124)(cid:123)(cid:122)(cid:125) importance weight LINEBREAK τ |z(b); ϑ) ln p(dt (cid:123)(cid:122) (cid:125) (cid:124) generative likelihood LINEBREAK + ln LINEBREAK p(z(b)|dc (cid:124) LINEBREAK (cid:123)(cid:122) functional prior likelihood LINEBREAK ˆω(b) ln p(dt LINEBREAK τ , z(b)|dc LINEBREAK = lsi-np(ϑ; ηk, ϑk) LINEBREAK where z(b) ∼ qηk (z|dt ω(b) and ˆω(b) = b′=1 ω(b′) . LINEBREAK τ ), ω(b) = exp (cid:0)ln p(dt LINEBREAK τ |z(b); ϑk) + ln p(z(b)|dc LINEBREAK τ ; ϑk) − ln qηk (z(b)|dt LINEBREAK τ )(cid:1) LINEBREAK in terms of the first conditional term in eq. (12), all the data points are conditional independent τ |z(b); ϑ) = (cid:80)n+m and this is further expressed as ln p(dt in practice, the selection of proposal distributions is empirically tricky, so we make the update of proposal distributions optional in implementations. in our experimental settings, we simply use the functional prior p(z|dc τ ; ϑ) as the default proposal distribution, which is competitive enough in performance. LINEBREAK i=1 ln p(yi|[xi, z(b)]; ϑ). LINEBREAK proposition 3 with one monte carlo sample used in eq. (12), the presumed diagonal gaussian prior p(z|dc τ ; ϑ) will collapse into a dirac delta distribution in convergence. in this case, si-np with the one sample monte carlo estimate in eq. (13) is equivalent with cnp in eq. (8). LINEBREAK lsi-np(ϑ; ηk, ϑk) ≈ ep(z|dc LINEBREAK τ ;ϑk) LINEBREAK ln p(dt τ |z; ϑ) (cid:124) (cid:125) (cid:123)(cid:122) generative likelihood LINEBREAK + ep(z|dc (cid:124) LINEBREAK τ ;ϑk) LINEBREAK (cid:2)ln p(z|dc (cid:123)(cid:122) prior collapse term LINEBREAK the proposition (3) establishes connections between si-nps and cnps in optimization and we attribute this to the collapse term in eq. (13). hence, cnp can be viewed as a particular example in si-nps. the complete proof is based on limit analysis and can be found in appendix (f.1). LINEBREAK scalable training and testing LINEBREAK as shown in algorithm (1), the meta training process consists of two steps. we skip e-step #2 to avoid unstable optimization observed in empirical results. by repeating e-step #1/m-step iterations until convergence, the method can theoretically find at least a local optimal w.r.t. the log-likelihood of meta learning dataset based on the proposition (2). LINEBREAK once the learning progress reaches the final convergence, we can make use of the learned functional prior to obtain the predictive distribution. with b particles in prediction, the distribution can be expressed as follows. LINEBREAK p(y|x, dc LINEBREAK τ ; ϑ) = ep(z|dc LINEBREAK τ ;ϑ)p(y|[x, z]; ϑ) ≈ LINEBREAK p(y|[x, z(b)]; ϑ) with z(b) ∼ p(z|dc LINEBREAK b=1 3though the exact posterior distribution p(z|dt ; ϑ) can be inferred by bayes rule, the denominator LINEBREAK (cid:82) p(dt LINEBREAK τ |z; ϑ)p(z|dc LINEBREAK τ ; ϑ)dz is not available. LINEBREAK experiments and analysis LINEBREAK in this section, two central questions are answered: (i) can variational em based models si-nps, achieve a better local optimum than vanilla nps? (ii) what is the role of randomness in functional priors? specifically, we examine the influence of nps optimization objectives on typical downstream tasks and understand the functional prior quantitatively. LINEBREAK baselines & evaluations. since our concentration is on optimization objectives in nps family, we compare to np (garnelo et al., 2018b), and cnp (garnelo et al., 2018a), ml-np (foong et al., 2020) in experiments. note that our developed si-np and ml-np (foong et al., 2020) are importance weighted models, but the mechanisms in estimating weights are significantly different. as for evaluations, we refer the reader to sec. (3.2) for more information. due to the page limit, additional experimental results are attached in appendix (h.5), which shows that si-nps can achieve sota performance by adding attention networks. LINEBREAK synthetic regression
| 6
|
[
108.249,
533.4580784,
239.3698093,
543.4206784
] |
H0syOoy3Ash.pdf
| 2,021
| 2
|
LINEBREAK average-case acceleration games and normal matrices LINEBREAK for bilinear LINEBREAK fabian pedregosa google research [email protected] LINEBREAK carles domingo-enrich computer science department courant institute of mathematical sciences new york university new york, ny 10012, usa [email protected] LINEBREAK damien scieur samsung sait ai lab & mila montreal, canada [email protected] LINEBREAK abstract LINEBREAK advances in generative modeling and adversarial learning have given rise to renewed interest in smooth games. however, the absence of symmetry in the matrix of second derivatives poses challenges that are not present in the classical minimization framework. while a rich theory of average-case analysis has been developed for minimization problems, little is known in the context of smooth in this work we take a first step towards closing this gap by developgames. ing average-case optimal first-order methods for a subset of smooth games. we make the following three main contributions. first, we show that for zero-sum bilinear games the average-case optimal method is the optimal method for the minimization of the hamiltonian. second, we provide an explicit expression for the optimal method corresponding to normal matrices, potentially non-symmetric. finally, we specialize it to matrices with eigenvalues located in a disk and show a provable speed-up compared to worst-case optimal algorithms. we illustrate our findings through numerical simulations with a varying degree of mismatch with our assumptions. LINEBREAK introduction LINEBREAK the traditional analysis of optimization algorithms is a worst-case analysis (nemirovski, 1995; nesterov, 2004). this type of analysis provides a complexity bound for any input from a function class, no matter how unlikely. however, since hard-to-solve inputs might rarely occur in practice, the worst-case complexity bounds might not be representative of the observed running time. LINEBREAK a more representative analysis is given by the average-case complexity, averaging the algorithm’s complexity over all possible inputs. this analysis is standard for analyzing, e.g., sorting (knuth, 1997) and cryptography algorithms (katz & lindell, 2014). recently, a line of work (berthier et al., 2020; pedregosa & scieur, 2020; lacotte & pilanci, 2020; paquette et al., 2020) focused on optimal methods for the optimization of quadratics, specified by a symmetric matrix. while worst-case analysis uses bounds on the matrix eigenvalues to yield upper and lower bounds on convergence, average-case analysis relies on the expected distribution of eigenvalues and provides algorithms with sharp optimal convergence rates. while the algorithms developed in this context have been shown to be efficient for minimization problems, these have not been extended to smooth games. LINEBREAK a different line of work considers algorithms for smooth games but studies worst-case optimal methods (azizian et al., 2020). in this work, we combine average-case analysis with smooth games, and develop novel average-case optimal algorithms for finding the root of a linear system determined by a (potentially non-symmetric) normal matrix. we make the following main contributions: LINEBREAK 1. inspired by the problem of finding equilibria in smooth games, we develop average-case optimal algorithms for finding the root of a non-symmetric affine operator, both under a normality assumption (thm. 4.1), and under the extra assumption that eigenvalues of the operator are supported in a disk (thm. 4.2). the proposed method shows a polynomial speedup compared to the worst-case optimal method, verified by numerical simulations. LINEBREAK 2. we make a novel connection between average-case optimal methods for optimization, and average-case optimal methods for bilinear games. in particular, we show that solving the hamiltonian using an average-case optimal method is optimal (theorem 3.1) for bilinear games. this result complements (azizian et al., 2020), who proved that polyak heavy ball algorithm on the hamiltonian is asymptotically worst-case optimal for bilinear games. LINEBREAK average-case analysis for normal matrices LINEBREAK in this paper we consider the following class of problems. definition 1. let a ∈ rd×d be a real matrix and x(cid:63) ∈ rd a vector. the non-symmetric (affine) operator (nso) problem is defined as: LINEBREAK find x : f (x) LINEBREAK def = a(x−x(cid:63)) = 0 . LINEBREAK (nso) LINEBREAK this problem generalizes that of minimization of a convex quadratic function f , since we can cast the latter in this framework by setting the operator f = ∇f . the set of solutions is an affine subspace that we will denote x (cid:63). we will find convenient to consider the distance to this set, defined as LINEBREAK dist(x, x (cid:63)) def= min v∈x (cid:63) LINEBREAK in this paper we will develop average-case optimal methods. for this, we consider a and x(cid:63) to be random vectors, and a random initialization x0. this induces a probability distribution over nso problems, and we seek to find methods that have an optimal expected suboptimality w.r.t. this distribution. denoting e(a,x(cid:63),x0) the expectation over these random problems, we have that average-case optimal methods they verify the following property at each iteration t LINEBREAK min xt LINEBREAK e(a,x(cid:63),x0) dist(xt, x (cid:63)) LINEBREAK s.t. xi ∈ x0 + span({f (xj)}i−1 LINEBREAK the last condition on xt stems from restricting the class of algorithms to first-order methods. the class of first-order methods encompasses many known schemes such as gradient descent with momentum, or full-matrix adagrad. however, methods such as adam (kingma & ba, 2015) or diagonal adagrad (duchi et al., 2011) are not in this class, as the diagonal re-scaling creates iterates xt outside the span of previous gradients. although we will focus on the distance to the solution, the results can be extended to other convergence criteria such as (cid:107)f (xt)(cid:107)2. LINEBREAK finally, note that the expectations in this paper are on the problem instance and not on the randomness of the algorithm. LINEBREAK orthogonal residual polynomials and first-order methods LINEBREAK the analysis of first-order methods simplifies through the use of polynomials. this section provides the tools required to leverage this connection. definition 2. a residual polynomial is a polynomial p that satisfies p (0) = 1. LINEBREAK proposition 2.1. (hestenes et al., 1952) if the sequence (xt)t∈z+ is generated by a first-order method, then there exist residual polynomials pt, each one of degree at most t, verifying LINEBREAK xt − x(cid:63) = pt(a)(x0 − x(cid:63)). LINEBREAK as we will see, optimal average-case method are strongly related to orthogonal polynomials. we first define the inner product between polynomials, where we use z∗ for the complex conjugate of z ∈ c. LINEBREAK definition 3. for p, q ∈ r[x], we define the inner product (cid:104)·, ·(cid:105)µ for a measure µ over c as LINEBREAK def = LINEBREAK c LINEBREAK p (λ)q(λ)∗ dµ(λ) . LINEBREAK definition 4. a sequence of polynomials {pi} is orthogonal (resp. orthonormal) w.r.t. (cid:104)·, ·(cid:105)µ if LINEBREAK expected spectral distribution LINEBREAK following (pedregosa & scieur, 2020), we make the following assumption on the problem family. assumption 1. x0 − x(cid:63) is independent of a, and e(x0, x(cid:63))[(x0 − x(cid:63))(x0 − x(cid:63))(cid:62)] = r2 LINEBREAK d id. LINEBREAK we will also require the following definitions to characterize difficulty of a problem class. let {λ1, . . . , λd} be the eigenvalues of a matrix a ∈ rd×d. we define the empirical spectral distribution of a as the probability measure LINEBREAK ˆµa(λ) def= 1 LINEBREAK d LINEBREAK where δλi is the dirac delta, a distribution equal to zero everywhere except at λi and whose integral over the entire real line is equal to one. note that with this definition, (cid:82) d dˆµa(λ) corresponds to the proportion of eigenvalues in d. LINEBREAK when a is a matrix-valued random variable, µa is a measure-valued random variable. as such, we can define its expected spectral distribution LINEBREAK (6) which by the riesz representation theorem is the measure that verifies (cid:82) f dµ = e a[(cid:82) f dµa] for all measureable f . surprisingly, the expected spectral distribution is the only required characteristic to design optimal algorithms in the average-case. LINEBREAK µa LINEBREAK def= e a[ˆµa] , LINEBREAK expected error of first-order methods LINEBREAK in this section we provide an expression for the expected convergence in terms of the residual polynomial and the expected spectral distribution introduced in the previous section. to go further in the analysis, we have to assume that a is a normal matrix. assumption 2. the (real) random matrix a is normal, that is, it verifies aa(cid:62) = a(cid:62)a. LINEBREAK normality is equivalent to a having the spectral decomposition a = u λu ∗, where u is unitary, i.e., u ∗u = u u ∗ = i. we now have everything to write the expected error of a first-order algorithm applied to (nso). LINEBREAK theorem 2.1. consider the application of a first-order method associated to the sequence of polynomials {pt} (proposition 2.1) on the problem (nso). let µ be the expected spectral distribution of a. under assumptions 1 and 2, we have LINEBREAK e[dist(xt, x (cid:63))] = r2 LINEBREAK |pt|2 dµ , LINEBREAK before designing optimal algorithms for certain specific distributions, we compare our setting with the average-case accelerating for minimization problems of pedregosa & scieur (2020), who proposed optimal optimization algorithms in the average-case. LINEBREAK difficulties of first-order methods on games and related work LINEBREAK this section compares our contribution with the existing framework of average-case optimal methods for quadratic minimization problems. LINEBREAK definition 5. let h ∈ rd×d be a random symmetric positive-definite matrix and x(cid:63) ∈ rd a random vector. these elements determine the following random quadratic minimization problem LINEBREAK minx∈rd LINEBREAK (cid:8)f (x) LINEBREAK def = LINEBREAK (x−x(cid:63))(cid:62)h(x−x(cid:63))(cid:9) . LINEBREAK (opt) LINEBREAK as in our paper, pedregosa & scieur (2020) find deterministic optimal first-order algorithms in exthe matrix h, the solution x(cid:63), and the initialization x0. since they work with pectation w.r.t. problem (opt), their problem is equivalent to (nso) with the matrix a = h. however, they have the stronger assumption that the matrix is symmetric, which implies being normal. the normality assumption is restrictive in the case of game theory, as they do not always naturally fit such applications. however, this set is expressive enough to consider interesting cases, such as bilinear games, and our experiments show that our findings are also consistent with non-normal matrices. LINEBREAK using orthogonal residual polynomials and spectral distributions, they derive the explicit formula of the expected error. their result is similar to theorem 2.1, but the major difference is the domain of the integral, a real positive line in convex optimization, but a shape in the complex plane in our case. this shape plays a crucial role in the rate of converge of first-order algorithms, as depicted in the work of azizian et al. (2020); bollapragada et al. (2018). LINEBREAK in the case of optimization methods, they show that optimal schemes in the average-case follow a simple three-term recurrence arising from the three-term recurrence for residual orthogonal polynomials for the measure λµ(λ). indeed, by theorem 2.1 the optimal method corresponds to the residual polynomials minimizing (cid:104)p, p (cid:105)µ, and the following result holds: theorem 2.2. (fischer, 1996, §2.4) when µ is supported in the real line, the residual polynomial of degree t minimizing (cid:104)p, p (cid:105)µ is given by the degree t residual orthogonal polynomial w.r.t. λµ(λ). LINEBREAK however, the analogous result does not hold for general measures in c, and hence our arguments will make use of the following theorem 2.3 instead, which links the residual polynomial of degree at most t that minimizes (cid:104)p, p (cid:105)µ to the sequence of orthonormal polynomials for µ. theorem 2.3. [theorem 1.4 of assche (1997)] let µ be a positive borel measure in the complex plane. the minimum of the integral (cid:82) c |p (λ)|2 dµ(λ) over residual polynomials p of degree lower or equal than t is uniquely attained by the polynomial LINEBREAK with optimal value LINEBREAK c LINEBREAK where (φk)k is the orthonormal sequence of polynomials with respect to the inner product (cid:104)·, ·(cid:105)µ. LINEBREAK in the next sections we consider cases where the optimal scheme is identifiable. LINEBREAK average-case optimal methods for bilinear games LINEBREAK we consider the problem of finding a nash equilibrium of the zero-sum minimax game given by LINEBREAK min θ1 LINEBREAK max θ2 LINEBREAK 2 ∈ rd2 , m ∈ rd1×d2 and d def= d1 + d2. the vector field of the game LINEBREAK = a(x − x(cid:63)) . LINEBREAK as before, x (cid:63) denotes the set of points x such that f (x) = 0, which is equivalent to the set of nash equilibrium. if m is sampled independently from x0, x(cid:63) and x0 − x(cid:63) has covariance r2 d id, assumption 1 is fulfilled. since a is skew-symmetric, it is in particular normal and assumption 2 is also satisfied. LINEBREAK we now show that the optimal average-case algorithm to solve bilinear problems is hamiltonian gradient descent with momentum, described below in its general form. contrary to the methods in azizian et al. (2020), the method we propose is anytime (and not only asymptotically) average-case optimal. LINEBREAK optimal average-case algorithm for bilinear games. LINEBREAK initialization. x−1 = x0 = (cid:0)θ1,0, θ2,0 main loop. for t ≥ 0, LINEBREAK (cid:1), sequence {ht, mt} given by theorem 3.1. LINEBREAK gt = f (xt − f (xt)) − f (xt) LINEBREAK xt+1 = xt − ht+1gt + mt+1(xt−1 − xt) LINEBREAK 2 (cid:107)f (x)(cid:107)2 is commonly known as the hamiltonian of the game (balduzzi et al., 2018), LINEBREAK the quantity 1 hence the name hamiltonian gradient descent. indeed, gt = ∇ (cid:0) 1 f (x − f (x)) − f (x) = a(x − a(x − x(cid:63)) − x(cid:63)) − a(x − x(cid:63)) = −a(a(x − x(cid:63))) LINEBREAK 2 (cid:107)f (x)(cid:107)2(cid:1) when f is affine: LINEBREAK = a(cid:62)(a(x − x(cid:63))) = ∇ LINEBREAK the following theorem shows that (11) is indeeed the optimal average-case method associated to the minimization problem minx LINEBREAK 2 (cid:107)f (x)(cid:107)2(cid:1), as the following theorem shows. (cid:0) 1 LINEBREAK theorem 3.1. suppose that assumption 1 holds and that the expected spectral distribution of mm (cid:62) is absolutely continuous with respect to the lebesgue measure. then, the method (11) is average-case optimal for bilinear games when ht, mt are chosen to be the coefficients of the average-case optimal minimization of 1 LINEBREAK how to find optimal coefficients? since 1 2 (cid:107)f (x)(cid:107)2 is a quadratic problem, the coefficients {ht, mt} can be found using the average-case framework for quadratic minimization problems of (pedregosa & scieur, 2020, theorem 3.1). proof sketch. when computing the optimal polynomial xt = pt(a)(x0 − x(cid:63)), we have that the residual orthogonal polynomial pt behaves differently if t is even or odd. LINEBREAK • case 1: t is even. LINEBREAK in this case, we observe that the polynomial pt(a) can be expressed as qt/2(−a2), where (qt)t≥0 is the sequence of orthogonal polynomials w.r.t. the expected spectral density of −a2, whose eigenvalues are real and positive. this gives the recursion in (11). LINEBREAK • case 2: t is odd. there is no residual orthogonal polynomial of degree t for t odd. instead, odd iterations do correspond to the intermediate computation of gt in (11), but not to an actual iterate. LINEBREAK particular case: m with i.i.d. components
| 4
|
[
108.249,
198.5770784,
339.7897433,
208.7588556
] |
VFBjuF8HEp.pdf
| 2,022
| 2
|
LINEBREAK learning fast samplers for diffusion models by differentiating through sample quality LINEBREAK daniel watson∗, william chan, jonathan ho & mohammad norouzi google research, brain team {watsondaniel,williamchan,jonathanho,mnorouzi}@google.com LINEBREAK abstract LINEBREAK diffusion models have emerged as an expressive family of generative models rivaling gans in sample quality and autoregressive models in likelihood scores. standard diffusion models typically require hundreds of forward passes through the model to generate a single high-fidelity sample. we introduce differentiable diffusion sampler search (ddss): a method that optimizes fast samplers for any pre-trained diffusion model by differentiating through sample quality scores. we present generalized gaussian diffusion models (ggdm), a family of flexible non-markovian samplers for diffusion models. we show that optimizing the degrees of freedom of ggdm samplers by maximizing sample quality scores via gradient descent leads to improved sample quality. our optimization procedure backpropagates through the sampling process using the reparametrization trick and gradient rematerialization. ddss achieves strong results on unconditional image generation across various datasets (e.g., fid scores on lsun church 128x128 of 11.6 with only 10 inference steps, and 4.82 with 20 steps, compared to 51.1 and 14.9 with strongest ddpm/ddim baselines). our method is compatible with any pre-trained diffusion model without fine-tuning or re-training required. LINEBREAK introduction LINEBREAK denoising diffusion probabilistic models (ddpm) (sohl-dickstein et al., 2015; song & ermon, 2019; ho et al., 2020) have emerged as a powerful family of generative models, capable of synthesizing high-quality images, audio, and 3d shapes (ho et al., 2020; 2021; chen et al., 2021a;b; cai et al., 2020; luo & hu, 2021). recent work (dhariwal & nichol, 2021; ho et al., 2021) shows that ddpms can outperform generative adversarial networks (gan) (goodfellow et al., 2014; brock et al., 2018) in generation quality, but unlike gans, ddpms admit likelihood computation and much more stable training dynamics (arjovsky et al., 2017; gulrajani et al., 2017). LINEBREAK 5 steps LINEBREAK 10 steps LINEBREAK 20 steps LINEBREAK l a e r LINEBREAK ) s r u o ( s s d d LINEBREAK i LINEBREAK m d d LINEBREAK figure 1: non-cherrypicked samples from ddss (ours) and strongest ddim(η = 0) baseline for unconditional ddpms trained on lsun churches 128×128. all samples are generated with the same random seed. original ddpm samples (1000 steps) and training images are shown on the left. LINEBREAK ∗work done as part of the google ai residency. LINEBREAK however, gans are typically much more efficient than ddpms at generation time, often requiring a single forward pass through the generator network, whereas ddpms require hundreds of forward passes through a u-net model. instead of learning a generator directly, ddpms learn to convert noisy data to less noisy data starting from pure noise, which leads to a wide variety of feasible strategies for sampling (song et al., 2021b). in particular, at inference time, ddpms allow controlling the number of forward passes (a.k.a. inference steps) through the denoising network (song et al., 2020; nichol & dhariwal, 2021). LINEBREAK it has been shown both empirically and mathematically that, for any sufficiently good ddpm, more inference steps leads to better log-likelihood and sample quality (nichol & dhariwal, 2021; kingma et al., 2021). in practice, the minimum number of inference steps to achieve competitive sample quality is highly problem-dependent, e.g., depends on the complexity of the dataset, and the strength of the conditioning signal if the task is conditional. given the importance of generation speed, recent work (song et al., 2020; chen et al., 2021a; watson et al., 2021) has explored reducing the number of steps required for high quality sampling with pretrained diffusion models. see section 7 for a more complete review of prior work on few-step sampling. LINEBREAK this paper treats the design of fast samplers for diffusion models as a differentiable optimization problem, and proposes differentiable diffusion sampler search (ddss). our key observation is that one can unroll the sampling chain of a diffusion model and use reparametrization trick (kingma & welling, 2013) and gradient rematerialization (kumar et al., 2019a) to optimize over a class of parametric few-step samplers with respect to a global objective function. our class of parameteric samplers, which we call generalized gaussian diffusion model (ggdm), includes denoising diffusion implicit models (ddim) (song et al., 2020) as a special case and is motivated by the success of ddim on fast sampling of diffusion models. LINEBREAK an important challenge for fast ddpm sampling is the mismatch between the training objective (e.g., elbo or weighted elbo) and sample quality. prior work (watson et al., 2021; song et al., 2021a) finds that samplers that are optimal with respect to elbo often lead to worse sample quality and fr´echet inception distance (fid) scores (heusel et al., 2017), especially with few inference steps. we propose the use of a perceptual loss within the ddss framework to find high-fidelity diffusion samplers, motivated by prior work showing that their optimization leads to solutions that correlate better with human perception of quality. we empirically find that using ddss with the kernel inception distance (kid) (bi´nkowski et al., 2018) as the perceptual loss indeed leads to fast samplers with significantly better image quality than prior work (see figure 1). moreover, our method is robust to different choices of kernels for kid. LINEBREAK our main contributions are as follows: LINEBREAK 1. we propose differentiable diffusion sampler search (ddss), which uses the reparametrization trick and gradient rematerialization to optimize over a parametric family of fast samplers for diffusion models. LINEBREAK 2. we identify a parametric family of generalized gaussian diffusion model (ggdm) that admits LINEBREAK high-fidelity fast samplers for diffusion models. LINEBREAK 3. we show that using ddss to optimize samplers by minimizing the kernel inception distance LINEBREAK leads to fast diffusion model samplers with state-of-the-art sample quality scores. LINEBREAK background on denoising diffusion implicit models LINEBREAK we start with a brief review on ddpm (ho et al., 2020) and ddim (song et al., 2020). ddpms pre-specify a markovian forward diffusion process, which gradually adds noise to data in t steps. following the notation of ho et al. (2020), LINEBREAK q(x0, ..., xt ) = q(x0) LINEBREAK q(xt|xt−1) LINEBREAK q(xt|xt−1) = n (xt|(cid:112)1 − βtxs, βti), LINEBREAK where q(x0) is the data distribution, and βt is the variance of gaussian noise added at step t. to be able to gradually convert noise to data, ddpms learn to invert (1) with a model pθ(xt−1|xt), which LINEBREAK is trained by maximizing a (possibly reweighted) evidence lower bound (elbo): LINEBREAK eq LINEBREAK dkl[q(xt |x0)(cid:107)p(xt )] + LINEBREAK dkl[q(xt−1|xt, x0)(cid:107)pθ(xt−1|xt)] − log pθ(x0|x1) LINEBREAK ddpms specifically choose the model to be parametrized as LINEBREAK pθ(xt−1|xt) = q LINEBREAK xt, ˆx0 = LINEBREAK (xt − LINEBREAK = n LINEBREAK xt − LINEBREAK βt√ LINEBREAK (cid:15)θ(xt, t) LINEBREAK βtid LINEBREAK where ¯αt = (cid:81)t to minimizing a weighted sum of denoising score matching objectives (vincent, 2011). LINEBREAK s=1(1−βt) for each t. with this parametrization, maximizing the elbo is equivalent LINEBREAK the seminal work of song et al. (2020) presents denoising diffusion implicit models (ddim): a family of evidence lower bounds (elbos) with corresponding forward diffusion processes and samplers. all of these elbos share the same marginals as ddpm, but allow arbitrary choices of posterior variances. specifically, song et al. (2020) note that is it possible to construct alternative elbos with only a subsequence of the original timesteps s ⊂ {1, ..., t } that shares the same marginals as the construction above (i.e., qs(xt|x0) = q(xt|x0) for every t ∈ s, so qs defines a faster sampler compatible with the pre-trained model) by simply using the new contiguous timesteps in the equations above. they also show it is also possible to construct an infinite family of nonmarkovian processes {qσ : σ ∈ [0, 1]t −1} where each qσ also shares the same marginals as the original forward process with: LINEBREAK qσ(x0, ..., xt) = q(x0)q(xt |x0) LINEBREAK qσ(xt|xt+1, x0) LINEBREAK and where the posteriors are defined as (cid:12) (cid:12) (cid:12) (cid:12) LINEBREAK qσ(xt−1|xt, x0) = n LINEBREAK xt − √ LINEBREAK t id LINEBREAK song et al. (2020) empirically find that the extreme case of using all-zero variances (a.k.a. ddim(η = 0)) consistently helps with sample quality in the few-step regime. combined with a good selection of timesteps to evaluate the modeled score function (a.k.a. strides), ddim(η = 0) establishes the current state-of-the-art for few-step diffusion model sampling with the smallest inference step budgets. our key contribution that allows improving sample quality significantly by optimizing sampler families is constructing a family that generalizes ddim. see section 4 for a more complete treatment of our novel ggdm family. LINEBREAK differentiable diffusion sampler search (ddss) LINEBREAK we now describe ddss, our approach to search for fast high-fidelity samplers with a limited budget of k < t steps. our key observation is that one can backpropagate through the sampling process of a diffusion model via the reparamterization trick (kingma & welling, 2013). equipped with this, we can now use stochastic gradient descent to learn fast samplers by optimizing any given differentiable loss function over a minibatch of model samples. LINEBREAK we begin with a pre-trained ddpm and a family of k-step samplers that we wish to optimize for the given ddpm. we parametrize this family’s degrees of freedom as simple transformations of trainable variables. we experiment with the following families in this paper, but emphasize that ddss is applicable to any other family where model samples are differentiable with respect to the trainable variables: LINEBREAK • ddim: we parametrize the posterior variances with σt = LINEBREAK 1 − ¯αt−1 sigmoid(vt), where 1 − ¯αt−1 constant ensures real-valued mean coef LINEBREAK v1, ..., vk are trainable variables (the ficients; see the square root in equation 6). LINEBREAK figure 2: illustration of ggdm. to improve sample quality, our novel family of samplers combines information from all previous (noisier) images at every denoising step. LINEBREAK • vars: we parametrize the marginal variances of a ddpm as cumsum(softmax([v; 1]))t instead of fixing them to 1 − ¯αt. this ensures they are monotonically increasing with respect to t (appending a one to ensure k degrees of freedom). LINEBREAK • ggdm: a new family of non-markovian samplers for diffusion models with more degrees of freedom illustrated in figure 2 and defined in section 4. we parametrize µtu and σt of a ggdm for all t as sigmoid functions of trainable variables. LINEBREAK • ggdm +pred: we parametrize all the µtu and σt identically to ggdm, but also learn the marginal coefficients with a cumsum ◦ softmax parametrization (identical to vars) instead of computing them via theorem 1, as well as the coefficients that predict x0 from atxt − bt(cid:15) with 1 + softplus and softplus parametrizations. LINEBREAK • [family]+time: for any sampler family, we additionally parametrize the timesteps used to query the score model with a cumsum ◦ softmax parametrization (identical to vars). LINEBREAK as we will show in the experiments, despite the fact that our pre-trained ddpms are trained with discrete timesteps, learning the timesteps is still helpful. in principle, this should only be possible for ddpms trained with continuous time sampling (chen et al., 2021a; song et al., 2021b; kingma et al., 2021), but in practice we find that ddpms trained with continuously embedded discrete timesteps are still well-behaved when applied at timesteps not present during training. we think this is due to the regularity of the sinusoidal positional encodings vaswani et al. (2017) used in these model architectures and training with a sufficiently large number of timesteps t . LINEBREAK differentiable sample quality scores LINEBREAK we can differentiate through a stochastic sampler using the reparameterization trick, but the question of which objective to optimize still remains. prior work has shown that optimizing log-likelihood can actually worsen sample quality and fid scores in the few-step regime (watson et al., 2021; song et al., 2021a). thus, we instead design a perceptual loss which simply compares mean statistics between model samples and real samples in the neural network feature space. these types of objectives have been shown in prior work to better correlate with human perception of sample quality (johnson et al., 2016; heusel et al., 2017), which we also confirm in our experiments. LINEBREAK we rely on the representations of the penultimate layer of a pre-trained inceptionv3 classifier (szegedy et al., 2016) and optimize the kernel inception distance (kid) (bi´nkowski et al., 2018). let φ(x) denote the inception features of an image x and pψ represent a diffusion sampler with trainable parameters ψ. for a linear kernel, which works best in our experiments, the objective is: LINEBREAK l(ψ) = e LINEBREAK xp∼pψ LINEBREAK e p∼pψ LINEBREAK p) − e LINEBREAK xp∼pψ LINEBREAK e xq∼q LINEBREAK φ(xp)(cid:62)φ(xq) LINEBREAK more generally, kid can be expressed as: LINEBREAK lkid(ψ) = LINEBREAK f ∗(xp) − e e xq∼q xp∼pψ where f ∗(x) = ex(cid:48) q∼q(x0)kφ(x, x(cid:48) q) is the witness function for any differentiable, positive definite kernel k, and kφ(x, y) = k(φ(x), φ(y)). note that f ∗ attains the supremum of the mmd. to enable stochastic gradient descent, we use an unbiased estimator of kid using a minibatch of n model samples x(1) p LINEBREAK p∼pψ kφ(x, x(cid:48) LINEBREAK . . . x(n) LINEBREAK . . . x(n) LINEBREAK f ∗(xq) LINEBREAK q ∼ q: LINEBREAK i(cid:54)=j LINEBREAK p ∼ pψ and n real samples x(1) q n (cid:88) LINEBREAK kφ(x(i) LINEBREAK p , x(j) LINEBREAK q ) + c , LINEBREAK kφ(x(i) LINEBREAK p , x(j) LINEBREAK p ) − LINEBREAK where c is constant in ψ. since the sampling chain of any gaussian diffusion process admits using the reparametrization trick, our loss function is fully differentiable with respect to the trainable variables ψ. we empirically find that using the perceptual features is crucial; i.e., by trying φ(x) = x to compare images directly on pixel space rather than neural network feature space (as above), we observe that our method makes samples consistently worsen in apparent quality as training progresses. LINEBREAK gradient rematerialization LINEBREAK in order for backpropagation to be feasible under reasonable memory constraints, one final problem must be addressed: since we are taking gradients with respect to model samples, the cost in memory to maintain the state of the forward pass scales linearly with the number of inference steps, which can quickly become unfeasible considering the large size of typical ddpm architectures. to address this issue, we use gradient rematerialization (kumar et al., 2019b). instead of storing a particular computation’s output from the forward pass required by the backward pass computation, we recompute it on the fly. to trade o(k) memory cost for o(k) computation time, we simply rematerialize calls to the pre-trained ddpm (i.e., the estimated score function), but keep in memory all the progressively denoised images from the sampling chain. in jax (bradbury et al., 2018), this is trivial to implement by simply wrapping the score function calls with jax.remat. LINEBREAK generalized gaussian diffusion models LINEBREAK we now present generalized gaussian diffusion model (ggdm), our novel family of gaussian diffusion processes that includes ddim as a special case mentioned in section 3. we define a joint distribution with no independence assumptions LINEBREAK qµ,σ(x0, ..., xt ) = q(x0)q(xt |x0) LINEBREAK qµ,σ(xt|x>t, x0) LINEBREAK where the new factors are defined as LINEBREAK qµ,σ(xt|x>t, x0) = n LINEBREAK xt LINEBREAK µtuxu, σ2 LINEBREAK t id LINEBREAK u∈st LINEBREAK (letting st = {0, ..., t } \ {1, ..., t} for notation compactness), with σt and µtu free parameters ∀t ∈ {1, ..., t }, u ∈ st. in other words, when predicting the next, less noisy image, the sampler can take into account all the previous, noisier images in the sampling chain, and similarly to ddim, we can also control the sampler’s variances. as we prove in the appendix (a.2), this construction admits gaussian marginals, and we can differentiably compute the marginal coefficients from arbitrary choices of µ and σ: theorem 1. given some t ∈ {1, ..., t }, let a(1) i ∈ {1, ..., t − t}, recursively define t,t+iµt+i,u + a(i) tu = a(i) a(i+1) LINEBREAK tu = µtu ∀u ∈ st and v(1) LINEBREAK tu ∀u ∈ st+i LINEBREAK a(i) t,t+iσt+i LINEBREAK t . for each LINEBREAK v(i+1) t LINEBREAK = v(i) LINEBREAK t + LINEBREAK and LINEBREAK then, it follows that LINEBREAK qµ,σ(xt|x>t+i, x0) = n LINEBREAK xt LINEBREAK tu xu, v(i+1) a(i+1) LINEBREAK t LINEBREAK id LINEBREAK u∈st+i LINEBREAK in other words, instead of letting the βt (or equivalently, the ¯αt) define the forward process as done by a usual ddpm, the ggdm family lets the µtu and σt define the process. in particular, an immediate corollary of theorem 1 is that the marginal coefficients are given by LINEBREAK qµ,σ(xt|x0) = n LINEBREAK xt LINEBREAK x0, v(t −t+1) t LINEBREAK id LINEBREAK the reverse process is thus defined as p(xt ) (cid:81)t LINEBREAK t=1 p(xt−1|xt) with p(xt ) ∼ n (0, id)) and LINEBREAK pθ(xt|x>t) = qµ,σ LINEBREAK xt|x>t, ˆx0 = LINEBREAK (cid:15)θ(xt, t) LINEBREAK xt − LINEBREAK v(t −t+1) t LINEBREAK table 1: fid and is scores for ddss against baseline methods for a ddpm trained on cifar10 with the lsimple objective proposed by (ho et al., 2020). fid scores (lower is better) are the numbers at the left of each entry, and is scores (higher is better) are at the right. LINEBREAK sampler \ k ddpm (linear stride) ddpm (quadratic stride) ddim (linear stride) ddim (quadratic stride) ggdm +pred+time LINEBREAK sampler \ k ddpm (linear stride) ddpm (quadratic stride) ddim (linear stride) ddim (quadratic stride) ggdm +pred+time LINEBREAK ignoring the matching marginals condition
| 5
|
[
132.15924,
458.1650784,
348.8324607,
468.1276784
] |
5OygDd-4Eeh.pdf
| 2,023
| 2
|
LINEBREAK an additive instance-wise approach to multiclass model interpretation LINEBREAK vy vo1 van nguyen1 trung le1 quan hung tran2 gholamreza haffari1 seyit camtepe3 dinh phung1,4 1monash university, australia 2adobe research, usa 3csiro’s data61, australia 4vinai research, vietnam LINEBREAK abstract LINEBREAK interpretable machine learning offers insights into what factors drive a certain prediction of a black-box system. a large number of interpreting methods focus on identifying explanatory input features, which generally fall into two main categories: attribution and selection. a popular attribution-based approach is to exploit local neighborhoods for learning instance-specific explainers in an additive manner. the process is thus inefficient and susceptible to poorly-conditioned samples. meanwhile, many selection-based methods directly optimize local feature distributions in an instance-wise training framework, thereby being capable of leveraging global information from other inputs. however, they can only interpret single-class predictions and many suffer from inconsistency across different settings, due to a strict reliance on a pre-defined number of features selected. this work exploits the strengths of both methods and proposes a framework for learning local explanations simultaneously for multiple target classes. our model explainer significantly outperforms additive and instance-wise counterparts on faithfulness with more compact and comprehensible explanations. we also demonstrate the capacity to select stable and important features through extensive experiments on various data sets and black-box model architectures. LINEBREAK introduction LINEBREAK black-box machine learning systems enjoy a remarkable predictive performance at the cost of interpretability. this trade-off has motivated a number of interpreting approaches for explaining the behavior of these complex models. such explanations are particularly useful for high-stakes applications such as healthcare (caruana et al., 2015; rich, 2016), cybersecurity (nguyen et al., 2021) or criminal investigation (lipton, 2018). while model interpretation can be done in various ways (mothilal et al., 2020; bodria et al., 2021), our discussion will focus on feature importance or saliency-based approach - that is, to assign relative importance weights to individual features w.r.t the model’s prediction on an input example. features here refer to input components interpretable to humans; for high-dimensional data such as texts or images, features can be a bag of words/phrases or a group of pixels/super-pixels (ribeiro et al., 2016). explanations are generally made by selecting top k features with the highest weights, signifying k most important features to a black-box’s decision. note that this work tackles feature selection locally for an input data point, instead of generating global explanations for an entire dataset. LINEBREAK an abundance of interpreting works follows the removal-based explanation approach (covert et al., 2021), which quantifies the importance of features by removing them from the model. based on how feature influence is summarized into an explanation, methods in this line of works can be broadly categorized as feature attribution and feature selection. in general, attribution methods produce relative importance scores to each feature, whereas selection methods directly identify the subset of features most relevant to the model behavior being explained. one popular approach to learn attribution is through an additive model (ribeiro et al., 2016; zafar & khan, 2019; zhao et al., 2021). the underlying principle is originally proposed by lime (ribeiro et al., 2016) which LINEBREAK learns a regularized linear model for each input example wherein each coefficient represents feature importance scores. lime explainer takes the form of a linear model w.z where z denotes neighboring examples sampled heuristically around the input 1. though highly interpretable themselves, additive methods are inefficient since they optimize individual explainers for every input. as opposed to the instance-specific nature of the additive model, most of the feature selection methods are developed instance-wisely (chen et al., 2018; bang et al., 2021; yoon et al., 2019; jethani et al., 2021a). instance-wise frameworks entail global training of a model approximating the local distributions over subsets of input features. post-hoc explanations can thus be obtained simultaneously for multiple instances. LINEBREAK contributions. in this work, we propose a novel strategy integrating both approaches into an additive instance-wise framework that simultaneously tackles all issues discussed above. the framework consists of 2 main components: an explainer and a feature selector. the explainer first learns the local attributions of features across the space of the response variable via a multi-class explanation module denoted as w . this module interacts with the input vector in an additive manner forming a linear classifier locally approximating the black-box decision. to support the learning of local explanations, the feature selector constructs local distributions that can generate high-quality neighboring samples on which the explainer can be trained effectively. both components are jointly optimized via backpropagation. unlike such works as (chen et al., 2018; bang et al., 2021) that are sensitive to the choice of k as a hyper-parameter, our learning process eliminates this reliance (see appendix g for a detailed analysis on why this is necessary). LINEBREAK our contributions are summarized as follows LINEBREAK • we introduce aim - an additive instance-wise approach to multi-class model interpretation. our model explainer inherits merits from both families of methods: model-agnosticism, flexibility while supporting efficient interpretation for multiple decision classes. to the best of our knowledge, we are the first to integrate additive and instance-wise approaches into an end-to-end amortized framework that produces such a multi-class explanation facility. LINEBREAK • our model explainer is shown to produce remarkably faithful explanations of high quality and compactness. through quantitative and human assessment results, we achieve superior performance over the baselines on different datasets and architectures of the black-box model. LINEBREAK related work LINEBREAK early interpreting methods are gradient-based in which gradient values are used to estimate attribution scores, which quantifies how much a change in an input feature affects the black-box’s prediction in infinitesimal regions around the input. it originally involves back-propagation for calculating the gradients of the output neuron w.r.t the input features (simonyan et al., 2014). this early approach however suffers from vanishing gradients during the backward pass through relu layers that can downgrade important features. several methods are proposed to improve the propagation rule (bach et al., 2015; springenberg et al., 2014; shrikumar et al., 2017; sundararajan et al., 2017). since explanations based on raw gradients tend to be noisy highlighting meaningless variations, a refined approach is sampling-based gradient, in which sampling is done according to a prior distribution for computing the gradients of probability baehrens et al. (2010) or expectation function (smilkov et al., 2017; adebayo et al., 2018). functional information (fi) (gat et al., 2022) is the state-of-the-art in this line of research applying functional entropy to compute feature attributions. fi is shown to work on auditory, visual and textual modalities, whereas most of the previous gradient-based methods are solely applicable to images. LINEBREAK a burgeoning body of works in recent years can be broadly categorized as removal-based explanation (covert et al., 2021). common removal techniques include replacing feature values with neutral or user-defined values such as zero or gaussian noises (zeiler & fergus, 2014; dabkowski & gal, 2017; fong & vedaldi, 2017; petsiuk et al., 2018; fong et al., 2019), marginalization of distributions over input features (lundberg & lee, 2017; covert et al., 2020; datta et al., 2016), or substituting held-out feature values with samples from the same distribution (ribeiro et al., 2016). the output explanations are often either attribution-based or selection-based. in addition to additive models LINEBREAK 1z is a binary representation vector of an input indicating the presence/absence of features. the dot-product operation is equivalent to summing up feature weights given by the weight vector w, giving rise to additivity. LINEBREAK that estimate feature important via the coefficients of the linear model, feature attributions can be calculated using shapley values (datta et al., 2016; lundberg & lee, 2017; covert et al., 2020) or directly obtained by measuring the changes in the predictive probabilities or prediction losses when adding or excluding certain features (zeiler & fergus, 2014; schwab & karlen, 2019). on the other hand, selection-based works straightforwardly determine which subset of features are important or unimportant to the model behavior under analysis (chen et al., 2018; yoon et al., 2019; bang et al., 2021; jethani et al., 2021a; nguyen et al., 2021; 2022). explanations are made by either selecting features with the highest logit scores obtained from the learned feature distribution, or specifying a threshold between 0 and 1 to decide on the most probable features. most selection methods adopt amortized optimization, thus post-hoc inference of features for multiple inputs can be done very efficiently. in contrast, attribution-based approaches are mostly less efficient since they process input examples individually. there have been methods focusing on improving the computational cost of these models (dabkowski & gal, 2017; schwab & karlen, 2019; jethani et al., 2021b). LINEBREAK recently, there is an emerging interest in integrating the instance-wise property into an additive framework to better exploit global information. for a given input, plumb et al. (2018); yoon et al. (2022) in particular learn a surrogate model assigning weights to training examples such that those more similar or relevant to the input are given higher weights. a locally interpretable model (that is often lime-based) is subsequently trained on these samples to return feature attributions. agarwal et al. (2021) further proposes a neural additive framework that constructs an explainer in a form of a linear combination of neural networks. despite their potential, these methods have only been reported to work on tabular data. LINEBREAK proposed method LINEBREAK problem setup LINEBREAK in the scope of this paper, we limit the current discussion to classification problems. consider a data set of pairs (x, y ) where x ∼ px (·) is the input random variable and y is characterized by the conditional distribution pm(y | x) obtained as the predictions of a pre-trained black-box classifier for the response variable. the notation m stands for model, indicating the predictive distribution of the black-box model, to be differentiated from the ground-truth distribution. we denote x ∈ rd as an input realization with d interpretable features and predicted label y = c ∈ {1, ..., c}. given an input x, we obtain the hard prediction from the black-box model as ym = argmaxc pm(y = c | x = x). while earlier methods generate a single d−dimensional weight vector wx assigning the importance weights to each feature, we define an explainer e : rd (cid:55)→ rd×c mapping an input x to a weight matrix wx ∈ rd×c with the entry w i,j x representing the relative weights of the ith feature of x to the predicted label j ∈ {1, ..., c}. LINEBREAK e(x) = wx. LINEBREAK given a training batch, lime (ribeiro et al., 2016) in particular trains separate explainers for every input, thus cannot take advantage of the global information from the entire dataset. in line with the instance-wise motivation, our explainer e is trained globally over all training examples to produce local explanations with respect to individual inputs simultaneously, which also seeks to effectively enable global behavior (e.g., two similar instances should have similar explanations). as e is expected to be locally faithful to the black-box model, we optimize e on the local neighborhood around the input x. this region is constructed via a feature selection module. we now explain how this is done. LINEBREAK training objectives
| 2
|
[
108.249,
163.1990784,
231.1357361,
173.1616784
] |
6Q52pZ-Th7N.pdf
| 2,022
| 2
|
LINEBREAK pseudo-labeled auto-curriculum learning for semi-supervised keypoint localization LINEBREAK can wang1 LINEBREAK sheng jin2,1 yingda guan1 wentao liu1∗ chen qian1 LINEBREAK ping luo2 wanli ouyang3 LINEBREAK 1sensetime research and tetras.ai {wangcan, jinsheng}@tetras.ai LINEBREAK 2the university of hong kong {guanyingda, liuwentao, qianchen}@sensetime.com LINEBREAK 3the university of sydney LINEBREAK [email protected] LINEBREAK [email protected] LINEBREAK abstract LINEBREAK localizing keypoints of an object is a basic visual problem. however, supervised learning of a keypoint localization network often requires a large amount of data, which is expensive and time-consuming to obtain. to remedy this, there is an ever-growing interest in semi-supervised learning (ssl), which leverages a small set of labeled data along with a large set of unlabeled data. among these ssl approaches, pseudo-labeling (pl) is one of the most popular. pl approaches apply pseudo-labels to unlabeled data, and then train the model with a combination of the labeled and pseudo-labeled data iteratively. the key to the success of pl is the selection of high-quality pseudo-labeled samples. previous works mostly select training samples by manually setting a single confidence threshold. we propose to automatically select reliable pseudo-labeled samples with a series of dynamic thresholds, which constitutes a learning curriculum. extensive experiments on six keypoint localization benchmark datasets demonstrate that the proposed approach significantly outperforms the previous state-of-the-art ssl approaches. LINEBREAK introduction LINEBREAK keypoints (also termed as landmarks) are a popular representation of objects that precisely represent locations of object parts and contain concise information about shapes and poses. example keypoints are ”right shoulder” on a human body or the ”tail tip” of a cat. keypoint localization is the basis of many visual tasks, including action recognition (yan et al., 2018), fine-grained classification (gavves et al., 2013; 2015), pose tracking (jin et al., 2017; 2019) and re-identification (zhao et al., 2017). LINEBREAK keypoint localization has achieved great success with the advent of deep learning in recent years (newell et al., 2016; xiao et al., 2018; duan et al., 2019; sun et al., 2019; jin et al., 2020a; xu et al., 2021; geng et al., 2021; li et al., 2021b). however, the success of deep networks relies on vast amounts of labeled data, which is often expensive and time-consuming to collect. semi-supervised learning (ssl) is one of the most important approaches for solving this problem. it leverages extensive amounts of unlabeled data in addition to sparsely labeled data to obtain gains in performance. pseudo-labeling (pl) has become one of the most popular ssl approaches due to its simplicity. pl-based methods iteratively add unlabeled samples into the training data by pseudo-labeling them with a model trained on a combination of labeled and pseudo-labeled samples. LINEBREAK pl-based methods commonly require a predefined handpicked threshold (lee et al., 2013; oliver et al., 2018), to filter out low-confidence noisy predictions. however, a single fixed threshold does not take into account the dynamic capacity of the current model for handling noisy pseudo-labels, leading to sub-optimal performance. in this work, we borrow ideas from curriculum learning (cl) (bengio et al., 2009) and design our curriculum as a series of thresholds for pl, which is tuned according to the feedback from the model. cl is a widely used strategy to control the model training pace by selecting from easier to harder samples. with a carefully designed curriculum, noticeable improvement is obtained. however, traditional cl methods suffer from hand-designed curricula, which heavily rely on expertise and detailed analysis for specific domains. manual cur LINEBREAK ∗corresponding author. LINEBREAK riculum design based on handcrafted criteria is always tedious and sub-optimal. moreover, curriculum design (or threshold setting) is complicated. high-confidence pseudo-labels typically correspond to easier samples with clean labels, while low-confidence pseudo-labels correspond to harder samples with noisy labels. how to design a curriculum to balance the correctness, representativeness, and difficulty of pseudo-labeled data is an open problem. this paper is devoted to tackling the aforementioned problem, i.e. how to automatically learn an optimal learning curriculum for pseudo-labeling in a data-driven way. to this end, we propose a novel method, called pseudolabeled auto-curriculum learning (placl). placl formulates the curriculum design problem as a decision-making problem and leverages the reinforcement learning (rl) framework to solve it. LINEBREAK additionally, pl-based methods suffer from confirmation bias (tarvainen & valpola, 2017), also known as noise accumulation (zhang et al., 2016), and concept drift (cascante-bonilla et al., 2021). this long-standing issue stems from the use of noisy or incorrect pseudo-labels in subsequent training stages. as a consequence, the noise accumulates and the performance degrades as the learning process evolves over time. to mitigate this problem, we propose the cross-training strategy which alternatively performs pseudo-label prediction and model training on separate sub-datasets. LINEBREAK we benchmark placl on six keypoint localization datasets, including lspet (johnson & everingham, 2011), mpii (andriluka et al., 2014), cub-200-2011 (welinder et al., 2010), atrw (li et al., 2019c), ms-coco (lin et al., 2014), and animalpose (cao et al., 2019). we empirically show that placl is general and can be applied to various keypoint localization tasks (human and animal pose estimation) and different keypoint localization networks. with a simple yet effective search paradigm, our method significantly boosts the keypoint estimation performance and achieves superior performance to other ssl methods. we hope our method will inspire the community to rethink the potential of pl-based methods for semi-supervised keypoint localization. LINEBREAK our main contributions can be summarized as follows: LINEBREAK • we propose pseudo-labeled auto-curriculum learning (placl). it is an an automatic pseudo-labeled data selection method, which learns a series of dynamic thresholds (or curriculum) via reinforcement learning. to the best of our knowledge, this is the first work that explores automatic curriculum learning for semi-supervised keypoint localization. LINEBREAK • we propose the cross-training strategy for pseudo-labeling to mitigate the long-standing LINEBREAK problem of confirmation bias. LINEBREAK • extensive experiments on a wide range of popular datasets demonstrate the superiority of placl over the previous state-of-the-art ssl approaches. in addition, placl is modelagnostic and can be easily applied to different keypoint localization networks. LINEBREAK related works LINEBREAK semi-supervised keypoint localization LINEBREAK keypoint localization focuses on predicting the keypoints of detected objects, e.g. human body parts (li et al., 2019b; jin et al., 2020b), facial landmarks (bulat & tzimiropoulos, 2017), hand keypoints (zimmermann & brox, 2017) and animal poses (cao et al., 2019). however, training a keypoint localization model often requires a large amount of data, which is expensive and timeconsuming to collect. semi-supervised keypoint localization is one of the most promising ways to solve this problem. semi-supervised keypoint localization can be categorized into consistency regularization based methods and pseudo-labeling based methods. consistency regularization methods (honari et al., 2018; moskvyak et al., 2020) assume that the output of the model should not be invariant to realistic perturbations. these approaches typically rely on modality-specific augmentation techniques for regularization. pseudo-labeling methods (ukita & uematsu, 2018; dong & yang, 2019; cao et al., 2019; li & lee, 2021) use labeled data to predict the labels of the unlabeled data, and then train the model in a supervised way with a combination of labeled and selected pseudo-labeled data. our approach also builds upon pseudo-labeling methods. in contrast to previous works, we propose to learn pseudo-labeled data selection via reinforcement learning. LINEBREAK curriculum learning LINEBREAK curriculum learning is firstly introduced by bengio et al. (2009). it is a training strategy that trains machine learning models from easy to complex samples, imitating human education. the curriculum is often pre-determined by heuristics (khan et al., 2011; bengio et al., 2009; spitkovsky et al., 2009). however, it requires expert domain knowledge and exhaustive trials to find a good curriculum suitable for a specific task and its dataset. recently, automatic curriculum learning methods are introduced to break through these limits. popular ones include self-paced learning methods (kumar et al., 2010; jiang et al., 2014; zhao et al., 2015) and reinforcement learning (rl) based methods (graves et al., 2017; matiisen et al., 2019; fan et al., 2018). our approach can be categorized as rl-based methods. unlike previous works that focus on supervised learning, our approach is designed for the ssl paradigm. our work is mostly related to curriculum labeling (cascante-bonilla et al., 2021). it adopts a hand-crafted curriculum based on extreme value theory (evt) to facilitate model training. in contrast, we propose an automatic curriculum learning approach by searching for dynamic thresholds for pseudo-labeling. in addition, the curriculum of (cascante-bonilla et al., 2021) is coarse-grained on the round level, while our curriculum is fine-grained on the epoch level. LINEBREAK reinforcement learning for automl LINEBREAK reinforcement learning (rl) has shown impressive results in a range of applications. well-known examples include game playing (mnih et al., 2015; silver et al., 2016; 2017) and robotics control(schulman et al., 2015; lillicrap et al., 2016). recent works have employed rl to the automl, automating the design of a machine learning system, e.g. searching for neural architectures (zoph & le, 2017; zoph et al., 2018; baker et al., 2017; pham et al., 2018), augmentation policies (cubuk et al., 2019), activation functions (ramachandran et al., 2017), loss functions (li et al., 2019a; 2021a), and training hyperparameters (dong et al., 2020). in contrast to these works, we apply rl to the automatic selection of pseudo-labeled data in the context of pseudo-labeling. LINEBREAK pseudo-labeled auto-curriculum learning (placl) LINEBREAK overview
| 2
|
[
108.249,
356.7030784,
178.45549,
366.6656784
] |
H-iABMvzIc.pdf
| 2,022
| 2
|
LINEBREAK switch to generalize: domain-switch learning for cross-domain few-shot classification LINEBREAK zhengdong hu1,2∗, yifan sun2, yi yang3 † 1 state key laboratory of industrial control technology, zhejiang university 2 baidu research, china 3 ccai, college of computer science and technology, zhejiang university {zhengdonghu,yangyics}@zju.edu.cn, [email protected] LINEBREAK abstract LINEBREAK this paper considers few-shot learning under the cross-domain scenario. the cross-domain setting imposes a critical challenge, i.e., using very few (support) samples to generalize the already-learned model to a novel domain. we hold a hypothesis, i.e., if a deep model is capable to fast generalize itself to different domains (using very few samples) during training, it will maintain such domain generalization capacity for testing. it motivates us to propose a novel domainswitch learning (dsl) framework. dsl embeds the cross-domain scenario into the training stage in a “fast switching” manner. specifically, dsl uses a single domain for a training iteration and switches into another domain for the following iteration. during the switching, dsl enforces two constraints: 1) the deep model should not over-fit the domain in the current iteration and 2) the deep model should not forget the already-learned knowledge of other domains. these two constraints jointly promote fast generalization across different domains. experimental results confirm that the cross-domain generalization capacity can be inherited from the training stage to the testing stage, validating our key hypothesis. consequentially, dsl significantly improves cross-domain few-shot classification and sets up new state of the art. LINEBREAK introduction LINEBREAK this paper challenges a realistic problem, i.e., the cross-domain scenario, for few-shot learning. basically, the few-shot learning task uses a classifier learned on the training set to recognize novel classes with very few support samples. in real-world applications, there is usually a domain gap between the training samples and the support samples tseng et al. (2020); guo et al. (2020); chen et al. (2019). the domain gap further imposes a critical challenge: since the support samples are very rare, they do not suffice for mitigating the domain gap between the support set (for novel classes) and the training set. consequentially, the domain gap significantly compromises the recognition accuracy of the novel classes. therefore, learning a model with strong cross-modality generalization capacity is important for cross-domain few-shot learning tseng et al. (2020). LINEBREAK we argue that we may enhance the desired cross-modality generalization by “learning-togeneralize”. to be more specific, we hold a hypothesis / intuition that if a deep model learns to fast generalize itself to different domains (using very few samples) during training, it will maintain the good domain generalization capacity for testing. LINEBREAK we model our intuition into a novel domain-switch learning (dsl) framework, as illustrated in fig. 1. dsl uses multiple (m > 1) domains to construct cross-domain training scenario in a “fast switching” manner. instead of simply mixing all the domains to construct a mini-batch (fig. 1 (a)), dsl includes only a single domain into every training iteration and switches to another domain for the following iteration (fig. 1 (b)). moreover, each iteration contains very few samples per category, so as to imitate the few-shot setting. therefore, after every switch, the deep model crosses into a domain different from the former one, yielding the cross-domain few-shot scenario. LINEBREAK ∗zhengdong hu makes his part of work during internship in baidu research. †corresponding author. LINEBREAK figure 1: the comparison between domain-switch learning (dsl) and a domain-mix pipeline. (a) mixes up all the m domains in each training iteration. the deep model memorizes all the domainspecific knowledge (apart from the domain-general knowledge), which hinders cross-domain generalization. (b) dsl includes only a single domain into a training iteration and switches to another domain for the following iteration. since the domain-specific knowledge does not fit other domains, the deep model is prone to discarding the domain-specific knowledge when switching to another domain. we note that in our experiments, we use multiple relatively small datasets ( e.g. cub welinder et al. (2010), cars krause et al. (2013), places zhou et al. (2018), and plantae horn et al. (2018) ) as the switchable domains while using mini-imagenet as a basic training set which appears in each iteration. LINEBREAK an important advantage of this domain-switch learning manner is that it can suppress learning from domain-specific knowledge, as illustrated in fig. 1. specifically, we consider each domain contains both domain-general and domain-specific knowledge. if we mix all the domains for each training iteration (fig. 1 (a)), the deep model may memorize all the domain-specific knowledge, as well as the domain-general knowledge. consequentially, during testing, the domain-specific knowledge hinders generalization towards the novel domain and thus compromises few-shot classification accuracy. in contrast, in dsl (fig. 1 (b)), the model only learns from one single domain in an iteration. since the domain-specific knowledge of the current domain does not fit the following domain, the deep model is prone to discarding these domain-specific knowledge during the following iteration. LINEBREAK to further promote cross-domain generalization in this domain-switch learning scheme, dsl enforces two constraints as follows: LINEBREAK 1) the deep model should not over-fit the domain in the current iteration, because over-fitting the current domain makes the model memorize much of the domain-specific knowledge. the first constraint is implemented with a domain-specific prompter module (consisted of multiple prompters). after the model learns from the i-th training domain di and gets updated, its prediction accuracy on di increases and is relatively high. we store this edition of model as the prompter for di. next time before the training domain switches to di again, the model just gets updated from di−1 and becomes relatively inaccurate on di. given the accurate prompter and the inaccurate learner (w.r.t. di), we average their prediction for supervision so that the penalty on the learner will be suppressed. the details are to be accessed in section 3.3. LINEBREAK 2) the deep model should not forget the already-learned knowledge of former domains, so that next time the model crosses into these domains again, it can directly re-use the corresponding knowledge for prediction. the second constraint is implemented with a domain-general teacher module. specifically, we collect several historical models and average their parameters to get a mean model. during training, we use the softmax prediction of the mean model as the auxiliary supervising signals for the learner (apart from the ground truth label). the mean model serves as a teacher distilling the already-learned knowledge of former domains to the learner. since this teacher has no obvious bias towards any single domain, we name it as a domain-general teacher. the details of the domaingeneral teacher module are to be accessed in section 3.4. LINEBREAK these two constraints achieve complementary benefits for dsl, and jointly reinforce the crossdomain generalization. extensive experiments under four cross-domain scenarios show that dsl consistently improves cross-domain few-shot learning and achieves performance on par with the state-of-the-art methods. LINEBREAK our main contributions are summarized as follows: LINEBREAK • we propose a novel domain-switch learning (dsl) framework for cross-domain few-shot learning. dsl uses multiple domains for training and switches the domain in consecutive training iterations. it provides a cross-domain learning scenario where the deep model learns to generalize across different domains. LINEBREAK • under the dsl framework, we integrate two modules, i.e., the domain-specific prompter and the domain-general teacher. these two modules achieve complementary benefits for dsl and jointly reinforce the cross-domain generalization. LINEBREAK • we conduct extensive experiments to validate the effectiveness of the proposed dsl. experimental results confirm that the fast generalization capacity can be inherited from training to testing and thus improves cross-domain few-shot classification. on all the four popular benchmarks, dsl achieves performance on par with the state of the art. LINEBREAK related works LINEBREAK few-shot learning. few shot learning methods could be roughly categorized into two branches: meta-learning and fine-tuning methods. some meta-learningsatorras & estrach (2018); mishra et al. (2018); ren et al. (2018); snell et al. (2017); sung et al. (2018); vinyals et al. (2016) methods map the few-shot samples into a non-linear embedding space and evaluate the similarity between support samples and the query samples. recently, fine-tuning methods chen et al. (2019); tian et al. (2020); afrasiyabi et al. (2020) propose to pre-train the model on the training set (typically in a classification learning approach), and fine-tune the classifier on the novel classes. the finetuning methods achieve competitive performance compared with the state-of-the-art meta-learning methods. this work considers the few-shot learning task under the cross-domain scenario and adopts the fine-tuning pipeline as the baseline. LINEBREAK domain generalization and adaptation may be viewed as two closely related concepts. domain adaptation uses abundant (unlabeled) samples to adapt the already-learned model from the source domain to the target domain ganin & lempitsky (2015); tzeng et al. (2017); long et al. (2017; 2015; 2016); tzeng et al. (2014). in contrast, domain generalization aims to generalize the knowledge from multiple source domains to the target domain without learning any samples of the target domain during the training stage balaji et al. (2018); li et al. (2018). in cross-domain fewshot learning, there is a domain gap between the training set and the testing set. to promote the cross-domain generalization, tseng et al. (2020) considers the challenge is more of a domain generalization problem than a domain adaptation problem. this consideration is reasonable because the support samples are very rare and do thus not suffice for a typical domain adaptation. LINEBREAK from the viewpoint of domain generalization, fwt tseng et al. (2020) proposes to simulate the cross-domain scenario to improve the domain generalization capacity. it indeed inspires us of the multi-domain training strategy. in spite of sharing the multi-domain training strategy, dsl significantly differs from fwt: first, fwt uses changes the training domain epoch-by-epoch. it does not rely on fast switching for better generalization. in contrast, dsl is featured for the novel fast switching manner and finds that this manner promotes learning domain-general knowledge. second, dsl further considers two constraints in multi-domain training strategy, i.e., the deep model should not over-fit every single domain and keep recognition on learned knowledge shared with other domains. finally, dsl achieves superior cross-domain effect than fwt (section 4.2). LINEBREAK catastrophic forgetting. catastrophic forgetting plays an important role in the mechanism of dsl. when the deep model is trained sequentially on multiple tasks (domains), there is a tendency that the knowledge learned on former tasks (domains) is abruptly lost, yielding the so-called catastrophic forgetting kirkpatrick et al. (2017); mccloskey & cohen (1989); french (1999). LINEBREAK in dsl, when the deep model switches from a domain to another, it forgets much of the knowledge on the former domain, due to catastrophic forgetting. forgetting the domain-specific knowledge is LINEBREAK beneficial, while forgetting the domain-general knowledge is harmful. in response, next time the deep model comes across the former domain again, we 1) supplement it with the corresponding knowledge with a domain-specific prompter to prevent over-fitting the domain-specific knowledge and 2) use a domain-general teacher to reinforce the common knowledge shared among all the former domains. in a word, in its mechanism, dsl actually utilizes catastrophic forgetting to improve cross-domain generalization. LINEBREAK methods LINEBREAK preliminaries LINEBREAK in the cross-domain few-shot learning task, there is a significant domain gap between the training set and the testing set. the testing set consists the support set and query set, which are sampled from the same novel categories (which are unseen in the training set). the support set provides very few labeled samples for recognizing the unlabeled samples in the query. concretely, the support set contains c classes and each class has k samples, which is a c-way k-shot setup in few-shot learning. LINEBREAK our work is based on a popular fine-tuning pipeline chen et al. (2019); tian et al. (2020); afrasiyabi et al. (2020). the fine-tuning baseline uses the training set d to learn a deep model consisted of a feature encoder f and a feature classifier y . f is parameterized with θ and y is parameterized with a weight matrix w . during training, given a sample x, the feature encoder first maps x into a feature f (x; θ) ∈ rd. then the feature classifier y predicts the softmax probability of x belonging to each training category as p (i|x; θ, w ) = exp(wt i f (x;θ)) j f (x;θ)) (wi is the weight vector j exp(wt for the i-th category). the training is supervised with a popular classification loss function, i.e., the cross-entropy loss, which is formulated as: LINEBREAK lce(x) = − log(p (y|x; θ, w )) = − log LINEBREAK exp(wt j exp(wt LINEBREAK y f (x;θ)) j f (x;θ)) , LINEBREAK where y is the label for x, wy is the weight vector corresponding to the ground-truth category. LINEBREAK during the testing stage, we replace the feature classifier y with a new linear classifier l. l is a c-way classifier, corresponding to the total number of classes in the support set. we freeze the parameters of the feature encoder f and fine-tune the parameters of l with samples from the support set. finally, we use the feature encoder f and the learned l as the predictor for the query. LINEBREAK this paper focuses on the training stage, i.e., learning the feature encoder f and the classifier y on the training set. LINEBREAK overview of domain-switch learning LINEBREAK domain-switch learning (dsl) employs m datasets to construct the training set, i.e., d = {d1, d2, ..., dm }. di is an individual domain, which may be selected from some popular fewshot datasets, e.g., cub welinder et al. (2010), cars krause et al. (2013), places zhou et al. (2018), plantae horn et al. (2018). these switchable training sets are relatively small, and does not suffice for learning a discriminative feature encoder. therefore, following tseng et al. (2020), we employ a relatively large-scale dataset mini-imagenet deng et al. (2009) as a “basic” training set. during training, each mini-batch actually contains samples from the basic mini-imagenet and a switchable training set di. we note that such implementation does not contradict our motivation of using a single domain for each training iteration, because we may view the mixture of mini-imagenet and a di as a single “compound” domain. LINEBREAK during training, dsl uses samples from a single switchable domain di (and the mini-imagenet) for each iteration, as illustrated in fig. 2. since mini-imagenet appears for every iteration, we omit it in fig. 2 for simplicity. the domain-switching process is formulated as: LINEBREAK bj ← di | di ∈ d; i = j − (cid:98) LINEBREAK j m LINEBREAK where bj is the training batch at the j-th iteration, di is the i-th domain, (cid:98)·(cid:99) is the rounding down operation. we define a enumeration of all the m domains as a switching round. LINEBREAK figure 2: the overview of domain-switch learning. dsl uses a single domain for a training iteration and switches to another domain for the following iteration. during the current iteration (the red area), dsl uses a domain-specific prompter and a domain-general teacher to assist the learner. the prompter prevents the learner from over-fitting the domain-specific knowledge of the current domain using a re-weighted cross-entropy loss (section 3.3). the teacher helps the learner to memorize the domain-general knowledge shared among former domains using a novel binary kullback-leibler divergence loss (section 3.4). LINEBREAK in order to further improve the cross-domain generalization in the above “fast switching”, dsl enforces two constraints: 1) the deep model should not over-fit the domain in the current iteration and 2) the deep model should not forget the knowledge of other domains. these two constraints are implemented with a domain-specific prompter (section.3.3) and a domain-general teacher (section.3.4) module, respectively. LINEBREAK domain-specific prompter LINEBREAK definition of the prompter: let us consider in the j-th iteration, the model has already learned from di and gets updated. we store this edition of model as the prompter for the (j + m )-th iteration (when the learner is to learn from di again), as illustrated in fig. 2. the prompter aims to prevent the learner from over-fitting the current domain di. LINEBREAK given a sample x in current domain, dsl averages the softmax prediction of the prompter (p (y|x; θp , w p ), where the upper-script p denotes the prompter) and the softmax prediction of the learner (p (y|x; θ, w )), which is formulated as: LINEBREAK ˆp = LINEBREAK (cid:40) λp (y|x; θ, w ) + (1 − λ)p (y|x; θp , w p ), arg max LINEBREAK p (i|x, θp , w p ) = y LINEBREAK p (y|x; θ, w ), LINEBREAK i otherwise LINEBREAK where λ is a hyper-parameter. the condition arg max LINEBREAK p (i|x; θp , w p ) = y is to ensure the LINEBREAK prompter makes the correct prediction. with the re-weighted softmax prediction ˆp , the cross-entropy loss for supervising the classification is transformed into a re-weighted cross-entropy loss (rce loss in fig. 2): LINEBREAK i LINEBREAK lrce = − log( ˆp) LINEBREAK we explain how the domain-specific prompter prevents the learner from over-fitting the current domain with two following remarks (remark1 and remark2). LINEBREAK remark1: compared with the learner, the prompter has relatively higher predicted probability on the ground-truth category, i.e., p (y|x; θp , w p ) ≥ p (y|x; θ, w ). LINEBREAK figure 3: analysis on the predictions of prompter and teacher. “d1(∗)” indicates that the current (a) the prompter fits d1 better than the learner before the learner gets training domain is d1. updated on d1. (b) the teacher memorizes the general knowledge from all the domains and thus fits the former domains (e.g., d2, d3) better, while the learner fits better d1. LINEBREAK remark1 is intuitive. without losing generality, we assume the current learning domain in fig. 2 is d1. the domain-specific prompter is the former model updated by d1 and thus fits d1 well. in contrast, the current learner is newly updated by dm and forgets some knowledge of d1, due to the well-known “catastrophic forgetting”. therefore, the prompter has higher predicted probability on the ground-truth category than the learner does. we empirically validate the above analysis in fig. 3, from which we clearly observe that the prompter has higher prediction accuracy than the learner. remark2: since p (y|x; θp , w p ) ≥ p (y|x; θ, w ) (i.e., remark1), the re-weighted procedure in eq. 3 alleviates the penalty on the learner, which is beneficial to exclude domain-specific knowledge. please refer to the appendix for the conceptual proof. consequentially, the prompter counters overfitting the current domain. LINEBREAK domain-general teacher LINEBREAK definition of the domain-general teacher: we recall that a switching round is a period within which all the m domains are enumerated. as illustrated in fig. 2, we average the parameters of all the m encoders updated in the past switching round to generate the domain-general teacher for the current domain di, which is formulated as: LINEBREAK j=i−m θj LINEBREAK the teacher aims to preserve and distill the domain-general knowledge learned in former domains to the current learner. LINEBREAK we note that the domain-general teacher is different from the popular temporal moving average for semi-supervised and unsupervised task tarvainen & valpola (2017); he et al. (2020); grill et al. (2020). in temporal moving average, the teacher absorbs parameters from all the historical models (with higher weighting factor for the more recent model). in contrast, our domain-general teacher absorbs parameters from only m historical models with equal weighting factor. LINEBREAK remark3: when the learner gets updated from di, it has higher prediction accuracy on di than the teacher does. meanwhile, the teacher has higher prediction accuracy on former domains dj(j (cid:54)= i). LINEBREAK remark3 is intuitive. it is because the teacher absorbs knowledge from m historical learners, therefore preserving historical knowledge of the former domains. we empirically validate this intuition in fig. 3 (b), which is consistent with remark3. moreover, since the teacher averages the parameters of all the m historical learners, it has no obvious bias towards any single domain. therefore, the teacher has relatively smaller variation of accuracy on all the domains, as shown in fig. 3 (b). LINEBREAK binary kullback-leibler divergence loss. given a sample x in the current domain, we use the output of the teacher p (y|x; θt , w t ) as an auxiliary supervising signal for the learner. to this end, we propose a novel binary kullback-leibler divergence (kld) loss as follows: LINEBREAK methods LINEBREAK table 1: comparison with the state of the arts for 5-way 1-shot task. “ft” (“lft”) denotes method in tseng et al. (2020) , “ata” denotes method in wang & deng (2021), “s”(“m”) denotes singledomain (multi-domain) learning. LINEBREAK methods LINEBREAK table 2: comparison with the state of the arts for 5-way 5-shot task. “ft” (“lft”) denotes method in tseng et al. (2020) , “ata” denotes method in wang & deng (2021), “s”(“m”) denotes singledomain (multi-domain) learning. LINEBREAK where py = p (y|x; θ, w ) and p t LINEBREAK lbkld = p t LINEBREAK y · log LINEBREAK p t y py y = p (y|x; θt , w t ). LINEBREAK y ) · log LINEBREAK 1 − p t y 1 − py LINEBREAK the difference between the proposed bkld loss and the popular kld loss is: kld aims to make the student consistent with the teacher at all the entries of the softmax prediction. in contrast, the proposed bkld loss only focuses on the consistency at the ground-truth entry. in the experiment in section 4.4, we empirically show bkld loss is better than the kld loss for dsl. LINEBREAK overall training. we recall that besides the switchable domains, mini-imagenet is employed as a “basic” training set, which is sampled into all the training iterations. for mini-imagenet, we adopt the cross-entropy loss as a basic loss lbasic. the overall training loss is as follows: LINEBREAK l = lbasic + α · lrce + (1 − α) · lbkld LINEBREAK where α is a weighting factor. 4 experiments LINEBREAK experimental setups LINEBREAK we evaluate the proposed dsl on five datasets: i.e., 4 fine-grained datasets (cub welinder et al. (2010), cars krause et al. (2013), places zhou et al. (2018), and plantae horn et al. (2018)) and 1 popular large scale dataset mini-imagenet deng et al. (2009). we use resnet-10 he et al. (2016) without pretraining as the backbone network. please refer to the appendix for more experimental setups and implementation details. LINEBREAK methods mini-imagenet (single) domain-mix (multi) domain-switch (multi) LINEBREAK table 3: comparison between two multi-domain learning scheme for 5-way 5-shot task. LINEBREAK comparison with the state of the arts LINEBREAK we compare dsl with the existing state of the arts on 4 benchmarks. we adopt the leave-one-out setting, i.e., one of the fine-grained datasets is chosen as a testing set and the other 3 datasets (out of the 4 datasets) are used as the training sets. meanwhile, we employ mini-imagenet as a “basic” training set, which is available during the whole training stage. the results of 5-way 1-shot and 5-way 5-shot are summarized in table 1 and table 2, respectively. LINEBREAK from table 1, we clearly observe the superiority of dsl under 5-way 1-shot classification. first, comparing dsl with all the single-domain training methods, we find that dsl achieves significant superiority. for example, dsl outperforms the most competing single-domain method (“relationnet + ata (s)”) wang & deng (2021) by +7.13%, +5.34%, +2%, +7.45% on cub, cars, places and plantae, respectively. second, while the multi-domain training methods achieve considerable improvement (over their single-domain counterpart), dsl still outperforms them with a clear margin. for example, dsl outperforms the most competing multi-domain method (“relationnet + lft (m)”) by +1.77%, +4.92%, +2.42%, +6.17% on cub, cars, places and plantae, respectively. LINEBREAK from table 2, we clearly observe that dsl achieves competitive accuracy under the 5-way 5-shot classification. most of the competing methods already appear in the comparison of 5-way 1-shot setting (table 1). compared with all these methods (except nsae liang et al. (2021)), dsl maintains significant superiority on all the four benchmarks. for example, dsl surpasses “relationnet + lft(m)”tseng et al. (2020) by +8.58%, +15.09%, +6.75%, +11.71% on cub, cars, places and plantae, respectively. LINEBREAK nsae in table 2 is a very recent and competitive single-domain training method. it splits the support samples of the same category into two sub-sets for similarity learning. therefore, it requires more than 1 support samples for each category and is incompatible to the 1-shot setting. with this unique similarity-learning manner, it achieves very competitive performance (e.g., 68.51% on cub). compared with nsae, dsl obtains consistent superiority for example, dsl surpasses nsae by 5.06% on cub. LINEBREAK the effectiveness of the domain-switch operation LINEBREAK a key characteristic of dsl is the domain-switch operation. in table 3, we compare the singledomain baseline (on mini-imagenet), the domain-mix and the proposed domain-switch scheme (without domain-general teacher and the domain-specific prompter ) on cub and cars. we draw two following observations: LINEBREAK first, compared with single-domain training, the domain-mix learning scheme only brings slight improvement. although it employs multiple domains (as well as multiple datasets) for training, the benefit of more training data is trivial (less than 1% improvement). we infer it is because in the domain-mix learning scheme, the disadvantage of learning domain-specific knowledge largely offsets the advantage of more training data. LINEBREAK second, comparing “domain-mix” with “domain-switch”, we observe that domain-switch is a superior multi-domain learning manner. specifically, domain-switch surpasses domain-mix by 1.60% accuracy under 5-way 5-shot setting on cub. it is consistent with our conceptual analysis, i.e., the domain-switch learning manner better ignores the domain-specific knowledge, therefore improving the cross-domain generalization. LINEBREAK ablation studies
| 7
|
[
108.249,
103.6650784,
216.6954963,
113.6276784
] |
TJ2nxciYCk-.pdf
| 2,023
| 2
|
LINEBREAK the lazy neuron phenomenon: on emergence of activation sparsity in transformers LINEBREAK zonglin li∗, chong you∗, srinadh bhojanapalli, daliang li, ankit singh rawat, sashank j. reddi, ke ye, felix chern, felix yu, ruiqi guo, and sanjiv kumar google research, new york city, usa {lizonglin,cyou,bsrinadh,daliangli,ankitsrawat}@google.com {sashank,kkye,fchern,felixyu,guorq,sanjivk}@google.com LINEBREAK abstract LINEBREAK this paper studies a curious phenomenon that machine learning model with transformer architectures have sparse activation maps. by activation map we refer to the intermediate output of the multi-layer perceptrons (mlps) after a relu activation function, and by “sparse” we mean that on average very few entries (e.g., 3.0% for t5-base and 6.3% for vit-b16) are nonzero for each input to mlp. moreover, larger transformers with more layers and wider mlp hidden dimensions are sparser as measured by the percentage of nonzero entries. through extensive experiments we demonstrate that the emergence of sparsity is a prevalent phenomenon that occurs for both natural language processing and vision tasks, on both training and evaluation data, for transformers of various configurations, at layers of all depth levels. we discuss how sparsity immediately implies a way to significantly reduce the flop count and improve efficiency for transformers. moreover, we demonstrate perhaps surprisingly that enforcing an even sparser activation via top-k thresholding with a small k brings a collection of desired properties, namely less sensitivity to noisy training data, more robustness to input corruptions, and better calibration for their prediction confidence. LINEBREAK introduction LINEBREAK the great success of modern machine learning for tasks in computer vision, natural language processing, game playing and beyond is driven primarily by the computational model known as deep neural networks (dnns) (lecun et al., 2015). with inspirations drawn from biological intelligent systems, dnns are massive systems of distributed computational nodes (a.k.a. neurons) with learned inter-connections, which possess the capacity of accomplishing complex real-world tasks. LINEBREAK although originally motivated from biological brains, there are differences at very fundamental levels on how dnns work compared to biological neural networks. one of such differences is in the sparsity of neural activities. evidence from neuroscience suggests that neural activity in biological brains is sparse, namely, only a small percentage of all neurons fire at each time (ahmed et al., 2020; barth & poulet, 2012; kerr et al., 2005; poo & isaacson, 2009). sparse firing suggests that despite having billions of neurons, only a small fraction of the brain participates in computation at each time, which may explain why brains can sustain at a very low energy cost. in contrast, learning and inference with dnns rely primarily on dense computations where all neurons are involved for any input. in fact, modern computational hardware for deep neural networks, such as gpus and tpus, are designed to facilitate massive scale dense computations. even with such dedicated hardware, dnns are still notoriously resource-demanding to train and deploy. aside from computation efficiency, dnns also lag far behind biological brains in terms of robustness to input perturbation, error correction for erroneous training labels, confidence calibration for the predictions, etc. LINEBREAK an intriguing observation: activations are sparse in trained transformers LINEBREAK this paper provides an extensive study on a surprising observation that despite performing dense computations, dnns produce very sparse activation in its intermediate layers once trained.specifically, LINEBREAK ∗equal contribution LINEBREAK (a) t5 encoder LINEBREAK (b) t5 decoder LINEBREAK figure 1: percentage of nonzero entries (y-axis, log scale) in the activation map as a function of number of training steps (x-axis) for a t5-base model trained with the span corruption objective on the c4 dataset. left: layers (from shallow to deep) of the encoder. right: layers of the decoder. LINEBREAK we study transformer (vaswani et al., 2017), a dnn model architecture that has become a workhorse for modern applications. transformers are constructed by interleaving a self-attention module and a multi-layer perceptrons (mlps) of depth 2, and the focus of this paper is on the activation map of the first mlp layer. figure 1 shows the sparsity of the activation maps, measured by the percentage of nonzeros, in all mlp layers of a t5-base model (raffel et al., 2020) computed on the training set of c4. we see that the percentage of nonzero entries is around 50% at initialization, which is expected: randomly initialized weights produce roughly equal numbers of positive and negative entries in the pre-activation map, resulting in about 50 % non-zeros after the relu. however, at the end of training the percentage of nonzero entries reduces drastically: the average value across all encoder-decoder layers is 2.7% with the largest one being 12.0% and the smallest one being only 1.1%. the emergence of sparse activation in transformers bears a similarity to the sparsity of neural activities in biological brains, revealing an interesting connection between artificial and biological networks. moreover, unlike classical sparse methods where such a connection is established via explicit sparse regularization (olshausen & field, 1996), the sparsity observed in transformers is emergent without any explicit design. LINEBREAK prevalence, benefits, and causes of sparsity LINEBREAK this paper studies the aforementioned phenomenon of sparse activation in trained transformers, with a focus on the following two questions. first, is the phenomenon shown in figure 1 a corner case or does it occur broadly? second, why should we care about the sparsity in dnns, other than the appeal of its similarity to biological brains? our main results along these two lines are summarized below. LINEBREAK 1. sparsity is a prevalent phenomenon. we show in section 2 that the emergence of sparse activation reported in figure 1 is not an isolated and cherry-picked case. rather, sparsity is prevalent, and occurs broadly in transformer models: it emerges in all layers of a transformer, for transformers trained on both vision and natural language data, for transformers of various configurations, and for activation maps computed on both train and test data, etc. moreover, through controlled experiments on the width and depth of transformers, we reveal that larger models are sparser, as measured by percentage of nonzero entries. we also show in the appendix b that sparsity emerges with many other architectures and with different optimizers. LINEBREAK 2. sparsity improves efficiency. sparsity of activation map in trained transformers implies that a large proportion of the computation during inference is spent on multiplying values by zero. hence, flops can be drastically reduced by avoiding all such computations, which we discuss in section 3.1. motivated by this observation, and to obtain reduced flops not only after training but throughout training, we introduce top-k transformer in section 3.2, a simple modification of transformers where a top-k thresholding is applied to the activation maps1. we show that top-k transformers with a reasonable sized k has on par performance with vanilla transformers. to demonstrate the computation benefits of top-k transformers, we provide proof-of-concept results on wall time reduction for the task of unbatched decoding on tpuv4 with a large top-k t5. meanwhile, we emphasise that this result is far from fully realizing the benefit of sparse activation, due to a lack of hardware support for sparse computation. LINEBREAK 1the approach is previously adopted in convnets for improving model robustness (ahmad & scheinkman, LINEBREAK 2019), and more recently in gupta et al. (2021) for improving memory efficiency of transformers. LINEBREAK 3. sparsity improves robustness and calibration. we further show in section 3.3 that enforcing explicit sparsity via top-k transformers improves model performance in terms of less sensitivity to noisy training data, less sensitivity to input corruptions, and better confidence calibration. LINEBREAK in addition, we provide a study on the causes of sparsity in the appendix d, showing that sparsity is likely not an artifact of the training data, and may be attributed to the training dynamics in the optimization process. LINEBREAK experimental setup LINEBREAK we study the sparsity in activation maps of transformers with two commonly used transformer models, namely text-to-text transfer transformer (i.e., t5) and vision transformer (i.e., vit). LINEBREAK • t5 is an encoder-decoder model for natural language processing tasks (raffel et al., 2020). we LINEBREAK train t5 on the colossal clean crawled corpus (c4) using the span corruption task. LINEBREAK • vit is an encoder model for vision tasks (dosovitskiy et al., 2021). unless specified otherwise, we train vit on imagenet-21k (deng et al., 2009), an image classification dataset with 14m images and 21k classes. for certain cases we also use imagenet-1k which is a subset of imagenet-21k with 1.3m images and 1k classes. LINEBREAK we measure the sparsity level (computed on training set unless specified otherwise) at the intermediate output of the two-layer mlps in a transformer . recall that an mlp performs the following mapping LINEBREAK f (x; k, v ) LINEBREAK dff(cid:88) LINEBREAK , or equivalently, f (x; k, v ) LINEBREAK . = v σ(k(cid:62)x), LINEBREAK where x ∈ irdmodel is the input, k = [k1, . . . , kdff] ∈ irdmodel×dff and v = [v1, . . . , vdff ] ∈ irdmodel×dff are learnable layer parameters, and σ() is a nonlinear activation function. we use relu as the activation function σ() for both t5 and vit2. a two-layer mlp may be regarded as having dff neurons in the hidden layer, where the i-th neuron performs the computation σ((cid:104)ki, x(cid:105)) · vi, and the final layer output is the sum of the output of all neurons. each neuron is called activated if σ((cid:104)ki, x(cid:105)) is strictly positive. hence, the sparsity of neuron activation can be measured by the number of nonzero entries in the feature map LINEBREAK . = σ(k(cid:62)x) ∈ irdff. (2) both t5 and vit come with several configurations for dmodel, dff, number of layers, etc. unless specified otherwise, we will use the base models (i.e., t5-base and vit-b/16) which have dmodel = 768, dff = 3072, and 12 layers (for vit) and 12 encoder layers +12 decoder layers (for t5). our experiment with t5 and vit uses the t5x (roberts et al., 2022) and the scenic codebase (dehghani et al., 2022), respectively. more training details of t5 and vit are provided in appendix a. LINEBREAK a LINEBREAK prevalence of sparsity in learned transformers LINEBREAK this section shows thorough experiments on commonly used transformers that sparsity in activation maps is a prevalent phenomenon. we also show through some controlled experiments that deeper and wider transformers tend to be sparser measured by percentage of nonzero entries in activation maps. LINEBREAK sparsity is a ubiquitous phenomenon LINEBREAK we start by providing experimental evidence that the emergence of sparse activation in trained transformers is a ubiquitous phenomenon. to this end, we plot the percentage of nonzero entries of activation maps in different transformers, and present the results in figure 2. these results demonstrate the following. LINEBREAK • sparsity emerges for both vision and nlp tasks. figure 2a shows the percentage of nonzero entries of trained t5 and vit models evaluated on their respective training datasets. we see that both encoder and decoder of t5, as well as the vit, all exhibit sparsity. LINEBREAK 2vit uses gelu as its activation function (dosovitskiy et al., 2021). here we switch to relu as it allows us to more easily measure the sparsity level using the number of nonzero entries with a very small performance drop (e.g., 47.78% with gelu vs 47.58% with relu for top-1 evaluation accuracy on imagenet-21k). LINEBREAK (a) t5 vs vit LINEBREAK (b) train vs evaluation data LINEBREAK (c) different training data size LINEBREAK (d) varying configuration (vit) LINEBREAK (e) varying config. (t5 encoder) LINEBREAK (f) varying config. (t5 decoder) LINEBREAK figure 2: percentage of nonzero entries across different layers of trained transformers (a) for both language data with t5 and vision data with vit, (b) on both train and evaluation data, (c) for vit trained on imagenet of 21k vs 1k classes, (d) on vit of varying configurations, and (e, f) on t5 of varying configurations. note that the y-axis is in log scale. sparsity emerges in all cases. LINEBREAK • sparsity emerges on both training and evaluation data. figure 2b shows the percentage of nonzero entries in a trained t5 model measured on both the training data and the evaluation data. we see that the property of sparsity generalizes very well to evaluation data as the curves for training and evaluation data align very closely with each other. LINEBREAK • sparsity emerges on datasets of varying scale. figure 2c shows the percentage of nonzero entries in vit trained on both imagenet-21k and imagenet-1k, where the former is a superset of the later with approximately 10× more images and 21× more classes. we see that the scale of data does not affect much of the sparsity level. LINEBREAK • sparsity emerges on transformers of varying configurations. figure 2d shows the percentage of nonzero entries for vit of varying configurations in model size. figure 2e and 2f show the percentage of nonzero entries for encoder and decoder, respectively, of t5 with varying configurations in model size. we see that sparsity persists for all cases. LINEBREAK • sparsity emerges across all layers of a transformer. finally, all plots in figure 2 show that sparsity emerges in all layers of a transformer. moreover, in all cases the first few and last few layers tend to be denser than intermediate layers. LINEBREAK the presence of sparsity in activation maps does not rule out the possibility that a small percentage of the neurons are always activated for all inputs, whereas the rest of the neurons are never activated. to illustrate that this is not the case, we experiment with a pretrained t5 base model3 to plot the percentage of layer inputs for which each of the dff neurons is activated when evaluated on 800 examples taken from c4 dataset with span corruption task. note that there are 800 × 512 = 409600 samples as mlp activation is computed per token. the results are presented in figure 3 with x-axis being indices of neurons in the first encoder layer of t5 sorted in descending order according to percentage of layer inputs on which they are activated. it can be seen that while a few neurons are activated for around 50% of the time, the vast majority of neurons (around 93.5%) are activated less than 10% of the time. moreover, LINEBREAK figure 3: percentage of times that each neuron in the first mlp layer of a trained t5 is activated on c4 dataset. LINEBREAK 3https://github.com/google-research/t5x/blob/main/docs/models.md#t5-checkpoints LINEBREAK (a) sparsity vs. depth LINEBREAK (b) sparsity (percentage) vs. width LINEBREAK (c) sparsity (count) vs. width LINEBREAK figure 4: activation sparsity across different encoder layers of trained t5 transformers of (a) varying depth and (b, c) varying width (i.e., dff). since with varying width the dimension of activation maps also changes, we evaluate sparsity both in term of the percentage (as in (b)) and the count (as in (c)) of nonzeros. deeper and wider models are sparser in terms of percentage of activated neurons. LINEBREAK there are no dead neurons that are never activated, and the least activated neuron is activated for around 0.001% of the time, and 99% of neurons are activated over 1% of the time. finally, while the results here are for neurons in the first mlp layer of a pretrained t5 base encoder, all other mlp layers show qualitatively similar behavior. LINEBREAK the larger, the sparser LINEBREAK we next examine the effect of model size on the sparsity level of activation maps. note that figure 2e and figure 2f provide evidence with t5 of varying configuration that larger models tend to be sparser. here we perform controlled experiments to examine the effect of model depth, measured by the number of transformer layers, as well as the effect of model width, measured by the dimension of activation map of mlps (i.e., dff), separately. towards that, we take a standard t5 model and vary the depth and width, respectively while keeping the rest of the configuration fixed, and examine their sparsity level after training. the results are presented in figure 4 for the encoder, whereas we omit the results for the decoder as they are qualitatively the same as those for encoder. LINEBREAK it can be seen from figure 4a that deeper transformers are arguably sparser. for example, many of the middle layers of the 32-layer model have less than 1% nonzero entries while all shallower models have more than 1% nonzero entries across all layers. for comparing networks of different widths, we measure the sparsity with the percentage and the count of nonzero entries in figure 4b and figure 4c, respectively. it can be seen that wider models have a lower percentage of nonzero entries, though a higher count of nonzero entries. LINEBREAK efficient, robust, and calibrated: sparsity is all you need? LINEBREAK in this section we show that activation sparsity provides several practical benefits. in section 3.1 we discuss how the free sparsity in trained transformers brings us free computation efficiency in terms of flops count during inference. in order to obtain sparsity hence flops reduction throughout training, in section 3.2 we introduce top-k transformers, a simple modification of transformers where a top-k thresholding operation is applied to the activation maps in all mlps. while existing hardware cannot well support sparse computation and fully realize the benefit of flops reduction, we provide a proof-of-concept experiment on preliminary benefits of top-k transformer. finally, in section 3.3 we show that sparsity in activation is a good regularization for transformers. namely, enforcing sparser activation with smaller values of k in top-k transformer (without any other hacks, tweaks and hyperparameter tuning) bestows transformers several desired properties, namely, robustness of training with erroneous annotations, less sensitivity to input noise/perturbation, and better confidence calibration of the predictions. LINEBREAK efficiency for free LINEBREAK given an embedding dimension dmodel and an mlp intermediate dimension dff, the computational complexity of a transformer for an input sequence of length n is o(n d2 model+n 2dmodel+n dmodeldff), where the first term comes from computing the key, query, and value matrices, the second term comes from computing the self-attention matrix, and the third term comes from the mlp. for a fixed LINEBREAK sequence length n , and considering the fact that dff is often much larger than dmodel, it is arguable that mlp poses the computational bottleneck in large transformers. in the following, we explain how sparsity in activation map of mlp can be leveraged to significantly reduce its computational cost, without affecting the model performance. LINEBREAK efficiency for the second mlp layer. the sparse activation immediately suggests that a lot of the computation for inference with transformers is not needed at all. that is, while doing dense matrix-matrix multiplications, much of it is about multiplying a vector by a value of zero, which can be avoided to save computation. LINEBREAK specifically, we consider the second layer of the mlp in (1) which performs the computation LINEBREAK v a, (3) where a ∈ irdff is the intermediate activation map of mlp (see (2)) and v ∈ irdmodel×dff is the layer parameter. eq. (3) involves a simple matrix-vector multiplication which has a flop count of 2dmodel × dff. however, if a is sparse with, say s nonzero entries, then the flop count for (3) reduces to 2dmodel × s. hence, LINEBREAK flop in the second mlp layer is reduced by a factor of 1 − s dff LINEBREAK note that s is exactly the percentage of nonzeros plotted in the y-axis of e.g. figure 1, which is 2.7% dff averaged across all layers. hence, the computational cost of the second mlp layer can be reduced by a significant amount. more excitingly, the reduction factor 1 − s is likely to be even bigger for dff larger transformer models (see figures 4a and 4b), pointing to a greater reduction in computation. LINEBREAK efficiency for the first mlp layer. the sparsity in the intermediate activation map of mlp does not immediately suggest a reduction in computation for the first mlp layer. nonetheless, it is possible to significantly reduce the computation in the first mlp layer by leveraging approximate nearest neighbor search, which we explain next. LINEBREAK recall from (1) that the computation in the first mlp layer is given by LINEBREAK σ(k(cid:62)x), (4) with k = [k1, . . . , kdff] ∈ irdmodel×dff being the layer parameter and x being the layer input. if the output is sparse with k nonzero entries, then the calculation in (4) may be formulated as finding k points from the set {ki}dff i=1 that are “closest” to the input x measured by values of inner product. such a problem is well-known as the nearest neighbor search (nns) problem or the maximum inner product search problem. while naive solution of the nns problem has linear complexity in dff, there exists approximate algorithms (guo et al., 2020; johnson et al., 2019; shrivastava & li, 2014) that are of sublinear complexity, and using them in transformers means that LINEBREAK flop in the first mlp layer may be reduced to have sublinear complexity in dff. LINEBREAK there are of course the questions of whether such approximate nns algorithms could hurt transformer performance, which we leave for future study. LINEBREAK sparsity in training via top-k transformers
| 5
|
[
108.249,
237.5850784,
352.1592352,
247.7668556
] |
hpH98mK5Puk.pdf
| 2,021
| 0
|
LINEBREAK infobert: improving robustness of language models from an information theoretic perspective LINEBREAK ∗boxin wang1, shuohang wang2, yu cheng2, zhe gan2, ruoxi jia3, bo li1, jingjing liu2 1university of illinois at urbana-champaign 2 microsoft dynamics 365 ai research 3 virginia tech {boxinw2,lbo}@illinois.edu LINEBREAK {shuohang.wang,yu.cheng,zhe.gan,jingjl}@microsoft.com LINEBREAK abstract LINEBREAK large-scale pre-trained language models such as bert and roberta have achieved state-of-the-art performance across a wide range of nlp tasks. recent studies, however, show that such bert-based models are vulnerable facing the threats of textual adversarial attacks. we aim to address this problem from an information-theoretic perspective, and propose infobert, a novel learning framework for robust fine-tuning of pre-trained language models. infobert contains two mutual-information-based regularizers for model training: (i) an information bottleneck regularizer, which suppresses noisy mutual information between the input and the feature representation; and (ii) an anchored feature regularizer, which increases the mutual information between local stable features and global features. we provide a principled way to theoretically analyze and improve the robustness of language models in both standard and adversarial training. extensive experiments demonstrate that infobert achieves stateof-the-art robust accuracy over several adversarial datasets on natural language inference (nli) and question answering (qa) tasks. our code is available at https://github.com/ai-secure/infobert. LINEBREAK introduction LINEBREAK self-supervised representation learning pre-trains good feature extractors from massive unlabeled data, which show promising transferability to various downstream tasks. recent success includes large-scale pre-trained language models (e.g., bert, roberta, and gpt-3 (devlin et al., 2019; liu et al., 2019; brown et al., 2020)), which have advanced state of the art over a wide range of nlp tasks such as nli and qa, even surpassing human performance. specifically, in the computer vision domain, many studies have shown that self-supervised representation learning is essentially solving the problem of maximizing the mutual information (mi) i(x; t ) between the input x and the representation t (van den oord et al., 2018; belghazi et al., 2018; hjelm et al., 2019; chen et al., 2020). since mi is computationally intractable in high-dimensional feature space, many mi estimators (belghazi et al., 2018) have been proposed to serve as lower bounds (barber & agakov, 2003; van den oord et al., 2018) or upper bounds (cheng et al., 2020) of mi. recently, kong et al. point out that the mi maximization principle of representation learning can be applied to not only computer vision but also nlp domain, and propose a unified view that recent pre-trained language models are maximizing a lower bound of mi among different segments of a word sequence. LINEBREAK on the other hand, deep neural networks are known to be prone to adversarial examples (goodfellow et al., 2015; papernot et al., 2016; eykholt et al., 2017; moosavi-dezfooli et al., 2016), i.e., the outputs of neural networks can be arbitrarily wrong when human-imperceptible adversarial perturbations are added to the inputs. textual adversarial attacks typically perform word-level substitution (ebrahimi et al., 2018; alzantot et al., 2018; ren et al., 2019) or sentence-level paraphrasing (iyyer et al., 2018; zhang et al., 2019) to achieve semantic/utility preservation that seems innocuous to human, while fools nlp models. recent studies (jin et al., 2020; zang et al., 2020; nie et al., 2020; wang et al., 2020) further show that even large-scale pre-trained language models (lm) such as LINEBREAK ∗work was done during boxin wang’s summer internship in microsoft dynamics 365 ai research. LINEBREAK bert are vulnerable to adversarial attacks, which raises the challenge of building robust real-world lm applications against unknown adversarial attacks. LINEBREAK we investigate the robustness of language models from an information theoretic perspective, and propose a novel learning framework infobert, which focuses on improving the robustness of language representations by fine-tuning both local features (word-level representation) and global features (sentence-level representation) for robustness purpose. infobert considers two mi-based regularizers: (i) the information bottleneck regularizer manages to extract approximate minimal sufficient statistics for downstream tasks, while removing excessive and noisy information that may incur adversarial attacks; (ii) the anchored feature regularizer carefully selects useful local stable features that are invulnerable to adversarial attacks, and maximizes the mutual information between local stable features and global features to improve the robustness of the global representation. in this paper, we provide a detailed theoretical analysis to explicate the effect of infobert for robustness improvement, along with extensive empirical adversarial evaluation to validate the theory. LINEBREAK our contributions are summarized as follows. (i) we propose a novel learning framework infobert from the information theory perspective, aiming to effectively improve the robustness of language models. (ii) we provide a principled theoretical analysis on model robustness, and propose two mibased regularizers to refine the local and global features, which can be applied to both standard and adversarial training for different nlp tasks. (iii) comprehensive experimental results demonstrate that infobert can substantially improve robust accuracy by a large margin without sacrificing the benign accuracy, yielding the state-of-the-art performance across multiple adversarial datasets on nli and qa tasks. LINEBREAK related work LINEBREAK textual adversarial attacks/defenses most existing textual adversarial attacks focus on wordlevel adversarial manipulation. ebrahimi et al. (2018) is the first to propose a whitebox gradientbased attack to search for adversarial word/character substitution. following work (alzantot et al., 2018; ren et al., 2019; zang et al., 2020; jin et al., 2020) further constrains the perturbation search space and adopts part-of-speech checking to make nlp adversarial examples look natural to human. LINEBREAK to defend against textual adversarial attacks, existing work can be classified into three categories: (i) adversarial training is a practical method to defend against adversarial examples. existing work either uses pgd-based attacks to generate adversarial examples in the embedding space of nlp as data augmentation (zhu et al., 2020a), or regularizes the standard objective using virtual adversarial training (jiang et al., 2020; liu et al., 2020; gan et al., 2020). however, one drawback is that the threat model is often unknown, which renders adversarial training less effective when facing unseen attacks. (ii) interval bound propagation (ibp) (dvijotham et al., 2018) is proposed as a new technique to consider the worst-case perturbation theoretically. recent work (huang et al., 2019; jia et al., 2019) has applied ibp in the nlp domain to certify the robustness of models. however, ibpbased methods rely on strong assumptions of model architecture and are difficult to adapt to recent transformer-based language models. (iii) randomized smoothing (cohen et al., 2019) provides a tight robustness guarantee in (cid:96)2 norm by smoothing the classifier with gaussian noise. ye et al. (2020) adapts the idea to the nlp domain, and replace the gaussian noise with synonym words to certify the robustness as long as adversarial word substitution falls into predefined synonym sets. however, to guarantee the completeness of the synonym set is challenging. LINEBREAK representation learning mi maximization principle has been adopted by many studies on selfsupervised representation learning (van den oord et al., 2018; belghazi et al., 2018; hjelm et al., 2019; chen et al., 2020). specifically, infonce (van den oord et al., 2018) is used as the lower bound of mi, forming the problem as contrastive learning (saunshi et al., 2019; yu et al., 2020). however, tian et al. (2020) suggests that the infomax (linsker, 1988) principle may introduce excessive and noisy information, which could be adversarial. to generate robust representation, zhu et al. (2020b) formalizes the problem from a mutual-information perspective, which essentially performs adversarial training for worst-case perturbation, while mainly considers the continuous space in computer vision. in contrast, infobert originates from an information-theoretic perspective and is compatible with both standard and adversarial training for discrete input space of language models. LINEBREAK infobert LINEBREAK before diving into details, we first discuss the textual adversarial examples we consider in this paper. we mainly focus on the dominant word-level attack as the main threat model, since it achieves higher attack success and is less noticeable to human readers than other attacks. due to the discrete nature of text input space, it is difficult to measure adversarial distortion on token level. instead, because most word-level adversarial attacks (li et al., 2019; jin et al., 2020) constrain word perturbations via the bounded magnitude in the semantic embedding space, by adapting from jacobsen et al. (2019), we define the adversarial text examples with distortions constrained in the embedding space. definition 3.1. ((cid:15)-bounded textual adversarial examples). given a sentence x = [x1; x2; ...; xn], where xi is the word at the i-th position, the (cid:15)-bounded adversarial sentence x(cid:48) = [x(cid:48) 2; ...; x(cid:48) n] for a classifier f satisfies: (1) f(x) = o(x) = o(x(cid:48)) but f(x(cid:48)) (cid:54)= o(x(cid:48)), where o(·) is the oracle (e.g., human decision-maker); (2) ||ti − t(cid:48) i||2 ≤ (cid:15) for i = 1, 2, ..., n, where (cid:15) ≥ 0 and ti is the word embedding of xi. LINEBREAK information bottleneck as a regularizer LINEBREAK in this section, we first discuss the general ib implementation, and then explain how ib formulation is adapted to infobert as a regularizer along with theoretical analysis to support why ib regularizer can help improve the robustness of language models. the ib principle formulates the goal of deep learning as an information-theoretic trade-off between representation compression and predictive power (tishby & zaslavsky, 2015). given the input source x, a deep neural net learns the internal representation t of some intermediate layer and maximizes the mi between t and label y , so that t subject to a constraint on its complexity contains sufficient information to infer the target label y . finding an optimal representation t can be formulated as the maximization of the lagrangian LINEBREAK lib = i(y ; t ) − βi(x; t ), LINEBREAK where β > 0 is a hyper-parameter to control the tradeoff, and i(y ; t ) is defined as: (cid:90) LINEBREAK i(y ; t ) = LINEBREAK p(y, t) log LINEBREAK dy dt . LINEBREAK p(y, t) p(y)p(t) LINEBREAK since eq. (2) is intractable, we instead use the lower bound from barber & agakov (2003): LINEBREAK i(y ; t ) ≥ LINEBREAK p(y, t) log qψ(y | t) dy dt , LINEBREAK where qψ(y|t) is the variational approximation learned by a neural network parameterized by ψ for the true distribution p(y|t). this indicates that maximizing the lower bound of the first term of ib i(y ; t ) is equivalent to minimizing the task cross-entropy loss (cid:96)task = h(y | t ). LINEBREAK to derive a tractable lower bound of ib, we here use an upper bound (cheng et al., 2020) of i(x; t ) LINEBREAK i(x; t ) ≤ LINEBREAK p(x, t) log(p(t | x)) dx dt − LINEBREAK p(x)p(t) log(p(t | x)) dx dt . LINEBREAK by combining eq. (3) and (4), we can maximize the tractable lower bound ˆlib of ib in practice by: LINEBREAK ˆlib = LINEBREAK (cid:2) log qψ(y(i) | t(i))(cid:3) − LINEBREAK β n LINEBREAK log(p(t(i) | x(i))) − LINEBREAK log(p(t(j) | x(i))) LINEBREAK with data samples {x(i), y(i)}n i=1, where qψ can represent any classification model (e.g., bert), and p(t | x) can be viewed as the feature extractor fθ : x → t , where x and t are the support of the input source x and extracted feature t , respectively. LINEBREAK the above is a general implementation of ib objective function. in infobert, we consider t as the features consisting of the local word-level features after the bert embedding layer fθ. the following bert self-attentive layers along with the linear classification head serve as qψ(y|t) that predicts the target y given representation t . LINEBREAK formally, given random variables x = [x1; x2; ...; xn] representing input sentences with xi (word token at i-th index), let t = [t1; ...; tn] = fθ([x1; x2; ...; xn]) = [fθ(x1); fθ(x2); ...; fθ(xn)] LINEBREAK denote the random variables representing the features generated from input x via the bert embedding layer fθ, where ti ∈ rd is the high-dimensional word-level local feature for word xi. due to the high dimensionality d of each word feature (e.g., 1024 for bert-large), when the sentence length n increases, the dimensionality of features t becomes too large to compute i(x; t ) in practice. thus, we propose to maximize a localized formulation of ib llib defined as: LINEBREAK llib := i(y ; t ) − nβ LINEBREAK i(xi; ti). LINEBREAK theorem 3.1. (lower bound of lib) given a sequence of random variables x = [x1; x2; ...; xn] and a deterministic feature extractor fθ, let t = [t1; ...; tn] = [fθ(x1); fθ(x2); ...; fθ(xn)]. then the localized formulation of ib llib is a lower bound of lib (eq. (1)), i.e., LINEBREAK i(y ; t ) − βi(x; t ) ≥ i(y ; t ) − nβ LINEBREAK i(xi; ti). LINEBREAK theorem 3.1 indicates that we can maximize the localized formulation of llib as a lower bound of ib lib when i(x; t ) is difficult to compute. in eq. (6), if we regard the first term (i(y ; t )) as a task-related objective, the second term (−nβ (cid:80)n i=1 i(xi; ti)) can be considered as a regularization term to constrain the complexity of representation t , thus named as information bottleneck regularizer. next, we give a theoretical analysis for the adversarial robustness of ib and demonstrate why localized ib objective function can help improve the robustness to adversarial attacks. following definition 3.1, let t = [t1; t2; ...; tn] and t (cid:48) = [t (cid:48) n] denote the features for the benign sentence x and adversarial sentence x (cid:48). the distributions of x and x (cid:48) are denoted by probability p(x) and q(x) with the support x and x (cid:48), respectively. we assume that the feature representation t has finite support denoted by t considering the finite vocabulary size in nlp. theorem 3.2. (adversarial robustness bound) for random variables x = [x1; x2; ...; xn] and x (cid:48) = [x (cid:48) n], let t = [t1; t2; ...; tn] = [fθ(x1); fθ(x2); ...; fθ(xn)] and t (cid:48) = [t (cid:48) 1; t (cid:48) n)] with finite support t , where fθ is a deterministic feature extractor. the performance gap between benign and adversarial data |i(y ; t ) − i(y ; t (cid:48))| is bounded above by LINEBREAK |i(y ; t ) − i(y ; t (cid:48))| ≤ b0 + b1 LINEBREAK i; t (cid:48) LINEBREAK i; t (cid:48) LINEBREAK where b0, b1, b2, b3 and b4 are constants depending on the sequence length n, (cid:15) and p(x). LINEBREAK the sketch of the proof is to express the difference of |i(y ; t ) − i(y (cid:48); t )| in terms of i(xi; ti). specifically, eq. (25) factorizes the difference into two summands. the first summand, the conditional entropy |h(t | y ) − h(t (cid:48) | y )|, can be bound by eq. (42) in terms of mi between benign/adversarial input and representation i(xi; ti) and i(x (cid:48) i ). the second summand |h(t ) − h(t (cid:48))| has a constant upper bound (eq. (85)), since language models have bounded vocabulary size and embedding space, and thus have bounded entropy. the intuition of theorem 3.2 is to bound the adversarial performance drop |i(y ; t ) − i(y ; t (cid:48))| by i(xi; ti). as explained in eq. (3), i(y ; t ) and i(y ; t (cid:48)) can be regarded as the model performance on benign and adversarial data. thus, the lhs of the bound represents such a performance gap. the adversarial robustness bound of theorem 3.2 indicates that the performance gap becomes closer when i(xi; ti) and i(x (cid:48) i ) decrease. note that our ib regularizer in the objective function eq. (6) achieves the same goal of minimizing i(xi; ti) while learning the most efficient information features, or approximate minimal sufficient statistics, for downstream tasks. theorem 3.2 also suggests that combining adversarial training with our ib regularizer can further minimize i(x (cid:48) i ), leading to better robustness, which is verified in §4. LINEBREAK i; t (cid:48) LINEBREAK i; t (cid:48) LINEBREAK i; t (cid:48) LINEBREAK anchored feature regularizer LINEBREAK in addition to the ib regularizer that suppresses noisy information that may incur adversarial attacks, we propose a novel regularizer termed “anchored feature regularizer”, which extracts local LINEBREAK algorithm 1 - local anchored feature extraction. this algorithm takes in the word local features and returns the index of local anchored features. 1: input: word local features t, upper and lower threshold ch and cl 2: δ ← 0 3: g(δ) = ∇δ(cid:96)task(qψ(t + δ), y) 4: sort LINEBREAK // perform adversarial attack on the embedding space vector from the in ascending LINEBREAK the magnitude ||g(δ)1||2, ||g(δ)2||2, ..., ||g(δ)n||2 order, where zi corresponds to its original index. LINEBREAK // initialize the perturbation vector δ LINEBREAK perturbation LINEBREAK gradient LINEBREAK the LINEBREAK of LINEBREAK of LINEBREAK 5: return: ki, ki+1, ..., kj, where cl ≤ i LINEBREAK n ≤ j LINEBREAK n ≤ ch. LINEBREAK stable features and aligns them with sentence global representations, thus improving the stability and robustness of language representations. LINEBREAK the goal of the local anchored feature extraction is to find features that carry useful and stable information for downstream tasks. instead of directly searching for local anchored features, we start with searching for nonrobust and unuseful features. to identify local nonrobust features, we perform adversarial attacks to detect which words are prone to changes under adversarial word substitution. we consider these vulnerable words as features nonrobust to adversarial threats. therefore, global robust sentence representations should rely less on these vulnerable statistical clues. on the other hand, by examining the adversarial perturbation on each local word feature, we can also identify words that are less useful for downstream tasks. for example, stopwords and punctuation usually carry limited information, and tend to have smaller adversarial perturbations than words containing more effective information. although these unuseful features are barely changed under adversarial attacks, they contain insufficient information and should be discarded. after identifying the nonrobust and unuseful features, we treat the remaining local features in the sentences as useful stable features and align the global feature representation based on them. LINEBREAK during the local anchored feature extraction, we perform “virtual” adversarial attacks that generate adversarial perturbation in the embedding space, as it abstracts the general idea for existing wordlevel adversarial attacks. formally, given an input sentence x = [x1; x2; ...; xn] with its corresponding local embedding representation t = [t1; ...; tn], where x and t are the realization of random variables x and t , we generate adversarial perturbation δ in the embedding space so that the task loss (cid:96)task increases. the adversarial perturbation δ is initialized to zero, and the gradient of the loss with respect to δ is calculated by g(δ) = ∇δ(cid:96)task(qψ(t+δ), y) to update δ ← (cid:81) ||δ||f ≤(cid:15)(ηg(δ)/||g(δ)||f ). the above process is similar to one-step pgd with zero-initialized perturbation δ. since we only care about the ranking of perturbation to decide on robust features, in practice we skip the update of δ to save computational cost, and simply examine the (cid:96)2 norm of the gradient g(δ)i of the perturbation on each word feature ti. a feasible plan is to choose the words whose perturbation is neither too large (nonrobust features) nor too small (unuseful features), e.g., the words whose perturbation rankings are among 50% ∼ 80% of all the words. the detailed procedures are provided in algorithm 1. LINEBREAK after local anchored features are extracted, we propose to align sentence global representations z with our local anchored features ti. in practice, we can use the final-layer [cls] embedding to represent global sentence-level feature z. specifically, we use the information theoretic tool to increase the mutual information i(ti; z) between local anchored features ti and sentence global representations z, so that the global representations can share more robust and useful information with the local anchored features and focus less on the nonrobust and unuseful ones. by incorporating the term i(ti; z) into the previous objective function eq. (6), our final objective function becomes: LINEBREAK max i(y ; t ) − nβ LINEBREAK i(xi; ti) + α LINEBREAK i(tkj ; z), LINEBREAK where tkj are the local anchored features selected by algorithm 1 and m is the number of local anchored features. an illustrative figure can be found in appendix figure 2. LINEBREAK in addition, due to the intractability of computing mi, we use infonce (van den oord et al., 2018) as the lower bound of mi to approximate the last term i(tkj ; z): LINEBREAK ˆi (infonce)(ti; z) := ep LINEBREAK gω(ti, z) − e˜p LINEBREAK egω(t(cid:48) LINEBREAK log LINEBREAK t(cid:48) i LINEBREAK where gω(·, ·) is a score function (or critic function) approximated by a neural network, ti are the positive samples drawn from the joint distribution p of local anchored features and global representations, and t(cid:48) i are the negative samples drawn from the distribution of nonrobust and unuseful features ˜p. LINEBREAK experiments LINEBREAK in this section, we demonstrate how effective infobert improves the robustness of language models over multiple nlp tasks such as nli and qa. we evaluate infobert against both strong adversarial datasets and state-of-the-art adversarial attacks. LINEBREAK experimental setup LINEBREAK adversarial datasets the following adversarial datasets and adversarial attacks are used to eval(i) adversarial nli (anli) (nie et al., 2020) uate the robustness of infobert and baselines. is a large-scale nli benchmark, collected via an iterative, adversarial, human-and-model-in-theloop procedure to attack bert and roberta. anli dataset is a strong adversarial dataset which can easily reduce the accuracy of bertlarge to 0%. (ii) adversarial squad (jia & liang, 2017) dataset is an adversarial qa benchmark dataset generated by a set of handcrafted rules and refined by crowdsourcing. since adversarial training data is not provided, we fine-tune robertalarge on benign squad training data (rajpurkar et al., 2016) only, and test the models on both benign and adversarial test sets. (iii) textfooler (jin et al., 2020) is the state-of-the-art word-level adversarial attack method to generate adversarial examples. to create an adversarial evaluation dataset, we sampled 1, 000 examples from the test sets of snli and mnli respectively, and run textfooler against bertlarge and robertalarge to obtain the adversarial text examples. LINEBREAK baselines since ibp-based methods (huang et al., 2019; jia et al., 2019) cannot be applied to largescale language models yet, and the randomized-smoothing-based method (ye et al., 2020) achieves limited certified robustness, we compare infobert against three competitive baselines based on adversarial training: (i) freelb (zhu et al., 2020a) applies adversarial training to language models during fine-tuning stage to improve generalization. in §4.2, we observe that freelb can boost the robustness of language models by a large margin. (ii) smart (jiang et al., 2020) uses adversarial training as smoothness-inducing regularization and bregman proximal point optimization during fine-tuning, to improve the generalization and robustness of language models. (iii) alum (liu et al., 2020) performs adversarial training in both pre-training and fine-tuning stages, which achieves substantial performance gain on a wide range of nlp tasks. due to the high computational cost of adversarial training, we compare infobert to alum and smart with the best results reported in the original papers. LINEBREAK |dadv| LINEBREAK evaluation metrics we use robust accuracy or robust f1 score to measure how robust the baseline models and infobert are when facing adversarial data. specifically, robust accuracy is calculated 1[arg max qψ(fθ(x(cid:48))) ≡ y], where dadv is the adversarial dataset, y is by: acc = 1 the ground-truth label, arg max selects the class with the highest logits and 1(·) is the indicator function. similarly, robust f1 score is calculated by: f1 = 1 v(arg max qψ(fθ(x(cid:48))), a), where v(·, ·) is the f1 score between the true answer a and the predicted answer arg max qψ(fθ(x(cid:48))), and arg max selects the answer with the highest probability (see rajpurkar et al. (2016) for details). LINEBREAK x(cid:48)∈dadv LINEBREAK x(cid:48)∈dadv LINEBREAK |dadv| LINEBREAK implementation details to demonstrate infobert is effective for different language models, we apply infobert to both pretrained robertalarge and bertlarge. since infobert can be applied to both standard training and adversarial training, we here use freelb as the adversarial training implementation. infobert is fine-tuned for 2 epochs for the qa task, and 3 epochs for the nli task. more implementation details such as α, β, ch, cl selection can be found in appendix a.1. LINEBREAK training LINEBREAK model LINEBREAK method LINEBREAK standard training LINEBREAK adversarial training LINEBREAK roberta LINEBREAK bert LINEBREAK roberta LINEBREAK bert LINEBREAK vanilla infobert LINEBREAK vanilla infobert LINEBREAK freelb infobert LINEBREAK freelb infobert LINEBREAK dev LINEBREAK anli LINEBREAK test LINEBREAK anli LINEBREAK table 1: robust accuracy on the anli dataset. models are trained on the benign datasets (mnli + snli) only. ‘a1-a3’ refers to the rounds with increasing difficulty. ‘anli’ refers to a1+a2+a3. LINEBREAK training LINEBREAK model LINEBREAK method LINEBREAK standard training LINEBREAK adversarial training LINEBREAK roberta LINEBREAK bert LINEBREAK roberta LINEBREAK bert LINEBREAK vanilla infobert LINEBREAK vanilla infobert LINEBREAK freelb smart alum infobert LINEBREAK freelb alum infobert LINEBREAK dev LINEBREAK anli LINEBREAK test LINEBREAK anli LINEBREAK table 2: robust accuracy on the anli dataset. models are trained on both adversarial and benign datasets (anli (training) + fevernli + mnli + snli). LINEBREAK experimental results LINEBREAK evaluation on anli as anli provides an adversarial training dataset, we evaluate models in two settings: 1) training models on benign data (mnli (williams et al., 2018) + snli (bowman et al., 2015)) only, which is the case when the adversarial threat model is unknown; 2) training models on both benign and adversarial training data (snli+mnli+anli+fevernli), which assumes the threat model is known in advance. LINEBREAK results of the first setting are summarized in table 1. the vanilla roberta and bert models perform poorly on the adversarial dataset. in particular, vanilla bertlarge with standard training achieves the lowest robust accuracy of 26.5% among all the models. we also evaluate the robustness improvement by performing adversarial training during fine-tuning, and observe that adversarial training for language models can improve not only generalization but also robustness. in contrast, infobert substantially improves robust accuracy in both standard and adversarial training. the robust accuracy of infobert through standard training is even higher than the adversarial training baseline freelb for both roberta and bert, while the training time of infobert is 1/3 ∼ 1/2 less than freelb. this is mainly because freelb requires multiple steps of pgd attacks to generate adversarial examples, while infobert essentially needs only 1-step pgd attack for anchored feature selection. LINEBREAK results of the second setting are provided in table 2, which shows infobert can further improve robust accuracy for both standard and adversarial training. specifically, when combined with adversarial training, infobert achieves the state-of-the-art robust accuracy of 58.3%, outperforming all existing baselines. note that although alum achieves higher accuracy for bert on the dev set, it tends to overfit on the dev set, therefore performing worse than infobert on the test set. LINEBREAK training LINEBREAK model LINEBREAK method LINEBREAK snli LINEBREAK mnli (m/mm) LINEBREAK adv-snli (bert) LINEBREAK adv-mnli (bert) LINEBREAK adv-snli (roberta) LINEBREAK adv-mnli (roberta) LINEBREAK standard training LINEBREAK adversarial training LINEBREAK roberta LINEBREAK bert LINEBREAK roberta LINEBREAK bert LINEBREAK vanilla infobert LINEBREAK vanilla infobert LINEBREAK freelb infobert LINEBREAK freelb infobert LINEBREAK table 3: robust accuracy on the adversarial snli and mnli(-m/mm) datasets generated by textfooler based on blackbox bert/roberta (denoted in brackets of the header). models are trained on the benign datasets (mnli+snli) only. LINEBREAK training LINEBREAK method LINEBREAK benign LINEBREAK addsent addonesent LINEBREAK standard training LINEBREAK vanilla infobert LINEBREAK adversarial training LINEBREAK freelb alum infobert LINEBREAK table 4: robust f1/em scores based on robertalarge on the adversarial squad datasets (addsent and addonesent). models are trained on standard squad 1.0 dataset. LINEBREAK figure 1: local anchored features contribute more to mi improvement than nonrobust/unuseful features, unveiling closer relation with robustness. LINEBREAK evaluation against textfooler infobert can defend against not only human-crafted adversarial examples (e.g., anli) but also those generated by adversarial attacks (e.g., textfooler). results are summarized in table 3. we can see that infobert barely affects model performance on the benign test data, and in the case of adversarial training, infobert even boosts the benign test accuracy. under the textfooler attack, the robust accuracy of the vanilla bert drops to 0.0% on both mnli and snli datasets, while roberta drops from 90% to around 20%. we observe that both adversarial training and infobert with standard training can improve robust accuracy by a comparable large margin, while infobert with adversarial training achieves the best performance among all models, confirming the hypothesis in theorem 3.2 that combining adversarial training with ib regularizer can further minimize i(x (cid:48) LINEBREAK i ), leading to better robustness than the vanilla one. LINEBREAK i; t (cid:48) LINEBREAK evaluation on adversarial squad previous experiments show that infobert can improve model robustness for nli tasks. now we demonstrate that infobert can also be adapted to other nlp tasks such as qa in table 4. similar to our observation on nli dataset, we find that infobert barely hurts the performance on the benign test data, and even improves it in some cases. moreover, infobert substantially improves model robustness when presented with adversarial qa test sets (addsent and addonesent). while adversarial training does help improve robustness, infobert can further boost the robust performance by a larger margin. in particular, infobert through standard training achieves the state-of-the-art robust f1/em score as 78.5/72.9 compared to existing adversarial training baselines, and in the meantime requires only half the training time of adversarialtraining-based methods. LINEBREAK analysis of local anchored features LINEBREAK we conduct an ablation study to further validate that our anchored feature regularizer indeed filters out nonrobust/unuseful information. as shown in table 1 and 2, adding adversarial data in the training set can significantly improve model robustness. to find out what helps improve the robustness from the mi perspective, we first calculate the mi between anchored features and global features 1 j=1 i(tkj ; z) on the adversarial test data and benign test data, based on the model m trained without adversarial training data (denoted by i (cid:48) r and ir). we then calculate the mi between nonrobust/unuseful features and global features 1 i=1 i(tki; z) on the adversarial test data and m (cid:48) LINEBREAK benign data as well (denoted by i (cid:48) n and in). after adding adversarial examples into the training set and re-training the model, we find that the mi between the local features and the global features substantially increases on the adversarial test data, which accounts for the robustness improvement. we also observe that those local anchored features extracted by our anchored feature regularizer, as expected, contribute more to the mi improvement. as shown in figure 1, the mi improvement of anchored features on adversarial test data ∆i (cid:48) r (red bar on the left) is higher than that of nonrobust/unuseful ∆i (cid:48) n (red bar on the right), thus confirming that local anchored features discovered by our anchored feature regularizer have a stronger impact on robustness than nonrobust/unuseful ones. LINEBREAK we conduct more ablation studies in appendix §a.2, including analyzing the individual impact of two regularizers, the difference between global and local features for ib regularizer, hyper-parameter selection strategy and so on. LINEBREAK conclusion LINEBREAK in this paper, we propose a novel learning framework infobert from an information theoretic perspective to perform robust fine-tuning over pre-trained language models. specifically, infobert consists of two novel regularizers to improve the robustness of the learned representations: (a) information bottleneck regularizer, learning to extract the approximated minimal sufficient statistics and denoise the excessive spurious features, and (b) local anchored feature regularizer, which improves the robustness of global features by aligning them with local anchored features. supported by our theoretical analysis, infobert provides a principled way to improve the robustness of bert and roberta against strong adversarial attacks over a variety of nlp tasks, including nli and qa tasks. comprehensive experiments demonstrate that infobert outperforms existing baseline methods and achieves new state of the art on different adversarial datasets. we believe this work will shed light on future research directions towards improving the robustness of representation learning for language models. LINEBREAK acknowledgement LINEBREAK we gratefully thank the anonymous reviewers and meta-reviewers for their constructive feedback. we also thank julia hockenmaier, alexander schwing, sanmi koyejo, fan wu, wei wang, pengyu cheng, and many others for the helpful discussion. this work is partially supported by nsf grant no.1910100, darpa qed-rml-fp-003, and the intel rsa 2020. LINEBREAK references LINEBREAK moustafa alzantot, yash sharma, ahmed elgohary, bo-jhang ho, mani b. srivastava, and kai-wei chang. generating natural language adversarial examples. in ellen riloff, david chiang, julia hockenmaier, and jun’ichi tsujii (eds.), emnlp, pp. 2890–2896. association for computational linguistics, 2018. LINEBREAK david barber and felix v. agakov. the im algorithm: a variational approach to information maxi LINEBREAK mization. in neurips, 2003. LINEBREAK mohamed ishmael belghazi, aristide baratin, sai rajeshwar, sherjil ozair, yoshua bengio, aaron courville, and devon hjelm. mutual information neural estimation. in jennifer dy and andreas krause (eds.), proceedings of the 35th international conference on machine learning, volume 80 of proceedings of machine learning research, pp. 531–540, stockholmsm¨assan, stockholm sweden, 10–15 jul 2018. pmlr. LINEBREAK samuel r. bowman, gabor angeli, christopher potts, and christopher d. manning. a large annotated corpus for learning natural language inference. in llu´ıs m`arquez, chris callison-burch, jian su, daniele pighin, and yuval marton (eds.), emnlp, pp. 632–642. the association for computational linguistics, 2015. LINEBREAK tom b. brown, benjamin mann, nick ryder, melanie subbiah, jared kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, sandhini agarwal, ariel herbert-voss, gretchen krueger, tom henighan, rewon child, aditya ramesh, daniel m. LINEBREAK ziegler, jeffrey wu, clemens winter, christopher hesse, mark chen, eric sigler, mateusz litwin, scott gray, benjamin chess, jack clark, christopher berner, sam mccandlish, alec radford, ilya sutskever, and dario amodei. language models are few-shot learners. 2020. LINEBREAK ting chen, simon kornblith, mohammad norouzi, and geoffrey e. hinton. a simple framework LINEBREAK for contrastive learning of visual representations. corr, abs/2002.05709, 2020. LINEBREAK pengyu cheng, weituo hao, shuyang dai, jiachang liu, zhe gan, and l. carin. club: a contrastive LINEBREAK log-ratio upper bound of mutual information. arxiv, abs/2006.12013, 2020. LINEBREAK jeremy m. cohen, elan rosenfeld, and j. zico kolter. certified adversarial robustness via randomized smoothing. in kamalika chaudhuri and ruslan salakhutdinov (eds.), icml, volume 97 of proceedings of machine learning research, pp. 1310–1320. pmlr, 2019. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep bidirectional transformers for language understanding. in jill burstein, christy doran, and thamar solorio (eds.), naacl-hlt, pp. 4171–4186. association for computational linguistics, 2019. LINEBREAK krishnamurthy dvijotham, sven gowal, robert stanforth, relja arandjelovic, brendan o’donoghue, jonathan uesato, and pushmeet kohli. training verified learners with learned verifiers. corr, abs/1805.10265, 2018. LINEBREAK javid ebrahimi, anyi rao, daniel lowd, and dejing dou. hotflip: white-box adversarial examples for text classification. in iryna gurevych and yusuke miyao (eds.), acl, pp. 31–36. association for computational linguistics, 2018. LINEBREAK kevin eykholt, ivan evtimov, earlence fernandes, bo li, amir rahmati, chaowei xiao, atul prakash, tadayoshi kohno, and dawn xiaodong song. robust physical-world attacks on deep learning models. 2017. LINEBREAK zhe gan, yen-chun chen, linjie li, chen zhu, yu cheng, and jingjing liu. large-scale adversarial training for vision-and-language representation learning. arxiv preprint arxiv:2006.06195, 2020. LINEBREAK ian j. goodfellow, jonathon shlens, and christian szegedy. explaining and harnessing adversarial LINEBREAK r devon hjelm, alex fedorov, samuel lavoie-marchildon, karan grewal, phil bachman, adam trischler, and yoshua bengio. learning deep representations by mutual information estimation and maximization. in iclr, 2019. LINEBREAK po-sen huang, robert stanforth, johannes welbl, chris dyer, dani yogatama, sven gowal, krishnamurthy dvijotham, and pushmeet kohli. achieving verified robustness to symbol substitutions via interval bound propagation. in kentaro inui, jing jiang, vincent ng, and xiaojun wan (eds.), emnlp-ijcnlp, pp. 4081–4091. association for computational linguistics, 2019. LINEBREAK mohit iyyer, john wieting, kevin gimpel, and luke zettlemoyer. adversarial example generation with syntactically controlled paraphrase networks. in marilyn a. walker, heng ji, and amanda stent (eds.), naacl-hlt, pp. 1875–1885. association for computational linguistics, 2018. LINEBREAK joern-henrik jacobsen, jens behrmann, richard zemel, and matthias bethge. excessive invariance LINEBREAK causes adversarial vulnerability. in iclr, 2019. LINEBREAK robin jia and percy liang. adversarial examples for evaluating reading comprehension systems. in martha palmer, rebecca hwa, and sebastian riedel (eds.), emnlp, pp. 2021–2031. association for computational linguistics, 2017. LINEBREAK robin jia, aditi raghunathan, kerem g¨oksel, and percy liang. certified robustness to adversarial word substitutions. in kentaro inui, jing jiang, vincent ng, and xiaojun wan (eds.), emnlpijcnlp, pp. 4127–4140. association for computational linguistics, 2019. LINEBREAK haoming jiang, pengcheng he, weizhu chen, xiaodong liu, jianfeng gao, and tuo zhao. smart: robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. in dan jurafsky, joyce chai, natalie schluter, and joel r. tetreault (eds.), acl, pp. 2177–2190. association for computational linguistics, 2020. LINEBREAK di jin, zhijing jin, joey tianyi zhou, and peter szolovits. is bert really robust? a strong baseline for natural language attack on text classification and entailment. in aaai, pp. 8018–8025. aaai press, 2020. LINEBREAK lingpeng kong, cyprien de masson d’autume, lei yu, wang ling, zihang dai, and dani yogatama. a mutual information maximization perspective of language representation learning. in iclr, 2020. LINEBREAK jinfeng li, shouling ji, tianyu du, bo li, and ting wang. textbugger: generating adversarial text LINEBREAK against real-world applications. in ndss. the internet society, 2019. LINEBREAK ralph linsker. self-organization in a perceptual network. computer, 21(3):105–117, 1988. LINEBREAK xiaodong liu, hao cheng, pengcheng he, weizhu chen, yu wang, hoifung poon, and jianfeng LINEBREAK gao. adversarial training for large neural language models. corr, abs/2004.08994, 2020. LINEBREAK yinhan liu, myle ott, naman goyal, jingfei du, mandar joshi, danqi chen, omer levy, mike lewis, luke zettlemoyer, and veselin stoyanov. roberta: a robustly optimized bert pretraining approach. corr, abs/1907.11692, 2019. LINEBREAK seyed-mohsen moosavi-dezfooli, alhussein fawzi, and pascal frossard. deepfool: a simple and LINEBREAK accurate method to fool deep neural networks. cvpr, pp. 2574–2582, 2016. LINEBREAK yixin nie, adina williams, emily dinan, mohit bansal, jason weston, and douwe kiela. adversarial nli: a new benchmark for natural language understanding. in dan jurafsky, joyce chai, natalie schluter, and joel r. tetreault (eds.), acl, pp. 4885–4901. association for computational linguistics, 2020. LINEBREAK nicolas papernot, patrick d. mcdaniel, xi wu, somesh jha, and ananthram swami. distillation as a defense to adversarial perturbations against deep neural networks. 2016 ieee symposium on security and privacy (sp), pp. 582–597, 2016. LINEBREAK pranav rajpurkar, jian zhang, konstantin lopyrev, and percy liang. squad: 100, 000+ questions for machine comprehension of text. in jian su, xavier carreras, and kevin duh (eds.), emnlp, pp. 2383–2392. the association for computational linguistics, 2016. LINEBREAK shuhuai ren, yihe deng, kun he, and wanxiang che. generating natural language adversarial examples through probability weighted word saliency. in anna korhonen, david r. traum, and llu´ıs m`arquez (eds.), acl, pp. 1085–1097. association for computational linguistics, 2019. LINEBREAK nikunj saunshi, orestis plevrakis, sanjeev arora, mikhail khodak, and hrishikesh khandeparkar. a theoretical analysis of contrastive unsupervised representation learning. in kamalika chaudhuri and ruslan salakhutdinov (eds.), icml, volume 97 of proceedings of machine learning research, pp. 5628–5637. pmlr, 2019. LINEBREAK yonglong tian, chen sun, ben poole, dilip krishnan, cordelia schmid, and phillip isola. what LINEBREAK makes for good views for contrastive learning. corr, abs/2005.10243, 2020. LINEBREAK n. tishby and n. zaslavsky. deep learning and the information bottleneck principle. in 2015 ieee LINEBREAK information theory workshop (itw), pp. 1–5, 2015. LINEBREAK a¨aron van den oord, yazhe li, and oriol vinyals. representation learning with contrastive predic LINEBREAK ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n. gomez, lukasz kaiser, and illia polosukhin. attention is all you need. in isabelle guyon, ulrike von luxburg, samy bengio, hanna m. wallach, rob fergus, s. v. n. vishwanathan, and roman garnett (eds.), neurips, pp. 5998–6008, 2017. LINEBREAK boxin wang, hengzhi pei, boyuan pan, qian chen, shuohang wang, and bo li. t3: tree LINEBREAK autoencoder constrained adversarial text generation for targeted attack. in emnlp, 2020. LINEBREAK adina williams, nikita nangia, and samuel r. bowman. a broad-coverage challenge corpus for sentence understanding through inference. in marilyn a. walker, heng ji, and amanda stent (eds.), naacl-hlt, pp. 1112–1122. association for computational linguistics, 2018. LINEBREAK mao ye, chengyue gong, and qiang liu. safer: a structure-free approach for certified robustness in dan jurafsky, joyce chai, natalie schluter, and joel r. LINEBREAK to adversarial word substitutions. tetreault (eds.), acl, pp. 3465–3475. association for computational linguistics, 2020. LINEBREAK yue yu, simiao zuo, haoming jiang, wendi ren, tuo zhao, and chao zhang. fine-tuning pretrained language model with weak supervision: a contrastive-regularized self-training approach. corr, abs/2010.07835, 2020. LINEBREAK yuan zang, fanchao qi, chenghao yang, zhiyuan liu, meng zhang, qun liu, and maosong sun. word-level textual adversarial attacking as combinatorial optimization. in dan jurafsky, joyce chai, natalie schluter, and joel r. tetreault (eds.), acl, pp. 6066–6080. association for computational linguistics, 2020. LINEBREAK yuan zhang, jason baldridge, and luheng he. paws: paraphrase adversaries from word scrambling. in jill burstein, christy doran, and thamar solorio (eds.), naacl-hlt, pp. 1298–1308. association for computational linguistics, 2019. LINEBREAK chen zhu, yu cheng, zhe gan, siqi sun, tom goldstein, and jingjing liu. freelb: enhanced LINEBREAK adversarial training for natural language understanding. in iclr. openreview.net, 2020a. LINEBREAK sicheng zhu, xiao zhang, and david evans. learning adversarially robust representations via LINEBREAK worst-case mutual information maximization. corr, abs/2002.11798, 2020b. LINEBREAK a appendix LINEBREAK figure 2: the complete objective function of infobert, which can be decomposed into (a) standard task objective, (b) information bottleneck regularizer, and (c) local anchored feature regularizer. for (b), we both theoretically and empirically demonstrate that we can improve the adversarial robustness by decreasing the mutual information of i(xi; ti) without affecting the benign accuracy much. for (c), we propose to align the local anchored features tkj (highlighted in yellow) with the global feature z by maximizing their mutual information i(tkj ; z). LINEBREAK implementation details LINEBREAK model details1 bert is a transformer (vaswani et al., 2017) based model, which is unsupervised pretrained on large corpora. we use bertlarge-uncased as the baseline model, which has 24 layers, 1024 hidden units, 16 self-attention heads, and 340m parameters. robertalarge shares the same architecture as bert, but modifies key hyperparameters, removes the next-sentence pretraining objective and trains with much larger mini-batches and learning rates, which results in higher performance than bert model on glue, race and squad. LINEBREAK standard training details for both standard and adversarial training, we fine-tune infobert for 2 epochs on the qa task, and for 3 epochs on the nli task. the best model is selected based on the performance on the development set. all fine-tuning experiments are run on nvidia v100 gpus. for nli task, we set the batch size to 256, learning rate to 2 × 10−5, max sequence length to 128 and warm-up steps to 1000. for qa task, we set the batch size to 32, learning rate to 3 × 10−5 and max sequence length to 384 without warm-up steps. LINEBREAK adversarial training details2 adversarial training introduces hyper-parameters including adversarial learning rates, number of pgd steps, and adversarial norm. when combing adversarial training with infobert, we use freelb as the adversarial training implementation, and set adversarial learning rate to 10−1 or 4∗10−2, adversarial steps to 3, maximal perturbation norm to 3∗10−1 or 2 ∗ 10−1 and initial random perturbation norm to 10−1 or 0. LINEBREAK information bottleneck regularizer details for information bottleneck, there are different ways to model p(t | x): LINEBREAK 1. assume that p(t | x) is unknown. we use a neural net parameterized by qθ(t | x) to learn the conditional distribution p(t | x). we assume the distribution is a gaussian distribution. the LINEBREAK 1we use the huggingface implementation https://github.com/huggingface/transformers LINEBREAK for bert and roberta. LINEBREAK 2we follow the freelb implementations in https://github.com/zhuchen03/freelb. LINEBREAK neural net qθ will learn the mean and variance of the gaussian given input x and representation t. by reparameterization trick, the neural net can be backpropagated to approximate the distribution given the training samples. LINEBREAK 2. p(t | x) is known. since t is the representation encoded by bert, we actually already know the distribution of p. we also denote it as qθ, where θ is the parameter of the bert encoder fθ. if we assume the conditional distribution is a gaussian n (ti, σ) for input xi whose mean is the bert representation ti and variance is a fixed constant σ, the eq.6 becomes LINEBREAK llib = LINEBREAK (cid:2) log qψ(y(i) | t(i))(cid:3) − β LINEBREAK − c(σ)||t(cid:48)(i) LINEBREAK k − t(i) LINEBREAK c(σ)||tj − tk||2 2 LINEBREAK where c(σ) is a positive constant related to σ. in practice, the sample t(cid:48) i from the conditional distribution gaussian n (ti, σ) can be ti with some gaussian noise, an adversarial examples of ti, or ti itself (assume σ = 0). LINEBREAK we use the second way to model p(t | x) for infobert finally, as it gives higher robustness improvement than the first way empirically (shown in the following §a.2). we suspect that the main reason is because the first way needs to approximate the distribution p(t | x) via another neural net which could present some difficulty in model training. LINEBREAK information bottleneck regularizer also introduces another parameter β to tune the trad-off between representation compression i(xi; ti) and predictive power i(y ; t ). we search for the optimal β via grid search, and set β = 5 × 10−2 for roberta, β = 10−3 for bert on the nli task. on the qa task, we set β = 5 × 10−5, which is substantially lower than β on nli tasks, thus containing more word-level features. we think it is mainly because the qa task relies more on the word-level representation to predict the exact answer spans. more ablation results can be found in the following §a.2. LINEBREAK anchored feature regularizer details anchored feature regularizer uses α to weigh the balance between predictive power and importance of anchored feature. we set α = 5 × 10−3 for both nli and qa tasks. anchored feature regularizer also introduces upper and lower threshold cl and ch for anchored feature extraction. we set ch = 0.9 and cl = 0.5 for the nli task, and set ch = 0.95 and cl = 0.75 for the qa task. the neural mi estimator used by infonce uses two-layer fully connected layer to estimate the mi with the intermediate layer hidden size set to 300. LINEBREAK a.2 additional experimental results LINEBREAK a.2.1 ablation study on information bottleneck regularizer LINEBREAK modeling p(t | x) as discussed in §a.1, we have two ways to model p(t | x): (i) using an auxiliary neural network to approximate the distribution; (ii) directly using the bert encoder fθ to calculate the p(t | x). thus we implemented these two methods and compare the robustness improvement in table 5. to eliminate other factors such as anchored feature regularizer and adversarial training, we set α = 0, β = 5 × 10−2 and conduct the following ablation experiments via standard training on standard datasets. we observe that although both modeling methods can improve the model robustness, modeling as bert encoder gives a larger margin than the auxiliary net. moreover, the second way barely sacrifices the performance on benign data, while the first way can hurt the benign accuracy a little bit. therefore, we use the bert encoder fθ to model the p(t | x) in our main paper. LINEBREAK local features v.s. global features information bottlenck regularizer improves model robustin the main paper, we use t as word-level local features. here we ness by reducing i(x; t ). consider t as sentence-level global features, and compare the robustness improvement with t as local features. to eliminate other factors such as anchored feature regularizer and adversarial training, we set α = 0, β = 5 × 10−2 and conduct the following ablation experiments via standard training. LINEBREAK model datasets method LINEBREAK adversarial accuracy benign accuracy LINEBREAK (anli) LINEBREAK (mnli/snli) LINEBREAK bert LINEBREAK standard datasets LINEBREAK vanilla LINEBREAK auxiliary net LINEBREAK bert encoder fθ LINEBREAK table 5: robust accuracy on the anli dataset. here we refer “standard datasets” as training on the benign datasets (mnli + snli) only. “vanilla” refers to the vanilla bert trained without information bottleneck regularizer. LINEBREAK the experimental results are summarized in table 6. we can see that while both features can boost the model robustness, using local features yield higher robust accuracy improvement than global features, especially when adversarial training dataset is added. LINEBREAK hyper-parameter search we perform grid search to find out the optimal β so that the optimal trade-off between representation compression (“minimality”) and predictive power (“sufficiency”) is achieved. an example to search for the optimal β on qa dataset is shown in fingure 3, which illustrates how β affects the f1 score on benign and adversarial datasets. we can see that from a very small β, both the robust and benign f1 scores increase, demonstrating infobert can improve both robustness and generalization to some extent. when we set β = 5 × 10−5 (log(β) = −9.9), infobert achieves the best benign and adversarial accuracy. when we set a larger β to further minimize i(xi; ti), we observe that the benign f1 score starts to drop, indicating the increasingly compressed representation could start to hurt its predictive capability. LINEBREAK a.2.2 ablation study on anchored feature regularizer LINEBREAK visualization of anchored words to explore which local anchored features are extracted, we conduct another ablation study to visualize the local anchored words. we follow the best hyperparameters of anchored feature regularizer introduced in §a.1, use the best bert model trained on benign datasets (mnli + snli) only and test on the anli dev set. we visualize the local anchored words in table 7 as follows. in the first example, we find that anchored features mainly focus on the important features such as quantity number “two”, the verb “playing” and objects “card”/“poker” to make a robust prediction. in the second example, the matching robust features between hypothesis and premise, such as “people”, “roller” v.s. “park”, “flipped upside” v.s. “ride”, are aligned to infer the relationship of hypothesis and premise. these anchored feature examples confirm that anchored feature regularizer is able to find out useful and stable features to improve the robustness of global representation. LINEBREAK model LINEBREAK datasets LINEBREAK features LINEBREAK adversarial accuracy benign accuracy LINEBREAK (anli) LINEBREAK (mnli/snli) LINEBREAK roberta LINEBREAK standard datasets LINEBREAK standard and adversarial datasets LINEBREAK vanilla LINEBREAK global feature LINEBREAK local feature LINEBREAK vanilla LINEBREAK global feature LINEBREAK local feature LINEBREAK table 6: robust accuracy on the anli dataset. here we refer “standard datasets” as training on the benign datasets (mnli + snli) only, and “standard and adversarial datasaets” as training on the both benign and adversarial datasets (anli(trianing) + mnli + snli + fevernli). “vanilla” refers to the vanilla roberta trained without information bottleneck regularizer. LINEBREAK figure 3: benign/robust f1 score on benign/adversarial qa datasets. models are trained on the benign squad dataset with different β. LINEBREAK input (bold = local stable words for local anchored features.) LINEBREAK premise: two woman, both sitting near a pile of poker chips, are playing cards. hypothesis: two woman playing poker. LINEBREAK premise: people are flipped upside - down on a bright yellow roller coaster. hypothesis: people on on a ride at an amusement park. LINEBREAK table 7: local anchored features extracted by anchored feature regularizer. LINEBREAK a.2.3 ablation study on disentangling two regularizers LINEBREAK to understand how two regularizers contribute to the improvement of robustness separetely, we apply two regularizers individually to both the standard training and adversarial training. we refer infobert trained with ib regularizer only as “infobert (ibr only)” and infobert trained with anchored feature regularizer only as “infobert (afr only)”. “infobert (both)” is the standard setting for infobert, where we incorporate both regularizers during training. for “infobert (ibr only)”, we set α = 0 and perform grid search to find the optimal β = 5 × 10−2. similarly for “infobert (afr only)”, we set β = 0 and find the optimal parameters as α = 5 × 10−3, ch = 0.9 and cl = 0.5. LINEBREAK the results are shown in table 8. we can see that both regularizers improve the robust accuracy on top of vanilla and freelb to a similar margin. applying one of the regularizer can achieve similar performance of freelb, but the training time of infobert is only 1/3˜1/2 less than freelb. moreover, after combining both regularizers, we observe that infobert achieves the best robust accuracy. LINEBREAK a.2.4 examples of adversarial datasets generated by textfooler LINEBREAK we show some adversarial examples generated by textfooler in table 9. we can see most adversarial examples are of high quality and look valid to human while attacking the nlp models, thus confirming our adversarial dastasets created by textfooler is a strong benchmark dataset to evaluate model robustness. however, as also noted in jin et al. (2020), we observe that some adversarial examples look invalid to human for example, in the last example of table 9, textfooler replaces “stand” with “position”, losing the critical information that “girls are standing instead of kneeling” and fooling both human and nlp models. therefore, we expect that infobert should achieve better robustness when we eliminate such invalid adversarial examples during evaluation. LINEBREAK model LINEBREAK training LINEBREAK method LINEBREAK adversarial accuracy benign accuracy LINEBREAK (anli) LINEBREAK (mnli/snli) LINEBREAK standard training LINEBREAK bert LINEBREAK adversarial training LINEBREAK vanilla LINEBREAK infobert (ibr only) LINEBREAK infobert (afr only) LINEBREAK infobert (both) LINEBREAK freelb LINEBREAK infobert (ibr only) LINEBREAK infobert (afr only) LINEBREAK infobert (both) LINEBREAK table 8: robust accuracy on the anli dataset. models are trained on the benign datasets (mnli + snli). here we refer “ibr only” as training with information bottleneck regularizer only. “afr only” refers to infobert trained with anchored feature regularizer only. “both” is the standard infobert that applies two regularizers together. LINEBREAK input (red = modified words, bold = original words.) LINEBREAK valid adversarial examples LINEBREAK premise: a young boy is playing in the sandy water. original hypothesis: there is a boy in the water. adversarial hypothesis: there is a man in the water. LINEBREAK model prediction: entailment → contradiction LINEBREAK premise: a black and brown dog is playing with a brown and white dog . original hypothesis: two dogs play. adversarial hypothesis: two dogs gaming. LINEBREAK model prediction: entailment → neutral LINEBREAK premise: adults and children share in the looking at something, and some young ladies stand to the side. original hypothesis: some children are sleeping. adversarial hypothesis: some children are dreaming. LINEBREAK model prediction: contradiction → neutral LINEBREAK premise: families with strollers waiting in front of a carousel. original hypothesis: families have some dogs in front of a carousel. adversarial hypothesis: families have some doggie in front of a carousel. LINEBREAK model prediction: contradiction → entailment LINEBREAK invalid adversarial examples LINEBREAK premise: two girls are kneeling on the ground. original hypothesis: two girls stand around the vending machines. adversarial hypothesis: two girls position around the vending machinery. LINEBREAK model prediction: contradiction → neutral LINEBREAK table 9: adversarial examples generated by textfooler for bertlarge on snli dataset. LINEBREAK a.3 proofs LINEBREAK a.3.1 proof of theorem 3.1 LINEBREAK we first state two lemmas. lemma a.1. given a sequence of random variables x1, x2, ..., xn and a deterministic function f , then ∀ i, j = 1, 2, ..., n, we have LINEBREAK i(xi; f (xi)) ≥ i(xj; f (xi)) LINEBREAK proof. by the definition, LINEBREAK i(xi; f (xi)) = h(f (xi)) − h(f (xi) | xi) i(xj; f (xi)) = h(f (xi)) − h(f (xi) | xj) LINEBREAK since f is a deterministic function, LINEBREAK therefore, LINEBREAK h(f (xi) | xi) = 0 h(f (xi) | xj) ≥ 0 LINEBREAK i(xi; f (xi)) ≥ i(xj; f (xi)) LINEBREAK lemma a.2. let x = [x1; x2; ...; xn] be a sequence of random variables, and t = [t1; t2; ...; tn] = [f (x1); f (x2); ...; f (xn)] be a sequence of random variables generated by a deterministic function f . then we have LINEBREAK i(x; t ) ≤ n LINEBREAK i(xi; ti) LINEBREAK proof. since x = [x1; x2; ...; xn] and t = [t1; t2; ...; tn] are language tokens with its corresponding local representations, we have LINEBREAK i(x; t ) = i(x; t1, t2, ..., tn) = LINEBREAK [h(ti | t1, t2, ..., ti−1) − h(ti | x, t1, t2, ..., ti−1)] LINEBREAK [h(ti) − h(ti | x)] = LINEBREAK i(x; ti) LINEBREAK i(xj; ti) ≤ n LINEBREAK i(xi; ti), LINEBREAK where the first inequality follows because conditioning reduces entropy, and the last inequality is because i(xi; ti) ≥ i(xj; ti) based on lemma a.1. LINEBREAK then we directly plug lemma a.2 into theorem 3.1, we have the lower bound of lib as LINEBREAK i(y ; t ) − βi(x; t ) ≥ i(y ; t ) − nβ LINEBREAK i(xi; ti). LINEBREAK a.3.2 proof of theorem 3.2 LINEBREAK we first state an easily proven lemma, LINEBREAK lemma a.3. for any a, b ∈ [0, 1], LINEBREAK where φ(·) : r+ → r+ is defined as LINEBREAK |a log(a) − b log(b)| ≤ φ(|a − b|), LINEBREAK φ(x) = LINEBREAK it is easy to verify that φ(x) is a continuous, monotonically increasing, concave and subadditive function. LINEBREAK now, we can proceed with the proof of theorem 3.2. LINEBREAK proof. we use the fact that LINEBREAK |i(y ; t ) − i(y ; t (cid:48))| ≤ |h(t | y ) − h(t (cid:48) | y )| + |h(t ) − h(t (cid:48))| LINEBREAK and bound each of the summands on the right separately. LINEBREAK we can bound the first summand as follows: LINEBREAK |h(t | y ) − h(t (cid:48) | y )| ≤ LINEBREAK y LINEBREAK p(y)|h(t | y = y) − h(t (cid:48) | y = y)| LINEBREAK p(y)| LINEBREAK p(t | y) log(1/p(t | y)) − LINEBREAK q(t | y) log(1/q(t | y))| LINEBREAK t LINEBREAK y LINEBREAK where LINEBREAK p(y) LINEBREAK p(y)
| 18
|
[
191.944,
372.5052556,
209.94645514,
382.4678556
] |
0sgntlpKDOz.pdf
| 2,022
| 0
|
LINEBREAK learning graphon mean field games and approximate nash equilibria LINEBREAK kai cui & heinz koeppl department of electrical engineering, technische universität darmstadt, germany {kai.cui,heinz.koeppl}@bcs.tu-darmstadt.de LINEBREAK abstract LINEBREAK recent advances at the intersection of dense large graph limits and mean field games have begun to enable the scalable analysis of a broad class of dynamical sequential games with large numbers of agents. so far, results have been largely limited to graphon mean field systems with continuous-time diffusive or jump dynamics, typically without control and with little focus on computational methods. we propose a novel discrete-time formulation for graphon mean field games as the limit of non-linear dense graph markov games with weak interaction. on the theoretical side, we give extensive and rigorous existence and approximation properties of the graphon mean field solution in sufficiently large systems. on the practical side, we provide general learning schemes for graphon mean field equilibria by either introducing agent equivalence classes or reformulating the graphon mean field system as a classical mean field system. by repeatedly finding a regularized optimal control solution and its generated mean field, we successfully obtain plausible approximate nash equilibria in otherwise infeasible large dense graph games with many agents. empirically, we are able to demonstrate on a number of examples that the finite-agent behavior comes increasingly close to the mean field behavior for our computed equilibria as the graph or system size grows, verifying our theory. more generally, we successfully apply policy gradient reinforcement learning in conjunction with sequential monte carlo methods. LINEBREAK introduction LINEBREAK today, reinforcement learning (rl) finds application in various application areas such as robotics (kober et al., 2013), autonomous driving (kiran et al., 2021) or navigation of stratospheric balloons (bellemare et al., 2020) as a method to realize effective sequential decision-making in complex problems. rl remains a very active research area, and there remain many challenges in multi-agent reinforcement learning (marl) as a generalization of rl such as learning goals, non-stationarity and scalability of algorithms (zhang et al., 2021). nonetheless, potential applications for marl are manifold and include e.g. teams of unmanned aerial vehicles (tožiˇcka et al., 2018; pham et al., 2018) or video games (berner et al., 2019; vinyals et al., 2017). while the domain of marl is somewhat empirically successful, problems quickly become intractable as the number of agents grows, and methods in marl typically miss a theoretical foundation. a recent tractable approach to handling the scalability problem in marl are competitive mean field games and cooperative mean field control (gu et al., 2021). instead of considering generic multi agent markov games, one considers many agents under the weak interaction principle, i.e. each agent alone has a negligible influence on all other agents. this class of models naturally contains a large number of real world scenarios and can find application e.g. in analysis of power network resilience (bagagiolo & bauso, 2014), smart heating (kizilkale & malhame, 2014), edge computing (banez et al., 2019) or flocking (perrin et al., 2021b). see also djehiche et al. (2017) for a review of other engineering applications. LINEBREAK mean field games. mean field games (mfgs) were first popularized in the independent seminal works of huang et al. (2006) and lasry & lions (2007) for the setting of differential games with diffusion-type dynamics given by stochastic differential equations. see also guéant et al. (2011); bensoussan et al. (2013) for a review. since then, extensions have been manifold and include e.g. discrete-time (saldi et al., 2018), partial observability (saldi et al., 2019), major-minor formulations LINEBREAK (nourian & caines, 2013) and many more. in the learning community, there has been immense recent interest in finding and analyzing solution methods for mean field equilibria (cardaliaguet & hadikhanloo, 2017; mguni et al., 2018; guo et al., 2019; subramanian & mahajan, 2019; elie et al., 2020; cui & koeppl, 2021; pasztor et al., 2021; perolat et al., 2021; perrin et al., 2021a), solving the inverse reinforcement learning problem (yang et al., 2018a) or applying related approximations directly to marl (yang et al., 2018b). in contrast to our work, yang et al. (2018a) consider states instead of agents on a graph, while yang et al. (2018b) requires restrictive assumptions and only considers averages instead of distributions of the neighbors. recently, focus increased also on the cooperative case of mean field control (carmona et al., 2019b; mondal et al., 2021), for which dynamic programming holds on an enlarged state space, resulting in a high-dimensional markov decision process (pham & wei, 2018; motte & pham, 2019; gu et al., 2020; cui et al., 2021). LINEBREAK mean field systems on graphs. for mean field systems on dense graphs, prior work mostly considers mean field systems without control (vizuete et al., 2020) or time-dynamics, i.e. the static case (parise & ozdaglar, 2019; carmona et al., 2019a). to the best of our knowledge, gao & caines (2017) and caines & huang (2019) are the first to consider general continuous-time diffusion-type graphon mean field systems with control, the latter proposing many clusters of agents as well as proving an approximate nash property as the number of clusters and agents grows. there have since been efforts to control cooperative graphon mean field systems with diffusive linear dynamics using spectral methods (gao & caines, 2019a;b). on the other hand, bayraktar et al. (2020); bet et al. (2020) consider large non-clustered systems in a continuous-time diffusion-type setting without control, while aurell et al. (2021b) and aurell et al. (2021a) consider continuous-time linear-quadratic systems and continuous-time jump processes respectively. to the best of our knowledge, only vasal et al. (2021) have considered solving and formulating a graphon mean field game in discrete time, though requiring analytic computation of an infinite-dimensional value function defined over all mean fields and thus being inapplicable to arbitrary problems in a black-box, learning manner. in contrast, we give a general learning scheme and also provide extensive theoretical analysis of our algorithms and (slightly different) model. finally, for sparse graphs there exist preliminary results (gkogkas & kuehn, 2020; lacker & soret, 2020), though the setting remains to be developed. LINEBREAK our contribution. in this work, we propose a dense graph limit extension of mfgs in discrete time, combining graphon mean field systems with mean field games. more specifically, we consider limits of many-agent systems with discrete-time graph-based dynamics and weak neighbor interactions. in contrast to prior works, we consider one of the first general discrete-time formulations as well as its controlled case, which is a natural setting for many problems that are inherently discrete in time or to be controlled digitally at discrete decision times. our contribution can be summarized as: (i) formulating one of the first general discrete-time graphon mfg frameworks for approximating otherwise intractable large dense graph games; (ii) providing an extensive theoretical analysis of existence and approximation properties in such systems; (iii) providing general learning schemes for finding graphon mean field equilibria, and (iv) empirically evaluating our proposed approach with verification of theoretical results in the finite n -agent graph system, finding plausible approximate nash equilibria for otherwise infeasible large dense graph games with many agents. LINEBREAK dense graph mean field games LINEBREAK in the following, we will give a dense graph n -agent model as well as its corresponding mean field system, where agents are affected only by the overall state distribution of all neighbors, as visualized in figure 1. as a result of the law of large numbers, this distribution will become deterministic – the mean field – as n . we begin with graph-theoretical preliminaries, see also lovász (2012) for a review. the study of dense large graph limits deals with the limiting representation of adjacency 0 as the space of all bounded, symmetric and matrices called graphons. define i 1. for any measurable functions (graphons) w ≤ ), we define its step-graphon a.e. uniquely by simple graph g = ( 1, . . . , n { LINEBREAK w i × i → LINEBREAK r bounded by 0 LINEBREAK ∈ w LINEBREAK w LINEBREAK e LINEBREAK wg(x, y) = LINEBREAK 1(i,j)∈e · LINEBREAK n , i LINEBREAK n ] · LINEBREAK n , j LINEBREAK n ], LINEBREAK (a): a graph with 5 nodes; (b): the associated step figure 1: graphical model visualization. graphon of the graph in (a) as a continuous domain version of its adjacency matrix; (c): a visualization of the dynamics, i.e. the center agent is affected only by its neighbors (grey). LINEBREAK see e.g. figure 1. we equip LINEBREAK 0 with the cut (semi-)norm LINEBREAK w LINEBREAK (cid:3) and cut (pseudo-)metric δ(cid:3) LINEBREAK for graphons w, w (cid:48) measurable subsets s, t LINEBREAK w LINEBREAK w (x, y) dx dy LINEBREAK w LINEBREAK (cid:3), LINEBREAK ϕ(x, y) := w (cid:48)(ϕ(x), ϕ(y)), where the supremum is over all LINEBREAK and the infimum is over measure-preserving bijections ϕ : LINEBREAK i → i LINEBREAK to provide motivation, note that convergence in δ(cid:3) is equivalent to e.g. convergence of probabilities of locally encountering any fixed subgraph by randomly sampling a subset of nodes. many such properties of graph sequences (gn )n ∈n converging to some graphon w 0 can then be described by w , and we point to lovász (2012) for details. in this work, we will primarily use the analytical fact that for converging graphon sequences LINEBREAK 0, we equivalently have LINEBREAK ∈ w LINEBREAK w LINEBREAK (cid:3) LINEBREAK w LINEBREAK under the operator norm of operators l∞ LINEBREAK wgn − (cid:107) (wgn (α, β) LINEBREAK → w (α, β))g(β) dβ LINEBREAK dα LINEBREAK by lovász (2012), theorem 11.59, the above is equivalent to convergence in the cut metric 0 up to relabeling. in the following, we will therefore assume sequences of simple δ(cid:3)(wgn , w ) → graphs gn = ( n , edge indicator variables n , v e ξn i,j := 1(i,j)∈en for all nodes i, j n , and associated step graphons wn converging in cut norm. assumption 1. the sequence of step-graphons (wn )n ∈n converges in cut norm (cid:3) or equivalently in operator norm LINEBREAK n ) with vertices e LINEBREAK , edge sets } LINEBREAK to some graphon w LINEBREAK as n LINEBREAK n = LINEBREAK ∈ v LINEBREAK v LINEBREAK (cid:3) LINEBREAK w LINEBREAK next, we define w -random graphs to consist of vertices with adjacency matrices ξn generated by sampling graphon indices αi uniformly from i,j ∼ bernoulli(w (αi, αj)) for all vertices i, j n . for experiments, by lovász (2012), lemma 10.16, we can thereby generate a.s. converging graph sequences by sampling w -random graphs for any fixed graphon w 0. in principle, one could also consider arbitrary graph generating processes whenever a valid relabeling function ϕ is known. LINEBREAK } and edges ξn LINEBREAK ∈ w LINEBREAK ∈ v LINEBREAK v LINEBREAK i LINEBREAK in our work, the usage of graphons enables us to find mean field systems on dense graphs and to extend the expressiveness of classical mfgs. as examples, we will use the limiting graphons of uniform attachment, ranked attachment and p-erd˝os–rényi (er) random graphs given by xy and wer(x, y) = p respectively (borgs et al., wunif (x, y) = 1 2011; lovász, 2012), each of which exhibits different node connectivities as shown in figure 2. LINEBREAK max(x, y), wrank(x, y) = 1 LINEBREAK figure 2: three graphons used in our experiments. (a): uniform attachment graphon; (b): ranked attachment graphon; (c): erd˝os–rényi (er) graphon with edge probability 0.5. LINEBREAK u LINEBREAK finite agent graph game. for simplicity of analysis, we consider finite state and action spaces , define the spaces of all borel as well as times x ) bounded by 1, equipped with the l1 probability measures norm. for simplified notation, we denote both a measure ν and its probability mass function by )t ×x , i.e. agents apply markovian feedback policies ). define the space of policies π := ν( · πi = (πi π that act on local state information. this allows for the definition of weakly interacting agent state and action random variables LINEBREAK . on a metric space 1( LINEBREAK ) and all borel measures LINEBREAK t)t∈t LINEBREAK ( a LINEBREAK ( u LINEBREAK t p LINEBREAK a LINEBREAK a LINEBREAK p LINEBREAK b LINEBREAK x i LINEBREAK πi t( under some transition kernel p : field gi LINEBREAK t of agent i is defined as the LINEBREAK t ∼ LINEBREAK x i LINEBREAK t ), x i t+1 ∼ ) 1( x LINEBREAK x ×u ×b 1( LINEBREAK p ( LINEBREAK t , gi LINEBREAK t , u i LINEBREAK x i ∈ t ), where the empirical neighborhood mean LINEBREAK t ∀ LINEBREAK ∈ v LINEBREAK i ∀ LINEBREAK t), LINEBREAK n LINEBREAK )-valued (unnormalized) neighborhood state distribution LINEBREAK → p LINEBREAK x LINEBREAK j∈vn (cid:88) where δ is the dirac measure, i.e. each agent affects each other at most negligibly with factor 1/n . finally, for each agent i we define separate, competitive objectives LINEBREAK ξn i,jδx j LINEBREAK t LINEBREAK b LINEBREAK x gi t := LINEBREAK i (π1, . . . , πn ) := e j n LINEBREAK r(x i LINEBREAK t , u i LINEBREAK t , gi t) LINEBREAK x × u × b LINEBREAK to be maximized over πi, where r : → remark 1. we can also consider infinite horizons, ˜j n t , gi i (π1, . . . , πn ) t) with all results but theorem 4 holding. one may also extend to state-action distributions, heteroge(cid:3) neous starting conditions and time-dependent r, p , though we avoid this for expositional simplicity. remark 2. note that it is straightforward to extend to heterogeneous agents by modelling agent types as part of the agent state, see also e.g. mondal et al. (2021). it is only required to model agent states in a unified manner, which does not imply that there can be no heterogeneity. LINEBREAK r is an arbitrary reward function. ∞ e t=0 γtr(x i LINEBREAK t , u i LINEBREAK x LINEBREAK with this, we can give a typical notion of nash equilibria as found e.g. in saldi et al. (2018). however, under graph convergence in assumption 1, it is always possible for a finite number of nodes to have an arbitrary neighborhood differing from the graphon as n . thus, it is impossible to show approximate optimality for all nodes and only possible to show for an increasingly large fraction 1 1 of nodes. for this reason, we slightly weaken the notion of nash equilibria by p − restricting to a fraction 1 definition 1. an (ε, p)-markov-nash equilibrium (almost markov-nash equilibrium) for ε, p > 0 is defined as a tuple of policies (π1, . . . , πn ) πn such that for any i ∈ w i (π1, . . . , πi−1, π, πi+1, . . . , πn ) j n LINEBREAK p of agents, as e.g. considered in (carmona, 2004; elie et al., 2020). LINEBREAK i (π1, . . . , πn ) j n LINEBREAK n , we have LINEBREAK sup π∈π LINEBREAK for some set LINEBREAK n LINEBREAK n containing at least LINEBREAK p)n LINEBREAK agents, i.e. LINEBREAK n LINEBREAK w LINEBREAK ⊆ v LINEBREAK − the minimal such ε > 0 for any fixed policy tuple (and typically p = 0) is also called its exploitability. whilst we ordain ε-optimality only for a fraction 1 p of agents, if the fraction p is negligible, it will have negligible impact on other agents as a result of the weak interaction property. thus, the solution will remain approximately optimal for almost all agents for sufficiently small p regardless of the behavior of that fraction p of agents. in the following, we will give a limiting system that shall provide (ε, p)-markov-nash equilibria with ε, p LINEBREAK 0 as n LINEBREAK |w LINEBREAK p)n LINEBREAK graphon mean field game. the formal n limit of the n -agent game constitutes its graphon mean field game (gmfg), which shall be rigorously justified in section 3. we define the )i and measurable mean field ensembles space of measurable state marginal ensembles µα m := . ∈ x ∈ t πi, i.e. with measurable similarly, we define the space of measurable policy ensembles π α LINEBREAK m t (x) is measurable for any µ LINEBREAK )t ×i, in the sense that α LINEBREAK → ∞ t := LINEBREAK x) for any π LINEBREAK m, t LINEBREAK ( x LINEBREAK π, t LINEBREAK , x LINEBREAK , u LINEBREAK , x LINEBREAK x LINEBREAK p LINEBREAK p πα t (u LINEBREAK ∈ t LINEBREAK ∈ x LINEBREAK ∈ u LINEBREAK in the gmfg, we will consider infinitely many agents α as a result, we will have infinitely many policies πα measurable policy ensemble π ∈ πα t ( LINEBREAK n . instead of the finitely many i ∈ i π – one for each agent α – through some π. we again define state and action random variables x α x α LINEBREAK t ), x α LINEBREAK t , gα LINEBREAK t , u α LINEBREAK (α, t) LINEBREAK x α LINEBREAK ∈ v LINEBREAK t ), LINEBREAK p ( LINEBREAK t ∼ LINEBREAK ∈ i × t LINEBREAK where we introduce the (now deterministic) LINEBREAK b LINEBREAK )-valued neighborhood mean field of agents α as LINEBREAK x w (α, β)µβ LINEBREAK t dβ LINEBREAK gα LINEBREAK t := LINEBREAK (cid:90)i m. under fixed π LINEBREAK for some deterministic µ µα t ≡ l LINEBREAK (x α LINEBREAK ∈ t ). finally, define the maximization objective of agent α over πα for fixed µ LINEBREAK t should be understood as the law of x α t , m as LINEBREAK α (πα) j µ LINEBREAK e LINEBREAK r(x α LINEBREAK t , u α LINEBREAK t , gα t ) LINEBREAK to formulate the limiting version of nash equilibria, we define a map ψ : π policy ensemble π LINEBREAK π to the corresponding generated mean field ensemble µ = ψ(π) LINEBREAK m mapping from a LINEBREAK µα t (x) LINEBREAK πα t (u LINEBREAK x)p (x(cid:48) LINEBREAK x, u, gα LINEBREAK t ), LINEBREAK ∈ i LINEBREAK x∈x (cid:88) LINEBREAK u∈u (cid:88) LINEBREAK m by LINEBREAK where integrability in (10) holds by induction, and note how then µα LINEBREAK t = LINEBREAK (x α LINEBREAK t ). LINEBREAK l LINEBREAK similarly, let φ : m bles π characterized by πα πα x) > 0 = t (u ∈ is the optimal action value function under fixed µ LINEBREAK 2π map from a mean field ensemble µ to the set of optimal policy ensem, which is particularly fulfilled if , where qµ , u , t α LINEBREAK α (π) for all α α(t, x, u(cid:48)) for all α LINEBREAK ∈ u ∈ t m following the bellman equation LINEBREAK arg maxu(cid:48)∈u qµ LINEBREAK arg maxπ∈π j µ LINEBREAK ∈ i ∈ i LINEBREAK → u LINEBREAK ∈ x LINEBREAK , x LINEBREAK qµ LINEBREAK α(t, x, u) = r(x, u, gα LINEBREAK t ) + LINEBREAK p (x(cid:48) LINEBREAK x, u, gα LINEBREAK t ) arg max u(cid:48)∈u LINEBREAK qµ LINEBREAK with qµ LINEBREAK α(t, x, u) LINEBREAK 0 and generally time-dependent, see puterman (2014) for a review. LINEBREAK we can now define the gmfg version of nash equilibria as policy ensembles π generating mean field ensembles µ under which they are optimal, as µα definition 2. a graphon mean field equilibrium (gmfe) is a pair (π, µ) π LINEBREAK follow πα. m such that LINEBREAK t ) if all agents α LINEBREAK φ(µ) and µ = ψ(π). LINEBREAK ∈ i π × LINEBREAK (x α LINEBREAK t = LINEBREAK l LINEBREAK theoretical analysis LINEBREAK to obtain meaningful optimality results beyond empirical mean field convergence, we will need a lipschitz assumption as in the uncontrolled, continuous-time case (cf. bayraktar et al. (2020), condition 2.3) and typical in mean field theory (huang et al., 2006). assumption 2. let r, p , w be lipschitz continuous with lipschitz constants lr, lp , lw > 0. LINEBREAK note that all proofs but theorem 1 also hold for only block-wise lipschitz continuous w , see appendix a.1. since proposition 1. under assumption 2, r will be bounded by LINEBREAK ) is compact, r is bounded by the extreme value theorem. mr for some constant mr > 0. LINEBREAK x × u × LINEBREAK x LINEBREAK r | LINEBREAK we then obtain existence of a gmfe by reformulating the gmfg as a classical mfg and applying existing results from saldi et al. (2018). more precisely, we consider the equivalent mfg with )t , )t ×x ×i, mean field ˜µ extended state space u reward function ˜r((x, α), u, ˜µ) := r(x, u, , β) dβ) and transition dynamics such that the states ( ˜xt, αt) follow ( ˜x0, α0) LINEBREAK , policy ˜π ( u i w (αt, β)˜µt( · LINEBREAK unif([0, 1]) and LINEBREAK , action space LINEBREAK ( x × i LINEBREAK x × i LINEBREAK ∈ p LINEBREAK ∈ p LINEBREAK ˜ut LINEBREAK ˜πt( LINEBREAK ˜xt, αt), LINEBREAK p ( LINEBREAK , β) dβ), αt+1 = αt . w (αt, β)˜µt( · LINEBREAK theorem 1. under assumption 2, there exists a gmfe (π, µ) LINEBREAK m. LINEBREAK meanwhile, in finite games, even showing the existence of nash equilibria in local feedback policies is problematic (saldi et al., 2018). note however, that while this reformulation will be useful for learning and existence, it does not allow us to conclude that the finite graph game is well approximated, as classical mfg approximation theorems e.g. in saldi et al. (2018) do not consider the graph structure and directly use the limiting graphon w in the dynamics (14). LINEBREAK as our next main result, we shall therefore show rigorously that the gmfe can provide increasingly good approximations of the n -agent finite graph game as n . as mentioned, the following also holds for only block-wise lipschitz continuous w instead of fully lipschitz continuous w . complete mathematical proofs together with additional theoretical supplements can be found in appendix a.1 and a.2. to obtain joint n -agent policies as approximate nash equilibria from a gmfe (π, µ), we define the map γn (π) := (π1, π2, . . . , πn ) x) := παi LINEBREAK πn , where LINEBREAK (α, t, x, u) LINEBREAK x), LINEBREAK πi t(u LINEBREAK t (u LINEBREAK ∈ i × t × x × u LINEBREAK with αi = i n , as by assumption 1 the agents are correctly labeled such that they match up with their limiting graphon indices αi . in our experiments, we use the αi generated during the generation process of the w -random graphs, though for arbitrary finite systems one would have to first identify the graphon as well as an appropriate assignment of agents to graphon indices αi , which is a separate, non-trivial problem requiring at least graphon estimation, e.g. xu (2018). LINEBREAK ∈ i LINEBREAK ∈ i LINEBREAK for theoretical analysis, we propose to lift the empirical distributions and policy tuples to the conπn , we define the step policy tinuous domain ensemble πn πn,α t LINEBREAK , i.e. under an n -agent policy tuple (π1, . . . , πn ) i π and the random empirical step measure ensemble µn ∈ LINEBREAK t, µn,α πi LINEBREAK ∈ (α, t) LINEBREAK m by LINEBREAK δx j LINEBREAK t LINEBREAK n , i LINEBREAK n ] · LINEBREAK t LINEBREAK ∈ i × t LINEBREAK n , i LINEBREAK n ] · LINEBREAK i∈vn (cid:88) LINEBREAK i∈vn (cid:88) LINEBREAK ∈ m LINEBREAK x∈x f (x, α)µα LINEBREAK πn in the following, we consider deviations of the i-th agent from (π1, π2, . . . , πn ) = γn (π) ∈ to (π1, . . . , πi−1, ˆπ, πi+1, . . . , πn ) πn , i.e. the i-th agent deviates by instead applying ˆπ π. ∈ ∈ r and state note that this includes the special case of no agent deviations. for any f : marginal ensemble µt t, define µt(f ) := t (x) dα. we are now ready to i state our first result of convergence of empirical state distributions to the mean field, potentially at (cid:82) (1/√n ) and consistent with results in uncontrolled, continuous-time diffusive the classical rate graphon mean field systems (cf. bayraktar et al. (2020), theorem 3.2). theorem 2. consider lipschitz continuous π π up to a finite number of discontinuities dπ, ∈ with associated mean field ensemble µ = ψ(π). under assumption 1 and the n -agent policy (π1, . . . , πi−1, ˆπ, πi+1, . . . , πn ) , we have for all measurable functions f : x × i → e µn t (f ) π, i LINEBREAK (17) n . furthermore, if the graphon convergence in LINEBREAK r uniformly bounded by some mf > 0, that LINEBREAK πn with (π1, π2, . . . , πn ) = γn (π) LINEBREAK x × i → LINEBREAK πn , ˆπ LINEBREAK µt(f ) LINEBREAK π, t LINEBREAK ∈ t LINEBREAK o LINEBREAK uniformly over all possible deviations ˆπ (cid:2)(cid:12) (cid:12) assumption 1 is at rate LINEBREAK ∈ v (1/√n ), then this rate of convergence is also LINEBREAK (cid:3) LINEBREAK o LINEBREAK o LINEBREAK in particular, the technical lipschitz requirement of π typically holds for neural-network-based policies (mondal et al., 2021; pasztor et al., 2021) and includes also the case of finitely many optimality regimes over all graphon indices α , which is sufficient to achieve arbitrarily good approximate nash equilibria through our algorithms as shown in section 4. we would like to remark that the above result generalizes convergence of state histograms to the mean field solution, since the state marginals of agents are additionally close to each of their graphon mean field equivalents. the above will be necessary to show convergence of the dynamics of a deviating agent to LINEBREAK ∈ i LINEBREAK i n LINEBREAK i n LINEBREAK i n LINEBREAK i n LINEBREAK ˆu LINEBREAK ˆx LINEBREAK ˆx LINEBREAK ˆx LINEBREAK p ( LINEBREAK ˆπt( LINEBREAK t ), LINEBREAK t ∼ LINEBREAK i ˆx n t 0 ∼ the dynamics are approximated by using the limiting deterministic for almost all agents i, i.e. neighborhood mean field g i n , see appendix a.1. this will imply the approximate nash property: theorem 3. consider a gmfe (π, µ) with lipschitz continuous π up to a finite number of discontinuities dπ. under assumptions 1 and 2, for any ε, p > 0 there exists n (cid:48) such that for all n > n (cid:48), the policy (π1, . . . , πn ) = γn (π) i (π1, . . . , πn ) j n LINEBREAK πn is an (ε, p)-markov nash equilibrium, i.e. i (π1, . . . , πi−1, π, πi+1, . . . , πn ) j n LINEBREAK i , ˆu n t LINEBREAK t ), LINEBREAK t ∀ LINEBREAK , g LINEBREAK ∈ t LINEBREAK i n LINEBREAK for all i LINEBREAK n and some LINEBREAK ∈ w LINEBREAK n LINEBREAK w LINEBREAK ⊆ v LINEBREAK n LINEBREAK |w LINEBREAK p)n LINEBREAK in general, nash equilibria are highly intractable (daskalakis et al., 2009). therefore, solving the gmfg allows obtaining approximate nash equilibria in the n -agent system for sufficiently large n , since ε, p . as a side result, we also obtain first results for the uncontrolled discretetime case by considering trivial action spaces with LINEBREAK = 1, see corollary a.2 in the appendix. LINEBREAK 0 as n LINEBREAK |u| LINEBREAK max π∈π LINEBREAK learning graphon mean field equilibria LINEBREAK by learning gmfe, one may potentially solve otherwise intractable large n -agent games. for learning, we can apply any existing techniques for classical mfgs (e.g. mguni et al. (2018); subramanian & mahajan (2019); guo et al. (2019)), since by (14) we have reformulated the gmfg as a classical mfg with extended state space. nonetheless, it may make sense to treat the graphon index α ∈ i separately, e.g. when treating special cases such as block graphons, or by grouping graphically similar agents. we repeatedly apply two functions ˆφ, ˆψ by beginning with the mean field µ0 = ˆψ(π0) generated by the uniformly random policy π0, and computing πn+1 = ˆφ(µn), µn+1 = ˆψ(πn+1) for n = 0, 1, . . . until convergence using one of the following two approaches: LINEBREAK i LINEBREAK i LINEBREAK i LINEBREAK ∈ i LINEBREAK ∈ i LINEBREAK ⊆ i LINEBREAK by partitioning LINEBREAK , and approximate each agent α LINEBREAK , i = 1, . . . , m covering the whole interval LINEBREAK for the otherwise uncountably many agents α LINEBREAK • equivalence classes method. we introduce agent equivalence classes, or discretization, of into m subsets. for example, in the special case of block graphons (block-wise constant w ), one can solve separately for each block equivalence class (type) of agents, since all agents in the class share the same dynamics. note that in contrast to multi-class mfgs (huang et al., 2006), gmfgs are rigorously connected to finite graph games and can handle an uncountable number of classes α. to deal with general graphons, we choose equidistant representatives ˜ αi i i by the nearest αi for the intervals ˜ of points closest to that αi to obtain m approxii i mate equivalence classes. formally, we approximate mean fields ˆψ(π) = ˆµαi recursively computed over all times for any fixed policy ensemble π, and similarly policies ˆφ(µ) = παi where παi is the optimal policy of αi for fixed µ. we solve the optimal control problem for each equivalence class using backwards induction (alternatively, one may use reinforcement learning), and solve the evolution equation for the representatives αi of the equivalence classes recursively. for space reasons, the details are found in appendix a.3. note that this does not mean that we consider the n -agent problem with n = m , but instead we approximate the limiting problem with the limiting graphon w , and the solution will be near-optimal for all sufficiently large finite systems at once. • direct reinforcement learning. we directly apply rl as ˆφ. the central idea is to consider , i.e. for fixed mean fields, the gmfg as a classical mfg with extended state space we solve the mdp defined by (14). agents condition their policy not only on their own state, but also their node index α , since the mean fields are non-stationary in general and require time-dependent policies for optimality. here, we assume that we can sample from a simulator of (9) for a given fixed mean field as commonly assumed in mfg learning literature (guo et al., 2019; subramanian & mahajan, 2019). for application to arbitrary finite systems, one could apply a model-based rl approach coupled with graphon estimation, though this remains outside the scope of this work. for solving the mean field evolution equation (12), we can again use any applicable numerical method and choose a conventional sequential monte carlo method for ˆψ. while it is possible to exactly solve optimal control problems for each agent equivalence class with finite stateaction spaces, this is generally not the case for e.g. continuous state-action spaces. here, a general reinforcement learning solution can solve otherwise intractable problems in an elegant manner, since the graphon index α simply becomes part of a continuous state space. LINEBREAK and the current time t LINEBREAK x × i LINEBREAK ∈ t LINEBREAK ∈ i LINEBREAK for convergence, we begin by stating the classical feedback regularity condition (huang et al., 2006; guo et al., 2019) after equipping π, m e.g. with the supremum metric. proposition 2. assume that the maps ˆψ, ˆφ are lipschitz with constants c1, c2 and c1 the fixed point iteration µn+1 = ˆψ( ˆφ(µn)) converges. LINEBREAK c2 < 1. then LINEBREAK feedback regularity is not assured, and thus there is no general convergence guarantee. whilst one could attempt to apply fictitious play (mguni et al., 2018), additional assumptions will be needed for convergence. instead, whenever necessary for convergence, we regularize by introducing boltzmann policies πα α(t, x, u)) with temperature η, provably converging to an approximation for sufficiently high temperatures (cui & koeppl, 2021). theorem 4. under assumptions 1 and 2, the equivalence classes algorithm with boltzmann policies ˆφ(µ)α LINEBREAK α(t, x, u)) converges for sufficiently high temperatures η > 0. LINEBREAK exp( 1 LINEBREAK exp( 1 LINEBREAK η qµ LINEBREAK t (u LINEBREAK t (u LINEBREAK x) LINEBREAK x) LINEBREAK η qµ LINEBREAK figure 3: achieved equilibrium via m = 100 approximate equivalence classes in sis-graphon, plotted for each agent α . top: probability of taking precautions when healthy. bottom: probability of being infected. it can be observed that agents with less connections (higher α) will take less precautions. (a): uniform attachment graphon; (b): ranked attachment graphon; (c): er graphon. LINEBREAK ∈ i LINEBREAK importantly, even an exact solution of the gmfg only constitutes an approximate nash equilibrium in the finite-graph system. furthermore, even the existence of exact finite-system nash equilibria in local feedback policies is not guaranteed, see the discussion in saldi et al. (2018) and references therein. therefore, little is lost by introducing slight additional approximations for the sake of a tractable solution, if at all needed (e.g. the investment-graphon problem in the following converges without introducing boltzmann policies), since near optimality holds for small temperatures (cui & koeppl, 2021). indeed, we find that we can show optimality of the equivalence classes approach for sufficiently fine partitions of LINEBREAK , giving us a theoretical foundation for our proposed algorithms. LINEBREAK theorem 5. under assumptions 1 and 2, for a solution (π, µ) m, π of the m equivalence classes method and for any ε, p > 0 there exists n (cid:48), m n > n (cid:48), the policy (π1, . . . , πn ) = γn (π) LINEBREAK πn is an (ε, p)-markov nash equilibrium. LINEBREAK ˆφ(µ), µ = ˆψ(π) n such that for all LINEBREAK i LINEBREAK a theoretically rigorous analysis of the elegant direct reinforcement learning approach is beyond our scope and deferred to future works, though we empirically find that both methods agree. LINEBREAK experiments LINEBREAK in this section, we will give an empirical verification of our theoretical results. as we are unaware of any prior discrete-time gmfgs (except for the example in vasal et al. (2021), which is similar to the first problem in the following), we propose two problems adapted from existing non-graphbased works on the three graphons in figure 2. for space reasons, we defer detailed descriptions of problems and algorithms, plots as well as further analysis, including exploitability and a verification of stability of our solution with respect to the number of equivalence classes – to appendix a.3. LINEBREAK the sis-graphon problem was considered in cui & koeppl (2021) as a classical discrete-time mfg. we impose an epidemics scenario where people (agents) are infected with probability proportional to the number of infected neighbors and recover with fixed probability. people may choose to take precautions (e.g. social distancing), avoiding potential costly infection periods at a fixed cost. LINEBREAK in the investment-graphon problem – an adaptation of a problem studied by chen et al. (2021), where it was in turn adapted from weintraub et al. (2010) – we consider many firms maximizing profits, where profits are proportional to product quality and decrease with total neighborhood product quality, i.e. the graph models overlap in e.g. product audience or functionality. firms can invest to improve quality, though it becomes more unlikely to improve quality as their quality rises. LINEBREAK learned equilibrium behavior. for the sis-graphon problem, we apply softmax policies for each approximate equivalence class to achieve convergence, see appendix a.3 for details on temperature choice and influence. in figure 3, the learned behavior can be observed for various α. as expected, in the er graphon case, behavior is identical over all α. otherwise, we find that agents take more precautions with many connections (low α) than with few connections (high α). for the uniform attachment graphon, we observe no precautions in case of negligible connectivity (α 1), while for the ranked attachment graphon there is no such α (cf. figure 2). further, the fraction of infected agents at stationarity rises as α falls. a similar analysis holds for investment-graphon without need for regularization, see appendix a.3. LINEBREAK ∈ i LINEBREAK figure 4: decreasing maximum deviation between average n -agent objective and mean field objective over all agents for the gmfe policy and 5 w -random graph sequences. (a): uniform attachment graphon; (b): ranked attachment graphon; (c): er graphon. LINEBREAK note that the specific method of solution is not of central importance here, as in general any rl and filtering method can be substituted to handle 1. otherwise intractable or 2. inherently samplebased settings. indeed, we achieve similar results using ppo (schulman et al., 2017) in investmentgraphon, enabling a general rl-based methodology for gmfgs. in appendix a.3, we find that ppo achieves qualitatively and quantitatively similar behavior to the equivalence classes method, with slight deviations due to the approximations from ppo and monte carlo. in particular, the ppo exploitability ε 2 remains low compared to ε > 30 for the uniform random policy, see appendix a.3. in appendix a.3, we also show how, due to the non-stationarity of the environment, a naive application of marl (yu et al., 2021) fails to converge, while existing mean field marl techniques (yang et al., 2018b) remain incomparable as agents must observe the average actions of all neighbors. on sis-graphon, we require softmax policies to achieve convergence, which is not possible with ppo as no q-function is learned. in general, one could use entropy regularized policies, e.g. sac (haarnoja et al., 2018), or alternatively use any value-based reinforcement learning method, though an investigation of the best approach is outside of our scope. LINEBREAK quantitative verification of the mean field approximation. to verify the rigorously established accuracy of our mean field system empirically, we will generate w -random graphs. note that there are considerable difficulties associated with an empirical verification of (19), since 1. for any n one must check the nash property for (almost) all n agents, 2. finding optimal ˆπ is intractable, as no dynamic programming principle holds on the non-markovian local agent state, while acting on the full state fails by the curse of dimensionality, and 3. the inaccuracy from estimating all j n , i = 1, . . . , n at once increases with n due to variance, i.e. cost scales fast with n for fixed i variance. instead, we verify (26) in appendix a.1 using the gmfe policy on systems of up to n = 100 agents, i.e. ˆπ = παi for the closest αi and comparing for all agents at once (p = 0). shown in figure 4, for w -random graph sequences, at each n we performed 10000 runs to estimate j n . we find that the maximum deviation between achieved returns and mean field maxi i − | , verifying that we obtain an increasingly good approximation of the return decreases as n finite n -agent graph system. the oscillations in figure 4 stem from the randomly sampled graphs. LINEBREAK jαi| LINEBREAK conclusion LINEBREAK in this work, we have formulated a new framework for dense graph-based dynamical games with the weak interaction property. on the theoretical side, we have given one of the first general discretetime gmfg formulations with existence conditions and approximate nash property of the finite graph system, thus extending classical mfgs and allowing for a tractable, theoretically well-founded solution of competitive large-scale graph-based games on large dense graphs. on the practical side, we have proposed a number of computational methods to tractably compute gmfe and experimentally verified the plausibility of our methodology on a number of examples. venues for further extensions are manifold and include extensions of theory to e.g. continuous spaces, partial observability or common noise. so far, graphons assume dense graphs and cannot properly describe sparse graphs (w = 0), which remain an active frontier of research. finally, real-world application scenarios may be of interest, where estimation of agent graphon indices becomes important for model-based marl. we hope that our work inspires further applications and research into scalable marl using graphical dynamical systems based on graph limit theory and mean field theory. LINEBREAK acknowledgments LINEBREAK this work has been funded by the loewe initiative (hesse, germany) within the emergencity center. the authors also acknowledge support by the german research foundation (dfg) via the collaborative research center (crc) 1053 – maki. LINEBREAK ethics statement LINEBREAK existing mean field methodologies, including ours, currently require manual modeling and have not been applied in a model-based reinforcement learning setting for given finite agent systems. as a result, we do not foresee any immediate ethical issues stemming from this work. LINEBREAK reproducibility statement LINEBREAK for reproducibility, in the supplement we provide all code required to reproduce all results in this work. this includes but is not limited to our models and problems, algorithms as well as all plotting scripts for all of the figures found in this work. LINEBREAK references LINEBREAK alexander aurell, rene carmona, gokce dayanikli, and mathieu lauriere. finite state graphon LINEBREAK games with applications to epidemics. arxiv preprint arxiv:2106.07859, 2021a. LINEBREAK alexander aurell, rene carmona, and mathieu lauriere. stochastic graphon games: ii. the linear LINEBREAK quadratic case. arxiv preprint arxiv:2105.12320, 2021b. LINEBREAK fabio bagagiolo and dario bauso. mean-field games and dynamic demand management in power LINEBREAK grids. dynamic games and applications, 4(2):155–176, 2014. LINEBREAK reginald a banez, lixin li, chungang yang, lingyang song, and zhu han. a mean-field-type in icc 2019 LINEBREAK game approach to computation offloading in mobile edge computing networks. 2019 ieee international conference on communications (icc), pp. 1–6. ieee, 2019. LINEBREAK erhan bayraktar, suman chakraborty, and ruoyu wu. graphon mean field systems. arxiv preprint LINEBREAK marc g bellemare, salvatore candido, pablo samuel castro, jun gong, marlos c machado, subhodeep moitra, sameera s ponda, and ziyu wang. autonomous navigation of stratospheric balloons using reinforcement learning. nature, 588(7836):77–82, 2020. LINEBREAK alain bensoussan, jens frehse, and phillip yam. mean field games and mean field type control LINEBREAK theory, volume 101. springer, 2013. LINEBREAK christopher berner, greg brockman, brooke chan, vicki cheung, przemysław d˛ebiak, christy dennison, david farhi, quirin fischer, shariq hashme, chris hesse, et al. dota 2 with large scale deep reinforcement learning. arxiv preprint arxiv:1912.06680, 2019. LINEBREAK gianmarco bet, fabio coppini, and francesca r nardi. weakly interacting oscillators on dense LINEBREAK christian borgs, jennifer chayes, lászló lovász, vera sós, and katalin vesztergombi. limits of randomly grown graph sequences. european journal of combinatorics, 32(7):985–999, 2011. LINEBREAK peter e caines and minyi huang. graphon mean field games and the gmfg equations: ε-nash equilibria. in 2019 ieee 58th conference on decision and control (cdc), pp. 286–292. ieee, 2019. LINEBREAK pierre cardaliaguet and saeed hadikhanloo. learning in mean field games: LINEBREAK the fictitious play. LINEBREAK esaim: control, optimisation and calculus of variations, 23(2):569–591, 2017. LINEBREAK guilherme carmona. nash equilibria of games with a continuum of players, 2004. LINEBREAK rené carmona, daniel cooney, christy graves, and mathieu lauriere. stochastic graphon games: LINEBREAK i. the static case. arxiv preprint arxiv:1911.10664, 2019a. LINEBREAK rené carmona, mathieu laurière, and zongjun tan. model-free mean-field reinforcement learning: LINEBREAK mean-field mdp and mean-field q-learning. arxiv preprint arxiv:1910.12802, 2019b. LINEBREAK yang chen, jiamou liu, and bakhadyr khoussainov. agent-level maximum entropy inverse rein LINEBREAK forcement learning for mean field games. arxiv preprint arxiv:2104.14654, 2021. LINEBREAK kai cui and heinz koeppl. approximately solving mean field games via entropy-regularized deep reinforcement learning. in international conference on artificial intelligence and statistics, pp. 1909–1917. pmlr, 2021. LINEBREAK kai cui, anam tahir, mark sinzger, and heinz koeppl. discrete-time mean field control with LINEBREAK environment states. arxiv preprint arxiv:2104.14900, 2021. LINEBREAK constantinos daskalakis, paul w goldberg, and christos h papadimitriou. the complexity of LINEBREAK computing a nash equilibrium. siam journal on computing, 39(1):195–259, 2009. LINEBREAK boualem djehiche, alain tcheukam, and hamidou tembine. mean-field-type games in engineering LINEBREAK [j]. aims electronics and electrical engineering, 1(1):18–73, 2017. LINEBREAK romuald elie, julien perolat, mathieu laurière, matthieu geist, and olivier pietquin. on the convergence of model free learning in mean field games. in proceedings of the aaai conference on artificial intelligence, volume 34, pp. 7143–7150, 2020. LINEBREAK shuang gao and peter e caines. the control of arbitrary size networks of linear systems via graphon limits: an initial investigation. in 2017 ieee 56th annual conference on decision and control (cdc), pp. 1052–1057. ieee, 2017. LINEBREAK shuang gao and peter e caines. graphon control of large-scale networks of linear systems. ieee LINEBREAK shuang gao and peter e caines. spectral representations of graphons in very large network systems control. in 2019 ieee 58th conference on decision and control (cdc), pp. 5068–5075. ieee, 2019b. LINEBREAK marios-antonios gkogkas and christian kuehn. graphop mean-field limits for kuramoto-type mod LINEBREAK haotian gu, xin guo, xiaoli wei, and renyuan xu. mean-field controls with q-learning for cooperative marl: convergence and complexity analysis. arxiv preprint arxiv:2002.04131, 2020. LINEBREAK haotian gu, xin guo, xiaoli wei, and renyuan xu. mean-field multi-agent reinforcement learning: LINEBREAK a decentralized network approach. arxiv preprint arxiv:2108.02731, 2021. LINEBREAK olivier guéant, jean-michel lasry, and pierre-louis lions. mean field games and applications. in LINEBREAK paris-princeton lectures on mathematical finance 2010, pp. 205–266. springer, 2011. LINEBREAK xin guo, anran hu, renyuan xu, and junzi zhang. learning mean-field games. in advances in LINEBREAK neural information processing systems, pp. 4966–4976, 2019. LINEBREAK tuomas haarnoja, aurick zhou, pieter abbeel, and sergey levine. soft actor-critic: off-policy maximum entropy deep reinforcement learning with a stochastic actor. in international conference on machine learning, pp. 1861–1870. pmlr, 2018. LINEBREAK minyi huang, roland p malhamé, and peter e caines. large population stochastic dynamic games: closed-loop mckean-vlasov systems and the nash certainty equivalence principle. communications in information & systems, 6(3):221–252, 2006. LINEBREAK b ravi kiran, ibrahim sobh, victor talpaert, patrick mannion, ahmad a al sallab, senthil yogamani, and patrick pérez. deep reinforcement learning for autonomous driving: a survey. ieee transactions on intelligent transportation systems, 2021. LINEBREAK arman c kizilkale and roland p malhame. collective target tracking mean field control for electric in 22nd mediterranean conference on control and automation, pp. 829–834. LINEBREAK space heaters. ieee, 2014. LINEBREAK jens kober, j andrew bagnell, and jan peters. reinforcement learning in robotics: a survey. the LINEBREAK international journal of robotics research, 32(11):1238–1274, 2013. LINEBREAK daniel lacker and agathe soret. a case study on stochastic games on large graphs in mean field LINEBREAK and sparse regimes. arxiv preprint arxiv:2005.14102, 2020. LINEBREAK jean-michel lasry and pierre-louis lions. mean field games. japanese journal of mathematics, 2 LINEBREAK eric liang, richard liaw, robert nishihara, philipp moritz, roy fox, ken goldberg, joseph gonzalez, michael jordan, and ion stoica. rllib: abstractions for distributed reinforcement learning. in international conference on machine learning, pp. 3053–3062. pmlr, 2018. LINEBREAK lászló lovász. large networks and graph limits, volume 60. american mathematical soc., 2012. LINEBREAK david mguni, joel jennings, and enrique munoz de cote. decentralised learning in systems with many, many strategic agents. thirty-second aaai conference on artificial intelligence, 2018. LINEBREAK washim uddin mondal, mridul agarwal, vaneet aggarwal, and satish v ukkusuri. on the approximation of cooperative heterogeneous multi-agent reinforcement learning (marl) using mean field control (mfc). arxiv preprint arxiv:2109.04024, 2021. LINEBREAK médéric motte and huyên pham. mean-field markov decision processes with common noise and LINEBREAK open-loop controls. arxiv preprint arxiv:1912.07883, 2019. LINEBREAK mojtaba nourian and peter e caines. (cid:15)-nash mean field game theory for nonlinear stochastic dynamical systems with major and minor agents. siam journal on control and optimization, 51 (4):3302–3331, 2013. LINEBREAK francesca parise and asuman ozdaglar. graphon games. in proceedings of the 2019 acm confer LINEBREAK ence on economics and computation, pp. 457–458, 2019. LINEBREAK barna pasztor, ilija bogunovic, and andreas krause. efficient model-based multi-agent mean-field LINEBREAK reinforcement learning. arxiv preprint arxiv:2107.04050, 2021. LINEBREAK julien perolat, sarah perrin, romuald elie, mathieu laurière, georgios piliouras, matthieu geist, karl tuyls, and olivier pietquin. scaling up mean field games with online mirror descent. arxiv preprint arxiv:2103.00623, 2021. LINEBREAK sarah perrin, mathieu laurière, julien pérolat, romuald élie, matthieu geist, and olivier pietquin. generalization in mean field games by learning master policies. arxiv preprint arxiv:2109.09717, 2021a. LINEBREAK sarah perrin, mathieu laurière, julien pérolat, matthieu geist, romuald élie, and olivier pietquin. the reinforcement learning way. arxiv preprint arxiv:2105.07933, LINEBREAK mean field games flock! 2021b. LINEBREAK huy xuan pham, hung manh la, david feil-seifer, and aria nefian. cooperative and distributed reinforcement learning of drones for field coverage. arxiv preprint arxiv:1803.07250, 2018. LINEBREAK huyên pham and xiaoli wei. bellman equation and viscosity solutions for mean-field stochastic control problem. esaim: control, optimisation and calculus of variations, 24(1):437–461, 2018. LINEBREAK martin l puterman. markov decision processes: discrete stochastic dynamic programming. john LINEBREAK naci saldi, tamer basar, and maxim raginsky. markov–nash equilibria in mean-field games with LINEBREAK discounted cost. siam journal on control and optimization, 56(6):4256–4287, 2018. LINEBREAK naci saldi, tamer ba¸sar, and maxim raginsky. approximate nash equilibria in partially observed stochastic games with mean-field interactions. mathematics of operations research, 44(3):1006– 1033, 2019. LINEBREAK john schulman, filip wolski, prafulla dhariwal, alec radford, and oleg klimov. proximal policy LINEBREAK optimization algorithms. arxiv preprint arxiv:1707.06347, 2017. LINEBREAK jayakumar subramanian and aditya mahajan. reinforcement learning in stationary mean-field games. in proceedings of the 18th international conference on autonomous agents and multiagent systems, pp. 251–259, 2019. LINEBREAK jan tožiˇcka, benedek szulyovszky, guillaume de chambrier, varun sarwal, umar wani, and mantas gribulis. application of deep reinforcement learning to uav fleet control. in proceedings of sai intelligent systems conference, pp. 1169–1177. springer, 2018. LINEBREAK deepanshu vasal, rajesh mishra, and sriram vishwanath. sequential decomposition of graphon LINEBREAK mean field games. in 2021 american control conference (acc), pp. 730–736. ieee, 2021. LINEBREAK oriol vinyals, timo ewalds, sergey bartunov, petko georgiev, alexander sasha vezhnevets, michelle yeo, alireza makhzani, heinrich küttler, john agapiou, julian schrittwieser, et al. starcraft ii: a new challenge for reinforcement learning. arxiv preprint arxiv:1708.04782, 2017. LINEBREAK renato vizuete, paolo frasca, and federica garin. graphon-based sensitivity analysis of sis epi LINEBREAK demics. ieee control systems letters, 4(3):542–547, 2020. LINEBREAK gabriel y weintraub, c lanier benkard, and benjamin van roy. computational methods for obliv LINEBREAK jiaming xu. rates of convergence of spectral methods for graphon estimation. in international LINEBREAK conference on machine learning, pp. 5433–5442. pmlr, 2018. LINEBREAK jiachen yang, xiaojing ye, rakshit trivedi, huan xu, and hongyuan zha. learning deep mean in international conference on learning LINEBREAK field games for modeling large population behavior. representations, 2018a. LINEBREAK yaodong yang, rui luo, minne li, ming zhou, weinan zhang, and jun wang. mean field multiagent reinforcement learning. in international conference on machine learning, pp. 5571–5580. pmlr, 2018b. LINEBREAK james j yeh. real analysis: theory of measure and integration. world scientific publishing LINEBREAK chao yu, akash velu, eugene vinitsky, yu wang, alexandre bayen, and yi wu. the surprising effectiveness of mappo in cooperative, multi-agent games. arxiv preprint arxiv:2103.01955, 2021. LINEBREAK kaiqing zhang, zhuoran yang, and tamer ba¸sar. multi-agent reinforcement learning: a selective overview of theories and algorithms. handbook of reinforcement learning and control, pp. 321–384, 2021. LINEBREAK a appendix LINEBREAK a.1 theoretical details LINEBREAK in this section, we will give all intermediate results required to prove the results in the main text, as well as additional results, e.g. for the uncontrolled case. for convenience, we first state all obtained theoretical result. proofs for each of the theorems and corollaries can be found in their own sections further below. LINEBREAK note that except for theorem 1, as mentioned in the main text we can also slightly weaken assumption 2 to block-wise lipschitz continuous w , i.e. there exist lw > 0 and disjoint intervals LINEBREAK q LINEBREAK i LINEBREAK {i LINEBREAK i = LINEBREAK , } ˜x − which is fulfilled e.g. for block-wise lipschitz-continuous or block-wise constant graphons. LINEBREAK , i } ∪ w (x, y) LINEBREAK i w (˜x, ˜y) LINEBREAK (x, y), (˜x, ˜y) LINEBREAK lw ( | LINEBREAK ), ˜y | LINEBREAK i ∈ i LINEBREAK × i LINEBREAK y | LINEBREAK i, j LINEBREAK s.t. LINEBREAK x LINEBREAK i LINEBREAK j LINEBREAK for α maps gα LINEBREAK ∈ i n : LINEBREAK , define the α-neighborhood maps gα : LINEBREAK t m LINEBREAK → p LINEBREAK ( x LINEBREAK ) and empirical α-neighborhood LINEBREAK w (α, β)µβ LINEBREAK t dβ, gα LINEBREAK n (µt) := LINEBREAK wn (α, β)µβ LINEBREAK t dβ LINEBREAK and note how we naturally have gα the finite system. finally, for ν, ν(cid:48) kernel operator p π LINEBREAK t = gα(µt) in the mean field system and gi ∈ m t via LINEBREAK t ) in π and graphon w , define the ensemble transition LINEBREAK t = g LINEBREAK n (µn LINEBREAK t, π LINEBREAK t LINEBREAK t,ν,w : LINEBREAK i n LINEBREAK t m LINEBREAK ) as LINEBREAK ( → p x gα(µt) := LINEBREAK νp π LINEBREAK t,ν (cid:48),w LINEBREAK → m LINEBREAK m α LINEBREAK and note how we have µt+1 = µtp π LINEBREAK (cid:0) LINEBREAK (cid:1) LINEBREAK x∈x (cid:88) LINEBREAK να(x) LINEBREAK πα t (u LINEBREAK x)p LINEBREAK u∈u (cid:88) LINEBREAK (cid:90)i t,µt,w in the mean field system. LINEBREAK x, u, LINEBREAK w (α, β)ν(cid:48)β dβ LINEBREAK i n LINEBREAK i n LINEBREAK ˆx LINEBREAK after showing theorem 2, we continue by showing convergence of the law of deviating agent state x i LINEBREAK t to the law of the corresponding auxiliary mean field systems given by , g LINEBREAK ˆu for almost all agents i as n lemma a.1. consider lipschitz continuous π π up to a finite number of discontinuities dπ, ∈ with associated mean field ensemble µ = ψ(π). under assumptions 1 and 2 and the n -agent policy (π1, . . . , πi−1, ˆπ, πi+1, . . . , πn ) π arbitrary, for any uniformly bounded family of functions , there exists n (cid:48) LINEBREAK πn where (π1, π2, . . . , πn ) = γn (π) from LINEBREAK πn , ˆπ to r and any ε, p > 0, t LINEBREAK n such that for all n > n (cid:48) we have LINEBREAK ˆπt( . → ∞ LINEBREAK ∈ ∈ t LINEBREAK i , ˆu n t LINEBREAK t ∼ LINEBREAK i ˆx n t LINEBREAK t ), LINEBREAK t ), LINEBREAK t ∀ LINEBREAK ∈ t LINEBREAK p ( LINEBREAK ˆx LINEBREAK ˆx LINEBREAK x LINEBREAK g LINEBREAK i n LINEBREAK i n LINEBREAK i n LINEBREAK uniformly over ˆπ LINEBREAK π, i LINEBREAK ∈ w LINEBREAK e LINEBREAK g( ˆx LINEBREAK i n LINEBREAK t ) LINEBREAK e LINEBREAK g(x i t ) LINEBREAK sup g∈g LINEBREAK (cid:12) (cid:2) (cid:12) n for some (cid:12) LINEBREAK n LINEBREAK w LINEBREAK (cid:3) ⊆ v LINEBREAK (cid:104) n with LINEBREAK |w LINEBREAK p)n LINEBREAK x × b LINEBREAK x LINEBREAK similarly, for any uniformly lipschitz, uniformly bounded family of measurable functions LINEBREAK from LINEBREAK ) to r and any ε, p > 0, t LINEBREAK , there exists n (cid:48) LINEBREAK e LINEBREAK h(x i LINEBREAK t , g LINEBREAK ∈ t i n (µn n LINEBREAK t )) LINEBREAK ∈ i h( ˆx n t LINEBREAK e LINEBREAK n such that for all n > n (cid:48) we have , g i LINEBREAK n (µt)) LINEBREAK h LINEBREAK sup h∈h LINEBREAK uniformly over ˆπ LINEBREAK π, i LINEBREAK n LINEBREAK w LINEBREAK (cid:104) n with LINEBREAK n LINEBREAK |w LINEBREAK as a direct implication of the above results, the objective functions of almost all agents converge uniformly to the mean field objectives. corollary a.1. consider lipschitz continuous π π up to a finite number of discontinuities dπ, with associated mean field ensemble µ = ψ(π). under assumptions 1 and 2 and the n -agent policy (π1, . . . , πi−1, ˆπ, πi+1, . . . , πn ) π ∈ arbitrary, for any ε, p > 0, there exists n (cid:48) LINEBREAK πn where (π1, π2, . . . , πn ) = γn (π) n such that for all n > n (cid:48) we have LINEBREAK πn , ˆπ LINEBREAK uniformly over ˆπ LINEBREAK j µ LINEBREAK i n LINEBREAK n for some LINEBREAK ∈ w LINEBREAK n LINEBREAK w LINEBREAK n with LINEBREAK ⊆ v LINEBREAK n LINEBREAK |w LINEBREAK p)n LINEBREAK the approximate nash property (theorem 3) of a gmfe (π, µ) then follows immediately from the definition of a gmfe, since π is by definition optimal under µ. LINEBREAK as a corollary, we also obtain results for the uncontrolled case without actions, which is equivalent to the case where |u| corollary a.2. under assumption 1 and r uniformly bounded by LINEBREAK = 1, i.e. there being only one trivial policy that is always optimal. LINEBREAK = 1, we have for all measurable functions f : LINEBREAK |u| mf and all t LINEBREAK x ×i → LINEBREAK that LINEBREAK f | LINEBREAK ∈ t LINEBREAK e LINEBREAK µn LINEBREAK t (f ) LINEBREAK µt(f ) LINEBREAK → furthermore, if the convergence in assumption 1 is at rate also at LINEBREAK (cid:3) LINEBREAK o LINEBREAK o LINEBREAK (1/√n ), the rate of convergence is LINEBREAK if further assumption 2 holds, then for any uniformly bounded family of functions and any ε, p > 0, t LINEBREAK n such that for all n > n (cid:48) we have LINEBREAK , there exists n (cid:48) LINEBREAK from LINEBREAK x LINEBREAK g LINEBREAK to r LINEBREAK ∈ t LINEBREAK ∈ g(x i t ) LINEBREAK e LINEBREAK sup g∈g LINEBREAK e LINEBREAK g( ˆx LINEBREAK i n LINEBREAK t ) LINEBREAK (cid:12) (cid:12) uniformly over i (cid:12) w uniformly lipschitz, uniformly bounded family of measurable functions and any ε, p > 0, t LINEBREAK (cid:105)(cid:12) (cid:12) , and similarly for any (cid:12) | ≥ (cid:98) ) to r from n such that for all n > n (cid:48) we have LINEBREAK , there exists n (cid:48) LINEBREAK (cid:104) (cid:3) n with LINEBREAK n for some LINEBREAK x × b LINEBREAK ∈ w LINEBREAK ⊆ v LINEBREAK p)n LINEBREAK |w LINEBREAK (cid:2) n LINEBREAK x LINEBREAK n LINEBREAK ∈ t LINEBREAK sup h∈h LINEBREAK e LINEBREAK t , g LINEBREAK n for some LINEBREAK ∈ n (µn LINEBREAK i n LINEBREAK t )) LINEBREAK (cid:105) n with LINEBREAK p)n LINEBREAK |w LINEBREAK n LINEBREAK w LINEBREAK ⊆ v LINEBREAK e LINEBREAK i h( ˆx n t LINEBREAK , g i LINEBREAK n (µt)) LINEBREAK uniformly over i LINEBREAK a.2 proofs LINEBREAK ∈ w LINEBREAK in this section, we will give full proofs to the statements made in the main text and in appendix a.1. LINEBREAK a.2.1 proof of theorem 1 LINEBREAK proof. first, we will verify saldi et al. (2018), assumption 1 for the mfg with dynamics given by (14). for this purpose, as in saldi et al. (2018) let us metrize the product space with the sup-metric, and equip the space ) with the weak topology. note that the results hold for both the finite and infinite horizon setting, see saldi et al. (2018), remark 6. LINEBREAK x × i LINEBREAK p LINEBREAK (a) the reward function ˜r((x, α), u, ˜µ) := r(x, u, LINEBREAK since for ((xn, αn), un, ˜µn) LINEBREAK ((x, α), u, ˜µ) we have LINEBREAK i w (αt, β)˜µt( LINEBREAK , β) dβ) is continuous, · LINEBREAK , β) dβ w (αn, β)˜µn( · LINEBREAK w (α, β)˜µ( · LINEBREAK , β) dβ LINEBREAK by lipschitz continuity of w and weak convergence of ˜µn, and therefore LINEBREAK r(xn, un, LINEBREAK w (αn, β)˜µn( LINEBREAK by assumption 2. LINEBREAK , β) dβ) · LINEBREAK r(x, u, LINEBREAK , β) dβ) w (α, β)˜µ( · LINEBREAK (b) the action space is compact and the state space is locally compact. LINEBREAK (c) consider the moment function w(x, α) instead of α in saldi et al. (2018)). LINEBREAK 2. in this case, we can choose ζ = 1 (we use ζ LINEBREAK (d) the stochastic kernel ˜p that fulfills (14) such that ( ˜xt+1, αt+1) LINEBREAK is weakly continuous, since for ((xn, αn), un, ˜µn) LINEBREAK ˜p ( ((x, α), u, ˜µ) we again have LINEBREAK ( ˜xt, αt), ˜ut, ˜µt) LINEBREAK w (αn, β)˜µn( LINEBREAK , β) dβ · LINEBREAK w (α, β)˜µ( · LINEBREAK , β) dβ LINEBREAK and therefore for any continuous bounded f : LINEBREAK r, LINEBREAK x × i → f dp α( LINEBREAK f d ˜p ( LINEBREAK (cid:90)x ×i LINEBREAK (xn, αn), un, ˜µn) = LINEBREAK (xn, α), un, ˜µn) δαn (dα) LINEBREAK f dp ( LINEBREAK xn, un, LINEBREAK , β) dβ) w (αn, β)˜µn( · LINEBREAK (cid:90)i w (α, β)˜µ( LINEBREAK , β) dβ) · LINEBREAK f dp ( LINEBREAK x, u, LINEBREAK f d ˜p ( LINEBREAK (x, α), u, ˜µ) LINEBREAK by disintegration of ˜p and (14). LINEBREAK (cid:90)x ×i LINEBREAK (e) by boundedness of r, we trivially have v(x) LINEBREAK (f) by boundedness of r, we can trivially choose β = 1 (we flip the usage of β and γ). LINEBREAK (g) as a result of the above choices, ζγβ = γ < 1 trivially. LINEBREAK t (u LINEBREAK by saldi et al. (2018), theorem 3.3 we have the existence of a mean field equilibrium (˜π, ˜µ) with some markovian feedback policy ˜π acting on the state ( ˜xt, αt). by defining the mean field and policy ensembles π, µ via πα , α), we obtain existence of the · | α-a.e. optimal policy ensemble π, since at any time t ˜πt puts mass 1 on optimal state-action pairs (see saldi et al. (2018), theorem 3.6), implying that for a.e. α the policy must be optimal, as otherwise there exists a non-null set ˜ such that for all 0 i α LINEBREAK ⊆ i ˜ 0, there is some suboptimality ε > 0, which directly contradicts the prequel. i LINEBREAK t = ˜µt( , the joint state-action distribution ˜µt LINEBREAK x) = ˜πt(u LINEBREAK x, α), µα LINEBREAK 0 in the null set LINEBREAK , we redefine π optimally for those α for the remaining suboptimal α (always possible in our case, see e.g. puterman (2014)). this policy ensemble generates µ = ψ(π) α-a.e. uniquely, and we need only consider its α-a.e. unique equivalence class for optimality, φ(µ). furthermore, µ is always measurable by definition, whereas π is measurable implying π is because ˜πt is by definition a markov kernel, and thus ˜πt(u , | · · a measurable function, which implies measurability of ˜πt(u ) (see e.g. yeh (2014), appendix | e). therefore, we have proven existence of the gmfe (π, µ). LINEBREAK ) for borel set · LINEBREAK ) = ˜πt( x, LINEBREAK u } { LINEBREAK u { LINEBREAK ⊆ i LINEBREAK ∈ i LINEBREAK ∈ t LINEBREAK i LINEBREAK a.2.2 proof of theorem 2 LINEBREAK proof. the proof is by induction as follows. LINEBREAK initial case. for t = 0, we trivially have for all measurable functions f : bounded by µn LINEBREAK mf a law of large numbers result LINEBREAK e LINEBREAK f LINEBREAK r uniformly LINEBREAK x × i → LINEBREAK (x) f (x, α) LINEBREAK x∈x (cid:88) LINEBREAK x∈x (cid:88) LINEBREAK µα 0 (x) f (x, α) dα LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK = e LINEBREAK e LINEBREAK f (x i LINEBREAK i∈vn (cid:88) by definition of µn the second equality follows from fubini’s theorem. LINEBREAK (cid:32)(cid:90)( i−1 t , independence of LINEBREAK n , i LINEBREAK n ] LINEBREAK i∈vn and x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK 2mf √n LINEBREAK 0 for all i LINEBREAK n , α ∈ v LINEBREAK ∈ i LINEBREAK , where LINEBREAK induction step. assume that the induction assumption holds at t. then by definition of µn all bounded function f : LINEBREAK r with LINEBREAK mf , LINEBREAK t , for LINEBREAK x × i → LINEBREAK e LINEBREAK µn LINEBREAK (cid:3) LINEBREAK f | e LINEBREAK | ≤ µn LINEBREAK + e LINEBREAK + e LINEBREAK t p π t p π LINEBREAK t,µn LINEBREAK t p πn µn t,µn LINEBREAK t ,wn LINEBREAK (f ) LINEBREAK (f ) LINEBREAK t ,wn LINEBREAK t ,w (f ) LINEBREAK t ,w (f ) t,µt,w (f ) LINEBREAK − µn LINEBREAK t p π LINEBREAK t,µn LINEBREAK µn LINEBREAK t p π LINEBREAK (cid:3) LINEBREAK first term. we have by definition of µn t LINEBREAK e LINEBREAK µn LINEBREAK t p πn µn t,µn LINEBREAK t ,wn LINEBREAK (f ) LINEBREAK µn,α t+1 (x) f (x, α) dα LINEBREAK = e LINEBREAK x∈x (cid:88) LINEBREAK 2mf √n LINEBREAK µn,α t LINEBREAK (x) LINEBREAK πn,α t LINEBREAK (u LINEBREAK u∈u (cid:88) LINEBREAK x) LINEBREAK p LINEBREAK x, u, LINEBREAK wn (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK xt LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK i∈vn (cid:88) LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK e LINEBREAK n , i LINEBREAK n ] LINEBREAK f (x i LINEBREAK xt LINEBREAK where the last equality follows from conditional independence of x i t } { LINEBREAK i∈vn and the law of total expectation. LINEBREAK x i LINEBREAK i∈vn given xt LINEBREAK second term. we have LINEBREAK e LINEBREAK t p πn µn t,µn LINEBREAK t ,wn LINEBREAK (f ) LINEBREAK t p πn µn t,µn LINEBREAK t ,w (f ) LINEBREAK µn,α t LINEBREAK (x) LINEBREAK πn,α t LINEBREAK (u LINEBREAK u∈u (cid:88) LINEBREAK µn,α t LINEBREAK πn,α t LINEBREAK (u LINEBREAK x) LINEBREAK (x) LINEBREAK u∈u (cid:88) LINEBREAK ≤ |x | LINEBREAK x∈x (cid:88) LINEBREAK p LINEBREAK x, u, LINEBREAK wn (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK x, u, LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK wn (α, β)µn,β LINEBREAK t LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK dα LINEBREAK 2mf lp sup x∈x LINEBREAK ≤ |x | LINEBREAK wn (α, β)µn,β LINEBREAK t LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dα LINEBREAK by assumption 1 and µn,β at rate LINEBREAK t LINEBREAK o LINEBREAK (1/√n ), then this convergence is also at rate LINEBREAK o LINEBREAK (x) trivially being bounded by 1. if the convergence in assumption 1 is LINEBREAK p LINEBREAK (cid:90)i (x) LINEBREAK third term. we have t p πn µn t,µn LINEBREAK t ,w (f ) LINEBREAK e LINEBREAK µn LINEBREAK t p π LINEBREAK t,µn LINEBREAK t ,w (f ) LINEBREAK µn,α t LINEBREAK (x) LINEBREAK πn,α t LINEBREAK (u LINEBREAK x∈x (cid:88) LINEBREAK (cid:90)i x∈x (cid:88) mf e LINEBREAK u∈u (cid:88) LINEBREAK µn,α t LINEBREAK (x) LINEBREAK u∈u (cid:88) (u LINEBREAK πn,α t LINEBREAK ≤ |x ||u| LINEBREAK |x ||u| LINEBREAK mf e LINEBREAK πα t (u LINEBREAK x) LINEBREAK p LINEBREAK x) LINEBREAK πα t (u LINEBREAK x) LINEBREAK dα LINEBREAK πα t (u LINEBREAK x) LINEBREAK t LINEBREAK |x ||u| LINEBREAK (cid:88)j∈vn \{i} (cid:90)( j−1 n , j mf e LINEBREAK ˆπt(u LINEBREAK n , i LINEBREAK n ] | LINEBREAK mf LINEBREAK lπ n LINEBREAK mf LINEBREAK dπ | n LINEBREAK πα t (u LINEBREAK dα LINEBREAK x) | LINEBREAK mf LINEBREAK dα LINEBREAK p LINEBREAK x, u, LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK x, u, LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK ≤ |x ||u| LINEBREAK |x ||u| by assumption of lipschitz continuous π up to a finite number of discontinuities dπ as well as the deviating agent i’s error term, for which the integrands are bounded by 2. LINEBREAK |x ||u| LINEBREAK fourth term. we have LINEBREAK e LINEBREAK µn LINEBREAK t p π LINEBREAK t,µn LINEBREAK t ,w (f ) LINEBREAK µn LINEBREAK t p π LINEBREAK t,µt,w (f ) LINEBREAK x∈x (cid:88) LINEBREAK (cid:90)i e LINEBREAK x∈x (cid:88) sup x,u LINEBREAK mf LINEBREAK |x | LINEBREAK µn,α t LINEBREAK (x) LINEBREAK πα t (u LINEBREAK u∈u (cid:88) LINEBREAK µn,α t LINEBREAK (x) LINEBREAK p LINEBREAK e LINEBREAK πα t (u LINEBREAK x, u, LINEBREAK p LINEBREAK mf LINEBREAK lp LINEBREAK |x | LINEBREAK mf LINEBREAK |x | LINEBREAK p LINEBREAK x, u, LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK x) LINEBREAK p LINEBREAK t LINEBREAK dβ LINEBREAK x, u, LINEBREAK w (α, β)µβ LINEBREAK t dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK t dβ LINEBREAK dα LINEBREAK x, u, LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK dα LINEBREAK in the case of rate functions f (cid:48) on f (cid:48) LINEBREAK x(cid:48),α to obtain LINEBREAK (1/√n ), or uniformly to zero otherwise, from lipschitz p by defining the and using the induction assumption LINEBREAK 1x=x(cid:48) for any (x(cid:48), α) LINEBREAK o LINEBREAK x(cid:48),α(x, β) = w (α, β) LINEBREAK ∈ x ×i LINEBREAK e LINEBREAK (cid:90)i e LINEBREAK e LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK (x(cid:48)) dβ LINEBREAK w (α, β)µβ LINEBREAK t (x(cid:48)) dβ LINEBREAK dα LINEBREAK w (α, β)µβ LINEBREAK dα LINEBREAK w (α, β)µn,β LINEBREAK t LINEBREAK µt(f (cid:48) LINEBREAK (cid:90)i dα LINEBREAK for some c (cid:48)(1) > 0 uniformly over all f (cid:48) bounded by 1 if the convergence in assumption 1 is at rate LINEBREAK (cid:2)(cid:12) (cid:12) (1/√n ), or uniformly to zero otherwise. LINEBREAK (cid:3) LINEBREAK o LINEBREAK fifth term. we have t p π LINEBREAK t,µt,w (f ) LINEBREAK µn LINEBREAK e LINEBREAK µtp π LINEBREAK t,µt,w (f ) LINEBREAK − µn,α t LINEBREAK x∈x (cid:88) LINEBREAK = e LINEBREAK = e LINEBREAK µα t (x) LINEBREAK πα t (u LINEBREAK x∈x (cid:88) µn,α t LINEBREAK u∈u (cid:88) (x)f (cid:48)(x, α) dα LINEBREAK µt(f (cid:48)) LINEBREAK c (cid:48)(mf ) √n LINEBREAK πα t (u LINEBREAK x) LINEBREAK (x) LINEBREAK u∈u (cid:88) LINEBREAK p LINEBREAK x, u, LINEBREAK w (α, β)µβ LINEBREAK t dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK x) LINEBREAK p LINEBREAK x, u, LINEBREAK w (α, β)µβ LINEBREAK t dβ LINEBREAK f (x(cid:48), α) dα LINEBREAK t (x)f (cid:48)(x, α) dα µα LINEBREAK x∈x (cid:88) LINEBREAK in the case of rate to the function LINEBREAK o LINEBREAK (1/√n ), or uniformly to zero otherwise, again by induction assumption applied LINEBREAK (cid:3) LINEBREAK f (cid:48)(x, α) = LINEBREAK πα t (u LINEBREAK x) LINEBREAK u∈u (cid:88) LINEBREAK p LINEBREAK x, u, LINEBREAK w (α, β)µβ LINEBREAK t dβ LINEBREAK f (x(cid:48), α) LINEBREAK bounded by mf . this completes the proof by induction. LINEBREAK a.2.3 proof of lemma a.1 LINEBREAK proof. first, we will show that (24) implies (25). LINEBREAK proof of (24) = surable functions be the uniform lipschitz constant. then, for arbitrary h LINEBREAK (25). we consider a uniformly lipschitz, uniformly bounded family of meaand lh from LINEBREAK ) to r. let mh be the uniform bound of functions in LINEBREAK we have LINEBREAK ⇒ h LINEBREAK x × b LINEBREAK h LINEBREAK x LINEBREAK e LINEBREAK h(x i LINEBREAK t , g LINEBREAK i n LINEBREAK n (µn LINEBREAK e LINEBREAK t , g LINEBREAK e LINEBREAK i n LINEBREAK e LINEBREAK h(x i LINEBREAK t , g i LINEBREAK n (µt)) LINEBREAK ∈ h i h( ˆx n t (cid:104) − LINEBREAK e LINEBREAK , g i LINEBREAK n (µt)) LINEBREAK h(x i LINEBREAK t , g LINEBREAK i n LINEBREAK i h( ˆx n t LINEBREAK e LINEBREAK , g i LINEBREAK h(x i LINEBREAK t , g LINEBREAK i n LINEBREAK h(x i LINEBREAK t , g i LINEBREAK which we will analyze in the following. LINEBREAK first term. we have LINEBREAK h(x i LINEBREAK t , g LINEBREAK n (µn LINEBREAK t )) LINEBREAK i n LINEBREAK e LINEBREAK h(x i LINEBREAK t , g LINEBREAK i n LINEBREAK n (µt)) LINEBREAK e LINEBREAK e LINEBREAK h(x i LINEBREAK t , g LINEBREAK h(x i LINEBREAK t , g LINEBREAK e LINEBREAK i n LINEBREAK g LINEBREAK g LINEBREAK n (µn t ) LINEBREAK (cid:104)(cid:12) (cid:12) (cid:12) (cid:104)(cid:13) (cid:13) (cid:13) x∈x (cid:88) by theorem 2 applied to the functions f (cid:48) LINEBREAK = lh LINEBREAK wn ( LINEBREAK i n LINEBREAK e LINEBREAK − n (µt) LINEBREAK i n LINEBREAK i n LINEBREAK x i t LINEBREAK second term. similarly, we have LINEBREAK e LINEBREAK h(x i LINEBREAK t , g LINEBREAK n (µt)) LINEBREAK i n LINEBREAK e LINEBREAK h(x i LINEBREAK t , g i LINEBREAK n (µt)) LINEBREAK lh LINEBREAK i n LINEBREAK n (µt) LINEBREAK (x) dβ LINEBREAK wn ( LINEBREAK i n LINEBREAK t (x) dβ LINEBREAK n,i,x(x(cid:48), β) = wn ( i LINEBREAK n , β) LINEBREAK 1x=x(cid:48) uniformly bounded by 1. LINEBREAK w ( LINEBREAK i n LINEBREAK µβ t (x) dβ LINEBREAK wn ( LINEBREAK wn ( LINEBREAK i n LINEBREAK i n LINEBREAK n LINEBREAK n , i LINEBREAK n ] LINEBREAK w (α, β) dα LINEBREAK n LINEBREAK w (α, β) dα LINEBREAK w ( LINEBREAK i n LINEBREAK n , i LINEBREAK n ] LINEBREAK lh LINEBREAK lh LINEBREAK + lh LINEBREAK where the latter term can be bounded as LINEBREAK lh LINEBREAK n LINEBREAK n , i LINEBREAK n ] LINEBREAK w (α, β) dα LINEBREAK w ( LINEBREAK i n LINEBREAK µβ t (x) dβ LINEBREAK w (α, β) LINEBREAK n α n LINEBREAK n , i LINEBREAK µβ t (x) dα dβ LINEBREAK n LINEBREAK |x | LINEBREAK lw lh n LINEBREAK |x | LINEBREAK lh LINEBREAK ≤ by assumption 2. LINEBREAK µβ t (x) dβ LINEBREAK alternatively, if we assumed the weaker block-wise lipschitz condition on w in (20), we can obtain n such that for any n , i.e. for any p0 > 0 there exists n (cid:48) the same result for almost all i ∈ v n > n (cid:48), there exists a set 0 0 0 n the above is true: n , n | ≥ (cid:98) |w since by (20) there exist only a finite number q of intervals and therefore jumps, there can be only q many i for which the above fails, while for all other i we again have LINEBREAK such that for all i LINEBREAK ∈ ∈ w LINEBREAK w LINEBREAK n LINEBREAK n , i LINEBREAK w (α, β) LINEBREAK n α n LINEBREAK µβ t (x) dα dβ LINEBREAK n α n LINEBREAK n LINEBREAK w (α, β) LINEBREAK (cid:90)ij LINEBREAK (cid:90)( i−1 lw lh n LINEBREAK n , i LINEBREAK |x | LINEBREAK · ≤ n , i by (20), as ( i−1 n ] × i for the former term we observe that LINEBREAK k ⊆ i LINEBREAK × i LINEBREAK j LINEBREAK j for some k LINEBREAK µβ t (x) dα dβ LINEBREAK lh LINEBREAK wn ( LINEBREAK i n LINEBREAK n LINEBREAK n , i LINEBREAK n ] LINEBREAK w (α, β) dα LINEBREAK µβ t (x) dβ LINEBREAK (wn (α, β) LINEBREAK n LINEBREAK x∈x (cid:88) LINEBREAK n , i LINEBREAK (cid:90)( i−1 n ] (cid:12) (cid:90)i (cid:12) (cid:12) the terms i n i (x) via (cid:12) LINEBREAK w (α, β)) µβ LINEBREAK t (x) dβ LINEBREAK and by defining for any x LINEBREAK ∈ x LINEBREAK i n i (x) := n LINEBREAK and noticing that we have LINEBREAK (wn (α, β) LINEBREAK n , i LINEBREAK w (α, β)) µβ LINEBREAK t (x) dβ LINEBREAK dα LINEBREAK dα LINEBREAK n LINEBREAK i n i (x) = LINEBREAK (wn (α, β) LINEBREAK w (α, β)) µβ LINEBREAK t (x) dβ LINEBREAK (cid:90)i (cid:90)i (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) by assumption 1, we can conclude that for any ε1, p1 > 0 there exists n (cid:48) (cid:12) (cid:12) 1 n > n (cid:48), there exists a set n | ≥ (cid:98) LINEBREAK such that for all i LINEBREAK |w LINEBREAK w LINEBREAK n such that for any LINEBREAK ∈ 1 n we have ∈ w LINEBREAK since by the above we can choose n (cid:48) ε1p1, and from i n i (x) which would be a direct contradiction. therefore, for all i LINEBREAK 0 it would otherwise follow that 1 n LINEBREAK n such that for any n > n (cid:48) we have 1 n LINEBREAK i (x) LINEBREAK n i=1 i n p1n (cid:80) ≥ 1 n , we have uniformly (cid:80) ∈ w LINEBREAK w LINEBREAK lh LINEBREAK n LINEBREAK x∈x (cid:88) LINEBREAK n , i LINEBREAK (wn (α, β) LINEBREAK w (α, β)) µβ LINEBREAK t (x) dβ LINEBREAK dα = lh LINEBREAK i n i (x) LINEBREAK x∈x (cid:88) LINEBREAK third term. by (24), for any ε2, p2 > 0 there exists a set for all i LINEBREAK 2 n we have LINEBREAK ∈ w LINEBREAK |w LINEBREAK such that LINEBREAK e LINEBREAK h(x i LINEBREAK t , g i LINEBREAK n (µt)) LINEBREAK e LINEBREAK i h( ˆx n t LINEBREAK , g i LINEBREAK n (µt)) LINEBREAK independent of ˆπ LINEBREAK w LINEBREAK ∈ the intersection of which completes the proof of (24) = small and p0, p1, p2 < p to 1 1 LINEBREAK n − LINEBREAK n − LINEBREAK w LINEBREAK w LINEBREAK n − LINEBREAK n − LINEBREAK n → LINEBREAK 2 n has at least n LINEBREAK agents fulfilling (25), (cid:101) − (cid:100) (25) for almost all agents by choosing ε1, ε2 sufficiently , which is equivalent (1 (cid:101)−(cid:100) − and is true for sufficiently large n , since in the limit, LINEBREAK n → LINEBREAK p as n LINEBREAK proof of (24). all that remains is to show (24), which will automatically imply (25) at all times t LINEBREAK by the prequel. we will show (24) by induction. LINEBREAK ∈ t LINEBREAK initial case. at t = 0, LINEBREAK l LINEBREAK (x i LINEBREAK i n LINEBREAK ( ˆx LINEBREAK t ) by definition. thus, trivially LINEBREAK l g(x i 0) LINEBREAK e LINEBREAK i n LINEBREAK e LINEBREAK (cid:2) induction step. for any uniformly bounded family of functions we will show that for any ε, p > 0, there exists n (cid:48) LINEBREAK from n such that for all n > n (cid:48) we have LINEBREAK x LINEBREAK g LINEBREAK (cid:3) LINEBREAK to r with bound mg, LINEBREAK e LINEBREAK g(x i LINEBREAK e LINEBREAK ∈ g( ˆx LINEBREAK i n LINEBREAK i n LINEBREAK w e LINEBREAK ⊆ v ln,t(x i LINEBREAK t , g LINEBREAK (cid:104) n with LINEBREAK |w n (µn LINEBREAK i n LINEBREAK p)n LINEBREAK (cid:99) − i ln,t( ˆx n t LINEBREAK uniformly over ˆπ LINEBREAK π, i LINEBREAK (cid:2) n for some LINEBREAK (cid:3) n LINEBREAK e LINEBREAK g(x i LINEBREAK e LINEBREAK (cid:105)(cid:12) (cid:104) where we defined the uniformly bounded, uniformly lipschitz functions (cid:12) (cid:12) LINEBREAK (cid:3) LINEBREAK (cid:2) LINEBREAK ln,t(x, ν) LINEBREAK ˆπt(u LINEBREAK x)
| 20
|
[
298.511,
272.06135,
308.07945514,
282.02395
] |
SaKO6z6Hl0c.pdf
| 2,022
| 0
|
LINEBREAK unsupervised semantic segmentation by distilling feature correspondences LINEBREAK mark hamilton mit, microsoft [email protected] LINEBREAK zhoutong zhang mit LINEBREAK bharath hariharan cornell university LINEBREAK noah snavely cornell university, google LINEBREAK william t. freeman mit, google LINEBREAK abstract LINEBREAK unsupervised semantic segmentation aims to discover and localize semantically meaningful categories within image corpora without any form of annotation. to solve this task, algorithms must produce features for every pixel that are both semantically meaningful and compact enough to form distinct clusters. unlike previous works which achieve this with a single end-to-end framework, we propose to separate feature learning from cluster compactification. empirically, we show that current unsupervised feature learning frameworks already generate dense features whose correlations are semantically consistent. this observation motivates us to design stego (self-supervised transformer with energy-based graph optimization), a novel framework that distills unsupervised features into highquality discrete semantic labels. at the core of stego is a novel contrastive loss function that encourages features to form compact clusters while preserving their relationships across the corpora. stego yields a significant improvement over the prior state of the art, on both the cocostuff (+14 miou) and cityscapes (+9 miou) semantic segmentation challenges. LINEBREAK introduction LINEBREAK semantic segmentation is the process of classifying each individual pixel of an image into a known ontology. though semantic segmentation models can detect and delineate objects at a much finer granularity than classification or object detection systems, these systems are hindered by the difficulties of creating labelled training data. in particular, segmenting an image can take over 100× more effort for a human annotator than classifying or drawing bounding boxes (zlateski et al., 2018). furthermore, in complex domains such as medicine, biology, or astrophysics, ground-truth segmentation labels may be unknown, ill-defined, or require considerable domain-expertise to provide (yu et al., 2018). LINEBREAK recently, several works introduced semantic segmentation systems that could learn from weaker forms of labels such as classes, tags, bounding boxes, scribbles, or point annotations (ren et al., 2020; pan et al., 2021; liu et al., 2020; bilen et al.). however, comparatively few works take up the challenge of semantic segmentation without any form of human supervision or motion cues. attempts such as independent information clustering (iic) (ji et al., 2019) and picie (cho et al., 2021) aim to learn semantically meaningful features through transformation equivariance, while imposing a clustering step to improve the compactness of the learned features. LINEBREAK in contrast to these previous methods, we utilize pre-trained features from unsupervised feature learning frameworks and focus on distilling them into a compact and discrete structure while preserving their relationships across the image corpora. this is motivated by the observation that correlations between unsupervised features, such as ones learned by dino (caron et al., 2021), are already semantically consistent, both within the same image and across image collections. LINEBREAK as a result, we introduce stego (self-supervised transformer with energy-based graph optimization), which is capable of jointly discovering and segmenting objects without human supervision. stego distills pretrained unsupervised visual features into semantic clusters using a novel LINEBREAK figure 1: unsupervised semantic segmentation predictions on the cocostuff (caesar et al., 2018) 27 class segmentation challenge. our method, stego, does not use labels to discover and segment consistent objects. unlike the prior state of the art, picie (cho et al., 2021), stego’s predictions are consistent, detailed, and do not omit key objects. LINEBREAK contrastive loss. stego dramatically improves over prior art and is a considerable step towards closing the gap with supervised segmentation systems. we include a short video detailing the work at https://aka.ms/stego-video. specifically, we make the following contributions: LINEBREAK • show that unsupervised deep network features have correlation patterns that are largely LINEBREAK consistent with true semantic labels. LINEBREAK • introduce stego, a novel transformer-based architecture for unsupervised semantic seg LINEBREAK mentation. LINEBREAK • demonstrate that stego achieves state of the art performance on both the cocostuff (+14 LINEBREAK miou) and cityscapes (+9 miou) segmentation challenges. LINEBREAK • justify stego’s design with an ablation study on the cocostuff dataset. LINEBREAK related work LINEBREAK self-supervised visual feature learning learning meaningful visual features without human annotations is a longstanding goal of computer vision. approaches to this problem often optimize a surrogate task, such as denoising (vincent et al., 2008), inpainting (pathak et al., 2016), jigsaw puzzles, colorization (zhang et al., 2017), rotation prediction (gidaris et al., 2018), and most recently, contrastive learning over multiple augmentations (hjelm et al., 2018; chen et al., 2020a;a;c; oord et al., 2018). contrastive learning approaches, whose performance surpass all other surrogate tasks, assume visual features are invariant under a certain set of image augmentation operations. these approaches maximize feature similarities between an image and its augmentations, while minimizing similarity between negative samples, which are usually randomly sampled images. some notable examples of positive pairs include temporally adjacent images in videos (oord et al., 2018), image augmentations (chen et al., 2020a;c), and local crops of a single image (hjelm et al., 2018). many works highlight the importance of large numbers of negative samples during training. to this end wu et al. (2018) propose keeping a memory bank of negative samples and chen et al. (2020c) propose momentum updates that can efficiently simulate large negative batch sizes. recently some works have aimed to produce spatially dense feature maps as opposed to a single global vector per image. in this vein, vader (pinheiro et al., 2020) contrasts local per-pixel features based on random compositions of image transformations that induce known correspondences among pixels which act as positive pairs for contrastive training. instead of trying to learn visual features and clustering from scratch, stego treats pretrained self-supervised features as input and is agnostic to the underlying feature extractor. this makes it easy to integrate future advances in self-supervised feature learning into stego. LINEBREAK unsupervised semantic segmentation many unsupervised semantic segmentation approaches use techniques from self-supervised feature learning. iic (ji et al., 2019) maximizes mutual information of patch-level cluster assignments between an image and its augmentations. contrastive clustering (li et al., 2020), and scan (van gansbeke et al., 2020) improve on iic’s image clustering results with supervision from negative samples and nearest neighbors but do not attempt semantic segmentation. picie (cho et al., 2021) improves on iic’s semantic segmentation results by using invariance to photometric effects and equivariance to geometric transformations as an inductive bias. in picie, a network minimizes the distance between features under different transformations, where the distance is defined by an in-the-loop k-means clustering process. segsort (hwang et al., 2019) adopts a different approach. first, segsort learns good features using superpixels as proxy segmentation maps, then uses expectation-maximization to iteratively refine segments over a spherical embedding space. in a similar vein, maskcontrast (van gansbeke et al., 2021) achieves promising results on pascalvoc by first using an off-the-shelf saliency model to generate a binary mask for each image. maskcontrast then contrasts learned features within and across the saliency masks. in contrast, our method focuses refining existing pretrained self-supervised visual features to distill their correspondence information and encourage cluster formation. this is similar to the work of collins et al. (2018) who show that low rank factorization of deep network features can be useful for unsupervised co-segmentation. we are not aware of any previous work that achieves the goal of high-quality, pixel-level unsupervised semantic segmentation on large scale datasets with diverse images. LINEBREAK visual transformers convolutional neural networks (cnns) have long been state of the art for many computer vision tasks, but the nature of the convolution operator makes it hard to model longrange interactions. to circumvent such shortcomings, wang et al. (2018); zhang et al. (2019) use self-attention operations within a cnn to model long range interactions. transformers (vaswani et al., 2017), or purely self-attentive networks, have made significant progress in nlp and have recently been used for many computer vision tasks (dosovitskiy et al., 2020; touvron et al., 2021; ranftl et al., 2021; caron et al., 2021). visual transformers (vit) (vaswani et al., 2017) apply self-attention mechanisms to image patches and positional embeddings in order to generate features and predictions. several modifications of vit have been proposed to improve supervised learning, unsupervised learning, multi-scale processing, and dense predictions. in particular, dino (caron et al., 2021) uses a vit within a self-supervised learning framework that performs self-distillation with exponential moving average updates. caron et al. (2021) show that dino’s class-attention can produce localized and semantically meaningful salient object segmentations. our work shows that dino’s features not only detect salient objects but can be used to extract dense and semantically meaningful correspondences between images. in stego, we refine the features of this pre-trained backbone to yield semantic segmentation predictions when clustered. we focus on dino’s embeddings because of their quality but note that stego can work with any deep network features. LINEBREAK methods LINEBREAK feature correspondences predict class co-occurrence LINEBREAK recent progress in self-supervised visual feature learning has yielded methods with powerful and semantically relevant features that improve a variety of downstream tasks. though most works aim to generate a single vector for an image, many works show that intermediate dense features are semantically relevant (hamilton et al., 2021; collins et al., 2018; zhou et al., 2016). to use this information, we focus on the “correlation volume” (teed & deng, 2020) between the dense feature maps. for convolutional or transformer architectures, these dense feature maps can be the activation map of a specific layer. additionally, the q, k or v matrices in transformers can also serve as candidate features, though we find these attention tensors do not perform as well in practice. more formally, let f ∈ rchw , g ∈ rcij be the feature tensors for two different images where c represents the channel dimension and (h, w ), (i, j) represent spatial dimensions. we form the feature correspondence tensor: LINEBREAK c whose entries represent the cosine similarity between the feature at spatial position (h, w) of feature tensor f and position (i, j) of feature tensor g. in the special case where f = g these correspon LINEBREAK fhwij := LINEBREAK fchw |fhw| LINEBREAK gcij |gij| LINEBREAK figure 2: feature correspondences from dino. correspondences between the source image (left) and the target images (middle and right) are plotted over the target images in the respective color of the source point (crosses in the left image). feature correspondences can highlight key aspects of shared semantics within a single image (middle) and across similar images such as knns (right) LINEBREAK feature LINEBREAK predict LINEBREAK figure 3: precision recall curves show self-correspondences that strongly cooccurrence. dino outperforms mocov2 and a crf kernel, which shows its power as an unsupervised learning signal. LINEBREAK label LINEBREAK true LINEBREAK dences measure the similarity between two regions of the same image. we note that this quantity appears often as the “cost-volume” within the optical flow literature, and hamilton et al. (2021) show this acts a higher-order generalization of class activation maps (zhou et al., 2016) for contrastive architectures and visual search engines. by examining slices of the correspondence tensor, f , at a given (h, w) we are able to visualize how two images relate according the featurizer. for example, figure 2 shows how three different points from the source image (shown in blue, red, and green) are in correspondence with relevant semantic areas within the image and its k-nearest neighbors with respect to the dino (caron et al., 2021) as the feature extractor. LINEBREAK this feature correspondence tensor not only allows us to visualize image correspondences but is strongly correlated with the true label co-occurrence tensor. in particular, we can form the ground truth label co-occurrence tensor given a pair of ground-truth semantic segmentation labels k ∈ chw , l ∈ cij where c represents the set of possible classes: LINEBREAK lhwij := LINEBREAK if lhw = kij if lhw (cid:54)= kij LINEBREAK by examining how well the feature correspondences, f , predict the ground-truth label cooccurrences, l, we can measure how compatible the features are with the semantic segmentation labels. more specifically we treat the feature correspondences as a probability logit and compute the average precision when used as a classifier for l. this approach not only acts as a quick diagnostic tool to determine the efficacy of features, but also allows us to compare with other forms of supervision such as the fully connected conditional random field (crf) (kr¨ahenb¨uhl & koltun, 2011), which uses correspondences between pixels to refine low-resolution label predictions. in figure 3 we plot precision-recall curves for the dino backbone, the mocov2 backbone, the crf kernel, and our trained stego architecture. interestingly, we find that dino is already a spectacular predictor of label co-occurrence within the coco stuff dataset despite never seeing the labels. in particular, dino recalls 50% of true label co-occurrences with a precision of 90% and significantly outperforms both mocov2 feature correspondences and the crf kernel. one curious note is that our final trained model is a better label predictor than the supervisory signal it learns from. we attribute this to the distillation process discussed in section 3.2 which amplifies this supervisory signal and drives consistency across the entire dataset. finally, we stress that our comparison to ground truth labels within this section is solely to provide intuition about the quality of feature correspondences as a supervisory signal. we do not use the ground truth labels to tune any parameters of stego. LINEBREAK distilling feature correspondences LINEBREAK in section 3.1 we have shown that feature correspondences have the potential to be a quality learning signal for unsupervised segmentation. in this section we explore how to harness this signal to create pixel-wise embeddings that, when clustered, yield a quality semantic segmentation. in particular, we seek to learn a low-dimensional embedding that “distills” the feature correspondences. to achieve LINEBREAK this aim, we draw inspiration from the crf which uses an undirected graphical model to refine noisy or low-resolution class predictions by aligning them with edges and color-correlated regions in the original image. more formally, let n : rc(cid:48)h (cid:48)w (cid:48) → rchw represent a deep network backbone, which maps an image x with c (cid:48) channels and spatial dimensions (h (cid:48), w (cid:48)) to a feature tensor f with c channels and spatial dimensions (h, w ). in this work, we keep this backbone network frozen and focus on training a light-weight segmentation head s : rchw → rkhw , that maps our feature space to a code space of dimension k, where k < c. the goal of s is to learn a nonlinear projection, s(f ) =: s ∈ rkhw , that forms compact clusters and amplifies the correlation patterns of f . LINEBREAK to build our loss function let f and g be two feature tensors from a pair of images x, and y and let s := s(f ) ∈ rchw and t := s(g) ∈ rcij be their respective segmentation features. next, using equation 1 we compute a feature correlation tensor f ∈ rhw ij from f and g and a segmentation correlation tensor s ∈ rhw ij from s and t. our loss function aims to push the entries of s and t together if there is a significant coupling between two corresponding entries of f and g. as shown in figure 4, we can achieve this with a simple element-wise multiplication of the tensors f and s: LINEBREAK lsimple−corr (x, y, b) := − LINEBREAK hwij LINEBREAK (fhwij − b)shwij LINEBREAK where b is a hyper-parameter which adds uniform “negative pressure” to the equation to prevent collapse. minimizing l with respect to s encourages elements of s to be large when elements of f − b are positive and small when elements of f − b are negative. more explicitly, because the elements of f and s are cosine similarities, this exerts an attractive or repulsive force on pairs of segmentation features with strength proportional to their feature correspondences. we note that the elements of s are not just encouraged to equal the elements of f but rather to push to total anti-alignment (−1) or alignment (1) depending on the sign of f − b. LINEBREAK in practice, we found that lsimple−corr is sometimes unstable and does not provide enough learning signal to drive the optimization. empirically, we found that optimizing the segmentation features towards total anti-alignment when the corresponding features do not correlate leads to instability, likely because this increases co-linearity. therefore, we optimize weakly-correlated segmentation features to be orthogonal instead. this can be efficiently achieved by clamping the segmentation correspondence, s, at 0, which dramatically improved the optimization stability. LINEBREAK additionally, we encountered challenges when balancing the learning signal for small objects which have concentrated correlation patterns. in these cases, fhwij − b is negative in most locations, and the loss drives the features to diverge instead of aggregate. to make the optimization more balanced, we introduce a spatial centering operation on the feature correspondences: LINEBREAK f sc LINEBREAK hwij := fhwij − LINEBREAK fhwi(cid:48)j(cid:48). LINEBREAK together with the zero clamping, our final correlation loss is defined as: LINEBREAK lcorr(x, y, b) := − LINEBREAK hwij LINEBREAK (f sc LINEBREAK hwij − b)max(shwij, 0). LINEBREAK we demonstrate the positive effect of both the aforementioned “0-clamp” and “sc” modifications in the ablation study of table 2. LINEBREAK stego architecture LINEBREAK stego uses three instantiations of the correspondence loss of equation 4 to train a segmentation head to distill feature relationships between an image and itself, its k-nearest neighbors (knns), and random other images. the self and knn correspondence losses primarily provide positive, attractive, signal and random image pairs tend to provide negative, repulsive, signal. we illustrate this and other major architecture components of stego in figure 4. LINEBREAK stego is made up of a frozen backbone that serves as a source of learning feedback, and as an input to the segmentation head for predicting distilled features. this segmentation head is a simple LINEBREAK figure 4: high-level overview of the stego architecture at train and prediction steps. grey boxes represent three different instantiations of the main correspondence distillation loss which is used to train the segmentation head. LINEBREAK feed forward network with relu activations (glorot et al., 2011). in contrast to other works, our method does not re-train or fine-tune the backbone. this makes our method very efficient to train: it only takes less than 2 hours on a single nvidia v100 gpu card. LINEBREAK we first use our backbone to extract global image features by global average pooling (gap) our spatial features: gap (f ). we then construct a lookup table of each image’s k-nearest neighbors according to cosine similarity in the backbone’s feature space. each training minibatch consists of a collection of random images x and random nearest neighbors xknn. in our experiments we sample xknn randomly from each image’s top 7 knns. we also sample random images, xrand, by shuffling x and ensuring that no image matched with itself. stego’s full loss is: LINEBREAK l = λself lcorr(x, x, bself ) + λknnlcorr(x, xknn, bknn) + λrandlcorr(x, xrand, brand) LINEBREAK where the λ’s and the b’s control the balance of the learning signals and the ratio of positive to negative pressure respectively. in practice, we found that a ratio of λself ≈ λrand ≈ 2λknn worked well. the b parameters tended to be dataset and network specific, but we aimed to keep the system in a rough balance between positive and negative forces. more specifically we tuned the bs to keep mean knn feature similarity at ≈ 0.3 and mean random similarity at ≈ 0.0. LINEBREAK many images within the cocostuff and cityscapes datasets are cluttered with small objects that are hard to resolve at a feature resolution of (40, 40). to better handle small objects and maintain fast training times we five-crop training images prior to learning knns. this not only allows the network to look at closer details of the images, but also improves the quality of the knns. more specifically, global image embeddings are computed for each crop. this allows the network to resolve finer details and yields five times as many images to find close matching knns from. five-cropping improved both our cityscapes results and cocostuff segmentations, and we detail this in table 2. LINEBREAK the final components of our architecture are the clustering and crf refinement step. due to the feature distillation process, stego’s segmentation features tend to form clear clusters. we apply a cosine distance based minibatch k-means algorithm (macqueen et al., 1967) to extract these clusters and compute concrete class assignments from stego’s continuous features. after clustering, we refine these labels with a crf to improve their spatial resolution further. LINEBREAK relation to potts models and energy-based graph optimization LINEBREAK equation 4 can be viewed in the context of potts models or continuous ising models from statistical physics (potts, 1952; baker jr & kincaid, 1979). we briefly overview this connection, and point interested readers to section a.8 for a more detailed discussion. to build the general ising model, let g = (v, w) be a fully connected, weighted, and undirected graph on |v| vertices. in our applications we take v to be the set of pixels in the training dataset. let w : v × v → r represent an edge LINEBREAK table 1: comparison of unsupervised segmentation architectures on 27 class cocostuff validation set. stego significantly outperforms prior art in both unsupervised clustering and linear-probe style metrics. LINEBREAK unsupervised LINEBREAK linear probe LINEBREAK model resnet50 (he et al., 2016) mocov2 (chen et al., 2020c) dino (caron et al., 2021) deep cluster (caron et al., 2018) sift (lowe, 1999) doersch et al. (2015) isola et al. (2015) ac (ouali et al., 2020) inmars (mirsadeghi et al., 2021) iic (ji et al., 2019) mdc (cho et al., 2021) picie (cho et al., 2021) picie + h (cho et al., 2021) stego (ours) LINEBREAK weighting function. let φ : v → c be a vertex valued function mapping into a generic code space c such as the probability simplex over cluster labels p(l), or the k-dimensional continuous feature space rk. the function φ can be a parameterized neural network, or a simple lookup table that assigns a code to each graph node. finally, we define a compatibility function µ : c × c → r that measures the cost of comparing two codes. we can now define the following graph energy functional: LINEBREAK e(φ) := LINEBREAK w(vi, vj)µ(φ(vi), φ(vj)) LINEBREAK vi,vj ∈v LINEBREAK constructing the boltzmann distribution (hinton, 2002) yields a normalized distribution over the function space φ: LINEBREAK p(φ|w, µ) = LINEBREAK exp(−e(φ)) φ exp(−e(φ(cid:48)))dφ(cid:48) LINEBREAK in general, sampling from this probability distribution is difficult because of the often-intractable normalization factor. however, it is easier to compute the maximum likelihood estimate (mle), arg maxφ∈φ p(φ|w, µ). in particular, if φ is a smoothly parameterized space of functions and φ and µ are differentiable functions, one can compute the mle using stochastic gradient descent (sgd) with highly-optimized automatic differentiation frameworks (paszke et al., 2019; abadi et al., 2015). in section a.8 of the supplement we prove that the finding the mle of equation 7 is equivalent to minimizing the loss of equation 4 when |v | is the set of pixels in our image training set, φ = s ◦ n , w is the cosine distance between features, and µ is cosine distance. like stego, the crf is also a potts model, and we use this connection to re-purpose the stego loss function to create continuous, minibatch, and unsupervised variants of the crf. we detail this exploration in section a.9 of the supplement. LINEBREAK experiments LINEBREAK we evaluate stego on standard semantic segmentation datasets and compare with current state-ofthe-art. we then justify different design choices of stego through ablation studies. additional details on datasets, model hyperparameters, hardware, and other implementation details can be found in section a.10 of the supplement. LINEBREAK 4.1 evaluation details datasets following cho et al. (2021), we evaluate stego on the 27 mid-level classes of the cocostuff class hierarchy and on the 27 classes of cityscapes. like prior art, we first resize images to 320 pixels along the minor axis followed by a (320 × 320) center crops of each validation image. we use mean intersection over union (miou) and accuracy for evaluation metrics. our cocostuff evaluation setting originated in ji et al. (2019) and is common in the literature. our cityscapes LINEBREAK figure 5: comparison of ground truth labels (middle row) and cluster probe predictions for stego (bottom row) for images from the cityscapes dataset. LINEBREAK figure 6: confusion matrix of stego cluster probe predictions on cocostuff. classes after the “vehicle” class are “stuff” and classes before are “things”. rows are normalized to sum to 1. LINEBREAK evaluation setting is adopted from cho et al. (2021). the latter is newer and more challenging, and thus fewer baselines are available. finally we also compare on the potsdam-3 setting fro ji et al. (2019) in section a.2 of the appendix. LINEBREAK linear probe the first way we evaluate the quality of the distilled segmentation features is through transfer learning effectiveness. as in van gansbeke et al. (2021); cho et al. (2021); chen et al. (2020b), we train a linear projection from segmentation features to class labels using the cross entropy loss. this loss solely evaluates feature quality and is not part of the stego training process. LINEBREAK clustering unlike the linear probe, the clustering step does not have access to ground truth supervised labels. as in prior art, we use a hungarian matching algorithm to align our unlabeled clusters and the ground truth labels for evaluation and visualization purposes. this measures how consistent the predicted semantic segments are with the ground truth labels and is invariant to permutations of the predicted class labels. LINEBREAK results LINEBREAK we summarize our main results on the 27 classes of cocostuff in table 1. stego significantly outperforms the prior state of the art, picie, on both linear probe and clustering (unsupervised) metrics. in particular, stego improves by +14 unsupervised miou, +6.9 unsupervised accuracy, +26 linear probe miou, and +21 linear probe accuracy compared to the next best baseline. in table 3, we find a similarly large improvement of +8.7 unsupervised miou and +7.7 unsupervised accuracy on the cityscapes validation set. these two experiments demonstrate that even though we do not fine-tune the backbone for these datasets, dino’s self-supervised weights on imagenet (deng et al., 2009) are enough to simultaneously solve both settings. stego also outperforms simply clustering the features from unmodified dino, mocov2, and imagenet supervised resnet50 backbones. this demonstrates the benefits of training a segmentation head to distill feature correspondences. LINEBREAK we show some example segmentations from stego and our baseline picie on the cocostuff dataset in figure 1. we include additional examples and failure cases in sections a.4 and a.5. we note that stego is significantly better at resolving fine-grained details within the images such as the legs of horses in the third image from the left column of figure 1, and the individual birds in the right-most column. though the picie baseline uses a feature pyramid network to output high resolution predictions, the network does not attune to fine grained details, potentially demonstrating the limitations of the sparse training signal induced by data augmentations alone. in contrast, stego’s predictions capture small objects and fine details. in part, this can be attributed to dino backbone’s higher resolution features, the 5-crop training described in 3.3, and the crf post-processing which helps to align the predictions to image edges. we show qualitative results on the cityscapes dataset in figure 5. stego successfully identifies people, street, sidewalk, cars, and street signs with high LINEBREAK table 2: architecture ablation study on the cocostuff dataset (27 classes). LINEBREAK p m a l c arch. 0 mocov2 (cid:88) LINEBREAK p o r c 5 LINEBREAK f r c LINEBREAK c s LINEBREAK unsup. LINEBREAK table 3: results on the cityscapes dataset (27 classes). stego improves significantly over all baselines in both accuracy and miou. LINEBREAK model iic (ji et al., 2019) LINEBREAK stego (ours) LINEBREAK detail and fidelity. we note that prior works did not publish pretrained models or linear probe results on cityscapes so we exclude this information from table 3 and figure 5. LINEBREAK to better understand the predictions and failures of stego, we include confusion matrices for cocostuff (figure 6) and cityscapes (figure 11 of the supplement). some salient stego errors include confusing the “food” category from the cocostuff “things”, and the “food” category from cocostuff “stuff”. stego also does not properly separate “ceilings” from “walls”, and lacks consistent segmentations for classes such as “indoor”, “accessory”, “rawmaterial” and “textile”. these errors also draw our attention to the challenges of evaluating unsupervised segmentation methods: label ontologies can be arbitrary. in these circumstances the divisions between classes are not well defined and it is hard to imagine a system that can segment the results consistently without additional information. in these regimes, the linear probe provides a more important barometer for quality because the limited supervision can help disambiguate these cases. nevertheless, we feel that there is still considerable progress to be made on the purely unsupervised benchmark, and that even with the improvements of stego there is still a measurable performance gap with supervised systems. LINEBREAK ablation study LINEBREAK to understand the impact of stego’s architectural components we perform an ablation analysis on the cocostuff dataset, and report the results in table 2. we examine the effect of using several different backbones in stego including mocov2, the vit-small, and vit-base architectures of dino. we find that vit-base is the best feature extractor of the group and leads by a significant margin both in terms of accuracy and miou. we also evaluate the several loss function and architecture decisions described in section 3.3. in particular, we explore clamping the segmentation feature correspondence tensor at 0 to prevent the negative pressure from introducing co-linearity (0-clamp), five-cropping the dataset prior to mining knns to improve the resolution of the learning signal (5crop), spatially centering the feature correspondence tensor to improve resolution of small objects (sc), and conditional random field post-processing to refine predictions (crf). we find that these modifications improve both the cluster and linear probe evaluation metrics. LINEBREAK conclusion LINEBREAK we have found that modern self-supervised visual backbones can be refined to yield state of the art unsupervised semantic segmentation methods. we have motivated this architecture by showing that correspondences between deep features are directly correlated with ground truth label cooccurrence. we take advantage of this strong, yet entirely unsupervised, learning signal by introducing a novel contrastive loss that “distills” the correspondences between features. our system, stego, produces low rank representations that cluster into accurate semantic segmentation predictions. we connect stego’s loss to crf inference by showing it is equivalent to mle in potts models over the entire collection of pixels in our dataset. we show stego yields a significant improvement over the prior state of the art, on both the cocostuff (+14 miou) and cityscapes (+9 miou) semantic segmentation challenges. finally, we justify the architectural decisions of stego with an ablation study on the cocostuff dataset. LINEBREAK acknowledgments LINEBREAK we would like to thank karen hamilton for proofreading the work and siddhartha sen for sponsoring access to the microsoft research compute infrastructure. we also thank jang hyun cho for helping us run and evaluate the picie baseline. we thank kavital bala, vincent sitzmann, marc bosch, desalegn delelegn, cody champion, and markus weimer for their helpful commentary on the work. LINEBREAK this material is based upon work supported by the national science foundation graduate research fellowship under grant no. 2021323067. any opinion, findings, and conclusions or recommendations expressed in this material are those of the authors(s) and do not necessarily reflect the views of the national science foundation. this research is based upon work supported in part by the office of the director of national intelligence (intelligence advanced research projects activity) via 202120111000006. the views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of odni, iarpa, or the u s government. the us government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein. this work is supported by the national science foundation under cooperative agreement phy-2019786 (the nsf ai institute for artificial intelligence and fundamental interactions, http://iaifi.org/) LINEBREAK references LINEBREAK mart´ın abadi, ashish agarwal, paul barham, eugene brevdo, zhifeng chen, craig citro, greg s. corrado, andy davis, jeffrey dean, matthieu devin, sanjay ghemawat, ian goodfellow, andrew harp, geoffrey irving, michael isard, yangqing jia, rafal jozefowicz, lukasz kaiser, manjunath kudlur, josh levenberg, dan man´e, rajat monga, sherry moore, derek murray, chris olah, mike schuster, jonathon shlens, benoit steiner, ilya sutskever, kunal talwar, paul tucker, vincent vanhoucke, vijay vasudevan, fernanda vi´egas, oriol vinyals, pete warden, martin wattenberg, martin wicke, yuan yu, and xiaoqiang zheng. tensorflow: large-scale machine learning on heterogeneous systems, 2015. url http://tensorflow.org/. software available from tensorflow.org. LINEBREAK jiwoon ahn, sunghyun cho, and suha kwak. weakly supervised learning of instance segmentation with inter-pixel relations. corr, abs/1904.05044, 2019. url http://arxiv.org/abs/ 1904.05044. LINEBREAK george a baker jr and john m kincaid. continuous-spin ising model and λ: φ 4: d field theory. LINEBREAK hakan bilen, rodrigo benenson, and seong joon oh. eccv 2020 tutorial on weakly-supervised url https://github.com/hbilen/wsl-eccv20. LINEBREAK learning in computer vision. github.io. LINEBREAK holger caesar, jasper uijlings, and vittorio ferrari. coco-stuff: thing and stuff classes in context. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 1209– 1218, 2018. LINEBREAK mathilde caron, piotr bojanowski, armand joulin, and matthijs douze. deep clustering for unsupervised learning of visual features. in proceedings of the european conference on computer vision (eccv), pp. 132–149, 2018. LINEBREAK mathilde caron, hugo touvron, ishan misra, herv´e j´egou, julien mairal, piotr bojanowski, and armand joulin. emerging properties in self-supervised vision transformers. arxiv preprint arxiv:2104.14294, 2021. LINEBREAK liang-chieh chen, george papandreou, iasonas kokkinos, kevin murphy, and alan l yuille. semantic image segmentation with deep convolutional nets and fully connected crfs. arxiv preprint arxiv:1412.7062, 2014. LINEBREAK liang-chieh chen, george papandreou, florian schroff, and hartwig adam. rethinking atrous LINEBREAK convolution for semantic image segmentation. arxiv preprint arxiv:1706.05587, 2017. LINEBREAK ting chen, simon kornblith, kevin swersky, mohammad norouzi, and geoffrey hinton. big selfsupervised models are strong semi-supervised learners. arxiv preprint arxiv:2006.10029, 2020a. LINEBREAK xinlei chen, haoqi fan, ross girshick, and kaiming he. LINEBREAK improved baselines with momentum LINEBREAK contrastive learning. arxiv preprint arxiv:2003.04297, 2020b. LINEBREAK xinlei chen, haoqi fan, ross girshick, and kaiming he. LINEBREAK improved baselines with momentum LINEBREAK contrastive learning. arxiv preprint arxiv:2003.04297, 2020c. LINEBREAK jang hyun cho, u. mall, k. bala, and bharath hariharan. picie: unsupervised semantic segmenta LINEBREAK tion using invariance and equivariance in clustering. arxiv, abs/2103.17070, 2021. LINEBREAK edo collins, radhakrishna achanta, and sabine susstrunk. deep feature factorization for concept discovery. in proceedings of the european conference on computer vision (eccv), pp. 336–352, 2018. LINEBREAK jia deng, wei dong, richard socher, li-jia li, kai li, and li fei-fei. imagenet: a large-scale hierarchical image database. in 2009 ieee conference on computer vision and pattern recognition, pp. 248–255. ieee, 2009. LINEBREAK carl doersch, abhinav gupta, and alexei a efros. unsupervised visual representation learning by context prediction. in proceedings of the ieee international conference on computer vision, pp. 1422–1430, 2015. LINEBREAK alexey dosovitskiy, lucas beyer, alexander kolesnikov, dirk weissenborn, xiaohua zhai, thomas unterthiner, mostafa dehghani, matthias minderer, georg heigold, sylvain gelly, et al. an image is worth 16x16 words: transformers for image recognition at scale. arxiv preprint arxiv:2010.11929, 2020. LINEBREAK william LINEBREAK lightning. https://github.com/pytorchlightning/pytorch-lightning, 3, 2019. LINEBREAK pytorch LINEBREAK falcon LINEBREAK al. LINEBREAK et LINEBREAK github. LINEBREAK note: LINEBREAK spyros gidaris, praveer singh, and nikos komodakis. unsupervised representation learning by LINEBREAK predicting image rotations. arxiv preprint arxiv:1803.07728, 2018. LINEBREAK xavier glorot, antoine bordes, and yoshua bengio. deep sparse rectifier neural networks. LINEBREAK in proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315–323. jmlr workshop and conference proceedings, 2011. LINEBREAK mark hamilton, scott lundberg, lei zhang, stephanie fu, and william t freeman. model-agnostic LINEBREAK explainability for visual search. arxiv preprint arxiv:2103.00370, 2021. LINEBREAK yufei han and maurizio filippone. mini-batch spectral clustering. LINEBREAK in 2017 international joint LINEBREAK conference on neural networks (ijcnn), pp. 3888–3895. ieee, 2017. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 770–778, 2016. LINEBREAK geoffrey e hinton. training products of experts by minimizing contrastive divergence. neural LINEBREAK r devon hjelm, alex fedorov, samuel lavoie-marchildon, karan grewal, phil bachman, adam trischler, and yoshua bengio. learning deep representations by mutual information estimation and maximization. arxiv preprint arxiv:1808.06670, 2018. LINEBREAK jyh-jing hwang, stella x. yu, jianbo shi, maxwell d. collins, tien-ju yang, xiao zhang, and liang-chieh chen. segsort: segmentation by discriminative sorting of segments. corr, abs/1910.06962, 2019. url http://arxiv.org/abs/1910.06962. LINEBREAK phillip isola, daniel zoran, dilip krishnan, and edward h adelson. learning visual groups from LINEBREAK co-occurrences in space and time. arxiv preprint arxiv:1511.06811, 2015. LINEBREAK max jaderberg, karen simonyan, andrew zisserman, and koray kavukcuoglu. spatial transformer LINEBREAK xu ji, jo˜ao f henriques, and andrea vedaldi. invariant information clustering for unsupervised image classification and segmentation. in proceedings of the ieee/cvf international conference on computer vision, pp. 9865–9874, 2019. LINEBREAK diederik p kingma and jimmy ba. adam: a method for stochastic optimization. arxiv preprint LINEBREAK philipp kr¨ahenb¨uhl and vladlen koltun. efficient inference in fully connected crfs with gaussian LINEBREAK edge potentials. advances in neural information processing systems, 24:109–117, 2011. LINEBREAK john lafferty, andrew mccallum, and fernando cn pereira. conditional random fields: proba LINEBREAK bilistic models for segmenting and labeling sequence data. 2001. LINEBREAK omer levy and yoav goldberg. neural word embedding as implicit matrix factorization. advances LINEBREAK in neural information processing systems, 27:2177–2185, 2014. LINEBREAK yunfan li, peng hu, zitao liu, dezhong peng, joey tianyi zhou, and xi peng. contrastive cluster LINEBREAK yun liu, yu-huan wu, peisong wen, yujun shi, yu qiu, and ming-ming cheng. leveraging instance-, image- and dataset-level information for weakly supervised instance segmentation. ieee transactions on pattern analysis and machine intelligence, 2020. doi: 10.1109/tpami. 2020.3023152.
| 11
|
[
108,
472.4580784,
504.0037874,
515.2976784
] |
nRj0NcmSuxb.pdf
| 2,022
| 1
|
LINEBREAK faircal: fairness calibration for face verification LINEBREAK tiago salvador1,3, stephanie cairns1,3, vikram voleti2,3, noah marshall1,3, adam oberman1,3 1 mcgill university 1,3{tiago.saldanhasalvador,stephanie.cairns,noah.marshall2}@mail.mcgill.ca 2,3 [email protected], 1,3 [email protected] LINEBREAK 2 université de montréal LINEBREAK 3 mila LINEBREAK abstract LINEBREAK despite being widely used, face recognition models suffer from bias: the probability of a false positive (incorrect face match) strongly depends on sensitive attributes such as the ethnicity of the face. as a result, these models can disproportionately and negatively impact minority groups, particularly when used by law enforcement. the majority of bias reduction methods have several drawbacks: they use an end-toend retraining approach, may not be feasible due to privacy issues, and often reduce accuracy. an alternative approach is post-processing methods that build fairer decision classifiers using the features of pre-trained models, thus avoiding the cost of retraining. however, they still have drawbacks: they reduce accuracy (agenda, pass, ftc), or require retuning for different false positive rates (fsn). in this work, we introduce the fairness calibration (faircal) method, a post-training approach that simultaneously: (i) increases model accuracy (improving the stateof-the-art), (ii) produces fairly-calibrated probabilities, (iii) significantly reduces the gap in the false positive rates, (iv) does not require knowledge of the sensitive attribute, and (v) does not require retraining, training an additional model, or retuning. we apply it to the task of face verification, and obtain state-of-the-art results with all the above advantages. LINEBREAK introduction LINEBREAK face recognition (fr) systems are being increasingly deployed worldwide in a variety of contexts, from policing and border control to providing security for everyday consumer electronics. according to garvie et al. (2016), face images of around half of all american adults are searchable in police databases. fr systems have achieved impressive results in maximizing overall accuracy (jain et al., 2016). however, they have also been shown to exhibit significant bias against certain demographic subgroups (buolamwini & gebru, 2018; orcutt, 2016; alvi et al., 2018), defined by a sensitive attribute such as ethnicity, gender, or age. many fr systems have much higher false positive rates (fprs) for non-white faces than white faces (grother et al., 2019). therefore, when fr is employed by law enforcement, non-white individuals may be more likely to be falsely detained (allyn, 2020). thus, it is of utmost importance to devise an easily-implementable solution to mitigate fr bias. LINEBREAK most efforts to mitigate fr bias have been directed towards learning less biased representations (liang et al., 2019; wang et al., 2019b; kortylewski et al., 2019; yin et al., 2019; gong et al., 2020; wang & deng, 2020; huang et al., 2020; gong et al., 2021). these approaches have enjoyed varying degrees of success: though the bias is reduced, so is the accuracy (gong et al., 2020). they often require retraining the models from scratch, which is computationally expensive. moreover, they often require the sensitive attribute of the face (such as ethnicity) (gong et al., 2020; dhar et al., 2020; terhörst et al., 2020a; dhar et al., 2021; robinson et al., 2020), which may not be feasible to obtain. hence, an approach that improves fairness in existing models without reducing accuracy, or knowing the sensitive attribute, or require retraining, is missing. LINEBREAK in this work, we focus on the face verification problem, a major subproblem in fr: determine whether two face images depict the same person. current state-of-the-art (sota) classifiers are based on deep neural networks that embed images into a low-dimensional space (taigman et al., 2014). the “baseline” method is one that deems a pair of images is a match if the cosine similarity between LINEBREAK figure 1: (lines closer together is better for fairness, best viewed in colour) illustration of improved fairness / reduction in bias, as measured by the fprs evaluated on intra-ethnicity pairs on the rfw dataset with the facenet (webface) feature model. the significant subgroup bias in the baseline method is reduced with post-processing methods agenda (dhar et al., 2020), ftc (terhörst et al., 2020a), fsn (terhörst et al., 2020b), and faircal (ours). our faircal performs best. LINEBREAK their embeddings exceeds a certain threshold. we illustrate and compare the bias of current models in figure 1, and compare their characteristics in table 1. LINEBREAK the fairness of face verification classifiers is typically assessed by three quantities, explained below: (i) fairness calibration across subgroups, (ii) equal false positive rates (fprs) across subgroups i.e. predictive equality, (iii) equal false negative rates (fnrs) across subgroups, i.e. equal opportunity. LINEBREAK a classifier is said to be globally calibrated if its predicted probability ppred of face matches in a dataset is equal to the fraction ptrue of true matches in the dataset (guo et al., 2017). this requires the classifier to additionally output an estimate of the true probability of a match, i.e. confidence. however, we suggest it is even more crucial for models to be fairly calibrated, i.e., for calibration to hold conditionally on each subgroup (see definition 2). otherwise, if the same predicted probability is known to carry different meanings for different demographic groups, users including law enforcement officers and judges may be motivated to take sensitive attributes into account when making critical decisions about arrests or sentencing (pleiss et al., 2017). moreover, previous works such as canetti et al. (2019) and pleiss et al. (2017) presume the use of a fairly-calibrated model for their success. LINEBREAK while global calibration can be achieved with off-the-shelf post-hoc calibration methods (platt, 1999; zadrozny & elkan, 2001; niculescu-mizil & caruana, 2005; guo et al., 2017), they do not achieve fairness-calibration. this is illustrated in figure 2. however, achieving all three fairness definitions mentioned above: (i) fairness-calibration, (ii) equal fprs, (iii) equal fnrs, is impossible in practice as several authors have shown (hardt et al., 2016; chouldechova, 2017; kleinberg et al., 2017; pleiss et al., 2017). we elaborate further on this in section 3, the key takeaway is that we may aim to satisfy at most two of the three fairness notions. in the particular context of policing, equal fprs i.e. predictive equality is considered more important than equal fnrs, as false positive errors (false arrests) risk causing significant harm, especially to members of subgroups already at disproportionate risk for police scrutiny or violence. as a result, our goals are to achieve fairness-calibration and predictive equality across subgroups, while maintaining accuracy, without retraining. LINEBREAK we further assume that we do not have access to the sensitive attributes, as this may not be feasible in practice due to (a) privacy concerns, (b) challenges in defining the sensitive attribute (e.g. ethnicity cannot be neatly divided into discrete categories), and (c) laborious and expensive to collect. LINEBREAK in this paper, we succeed in achieving all of the objectives mentioned above. the main contribution is the introduction of a post-training fairness calibration (faircal) method: LINEBREAK 1. accuracy: faircal achieves state-of-the-art accuracy (table 2) for face verification on two LINEBREAK large datasets. LINEBREAK 2. fairness-calibration: our face verification classifier outputs state-of-the-art fairness LINEBREAK calibrated probabilities without knowledge of the sensitive attribute (table 3). LINEBREAK 3. predictive equality: our method reduces the gap in fprs across sensitive attributes (table 4). for example, in figure 2, at a global fpr of 5% using the baseline method black people are 15x more likely to false match than white people. our method reduces this to 1.2x (while sota for post-hoc methods is 1.7x). LINEBREAK 4. no sensitive attribute required: our approach does not require the sensitive attribute, neither at training nor at test time. in fact, it outperforms models that use this knowledge. LINEBREAK figure 2: illustration of bias reduction. false positives correspond to the imposter pairs above a decision threshold value. black horizontal line: threshold which achieves global fpr of 5%; red lines: thresholds for subgroup fprs of 5%. the deviation of the subgroup fprs from the global fpr is a measure of bias (red lines closer to black horizontal line is better). the baseline method is biased. calibration (based on cosine similarity alone) does not reduce the bias. the oracle method reduces bias by using subgroup membership labels for calibration. the faircal method (ours) reduces bias by using feature vectors for calibration without using subgroup information. LINEBREAK 5. no retraining: our method has no need for retraining or tuning the feature representation model, or training an additional model, since it performs statistical calibration post-hoc. LINEBREAK related work
| 2
|
[
108.299,
468.7686768,
208.9393649,
480.7238768
] |
TBIzh9b5eaz.pdf
| 2,021
| 2
|
LINEBREAK risk-averse offline reinforcement learning LINEBREAK n ´uria armengol urp´ı dept. of computer science eth zurich [email protected] LINEBREAK sebastian curi dept. of computer science eth zurich [email protected] LINEBREAK andreas krause dept. of computer science eth zurich [email protected] LINEBREAK abstract LINEBREAK training reinforcement learning (rl) agents online in high-stakes applications is often prohibitive due to the risk associated with exploration. thus, the agent can only use data previously collected by safe policies. while previous work considers optimizing the average performance using offline data, we focus on optimizing a risk-averse criterion. in particular, we present the offline riskaverse actor-critic (o-raac), a model-free rl algorithm that is able to learn risk-averse policies in a fully offline setting. we show that o-raac learns policies with higher risk-averse performance than risk-neutral approaches in different robot control tasks. furthermore, considering risk-averse criteria guarantees distributional robustness of the average performance with respect to particular distribution shifts. we demonstrate empirically that in the presence of natural distribution-shifts, o-raac learns policies with good average performance. LINEBREAK introduction LINEBREAK in high-stakes applications, the deployment of highly-performing reinforcement learning (rl) agents is limited by prohibitively large costs at early exploration stages (dulac-arnold et al., 2019). to address this issue, the offline (or batch) rl setting considers learning a policy from a limited batch of pre-collected data. however, high-stakes decision-making is typically also risk-averse: we assign more weight to adverse events than to positive ones (pratt, 1978). although several algorithms for risk-sensitive rl exist (howard & matheson, 1972; mihatsch & neuneier, 2002), none of them addresses the offline setting. on the other hand, existing offline rl algorithms consider the average performance criterion and are risk-neutral (ernst et al., 2005; lange et al., 2012). LINEBREAK main contributions we present the first approach towards learning a risk-averse rl policy for high-stakes applications using only offline data: the offline risk-averse actor-critic (o-raac). the algorithm has three components: a distributional critic that learns the full value distribution (section 3.1), a risk-averse actor that optimizes a risk averse criteria (section 3.2) and an imitation learner implemented with a variational auto-encoder (vae) that reduces the bootstrapping error due to the offline nature of the algorithm (section 3.3). in figure 1, we show how these components interact with each other. finally, in section 4 we demonstrate the empirical performance of o-raac. our implementation is freely available at github: https://github.com/nuria95/o-raac. LINEBREAK related work LINEBREAK risk-averse rl the most common risk-averse measure in the literature is the conditional valueat-risk (cvar) (rockafellar & uryasev, 2002), which corresponds to the family of coherent riskmeasures (artzner et al., 1999), and we focus mainly on these risk-measures. nevertheless, other risk criteria such as cumulative prospect theory (tversky & kahneman, 1992) or exponential utility (rabin, 2013) can also be used with the algorithm we propose. in the context of rl, petrik & subramanian (2012); chow & ghavamzadeh (2014); chow et al. (2015) propose dynamic programming algorithms for solving the cvar of the return distribution with known tabular markov decision processes (mdps). for unknown models, morimura et al. (2010) propose a sarsa algorithm for (cvar) optimization but it is limited to the on-policy setting and small action spaces. to scale to larger systems, tamar et al. (2012; 2015) propose on-policy actor-critic algorithms for coherent risk-measures. however, they are extremely sample inefficient due to sample discarding to compute LINEBREAK fixed buffer (s,a,r,s(cid:48)) LINEBREAK critic zw LINEBREAK actor πθ LINEBREAK vaeφ LINEBREAK lcritic(w) lactor(θ) LINEBREAK lvae(φ) LINEBREAK z(s, a) LINEBREAK z LINEBREAK d LINEBREAK ez LINEBREAK figure 1: visualization of the algorithm components. solid lines indicate the forward flow of data whereas dashed lines indicate the backward flow of gradients. data is stored in the fixed buffer. the vae, in blue, learns a generative model of the behavior policy. the actor, in green, perturbs the vae and outputs a policy. the critic, learns the z-value distribution of the policy. the actor optimizes a risk-averse distortion of the z-value distribution, which we denote by z. on the right, we show a typical probability density function of z learned by the critic in red. in dashed black we indicate the expected value of z, which a risk-neutral actor intends to maximize. instead, z, shown in dashed green. in this particular a risk-averse actor intends to maximize a distortion visualization, we show the ubiquitous conditional value at risk (cvar). LINEBREAK d LINEBREAK d LINEBREAK the risk-criteria and the high-variance of the gradient estimate. while prashanth et al. (2016) address sample efficiency by considering cumulative prospect theory instead of coherent risk-measures, their algorithm is limited to tabular mdps and is also on-policy. instead, tang et al. (2020) propose an off-policy algorithm that approximates the return distribution with a gaussian distribution and learns its moments using the bellman equation for the mean and the variance of the distribution. instead, we learn the full return distribution without making the gaussianity assumption (bellemare et al., 2017). perhaps most closely related is the work of singh et al. (2020), who consider also a distributional critic but their algorithm is limited to the cvar and they do not address the offline rl setting. furthermore, they use a sample-based distributional critic, which makes the computation of the cvar inefficient. instead, we modify implicit quantile networks (dabney et al., 2018) in order to compute different risk criteria efficiently. although (dabney et al., 2018) already investigated risk-related criteria, their scope is limited to discrete action spaces (e.g., the atari domain) in an off-policy setting whereas we consider continuous actions in an offline setting. LINEBREAK offline rl the biggest challenge in offline rl is the bootstrapping error: a q-function is evaluated at state-action pairs where there is little or no data and these get propagated through the bellman equation (kumar et al., 2019). in turn, a policy optimized with offline data induces a state-action distribution that is shifted from the original data (ross et al., 2011). to address this, fujimoto et al. (2019) propose to express the actor as the sum between an imitation learning component and a perturbation model to control the deviation of the behavior policy. other approaches to control the difference between the data-collection policy and the optimized policy include regularizing the policies with the behavior policy using the mmd distance (kumar et al., 2019) or f-divergences (wu et al., 2020; jaques et al., 2019), or using the behavior policy as a prior (siegel et al., 2020). an alternative strategy in offline rl is to be pessimistic with respect to the epistemic uncertainty that arises due to data scarcity. yu et al. (2020) take a model-based approach and penalize the per-step rewards with the epistemic uncertainty of their dynamical model. using a model-free approach kumar et al. (2020); buckman et al. (2020) propose to learn a lower bound of the q-function using an estimate of the uncertainty as penalty in the target of the equation. our work uses ideas from both strategies to address the offline risk-averse problem. first, we use an imitiation learner to control the bootstrapping error. however, by considering a risk-averse criterion, we are also optimizing over a pessimistic distribution compatible with the empirical distribution in the data set. the connections between risk-aversion and distributional robustness are well studied in supervised learning (shapiro et al., 2014; namkoong & duchi, 2017; curi et al., 2020; levy et al., 2020) and in reinforcement learning (chow et al., 2015; pan et al., 2019). LINEBREAK problem statement LINEBREAK we consider a markov decision process (mdp) with possibly continuous s and possibly cons, a) and discount factor γ. we tinuous actions a denote by π a stationary policy, i.e., a mapping from states to distribution over actions. we have LINEBREAK s, a), reward kernel r( LINEBREAK , transition kernel p ( LINEBREAK ∈ a LINEBREAK ∈ s LINEBREAK access to a fixed batch data set collected with an unknown behaviour policy πβ. we call dβ the joint state, action, reward, next-state distribution induced by the behaviour policy and ρβ the marginal state distribution. we access this distribution by sampling from the fixed data set. similarly, for any policy π, we call dπ the joint state, action, reward, next-state distribution induced by π on the mdp. LINEBREAK st, at)(cid:3), where the expectation is taken with respect t=1 γt−1r( ·| LINEBREAK in risk-neutral rl, the goal is to find a policy that maximizes the expected discounted sum of returns edπ to the stochasticity introduced by the reward kernel, the transition kernel, and the policy. we define as z π(s, a) =d st, at) as the return distribution conditioned on (s1 = s, a1 = a) and following π thereafter. here =d denotes equality in distribution. the risk-neutral rl objective is the expectation of the distribution of z π. LINEBREAK in risk-averse settings, we replace the expectation with a distortion operator that is a mapping from the distribution over the returns to the reals. thus, the goal is to find a policy π that maximizes LINEBREAK d LINEBREAK max LINEBREAK π d LINEBREAK st, at) LINEBREAK with this framework, we address many different risk-averse distortions. for example, this includes probability weighting functions (gonzalez & wu, 1999; tversky & kahneman, 1992), the cvar (rockafellar & uryasev, 2002), the mean-variance criteria (namkoong & duchi, 2017) or the wang criteria (wang, 1996; rabin, 2013). LINEBREAK offline risk-averse actor-critic (o-raac) LINEBREAK we now present our algorithm o-raac for offline-risk averse rl. one of the main technical challenges in going beyond expected rewards is to find an analogue of the q-function for the particular distortion operator we want to optimize. unfortunately, the bellman target of most risk-analogues does not have a closed-form expression. therefore, we instead learn the full distribution of returns as proposed by bellemare et al. (2017). in section 3.1, we describe the training procedure for the distributional critic. next, in section 3.2 we define the actor loss as the risk-distortion operator on the learned return distribution and optimize it using a gradient-based approach. up to this point, the actor-critic template is enough to optimize a risk-averse criteria. however, as we focus on the offline setting, we need to control the bootstrapping error. to this end, we use a variational auto-encoder vae to learn a generative model of the behavior policy in section 3.3. finally, in section 3.4 we bring all the pieces together and instantiate our algorithm for different risk distortions LINEBREAK d LINEBREAK distributional critic learning LINEBREAK p ( LINEBREAK s, a) and a(cid:48) ·| LINEBREAK to learn the distributional critic, we exploit the distributional bellman equation of returns z π(s, a) =d r(s, a) + γz π(s(cid:48), a(cid:48)) for policy evaluation. the random variables s(cid:48), a(cid:48) are s(cid:48)). in particular, we represent the return distributed according to s(cid:48) ∼ ·| distribution implicitly through its quantile function as proposed by dabney et al. (2018). we use this representation because many risk distortion operators can be efficiently computed using the quantile function of the underlying random variable. we parameterize the quantile function through a neural network with learnable parameters w. we express such implicit quantile function as z π w(s, a; τ ), [0, 1] is the quantile level. whereas the neural network architecture proposed by dabney where τ et al. (2018) is for discrete actions only, we extend it to continuous actions by considering all s, a, and τ as the inputs and only the quantile value as the output. to learn the parameters w, we use the distributional variant of fitted value-iteration (bellemare et al., 2017; munos & szepesv´ari, 2008) using a quantile huber-loss (huber, 1964) as a surrogate of the wasserstein-distance as proposed by dabney et al. (2018). to this end, we use a target network with parameters w(cid:48) and compute the temporal difference (td) error at a sample (s, a, r, s(cid:48)) as w(cid:48)(s(cid:48), a(cid:48); τ (cid:48)) LINEBREAK δτ,τ (cid:48) = r + γz π w(s, a; τ ), for τ, τ (cid:48) independently sampled from the uniform distribution, i.e., τ, τ (cid:48) the τ -quantile huber-loss is LINEBREAK ∼ u LINEBREAK z π LINEBREAK l LINEBREAK if LINEBREAK κ, δ | 1 2 κ otherwise. LINEBREAK (cid:123)(cid:122) huber loss LINEBREAK we prefer the huber loss over the 1 loss as it is better behaved due to smooth gradientclipping (mnih et al., 2015). finally, we approximate the quantile loss for all levels τ by sampling n independent quantiles τ and n (cid:48) independent target quantiles τ (cid:48). the critic loss is LINEBREAK l LINEBREAK l LINEBREAK critic(w) = e LINEBREAK (s,a,r,s(cid:48))∼dβ (·) a(cid:48)∼π(·|s(cid:48)) LINEBREAK l LINEBREAK (cid:2) LINEBREAK n LINEBREAK learning a risk-averse actor LINEBREAK j LINEBREAK l LINEBREAK ; τi)(cid:3). LINEBREAK in risk-averse applications, we generally prefer deterministic policies over stochastic ones because introducing extra randomness is against a risk-averse behavior (pratt, 1978) and there is no benefit of exploration often associated with stochastic policies in the offline setting. hence, we consider parameterized deterministic policies πθ(s) : . given a learned distributional critic, we define the actor loss as LINEBREAK lactor(θ) = LINEBREAK (z πθ where is the operator that models risk aversion. we consider markovian policies because these contain the optimal policy for many common risk distortions in the discounted infinite horizon setting (ruszczy´nski, 2010, theorem 4). to minimize the actor loss (5), we use pathwise derivatives of the objective (mohamed et al., 2020), computed by backpropagating the actor through the learned critic at states sampled from the offline data set. minimizing the actor loss is equivalent to maximizing the risk-averse performance. LINEBREAK w (s, πθ(s); τ ))] , LINEBREAK es∼ρβ (·) [ LINEBREAK s → a LINEBREAK d LINEBREAK d LINEBREAK we leverage the quantile representation of the critic (c.f. section 3.1) to compute the risk distortion operator inside the actor loss (5), given a quantile representation of a distribution, common risk distortions can be efficiently approximated using a sampling-based scheme. in particular, there exists a quantile sampling distribution pd associated to LINEBREAK such that LINEBREAK d LINEBREAK d LINEBREAK (z πθ LINEBREAK w (s, πθ(s); τ )) = LINEBREAK d LINEBREAK w (s, πθ(s); τ )pd(τ ) dτ z πθ LINEBREAK z πθ LINEBREAK w (s, πθ(s); τk), τk LINEBREAK pd. LINEBREAK for cumulative prospect theory (tversky & kahneman, 1992) and coherent risk measures (artzner et al., 1999), the associated quantile sampling distributions are well-known. in the particular case of the cvar, this is known as the acerbi’s formula (acerbi & tasche, 2002) LINEBREAK cvarα(z πθ LINEBREAK w (s, a; τ )) = LINEBREAK z πθ LINEBREAK w (s, a; τ ) dτ. LINEBREAK when other representations are used for the critic, computing the risk-distortion becomes computationally expensive. in some particular cases, there are variational formulas to compute the risk-distortion that require to solve an inner optimization problem. for example, singh et al. (2020) use the common rockafellar truncated optimization procedure (rockafellar & uryasev, 2002) to compute the cvar, which is sample inefficient and has high variance (curi et al., 2020). LINEBREAK d LINEBREAK d LINEBREAK off-policy to offline: controlling the bootstraping error. LINEBREAK up to this point, the actor-critic procedure we describe in sections 3.1 and 3.2 is theoretically sufficient to learn a risk-averse rl agent. however, in the offline setting the bootstrapping error appears: when evaluating the td-error (2), the z-value target will be evaluated at actions where there is no data (kumar et al., 2019) and propagated through the bellman equation. to address this issue, (kumar et al., 2019; wu et al., 2020; siegel et al., 2020) propose stochastic policies and penalize deviations from the behaviour policy while optimizing the actor. LINEBREAK as discussed in section 3.2, on one hand we prefer deterministic policies over stochastic ones for risk-averse optimization and on the other hand, we prefer stochastic policies to avoid overfitting to the fixed batch of data. to this end, we use a similar parameterization to fujimoto et al. (2019) and decompose the actor in two components: an imitation learning component πil and a perturbation model ξθ such that the policy is expressed as: LINEBREAK πθ(s) = b + λξθ( LINEBREAK s, b), LINEBREAK s.t., b LINEBREAK πil( LINEBREAK s). LINEBREAK that is, b is an action sampled from the imitation learning component, ξθ is a conditionally deterministic perturbation model that is optimized maximizing the actor loss (5) and λ is a hyperparameter that scales the perturbation magnitude. thus, all the randomness in our policy arises from the behaviour policy and not from the subsequent optimization. furthermore, if we would have access to the behaviour policy πβ we could directly replace the imitation learning module by πβ. LINEBREAK to learn a generative model of the πil from state-action pairs from the behaviour distribution dβ we use a conditional variational autoencoder (vae) (kingma & welling, 2014), which is also done in fujimoto et al. (2019). the main advantage of the vae compared to behavioral cloning (bain & sammut, 1995) is that it does not suffer from mode-collapse which hinders the actor optimization, and compared to inverse imitation learning (ziebart et al., 2008; abbeel & ng, 2004) it does not assume that the policy is optimal. we chose the vae over generative adversarial networks (ho & ermon, 2016) due to easiness of training (arjovsky & bottou, 2017). LINEBREAK the conditional variational autoencoder is a probabilistic model that samples an action b vaeφ(s, a) according to the generative model z LINEBREAK (9) ∼ n where eφ1 is the neural network encoder, dφ2 is the neural network decoder, and we sample the code z using the re-parameterization trick (kingma & welling, 2014). to learn the φ = parameters we place a prior LINEBREAK φ1, φ2 { (0, i) on the code z and minimize the variational lower-bound LINEBREAK µ, σ = eφ1(s, a); LINEBREAK b = dφ2(s, z), LINEBREAK n LINEBREAK vae(φ) = es,a∼β(·) LINEBREAK l LINEBREAK − (cid:123)(cid:122) reconstruction loss LINEBREAK n LINEBREAK (µ, σ), n (cid:123)(cid:122) regularization LINEBREAK upon a new state s, the generative model of the vaeφ(s) is z LINEBREAK (0, i), b = dφ2(s, z). LINEBREAK ∼ n LINEBREAK final algorithm
| 4
|
[
108.249,
403.9825094,
214.6113009,
413.9451094
] |
AUGBfDIV9rL.pdf
| 2,022
| 2
|
LINEBREAK emergent communication at scale LINEBREAK rahma chaabouni∗, florian strub∗, florent altch´e , corentin tallec , eugene trassov , elnaz davoodi , kory mathewson , olivier tieleman , angeliki lazaridou , bilal piot LINEBREAK deepmind LINEBREAK abstract LINEBREAK emergent communication aims for a better understanding of human language evolution and building more efficient representations. we posit that reaching these goals will require scaling up, in contrast to a significant amount of literature that focuses on setting up small-scale problems to tease out desired properties of the emergent languages. we focus on three independent aspects to scale up, namely the dataset, task complexity, and population size. we provide a first set of results for large populations solving complex tasks on realistic large-scale datasets, as well as an easy-to-use codebase to enable further experimentation1. in more complex tasks and datasets, we find that rl training can become unstable, but responds well to established stabilization techniques. we also identify the need for a different metric than topographic similarity, which does not correlate with the generalization performances when working with natural images. in this context, we probe ease-of-learnability and transfer methods to assess emergent languages. finally, we observe that larger populations do not induce robust emergent protocols with high generalization performance, leading us to explore different ways to leverage population, through voting and imitation learning. LINEBREAK introduction LINEBREAK language emergence is at the intersection of cognitive science and machine learning. from a cognitive science view, researchers have been looking at artificial agents as another expressive species to shed light on the source of linguistic regularities (wagner et al., 2003; guo et al., 2019; chaabouni et al., 2021). from a machine learning view, language evolution is deemed as a promising direction to shape agents’ representation and design interactive ai (steels, 1997; lazaridou et al., 2020). LINEBREAK most of the literature in this field relies on different variants of the lewis game (lewis, 1969). there, a speaker network must describe an object to a listener network, which must then retrieve it among a set of other objects. to solve the game, the two agents need to settle on a communication protocol. while deep agents manage to solve the lewis game, their communication protocols are usually degenerate, lacking core properties of human languages (bouchacourt & baroni, 2018; chaabouni et al., 2019). in response to these findings, several works proposed ad-hoc solutions by constraining the game and agents’ capacity (kottur et al., 2017; resnick et al., 2020). while reducing problem complexity is tempting, it can lead to unexpected outcomes and may miss general language emergence behaviors (hayes, 1985). we take a different route and advocate that scaling up communication games is a prerequisite to building interactive ai (baroni et al., 2017; sutton, 2019) or modeling language evolution (barsalou, 2008). indeed, contrary to other machine learning communities, the emergent communication field mostly relies on small-scale games where only one speaker and one listener communicate about disentangled stimuli, which can hinder the generality of its conclusions. in this paper, we focus on three scaling dimensions: the dataset, the task complexity, and the population size. that is, we argue that making populations of deep agents communicate about larger and more realistic datasets and solve more complex tasks, is necessary if in the end we want these agents to interact with us or if we want to model human communication. LINEBREAK we study three properties of emergent languages: generalization, robustness to input noise, and ease of learning over transfer tasks, analyzing different facets of communication protocols. the proposed LINEBREAK ∗ contributed equally. 1 source code: github.com/deepmind/emergent_communication_at_scale LINEBREAK corresponding authors: {rahmac,fstrub,piot}@deepmind.com LINEBREAK scaling up remains computationally tractable, as most of the experiments can be done within a day on a single gpu. the source code is based on the jaxline pipeline (babuschkin et al., 2020). LINEBREAK overall, our experiments provide a large spectrum of observations, both positive and negative. first, we found that scaling up the lewis game quickly entails unstable rl optimization. we propose kl regularization (geist et al., 2019) as an effective way to overcome this issue. second, we observe that complexifying the task has two positive aspects: it better discriminates between methods and improves the generalization of the learned communication protocol. third, we note no correlation between generalization and the widely used topographic similarity metric, which suggests that the latter is not adequate to assess the compositionality of the languages in our more complex setup. instead, we take inspiration from the self-supervised learning literature and explore transfer learning as a new evaluation metric. fourth, unlike what was observed in human communication (gary lupyan, 2010; raviv et al., 2019a;b), we find little to no systematic benefit on emergent languages’ properties when increasing the population size. instead, we propose alternative methods to leverage populations, namely voting and imitation among speakers (hester et al., 2018; vecerik et al., 2017). in particular, we show that such population dynamics lead to more robust, productive, and in some cases easy-to-learn languages even when compared to our best seed without population, opening up new research opportunities. in the end, we expect that these observations, baselines, and good practices would allow the language emergence community to benefit further from deep rl advances and move the field closer to its goals of improving representations and interactive systems. LINEBREAK setup LINEBREAK discrimination game LINEBREAK the discrimination game involves two players, speaker and listener, and is decomposed into three sequential stages. first, speaker receives a target image x and outputs a message m that is sent to listener. second, listener receives m and selects an image ˆx among a set c of different images containing the target image x. the set c is called candidates. finally, the target image x is revealed to listener. if listener selects the target image, then both players receive a positive reward of 1, and 0 otherwise. speaker and listener are parameterized by a set of parameters θ and φ respectively. the message m(x, θ) = (wt(x, θ))t −1 t=0 is a sequence of length t of words wt(x, θ). when no confusion is possible, we omit the dependence on x and θ to simplify notations. a word wt is an element of a finite vocabulary set w. for the image selected by listener ˆx(φ, m, c), we also omit the dependence on φ, m and c. finally, the reward for listener and speaker is denoted by r(x, ˆx) = 1x=ˆx. LINEBREAK communication in a population of agents. a straightforward extension of the standard discrimination game is to train a population of agents. in this case, given a population of n speakers and n listeners, we sample s speakers and s listeners with replacement at each training step to construct s random pairs; where each speaker is paired with only one listener.2 all pairs observe the same examples and are trained independently to play the discrimination game as described in the 1-pair setting above. in our case, s = n so that each agent is trained on average once per step, which allows a fair comparison with the baseline of 1-pair. at inference time, we take the first p speakers and listeners and construct all the possible p 2 pairs to compute the accuracy, by averaging the rewards of all pairs as in (mordatch & abbeel, 2018). LINEBREAK exploiting the population. the training dynamic of the population of agents described above does not take advantage of the diversity of the population. indeed, we treat all agents in the same way. yet, one motivation for the effectiveness of the population is the variety between speakers to invent new structures and between listeners to avoid over-specialization (bromham et al., 2015). prior works have looked at the impact of training agents with different dynamics (e.g., ren et al., 2019; in this work, we introduce two guo et al., 2019; cogswell et al., 2019; li & bowling, 2019). different ways to exploit the population; on speakers’ side, we add imitation, and on listeners’ side, we allow listeners to vote to get the final prediction. mathematical details are found in sec. 2.3. imitation training consists of two different steps. first, as described above, speakers and listeners are paired randomly for m interaction steps to learn to communicate. second, speakers are trained for 1 imitation step as follows: we select the best speaker (called “teacher”) among k randomly sampled speakers without replacement, and use the remaining k-1 samples as “students”. we then train all students in a supervised way to imitate the teacher. we alternate between the interaction LINEBREAK 2in this work, we only consider populations with the same number of speakers and listeners. LINEBREAK and imitation steps. both m and k are hyper-parameters (see appendix a.5). finally, voting is only used at inference time, irrespective of the training mode. here, instead of averaging p 2 pairs’ rewards to compute accuracy, we now allow p listeners to vote to get a unique prediction. this is inspired by ensemble methods to reduce prediction errors (polikar, 2012). more details on imitation and voting are reported in sec. 2.3. for completeness, we also reproduce ease-of-teaching protocol as another effective way to exploit population in appendix b.4 (li & bowling, 2019). LINEBREAK datasets and neural architectures
| 2
|
[
108.249,
626.1060784,
311.6381223,
636.0686784
] |
BGvt0ghNgA.pdf
| 2,022
| 2
|
LINEBREAK lipschitz-constrained unsupervised skill discovery LINEBREAK seohong park1 1seoul national university 2university of michigan 3lg ai research LINEBREAK jongwook choi∗ LINEBREAK jaekyeom kim∗ LINEBREAK 1 honglak lee2,3 gunhee kim1 LINEBREAK artberryx,jaekyeom,gunhee { jwook,honglak { LINEBREAK @umich.edu } LINEBREAK @snu.ac.kr LINEBREAK abstract LINEBREAK we study the problem of unsupervised skill discovery, whose goal is to learn a set of diverse and useful skills with no external reward. there have been a number of skill discovery methods based on maximizing the mutual information (mi) between skills and states. however, we point out that their mi objectives usually prefer static skills to dynamic ones, which may hinder the application for downstream tasks. to address this issue, we propose lipschitz-constrained skill discovery (lsd), which encourages the agent to discover more diverse, dynamic, and far-reaching skills. another benefit of lsd is that its learned representation function can be utilized for solving goal-following downstream tasks even in a zero-shot manner — i.e., without further training or complex planning. through experiments on various mujoco robotic locomotion and manipulation environments, we demonstrate that lsd outperforms previous approaches in terms of skill diversity, state space coverage, and performance on seven downstream tasks including the challenging task of following multiple goals on humanoid. our code and videos are available at https://shpark.me/projects/lsd/. LINEBREAK introduction LINEBREAK reinforcement learning (rl) aims at learning optimal actions that maximize accumulated reward signals (sutton & barto, 2005). recently, rl with deep neural networks has demonstrated remarkable achievements in a variety of tasks, such as complex robotics control (gu et al., 2017; andrychowicz et al., 2020) and games (schrittwieser et al., 2020; badia et al., 2020). however, one limitation of the rl framework is that a practitioner has to manually define and tune a reward function for desired behaviors, which is often time-consuming and hardly scalable especially when there are multiple tasks to learn (hadfield-menell et al., 2017; dulac-arnold et al., 2019). LINEBREAK therefore, several methods have been proposed to discover skills without external task rewards (gregor et al., 2016; eysenbach et al., 2019; sharma et al., 2020), which is often referred to as the unsupervised skill discovery problem. unsupervised discovery of skills helps not only relieve the burden of manually specifying a reward for each behavior, but also provide useful primitives to initialize with or combine hierarchically for solving downstream tasks (eysenbach et al., 2019; lee et al., 2020). moreover, learned skills can effectively demonstrate the agent’s capability in the environment, allowing a better understanding of both the agent and the environment. LINEBREAK one of the most common approaches to the unsupervised skill discovery problem is to maximize the mutual information (mi) between skill latent variables and states (gregor et al., 2016; achiam et al., 2018; eysenbach et al., 2019; hansen et al., 2020; sharma et al., 2020; choi et al., 2021; zhang et al., 2021). intuitively, these methods encourage a skill latent z to be maximally informative of states or trajectories obtained from a skill policy π(a s, z). as a result, optimizing the mi objective | leads to the discovery of diverse and distinguishable behaviors. LINEBREAK however, existing mi-based skill discovery methods share a limitation that they do not necessarily prefer learning ‘dynamic’ skills (i.e., making large state variations) or task-relevant behaviors such as diverse locomotion primitives. since mi is invariant to scaling or any invertible transformation of the input variables, there exist infinitely many optima for the mi objective. as such, they will LINEBREAK ∗equal contribution, listed in alphabetical order. LINEBREAK (a) ant environment. (b) visualization of discovered 2-d skills on the x-y plane. (c) zero-shot goal following. LINEBREAK figure 1: skills discovered by lsd can be used to follow goals with no further training or planning. LINEBREAK converge to the maximum that is most easily optimizable, which would usually be just learning simple and static skills. for instance, figure 1b and figure 17 demonstrate that diayn (eysenbach et al., 2019) simply learns to take various postures in place rather than learning locomotion skills in the ant environment (schulman et al., 2016). while these works often employ some feature engineering or prior domain knowledge to discover more dynamic skills (e.g., discriminating skills based on x-y coordinates only (eysenbach et al., 2019; sharma et al., 2020)), it brings about other drawbacks: (i) practitioners need to manually specify the dimensions of interest and (ii) the diversity of skills may be limited to a specific type (e.g., the x-y prior results in neglecting non-locomotion behaviors). LINEBREAK in order to address this limitation of mi-based approaches, we propose an unsupervised skill discovery method based on a lipschitz continuity constraint, named lipschitz-constrained skill discovery (lsd). specifically, we argue one reason behind the aforementioned problem is that the mi-based skill discovery methods can easily maximize the mi objective with only slight differences in the state space. to resolve this, we propose a novel objective based on a lipschitz-constrained state representation function so that the objective maximization in the latent space always entails an increase in traveled distances (or variations) in the state space (equation (6)). LINEBREAK lsd has several advantages. first, unlike previous mi-based skill discovery objectives, lsd encourages learned skills to have larger traveled distances, which leads to more diverse, dynamic, and far-reaching skills. second, lsd produces a useful state representation function that can be used to solve goal-following downstream tasks (i.e., reaching multiple goals in order) in a fully zero-shot manner (figure 1c); i.e., with no further training or complex planning. finally, lsd is easy to implement in contrast to many existing approaches and introduces no additional hyperparameters. LINEBREAK our contributions can be summarized as follows: • we propose a novel skill discovery objective based on a lipschitz constraint named lsd, which maximizes traveled distances in the state space unlike existing mi-based approaches, and thus learns more diverse and dynamic behaviors with no need for feature engineering. LINEBREAK • since lsd aligns the directions of skills and differences in latent state representations, it can efficiently solve goal-following tasks with a wider range of goals in a zero-shot fashion compared to previous methods, with no burden of additional training or complex planning. table 1 highlights other distinctive properties of lsd in comparison to existing approaches. LINEBREAK • lsd exhibits the best performance in terms of the state space coverage on five mujoco environments and final rewards on seven downstream tasks, including antmultigoals (kim et al., 2021), humanoidmultigoals and fetchpushgoal, compared to previous skill discovery methods such as diayn (eysenbach et al., 2019), dads (sharma et al., 2020) and ibol (kim et al., 2021). LINEBREAK preliminaries and related work LINEBREAK problem setting
| 1
|
[
108.249,
147.5690784,
213.7968518,
157.5316784
] |
WL8FlAugqQ.pdf
| 2,023
| 0
|
LINEBREAK neural dag scheduling via one-shot priority sampling LINEBREAK wonseok jeon∗, mukul gagrani∗, burak bartan, weiliang will zeng, harris teague piero zappi, christopher lott qualcomm ai research† LINEBREAK abstract LINEBREAK we consider the problem of scheduling operations/nodes, the dependency among which is characterized by a directed acyclic graph (dag). due to its np-hard nature, heuristic algorithms were traditionally used to acquire reasonably good solutions, and more recent works have proposed machine learning (ml) heuristics that can generalize to unseen graphs and outperform the non-ml heuristics. however, it is computationally costly to generate solutions using existing ml schedulers since they adopt the episodic reinforcement learning framework that necessitates multi-round neural network processing. we propose a novel ml scheduler that uses a one-shot neural network encoder to sample node priorities which are converted by list scheduling to the final schedules. since the one-shot encoder can efficiently sample the priorities in parallel, our algorithm runs significantly faster than existing ml baselines and has comparable run time with the fast traditional heuristics. we empirically show that our algorithm generates better schedules than both non-neural and neural baselines across various real-world and synthetic scheduling tasks. LINEBREAK introduction LINEBREAK the problem of scheduling operations arises across many domains, such as data centers where the incoming jobs have to be scheduled on a distributed server (mao et al., 2019), manufacturing pipelines in the form of job shop scheduling problems (jssp) (manne, 1960), and ml compilers where the operations of a computation graph need to be scheduled on the available hardware devices (paliwal et al., 2020; zhou et al., 2020). in all these cases, the problem may be abstracted using a directed acyclic graph (dag) where the nodes of the graph represent the operations and the edges represent the dependency constraints between the operations and hence the problem is also referred to as dag scheduling. the objective is to minimize the finish time (or makespan) of the dag subject to resource and dependency constraints. LINEBREAK it is well known that this is an np-hard problem (kan, 2012), and practitioners have traditionally relied on heuristic methods to obtain good solutions. one of the celebrated scheduling approaches is list scheduling (graham, 1969) where the idea is to schedule nodes as early as possible and to break ties using priorities. the priorities can be obtained via different node metrics which are computationally inexpensive such as critical-path based, shortest processing time or most operations remaining (haupt, 1989). more recently, researchers have proposed deep reinforcement learning based methods to solve scheduling problems (zhang et al., 2020; zhou et al., 2020; wang et al., 2021; mao et al., 2019). the scheduling policy in all the references utilize graph neural networks (gnn) as an encoder to derive node embeddings. zhang et al. (2020) proposed an auto-regressive gnn based policy for the jssp problem which predicts the next node for scheduling given the nodes scheduled so far. wang et al. (2021) proposed a bi-level optimization approach which modifies the input dag by adding multiple edges via a learned policy and then apply the critical-path heuristic on the modified dag. one major drawback of the existing ml based schedulers is the computational cost as they require multi-round neural network processing (encoding step). the multi-round neural network processing is reflected as auto-regressive architecture (zhang et al., 2020) or bi-level optimization LINEBREAK ∗equal contribution †qualcomm ai research is an initiative of qualcomm technologies, inc. LINEBREAK design (wang et al., 2021). this drawback limits the scalability to large graphs and the applicability to domains where solutions need to be obtained in a timely manner (e.g., scheduling computation graphs in compilers). LINEBREAK in this paper, we propose a novel ml scheduler that uses a one-shot neural network encoder to sample node priorities which are converted by list scheduling to the final schedules. since our encoder generates node priorities with a single forward pass of a neural network and efficiently samples priorities in parallel, our algorithm runs significantly faster than existing ml baselines and has comparable run time with the fast traditional heuristics. LINEBREAK the contributions of this paper are summarized below: LINEBREAK • we propose a novel end-to-end approach to learn scheduling priorities for list scheduling on dags. our model adopts the recently proposed topoformer architecture (gagrani et al., 2022) as a dag encoder and the gumbel-top-k trick (kool et al., 2019b) to sample node priorities (which are acquired by perturbing the encoder’s output and converted into valid schedules via list scheduling). while optimizing our model with reinforce (williams, 1992), we introduce logit norm regularization and cost standardization that significantly improve our model’s representation power and performance compared to the model used in gagrani et al. (2022). LINEBREAK • our approach uses the one-shot encoder which generates the node priorities by running the topoformer encoder once. this is in contrast of existing neural baselines (wang et al., 2021; zhang et al., 2020), all of which involves multi-round neural network processing. due to the one-shot nature of our model, our method runs significantly faster than our neural baselines, while achieving runtimes slightly worse than yet comparable with those of computationally-efficient and simple non-ml heuristics. LINEBREAK • we show that our approach can be generally applied to a variety of scheduling tasks that includes jssp, tpc-h benchmark and scheduling for synthetic and real-world computation graphs. for all benchmarks, our model outperforms both neural and non-neural baselines w.r.t. makespan metric (wang et al., 2021; zhang et al., 2020). LINEBREAK preliminaries LINEBREAK scheduling problem LINEBREAK in scheduling problems, we define a dag as a tuple g := (v, e, δ, ρ, µ) with a set v of nodes (or vertices) and a set e of directed edges (or arcs). each node v ∈ v represents an operation with δ(v) ≥ 0 denoting its operational duration and ρ(v) ≥ 0 denoting the resources required to execute v. for a set m of machine types, each node v ∈ v has to be assigned to its own machine type µ(v) ∈ m (|m| = 1 and |m| > 1 correspond to scheduling with homogeneous machines and heterogeneous ones, respectively). the set e of edges in the dag g represents computational dependency among nodes. for instance, for the scheduled start time τ (v) ≥ 0, v ∈ v for each node, a directed edge (v1, v2) ∈ e, v1, v2 ∈ v, means τ (v1) + δ(v1) ≤ τ (v2), i.e., any node should be scheduled on or after all its predecessor nodes are finished. we assume that each type of machine m ∈ m has its own maximum resource limit λ(m) ≥ 0, i.e., at any point of time the total amount of occupied resources for machines of type m cannot exceed λ(m). LINEBREAK let us introduce the vectorized notation τ = [τ (v)]v∈v ∈ r|v| ≥0 of the start times with a little abuse of notation for the sake of simpler notation. we define a valid schedule as a vector τ ∈ t where t is the set of all valid schedules (satisfying both precedence and resource constraints for given dag g). the objective of the scheduling problem is to find τ ∗ := arg minτ ∈t c(τ ; g), where c(τ ; g) := maxv∈v {τ (v) + δ(v)}, the duration required to complete all operations, is the makespan of schedule τ . LINEBREAK list scheduling LINEBREAK list scheduling (graham, 1969) is a class of priority-based schedule algorithms that are widely adopted in practice due to their simplicity. we describe how list scheduling works as follows: LINEBREAK (step 1) input a list of node priorities and set the current decision time to be zero. (step 2) find ready nodes that can be scheduled at the current decision time, i.e., nodes whose LINEBREAK predecessors have finished. LINEBREAK figure 1: an example of list scheduling (graham, 1969) for a 4-node dag scheduling is described. each node has its own duration, while resource limit is ignored for illustration purpose. list scheduling takes node priority as an input (e.g., 1 ≻ 3 ≻ 2 ≻ 4, brighter color implies higher priority) and schedules the higher-priority node among ready nodes earlier than the other nodes. after all ready nodes are scheduled, we move the decision time until a new set of ready nodes is found. we repeat these steps until we schedule all nodes. LINEBREAK (step 3) schedule the ready nodes sequentially at the current decision time by following the order of node priority until either all ready nodes are scheduled or further nodes cannot be scheduled due to resource constraints. LINEBREAK (step 4) move the decision time to the earliest finish time over all scheduled nodes which have not finished at the current decision time and repeat (step 2) to (step 4) until all nodes are scheduled. LINEBREAK we describe a simple example of list scheduling in figure 1. although graham (1969) originally presented list scheduling for scheduling with homogeneous machines, we use the same definition of list scheduling for both homogeneous and heterogeneous machines. LINEBREAK the gumbel-top-k trick LINEBREAK consider a random variable y over a set y of finite categories, where the distribution is defined by the softmax over logits(y) ∈ r, y ∈ y (the unnormalized log-probabilities), i.e., pr{y = y} ∝ exp(logits(y)), y ∈ y, and thus LINEBREAK pr{y = y} = LINEBREAK exp(logits(y)) y′∈y exp(logits(y′)) LINEBREAK the gumble-max trick (gumbel, 1954) is a method to sample from the categorical distributions when logits characterizing the distributions are tractable. specifically, the trick shows that by using a random vector z ∈ r|y| where elements z(y), y ∈ y, are sampled from i.i.d. standard gumbel distribution, one can randomly generate a category as follows: arg max y∈y LINEBREAK {logits(y) + z(y)} ∼ pr{y = y}. LINEBREAK more recent works (vieira, 2014; kool et al., 2019b) found that the gumbel-max trick can be extended to sample k categories without replacement, which is called the gumbel-top-k trick. for the extension, they introduced arg top(k) which takes a real vector on y and outputs a sequence of elements in y that correspond to the k largest values; the output sequence of the elements should be ordered by the corresponding decreasing input values (kool et al., 2019b). as a special case where k = |y|, arg top(k) becomes arg sort in decreasing values. the gumbel-top-k trick generates the random sequence of elements in y LINEBREAK [y1, y2, ..., yk] := arg top LINEBREAK y∈y LINEBREAK (k){logits(y) + z(y)}, LINEBREAK and shows that the sequence is equivalent to the one from sampling k elements without replacement; note that the random vector z is sampled once and before applying arg top(k). in other words, the distribution of the random sequence in eq. (3) is shown to be described as follows (kool et al., 2019b): LINEBREAK pr{[y1, y2, ..., yk] = [y1, y2, ..., yk]} = LINEBREAK exp(logits(yi)) y′∈y\{y1,...,yi−1} exp(logits(y′)) LINEBREAK gnnθ1 LINEBREAK mlpθ2 LINEBREAK mlpθ2 LINEBREAK mlpθ2 LINEBREAK mlpθ2 LINEBREAK arg sort LINEBREAK figure 2: our neural scheduler for dags works as follows: (step 1) generate logits for all nodes from a dag by using a gnn encoder followed by an mlp. (step 2) perturb logits by adding i.i.d. gumbel random variables. (step 3) take argsort over perturbed logits to define node priorities. higher priority nodes have brighter colors. (step 4) use list scheduling to generate a schedule. LINEBREAK intuitively, eq. (4) tells us that each element in the random sequence in eq. (3) follows the categorical distribution that is characterized by the softmax over logits, where previously sampled categories are excluded. in this work, we use eq. (3) to decide the priorities over the elements in y when k = |y|, which will be elaborated in the next section. LINEBREAK dag scheduling with neural priority sampler LINEBREAK we present our one-shot neural scheduler for dag scheduling problems and its training method in this section. the content in this section is summarized as follows; we introduce the formal problem setting for the ml-based scheduling in section 3.1; we describe how our model generates schedules by using the one-shot neural priority encoder and list scheduling in section 3.2; the training method for our model and how it is relevant to the gumbel top-k trick are discussed in section 3.3 with some technical details to stabilize our algorithm, which we introduced in this work. LINEBREAK learning-to-schedule framework LINEBREAK suppose we have a set g := {g1, g2, ...} of dags, where each dag gi := (vi, ei, δi, ρi, µi) follows the definition in section 2.1. we also assume that we have a device which is equipped with machines required for the dags. the learning-to-schedule algorithms by zhang et al. (2020) and wang et al. (2021) aim to find out a parameterized schedule generator πθ(τ |g) (with the neural network parameter θ) that minimizes the average makespan over g, i.e., LINEBREAK arg min θ LINEBREAK eg∼geτ ∼πθ(·|g) [c(τ ; g)] , LINEBREAK where τ is the schedule (the start times of nodes) and c(τ ; g) is the makespan of τ in g as in section 2.1. the neural schedulers of existing works (zhang et al., 2020; wang et al., 2021) are sequential decision-making models that require multi-shot neural network processing. in contrast, we use a computationally efficient single-shot neural scheduler which is described in the next subsection. LINEBREAK schedule generator with one-shot priority sampler LINEBREAK using one-shot node priorities was recently proposed by gagrani et al. (2022) to solve peak memory minimization problems in dags. our neural scheduler is motivated by their idea and described in figure 2. we adopt topoformer, the graph neural network (gnn) encoder presented by gagrani et al., as our graph encoder gnnθ1 (g) ∈ (rh)|v|, where h is the dimension of output embeddings for each node, and θ1 is the neural network parameter of the encoder. we use mlpθ2 : rh → r to convert the gnn’s output node embeddings into logits over the nodes, i.e., for θ := (θ1, θ2) and g ∈ g = {g1, g2, ...}, LINEBREAK logitsθ(v; g) := mlpθ2([gnnθ1(g)]v) ∈ r, v ∈ v. LINEBREAK the difference between gagrani et al.’s algorithm and ours arises from sampling procedure using logits. gagrani et al. considers logits of schedulable nodes at each decoding step and sequentially LINEBREAK samples among those schedulable nodes, whereas we sample node priorities only once at the start of decoding. specifically, by using i.i.d. standard gumbel variables z(v) ∈ r, v ∈ v, and arg sort, we randomly sample a sequence of nodes from perturbed logits: LINEBREAK ⃗v := [v1, v2, ..., v|v|] := arg sort LINEBREAK v∈v LINEBREAK {logitsθ(v; g) + z(v) }. (cid:124) (cid:125) (cid:123)(cid:122) perturbed logits LINEBREAK note that the lhs of eq. (7) is a random sequence due to the randomness of z and arg sort is applied in decreasing values of the perturbed logits. we then regard the sampled random sequence ⃗v = [v1, v2, ..., v|v|] as the sequence of node priorities v1 ≻ v2 ≻ ... ≻ v|v|, which does not require additional computation. due to the stochastic nature of the gumbel-top-k trick described in section 2.3, our mapping from the random sequence to the node priorities is equivalent to sampling nodes without replacement where nodes sampled earlier are considered to be higher-priority ones. more importantly, the trick allows us to use the tractable distribution of the random sequence, which becomes highly beneficial when optimizing the neural network. we will discuss this further in the next subsection.
| 4
|
[
108,
535.5090784,
505.74304715,
635.1918556
] |
_i3ASPp12WS.pdf
| 2,021
| 2
|
LINEBREAK online adversarial purification based on self-supervised learning LINEBREAK changhao shi1, chester holtz2 & gal mishne1,2,3 1department of electrical and computer engineering, 2department of computer science and engineering, 3the halıcıo˘glu data science institute university of california, san diego {cshi,chholtz,gmishne}@ucsd.edu LINEBREAK abstract LINEBREAK deep neural networks are known to be vulnerable to adversarial examples, where a perturbation in the input space leads to an amplified shift in the latent network representation. in this paper, we combine canonical supervised learning with selfsupervised representation learning, and present self-supervised online adversarial purification (soap), a novel defense strategy that uses a self-supervised loss to purify adversarial examples at test-time. our approach leverages the labelindependent nature of self-supervised signals, and counters the adversarial perturbation with respect to the self-supervised tasks. soap yields competitive robust accuracy against state-of-the-art adversarial training and purification methods, with considerably less training complexity. in addition, our approach is robust even when adversaries are given knowledge of the purification defense strategy. to the best of our knowledge, our paper is the first that generalizes the idea of using self-supervised signals to perform online test-time purification. LINEBREAK introduction LINEBREAK deep neural networks have achieved remarkable results in many machine learning applications. however, these networks are known to be vulnerable to adversarial attacks, i.e. strategies which aim to find adversarial examples that are close or even perceptually indistinguishable from their natural counterparts but easily mis-classified by the networks. this vulnerability raises theory-wise issues about the interpretability of deep learning as well as application-wise issues when deploying neural networks in security-sensitive applications. LINEBREAK many strategies have been proposed to empower neural networks to defend against these adversaries. the current most widely used genre of defense strategies is adversarial training. adversarial training is an on-the-fly data augmentation method that improves robustness by training the network not only with clean examples but adversarial ones as well. for example, madry et al. (2017) propose projected gradient descent as a universal first-order attack and strengthen the network by presenting it with such adversarial examples during training (e.g., adversarial training). however, this method is computationally expensive as finding these adversarial examples involves sample-wise gradient computation at every epoch. LINEBREAK self-supervised representation learning aims to learn meaningful representations of unlabeled data where the supervision comes from the data itself. while this seems orthogonal to the study of adversarial vulnerability, recent works use representation learning as a lens to understand as well as improve adversarial robustness (hendrycks et al., 2019; mao et al., 2019; chen et al., 2020a; naseer et al., 2020). this recent line of research suggests that self-supervised learning, which often leads to a more informative and meaningful data representation, can benefit the robustness of deep networks. LINEBREAK in this paper, we study how self-supervised representation learning can improve adversarial robustness. we present self-supervised online adversarial purification (soap), a novel defense strategy that uses an auxiliary self-supervised loss to purify adversarial examples at test-time, as illustrated in figure 1. during training, beside the classification task, we jointly train the network on a carefully selected self-supervised task. the multi-task learning improves the robustness of the network LINEBREAK (a) joint training of classification and auxiliary. LINEBREAK (b) test-time online purification LINEBREAK figure 1: an illustration of self-supervised online adversarial purification (soap). left: joint training of the classification and the auxiliary task; right: input adversarial example is purified iteratively to counter the representational shift, then classified. note that the encoder is shared by both classification and purification. LINEBREAK and more importantly, enables us to counter the adversarial perturbation at test-time by leveraging the label-independent nature of self-supervised signals. experiments demonstrate that soap performs competitively on various architectures across different datasets with only a small computation overhead compared with vanilla training. furthermore, we design a new attack strategy that targets both the classification and the auxiliary tasks, and show that our method is robust to this adaptive adversary as well. code is available at https://github.com/mishne-lab/soap. LINEBREAK related work LINEBREAK adversarial training adversarial training aims to improve robustness through data augmentation, where the network is trained on adversarially perturbed examples instead of the clean original training samples (goodfellow et al., 2014; kurakin et al., 2016; tram`er et al., 2017; madry et al., 2017; kannan et al., 2018; zhang et al., 2019). by solving a min-max problem, the network learns a smoother data manifold and decision boundary which improve robustness. however, the computational cost of adversarial training is high because strong adversarial examples are typically found in an iterative manner with heavy gradient calculation. compared with adversarial training, our method avoids solving the complex inner-max problem and thus is significantly more efficient in training. our method does increase test-time computation but it is practically negligible per sample. LINEBREAK adversarial purification another genre of robust learning focuses on shifting the adversarial examples back to the clean data representation , namely purification. gu & rigazio (2014) exploited using a general dae (vincent et al., 2008) to remove adversarial noises; meng & chen (2017) train a reformer network, which is a collection of autoencoders, to move adversarial examples towards clean manifold; liao et al. (2018) train a unet that can denoise adversarial examples to their clean counterparts; samangouei et al. (2018) train a gan on clean examples and project the adversarial examples to the manifold of the generator; song et al. (2018) assume adversarial examples have lower probability and learn the image distribution with a pixelcnn so that they can maximize the probability of a given test example; naseer et al. (2020) train a conditional gan by letting it play a min-max game with a critic network in order to differentiate between clean and adversarial examples. in contrast to above approaches, soap achieves better robust accuracy and does not require a gan which is hard and inefficient to train. more importantly, our approach exploits a wider range of self-supervised signals for purification and conceptually can be applied to any format of data and not just images, given an appropriate self-supervised task. LINEBREAK self-supervised learning self-supervised learning aims to learn intermediate representations of unlabeled data that are useful for unknown downstream tasks. this is done by solving a selfsupervised task, or pretext task, where the supervision of the task comes from the data itself. recently, a variety of self-supervised tasks have been proposed on images, including data reconstruction (vincent et al., 2008; rifai et al., 2011), relative positioning of patches (doersch et al., 2015; noroozi & favaro, 2016), colorization (zhang et al., 2016), transformation prediction (dosovitskiy et al., 2014; gidaris et al., 2018) or a combination of tasks (doersch & zisserman, 2017). LINEBREAK more recently, studies have shown how self-supervised learning can improve adversarial robustness. mao et al. (2019) find that adversarial attacks fool the networks by shifting latent representation to LINEBREAK a false class. hendrycks et al. (2019) observe that pgd adversarial training along with an auxiliary rotation prediction task improves robustness, while naseer et al. (2020) use feature distortion as a self-supervised signal to find transferable attacks that generalize across different architectures and tasks. chen et al. (2020a) combine adversarial training and self-supervised pre-training to boost fine-tuned robustness. these methods typically combine self-supervised learning with adversarial training, thus the computational cost is still high. in contrast, our approach achieves robust accuracy by test-time purification which uses a variety of self-supervised signals as auxiliary objectives. LINEBREAK self-supervised purification LINEBREAK problem formulation LINEBREAK as aforementioned, mao et al. (2019) observe that adversaries shift clean representations towards false classes to diminish robust accuracy. the small error in input space, carefully chosen by adversaries, gets amplified through the network, and finally leads to wrong classification. a natural way to solve this is to perturb adversarial examples so as to shift their representation back to the true classes, i.e. purification. in this paper we only consider classification as our main task, but our approach should be easily generalized to other tasks as well. LINEBREAK consider an encoder z = f (x; θenc), a classifier g(z; θcls) on top of the representation z, and the network g ◦ f a composition of the encoder and the classifier. we formulate the purification problem as follows: for an adversarial example (xadv, y) and its clean counterpart (x, y) (unknown to the network), a purification strategy π aims to find xpfy = π(xadv) that is as close to the clean example x as possible: xpfy → x. however, this problem is underdetermined as different clean examples can share the same adversarial counterpart, i.e. there might be multiple or even infinite solutions for xpfy. thus, we consider the relaxation LINEBREAK min π LINEBREAK lcls ((g ◦ f )(xpfy), y) LINEBREAK s.t. ||xpfy − xadv|| ≤ (cid:15)adv, LINEBREAK xpfy = π(xadv), LINEBREAK i.e. we accept xpfy as long as lcls is sufficiently small and the perturbation is bounded. here lcls is the cross entropy loss for classification and (cid:15)adv is the budget of adversarial perturbation. however, this problem is still unsolvable since neither the true label y nor the budget (cid:15)adv is available at testtime. we need an alternative approach that can lead to a similar optimum. LINEBREAK self-supervised online purification
| 2
|
[
108.249,
326.7040784,
309.7177232,
336.6666784
] |
JFKR3WqwyXR.pdf
| 2,021
| 1
|
LINEBREAK neural jump ordinary differential equations: consistent continuous-time prediction and filtering LINEBREAK calypso herrera department of mathematics, eth zurich, switzerland {firstname.lastname}@math.ethz.ch LINEBREAK florian krach LINEBREAK josef teichmann LINEBREAK abstract LINEBREAK combinations of neural odes with recurrent neural networks (rnn), like gruode-bayes or ode-rnn are well suited to model irregularly observed time series. while those models outperform existing discrete-time approaches, no theoretical guarantees for their predictive capabilities are available. assuming that the irregularly-sampled time series data originates from a continuous stochastic process, the l2-optimal online prediction is the conditional expectation given the currently available information. we introduce the neural jump ode (nj-ode) that provides a data-driven approach to learn, continuously in time, the conditional expectation of a stochastic process. our approach models the conditional expectation between two observations with a neural ode and jumps whenever a new observation is made. we define a novel training framework, which allows us to prove theoretical guarantees for the first time. in particular, we show that the output of our model converges to the l2-optimal prediction. this can be interpreted as solution to a special filtering problem. we provide experiments showing that the theoretical results also hold empirically. moreover, we experimentally show that our model outperforms the baselines in more complex learning tasks and give comparisons on real-world datasets. LINEBREAK introduction LINEBREAK stochastic processes are widely used in many fields to model time series that exhibit a random behaviour. in this work, we focus on processes that can be expressed as solutions of stochastic differential equations (sde) of the form LINEBREAK dxt = µ(t, xt)dt + σ(t, xt)dwt , LINEBREAK with certain assumptions on the drift µ and the diffusion σ. with respect to the l2-norm, the best prediction of a future value of the process is provided by the conditional expectation given the current value. if the drift and diffusion are known or a good estimation is available, the conditional expectation can be approximated by a monte carlo (mc) simulation. however, since µ and σ are usually unknown, this approach strongly depends on the assumptions made on their parametric form. a more flexible approach is given by neural sdes, where the drift µ and diffusion σ are modelled by neural networks (tzen & raginsky, 2019; li et al., 2020; jia & benson, 2019). nevertheless, modelling the diffusion can be avoided if one is only interested in forecasting the behaviour instead of sampling new paths. LINEBREAK an alternative widely used approach is to use recurrent neural networks (rnn), where a neural network dynamically updates a latent variable with the observations of a discrete input time-series. rnns are successfully applied to tasks for which time-series are regularly sampled, as for example speech or text recognition. however, often observations are irregularly observed in time. the standard approach of dividing the time-line into equally-sized intervals and imputing or aggregating observations might lead to a significant loss of information (rubanova et al., 2019). frameworks that overcome this issue are the gru-ode-bayes (brouwer et al., 2019) and the ode-rnn (rubanova et al., 2019), which combine a rnn with a neural ode (chen et al., 2018). in standard rnns, the LINEBREAK hidden state is updated at each observation and constant in between. conversely, in the gru-odebayes and ode-rnn framework, a neural ode is trained to model the continuous evolution of the hidden state of the rnn between two observations. while gru-ode-bayes and ode-rnn both provide convincing empirical results, they lack thorough theoretical guarantees. LINEBREAK contribution. in this paper, we introduce a mathematical framework to precisely describe the problem statement of online prediction and filtering of a stochastic process with temporal irregular observations. based on this rigorous mathematical description, we introduce the neural jump ode (nj-ode). the model architecture is very similar to the one of gru-ode-bayes and ode-rnn, however we introduce a novel training framework, which in contrast to them allows us to prove convergence guarantees for the first time. moreover, we demonstrate empirically the capabilities of our model. LINEBREAK precise problem formulation. we emphasize that a precise definition of all ingredients is needed, to be able to show theoretical convergence guarantees, which is the main purpose of this work. since the objects of interest are stochastic processes, we use tools from probability theory and stochastic calculus. to make the paper more readable and comprehensible also for readers without background in these fields, the precise formulations and demonstrations of all claims are given in the appendix, while the main part of the paper focuses on giving well understandable heuristics. LINEBREAK problem statement
| 1
|
[
108.299,
480.6606768,
239.6903563,
492.6158768
] |
vVjIW3sEc1s.pdf
| 2,021
| 1
|
LINEBREAK a mathematical exploration of why language models help solve downstream tasks LINEBREAK nikunj saunshi, sadhika malladi & sanjeev arora princeton university {nsaunshi,smalladi,arora}@cs.princeton.edu LINEBREAK abstract LINEBREAK autoregressive language models, pretrained using large text corpora to do well on next word prediction, have been successful at solving many downstream tasks, even with zero-shot usage. however, there is little theoretical understanding of this success. this paper initiates a mathematical study of this phenomenon for the downstream task of text classification by considering the following questions: (1) what is the intuitive connection between the pretraining task of next word prediction and text classification? (2) how can we mathematically formalize this connection and quantify the benefit of language modeling? for (1), we hypothesize, and verify empirically, that classification tasks of interest can be reformulated as sentence completion tasks, thus making language modeling a meaningful pretraining task. with a mathematical formalization of this hypothesis, we make progress towards (2) and show that language models that are (cid:15)-optimal in crossentropy (log-perplexity) learn features that can linearly solve such classification tasks with o( (cid:15)) error, thus demonstrating that doing well on language modeling can be beneficial for downstream tasks. we experimentally verify various assumptions and theoretical findings, and also use insights from the analysis to design a new objective function that performs well on some classification tasks. LINEBREAK introduction LINEBREAK the construction of increasingly powerful language models has revolutionized natural language processing (nlp). using gigantic text corpora and a cross-entropy objective, language models are trained to predict a distribution over the next word to follow a given context (piece of text). pretrained language models are useful for many downstream nlp tasks, either as initializations (ramachandran et al., 2017; howard & ruder, 2018) or as a source of contextual word embeddings (mccann et al., 2017; peters et al., 2018). recent models (radford et al., 2019; brown et al., 2020) have even bypassed the need for careful fine-tuning and have demonstrated strong performance on downstream tasks without fine-tuning. this work aims to understand this incredible success of language models. LINEBREAK since next word prediction is a powerful test of language understanding, at an intuitive level it is believable that doing well on language modeling can help with many diverse nlp tasks. at the same time, it is quite intriguing how improvements in the test perplexity of language models translate to better downstream performance. attempting to understand this phenomenon naturally raises the following questions: (a) why should training on the next-word prediction task, with the cross-entropy objective, result in useful features for downstream tasks? (b) what role do inductive biases of the model architecture and training algorithms play in this empirical success? given the nascency of deep learning theory, it is very challenging to say anything mathematically precise about (b) for deep networks. given these difficulties, this paper focusses on the mathematical study of (a) by exploring if and how quantitative improvements on downstream nlp tasks can be mathematically guaranteed for language models that do well on the cross-entropy objective. as a first cut analysis, we restrict attention to text classification tasks and the striking observation that they can be solved fairly well with linear classifiers on top of fixed language models features, i.e. without finetuning (table 1). although we treat models as black boxes, just first-order optimality conditions of the cross-entropy objective reveal interesting properties of learned features, leading to an understanding of their success on classification tasks. insights from the analysis help us construct a simple objective LINEBREAK (quad), that provably learns useful features for classification tasks, as also verified empirically. we summarize our contributions along with an overview of the paper below. LINEBREAK in section 2, we set up notation and formally describe language modeling and the ubiquitous lowdimensional softmax parametrization, along with a description of the cross-entropy objective and properties of its optimal solutions. we then describe the observation, in section 3.1, that text classification tasks of interest can be reformulated as sentence completion tasks. amenability to such a reformulation is mathematically formalized (section 3.2) as the classification task being a natural task: tasks that can be solved linearly using conditional distribution over words following an input text. section 4 presents our main results, theorems 4.1 and 4.2, that use the above formalization to mathematically quantify the utility of language model features on natural tasks: (cid:15)-optimal language model (in cross-entropy) will do o( (cid:15))-well on such tasks. theorem 4.2 shows a stronger result for low-dimensional softmax models by leveraging a new tool, conditional mean features (definition 4.1), which we show (section 6) to be effective in practice. the usefulness of the language model features themselves is demonstrated by arguing a weak linear relationship between them and conditional mean features. in section 5.2, we present a new mathematically motivated objective (quad) that has formal guarantees. experiments in section 6 verify the sentence completion reformulation idea and the good performance of conditional mean features on standard benchmarks. LINEBREAK related work LINEBREAK text embedding methods: prior to language models, large text corpora like wikipedia (merity et al., 2016) were used to learn low-dimensional embeddings for words (mikolov et al., 2013b;a; pennington et al., 2014) and subsequently for sentences (kiros et al., 2015; arora et al., 2017; pagliardini et al., 2018; logeswaran & lee, 2018) for downstream task usage. these methods were inspired by the distributional hypothesis (firth, 1957; harris, 1954), which posits that meaning of text is determined in part by the surrounding context. recent methods like bert (devlin et al., 2018) and variants (lan et al., 2019; yang et al., 2019; liu et al., 2019) learn models from auxiliary tasks, such as sentence completion, and are among the top performers on downstream tasks. in this work we consider autoregressive models and make a distinction from masked language models like bert; table 2 shows that language model and bert features have comparable performances. LINEBREAK language models for downstream tasks: we are interested in language models (chen & goodman, 1999), especially those that use neural networks to compute low-dimensional features for contexts and parametrize the next word distribution using softmax (xu & rudnicky, 2000; bengio et al., 2003). language models have shown to be useful for downstream tasks as initializations (ramachandran et al., 2017; howard & ruder, 2018) or as learned feature maps (radford et al., 2017; mccann et al., 2017; peters et al., 2018). the idea of phrasing classification tasks as sentence completion problems to use language models is motivated by recent works (radford et al., 2019; puri & catanzaro, 2019; schick & sch¨utze, 2020) that show that many downstream tasks can be solved by next word prediction for an appropriately conditioned language model. this idea also shares similarities with work that phrase a suite of downstream tasks as question-answering tasks (mccann et al., 2018) or text-to-text tasks (raffel et al., 2019) and symbolic reasoning as fill-in-the-blank tasks (talmor et al., 2019). our work exploits this prevalent idea of task rephrasing to theoretically analyze why language models succeed on downstream tasks. LINEBREAK relevant theory: since the success of early word embedding algorithms like word2vec (mikolov et al., 2013a) and glove (pennington et al., 2014), there have been attempts to understand them theoretically. levy & goldberg (2014) argue that word2vec algorithm implicitly factorizes the pmi matrix. noise contrastive estimation (nce) theory is used to understand word embeddings (dyer, 2014) and to show parameter recovery for negative sampling based conditional models (ma & collins, 2018). a latent variable model (arora et al., 2016) is used to explain and unify various word embedding algorithms. theoretical justification is provided for sentence embedding methods either by using a latent variable model (arora et al., 2017) or through the lens of compressed sensing (arora et al., 2018). also relevant is recent work on theory for contrastive learning (arora et al., 2019; tosh et al., 2020b;a; wang & isola, 2020) and reconstruction-based methods (lee et al., 2020), which analyze the utility of self-supervised representations learned for downstream tasks. our work is the first to analyze the efficacy of language model features on downstream tasks. LINEBREAK language modeling and optimal solutions LINEBREAK we use s to denote the discrete set of all contexts, i.e. complete or partial sentences (prefixes), w to denote the vocabulary of words, with v = |w| being the vocabulary size. for a discrete set a, let ∆a denote the set of distributions on a. we use p, pl ∈ ∆s to denote probability distributions over s, and p·|s, p∗ ·|s ∈ ∆w to denote conditional distributions, where p·|s(w) is the predicted probability of word w following context s and p∗ ·|s(w) denotes the true conditional probability. ·|s ∈ ∆w . for v ∈ rv , v(w) boldface p·|s, p∗ indexes the coordinate for w ∈ w; p·|s(w) is the probability of w according to p·|s. we use φw ∈ rd to denote a d-dimensional embedding for word w; word embeddings are stacked into the columns φ ∈ rd×v . we use f : s → rd for a feature map from contexts to d-dimensional embeddings, e.g. f (s) can be the output of a transformer model for input context s ∈ s. for embeddings {θs}s∈s with θs ∈ rd (any d), we use {θs} to denote g : s → rd such that g(s) = θs. LINEBREAK ·|s ∈ rv denote vectors of probabilities for p·|s, p∗ LINEBREAK language modeling using cross-entropy LINEBREAK language model aims to learn the true distribution of a text corpus and a popular approach to do so is through next word prediction. given a context (e.g., a sentence s ∈ s), it predicts a distribution p·|s over the word to follow, e.g. for the context “the food was ”, the model could place high probabilities on words “delicious”, “expensive”, “bland”, etc. we use pl to denote the true distribution over the context set s in the language modeling corpus. a standard approach is to minimize the expected cross-entropy loss between the true distribution p∗ ·|s and the model prediction p·|s. we define the cross-entropy loss for a language model with output vector of probabilities {p·|s}s∈s as LINEBREAK (cid:96)xent({p·|s}) = e s∼pl LINEBREAK e w∼p∗ LINEBREAK ·|s LINEBREAK (cid:2)− log(p·|s(w))(cid:3) = e LINEBREAK s∼pl LINEBREAK (cid:2)(cid:96)xent,s(p·|s)(cid:3) LINEBREAK to understand what language models learn, we look at the optimal solution of the cross-entropy objective. while one cannot practically hope to learn the optimal solution due to optimization, statistical and expressivity limitations, the optimal solution at least tells us the best that language modeling can hope to do. a well-known property of cross-entropy objective is that its optimal solution is p∗ proposition 2.1 (cross-entropy recovers p∗ for every s ∈ support(pl). LINEBREAK ·|s, which can be proved by noting that (cid:96)xent,s(p·|s) = dkl(p∗ LINEBREAK ·|s). the unique minimizer of (cid:96)xent({p·|s}) is p·|s = p∗ ·|s LINEBREAK ·|s, p·|s) + c. LINEBREAK softmax parametrized language modeling LINEBREAK unlike traditional language models like n-gram models, neural language models parametrize the conditional distribution p·|s as a softmax computed using low dimensional embeddings. for an embedding θ ∈ rd, the softmax distribution over w using word embeddings φ ∈ rd×v is pθ,φ(w) = eθ(cid:62)φw /zθ, where zθ = (cid:80) w(cid:48)∈w eθ(cid:62)φw(cid:48) is the partition function. while pθ,φ depends on φ, we will use pθ instead whenever φ is clear from context. just like p∗ ·|s, we can interpret pθ ∈ rv as a vector of probabilities for the distribution pθ. we now describe the abstraction for softmax models that is applicable to most neural models. a language model first embeds a context s into f (s) ∈ rd using a feature map f : s → rd that is parametrized by an architecture of choice (e.g. transformer (vaswani et al., 2017)). the output conditional distribution is set to be the softmax distribution induced by the context embedding f (s) and word embeddings φ, i.e. p·|s = pf (s). the cross-entropy in its familiar form is presented below LINEBREAK (cid:96)xent(f, φ) = e s∼pl LINEBREAK e w∼p∗ LINEBREAK ·|s LINEBREAK (cid:2)− log(pf (s)(w))(cid:3) = e LINEBREAK s∼pl LINEBREAK e w∼p∗ LINEBREAK ·|s LINEBREAK (cid:35) [−f (s)(cid:62)φw] + log(zf (s)) LINEBREAK we rewrite it as (cid:96)xent(f, φ) = e s∼pl LINEBREAK [(cid:96)xent,s(f (s), φ)], where (cid:96)xent,s(θ, φ) = (cid:96)xent,s(pθ,φ) is the cross LINEBREAK entropy loss for a context s that uses embedding θ. analogous to proposition 2.1, we would like to know the optimal d-dimensional feature map f ∗ and the induced conditional distribution pf ∗(s) LINEBREAK 1a finite minimizer may not always exist. this is handled in section 4 that deals with (cid:15)-optimal solutions. LINEBREAK proposition 2.2 (softmax models recover p∗ arg minf :s→rd (cid:96)xent(f, φ) exists, then φpf ∗(s) = φp∗ LINEBREAK ·|s on a subspace). fix a fixed φ, ·|s for every s ∈ support(pl). LINEBREAK if f ∗ ∈ LINEBREAK unlike proposition 2.1, pf ∗(s) ∈ rv is only guaranteed to be equal to p∗ ·|s ∈ rv on the ddimensional subspace spanned by rows of φ ∈ rd×v . we may not learn p∗ ·|s exactly when d < v , but this result at least guarantees learning p∗ ·|s on a linear subspace determined by word embeddings φ. this forms the basis for our main results later and is proved by using the firstorder optimality condition, i.e. ∇θ(cid:96)xent,s(f ∗(s)) = 0, ∀s ∈ s. the gradient of cross-entropy is ∇θ(cid:96)xent,s(θ) = −φp∗ ·|s + φpθ. setting it to 0 completes the proof. we use the properties of optimal solutions to understand why language models help with classification tasks. LINEBREAK ·|s + ∇θzθ/zθ = −φp∗ LINEBREAK using language models for classification tasks LINEBREAK ·|s, or a low-dimensional projection ·|s. thus to understand why language models help with downstream tasks, a natural starting point ·|s can help with downstream tasks. in a thought experiment, we ·|s for any s and demonstrate that sentence classification task can be solved by ·|s to get completions to predict the LINEBREAK sections 2.1 and 2.2 suggest that language models aim to learn p∗ φp∗ is to understand how access to p∗ use oracle access to p∗ reformulating it as a sentence completion problem and using p∗ label. this sentence completion reformulation is mathematically formalized as natural tasks. LINEBREAK sentence completion reformulation LINEBREAK for exposition, we consider the sentence classification task of sentiment analysis, where the inputs are movie reviews (subset of s) and labels belongs to {±1}, denoting positive and negative reviews. LINEBREAK classification task as sentence completion: can we predict the label for a movie review s by using p∗ ·|s? one way is to use p∗ ·|s to compare probabilities of “:)” and “:(” following a movie review and to predict sentiment based on which is higher. this seems like a reasonable strategy, since “:)” is likelier than “:(” to follow a positive movie review. one issue, however, is that p∗ ·|s will place much higher probability on words that start sentences, like “the”, rather than discriminative words useful for the task. to allow a larger set of grammatically correct completions, we can append a prompt like “this movie is ” at the end of all movie reviews and query probabilities of indicative adjectives like good, bad, interesting, boring etc. that are better indicators of sentiment. this approach of adding a prompt can also work for other classification tasks. for the ag news dataset (zhang et al., 2015) containing news articles from 4 categories (world, science/tech., sports, business), a prompt like “this article is about ” can help solve the task. the theoretical and practical relevance of prompts is discussed in theorem 4.1, and section 6 respectively. we note that the choice of prompts and completion words is less important than the underlying idea of sentence completion reformulation and its formalization. solving tasks using a linear function of p∗ ·|s: the above process is actually a sub-case of using ·|s ∈ rv . for sentiment analysis, if w+ = “:)” and w− = “:(”, a linear classifier on top of p∗ ·|s(w+) − p∗ then the sign of p∗ ·|s(w−) can predict the sentiment. this strategy can be expressed ·|s, where the linear classifier v ∈ rv has v(w+) = 1, v(w−) = −1 and v(w(cid:48)) = 0 for as v(cid:62)p∗ w(cid:48) ∈ w\{w+, w−}. similarly with the prompt, we can assign positive weights in v to adjectives like “good” and negative weights to adjectives like “boring”. strength of sentiment in different adjectives (e.g., “good” vs “amazing”) can be captured through different weights. this equivalence between sentence completion reformulation and linear classifier on p∗ ·|s is further explored in section d.1. other tasks can be similarly solved with a different set of words for each class. we verify experimentally that sst and ag news tasks can be solved by a linear function of probabilities of just a small subset of words in section 6 and for many other classification tasks in section f.1, thus lending credibility to the sentence completion view. LINEBREAK natural classification tasks LINEBREAK we now translate the above sentence completion reformulation into a reasonable mathematical characterization for classification tasks of interest. firstly we formally define text classification tasks and the standard metric for performance of linear classification on fixed features. a binary classification task2 t is characterized by a distribution pt over s × {±1}, where the input s is a piece of text from s and the label y is in {±1}. given a feature map g : s → rd (arbitrary d), t is solved by fitting a linear classifier v ∈ rd on top of g(s) and the metric of classification loss is LINEBREAK (cid:96)t (g, v) = e(s,y)∼pt LINEBREAK (cid:2)(cid:96)(v(cid:62)g(s), y)(cid:3) ; (cid:96)t (g) = inf v∈rd LINEBREAK (cid:96)t (g, v) LINEBREAK where (cid:96) is a 1-lipschitz surrogate to the 0-1 loss, like the hinge loss (cid:96)(ˆy, y) = (1 − y ˆy)+ or the logistic loss (cid:96)(ˆy, y) = log(1 + e−y ˆy). for given embeddings {θs}s∈s , the classification loss is written as (cid:96)t ({θs}, v) = e(s,y)∼pt [(cid:96)(v(cid:62)θs, y)]. we now formalize classification tasks amenable to sentence completion reformulation, from section 3.1), as (τ, b)-natural tasks, i.e. tasks that achieve a small classification loss of τ by using a linear classifier with (cid:96)∞-norm bounded3 by b on top of features p∗ definition 3.1. a classification task t is (τ, b)-natural if min v∈rv ,(cid:107)v(cid:107)∞≤b LINEBREAK ·|s}, v) ≤ τ . LINEBREAK ·|s ∈ rv . LINEBREAK (cid:96)t ({p∗ LINEBREAK while we motivated this formalization of linear classification over p∗ ·|s in section 3.1, we provide a mathematical justification in section d.1, along with interpretations for τ and b that relate them to the bayes optimal predictor and probability mass of indicative words respectively. low dimensional softmax models, however, only learn p∗ ·|s in the subspace of φ, per proposition 2.2. thus we are also interested in subset of tasks that this subspace can solve. definition 3.2. task t is (τ, b)-natural w.r.t. φ ∈ rd×v if LINEBREAK (cid:96)t ({p∗ LINEBREAK ·|s}, v) ≤ τ . LINEBREAK min v∈row-span(φ),(cid:107)v(cid:107)∞≤b LINEBREAK note that every (τ, b)-natural task w.r.t. φ is trivially (τ, b)-natural, though the converse may not hold. however it can be argued that if φ has some “nice properties”, then (τ, b)-natural tasks of interest will roughly also be (τ, b)-natural w.r.t. φ. capturing the synonym structure of words can be such a nice property, as discussed in section d.2. a better understanding of these properties of word embeddings φ can potentially enable better performance of language models on downstream tasks. in fact, section 5.2 describes a carefully designed objective that can learn word embeddings with desirable properties like synonyms having similar embeddings. in the subsequent sections, we use the above formalization to show guarantees for language models on natural tasks. LINEBREAK guarantees for language models on natural tasks
| 4
|
[
108.299,
289.0506768,
431.2453824,
301.0058768
] |
tFgdrQbbaa.pdf
| 2,022
| 0
|
LINEBREAK learning curves for continual learning in neural networks: self-knowledge transfer and forgetting LINEBREAK ryo karakida & shotaro akaho national institute of advanced industrial science and technology (aist), japan {karakida.ryo,s.akaho}@aist.go.jp LINEBREAK abstract LINEBREAK sequential training from task to task is becoming one of the major objects in deep learning applications such as continual learning and transfer learning. nevertheless, it remains unclear under what conditions the trained model’s performance improves or deteriorates. to deepen our understanding of sequential training, this study provides a theoretical analysis of generalization performance in a solvable case of continual learning. we consider neural networks in the neural tangent kernel (ntk) regime that continually learn target functions from task to task, and investigate the generalization by using an established statistical mechanical analysis of kernel ridge-less regression. we first show characteristic transitions from positive to negative transfer. more similar targets above a specific critical value can achieve positive knowledge transfer for the subsequent task while catastrophic forgetting occurs even with very similar targets. next, we investigate a variant of continual learning which supposes the same target function in multiple tasks. even for the same target, the trained model shows some transfer and forgetting depending on the sample size of each task. we can guarantee that the generalization error monotonically decreases from task to task for equal sample sizes while unbalanced sample sizes deteriorate the generalization. we respectively refer to these improvement and deterioration as self-knowledge transfer and forgetting, and empirically confirm them in realistic training of deep neural networks as well. LINEBREAK introduction LINEBREAK as deep learning develops for a single task, it enables us to work on more complicated learning frameworks where the model is sequentially trained on multiple tasks, e.g., transfer learning, curriculum learning, and continual learning. continual learning deals with the situation in which the learning machine cannot access previous data due to memory constraints or privacy reasons. it has attracted much attention due to the demand on applications, and fundamental understanding and algorithms are being explored (hadsell et al., 2020). one well-known phenomenon is catastrophic forgetting; when a network is trained between different tasks, naive training cannot maintain performance on the previous task (mccloskey & cohen, 1989; kirkpatrick et al., 2017). LINEBREAK it remains unclear in most cases under what conditions a trained model’s performance improves or deteriorates in sequential training. understanding its generalization performance is still limited (pentina & lampert, 2014; bennani et al., 2020; lee et al., 2021). for single-task training, however, many empirical and theoretical studies have succeeded in characterizing generalization performance in over-parameterized neural networks and given quantitative evaluation on sample-size dependencies, e.g., double descent (nakkiran et al., 2020). for further development, it will be helpful to extend the analyses on single-task training to sequential training on multiple tasks and give theoretical backing. LINEBREAK to deepen our understanding of sequential training, this study shows a theoretical analysis of its generalization error in the neural tangent kernel (ntk) regime. in more details, we consider the ntk formulation of continual learning proposed by bennani et al. (2020); doan et al. (2021). by extending a statistical mechanical analysis of kernel ridge-less regression, we investigate learning curves, i.e., the dependence of generalization error on sample size or number of tasks. the analysis LINEBREAK focuses on the continual learning with explicit task boundaries. the model learns data generated by similar teacher functions, which we call target functions, from one task to another. all input samples are generated from the same distribution in an i.i.d. manner, and each task has output samples (labels) generated by its own target function. our main contributions are summarized as follows. first, we revealed characteristic transitions from negative to positive transfer depending on the target similarity. more similar targets above a specific critical value can achieve positive knowledge transfer (i.e., better prediction on the subsequent task than training without the first task). compared to this, backward transfer (i.e., prediction on the previous task) has a large critical value, and subtle dissimilarity between targets causes negative transfer. the error can rapidly increase, which clarifies that catastrophic forgetting is literally catastrophic (section 4.1). LINEBREAK second, we considered a variant of continual learning, that is, learning of the same target function in multiple tasks. even for the same target function, the trained model’s performance improves or deteriorates in a non-monotonic way. this depends on the sample size of each task; for equal sample sizes, we can guarantee that the generalization error monotonically decreases from task to task (section 4.2 for two tasks & section 5 for more tasks). unbalanced sample sizes, however, deteriorates generalization (section 4.3). we refer to these improvement and deterioration of generalization as self-knowledge transfer and forgetting, respectively. finally, we empirically confirmed that selfknowledge transfer and forgetting actually appear in the realistic training of multi-layer perceptron (mlp) and resnet-18 (section 5.1). thus, this study sheds light on fundamental understanding and the universal behavior of sequential training in over-parameterized learning machines. LINEBREAK related work LINEBREAK method of analysis. as an analysis tool, we use the replica method originally developed for statistical mechanics. statistical mechanical analysis enables us typical-case evaluation, that is, the average evaluation over data samples or parameter configurations. it sometimes provides us with novel insight into what the worst-case evaluation has not captured (abbaras et al., 2020; spigler et al., 2020). the replica method for kernel methods has been developed in dietrich et al. (1999), and recently in bordelon et al. (2020); canatar et al. (2021). these recent works showed excellent agreement between theory and experiments on ntk regression, which enables us to quantitatively understand sample-size dependencies including implicit spectral bias, double descent, and multiple descent. LINEBREAK continual learning. continual learning dynamics in the ntk regime was first formulated by bennani et al. (2020); doan et al. (2021), though the evaluation of generalization remains unclear. they derived an upper bound of generalization via the rademacher complexity, but it includes naive summation over single tasks and seems conservative. in contrast, our typical-case evaluation enables us to newly find such rich behaviors as negative/positive transfer and self-knowledge transfer/forgetting. the continual learning in the ntk regime belongs to so-called single-head setting (farquhar & gal, 2018), and it allows the model to revisit the previous classes (target functions) in subsequent tasks. this is complementary to earlier studies on incremental learning of new classes and its catastrophic forgetting (ramasesh et al., 2020; lee et al., 2021), where each task includes different classes and does not allow the revisit. note that the basic concept of continual learning is not limited to incremental learning but allows the revisit (mccloskey & cohen, 1989; kirkpatrick et al., 2017). under the limited data acquisition or resources of memory, we often need to train the same model with the same targets (but different samples) from task to task. therefore, the setting allowing the revisit seems reasonable. LINEBREAK preliminaries LINEBREAK neural tangent kernel regime LINEBREAK we summarize conventional settings of the ntk regime (jacot et al., 2018; lee et al., 2019). let us consider a fully connected neural network f = ul given by LINEBREAK ul = σwwlhl−1/(cid:112)ml−1 + σbbl, hl = φ(ul) LINEBREAK where we define weight matrices wl ∈ rml×ml−1, bias terms bl ∈ rml , and their variances σ2 w and σ2 b . we set random gaussian initialization wl,ij, bl,i ∼ n (0, 1) and focus on the mean squared error loss: l(θ) = (cid:80)n µ=1 (cid:107)yµ − f (xµ)(cid:107)2, where the training samples {xµ, yµ}n µ=1 are composed of LINEBREAK inputs xµ ∈ rd normalized by (cid:107)xµ(cid:107)2 = 1 and labels yµ ∈ rc. the set of all parameters is denoted as θ, and the number of training samples is n . assume the infinite-width limit for hidden layers (ml → ∞), finite sample size and depth. the gradient descent dynamics with a certain learning rate then converges to a global minimum sufficiently close to the random initialization. this is known as the ntk regime, and the trained model is explicitly obtained as 0 (x(cid:48)) + θ(x(cid:48), x)θ(x)−1(y(c) − f (c) LINEBREAK (2) we denote the ntk matrix as θ, arbitrary input samples (including test samples) as x(cid:48), and the set of training samples as x. the indices of f mean 0 for the model at initialization and c for the head of the network. entries of ntk θ(x(cid:48), x) are defined by ∇θf0(x(cid:48))∇θf0(x)(cid:62). we write θ(x) as an abbreviation for θ(x, x). the trained network is equivalent to a linearized model around random initialization (lee et al., 2019), that is, f (c) = f (c) LINEBREAK f (c)(x(cid:48)) = f (c) LINEBREAK 0 ∆θ with LINEBREAK ∇θf (c) LINEBREAK while over-parameterized models have many global minima, the ntk dynamics implicitly select the above θ, which corresponds to the l2 min-norm solution. usually, we ignore f0 by taking the average over random initialization. the trained model (2) is then equivalent to the kernel ridge-less regression (krr). LINEBREAK ntk regime also holds in various architectures including resnets and cnns (yang & littwin, 2021), and the difference only appears in the ntk matrix. although we focus on the fully connected network in synthetic experiments, the following ntk formulation of sequential training and our theoretical results hold in any architecture under the ntk regime. LINEBREAK ntk formulation of continual learning. we denote the set of training samples in the n-th task as (xn, yn) (n = 1, 2, ..., k), a model trained in a sequential manner from task 1 to task n as fn and its parameters as θn. that is, we train the network initialized at θn−1 for the n-th task and obtain fn. assume that the number of tasks k is finite. the trained model within the ntk regime is then given as follows (bennani et al., 2020; doan et al., 2021): LINEBREAK fn(x(cid:48)) = fn−1(x(cid:48)) + θ(x(cid:48), xn)θ(xn)−1(yn − fn−1(xn)), LINEBREAK θn − θn−1 = ∇θf0(xn)(cid:62)θ(xn)−1(yn − fn−1(xn)). LINEBREAK (5) we omit the index c because each head is updated independently. the model fn completely fits the n-th task, i.e., yn = fn(xn). the main purpose of this study is to analyze the generalization performance of the sequentially trained model (4). at each task, the model has an inductive bias of krr in the function space and l2 min-norm solution in the parameter space. the next task uses this inductive bias as the initialization of training. the problem is whether this inductive bias helps improve the generalization in the subsequent tasks. LINEBREAK remark (independence between different heads). for a more accurate understanding of the continual learning in the ntk regime, it may be helpful to remark on the heads’ independence, which previous studies did not explicitly mention. as in eq. (2), all heads share the same ntk, and f (c) depends only on the label of its class y(c). while the parameter update (3) includes information of all classes, the c-th head can access only the information of the c-th class1. for example, suppose that the n-th task includes all classes except 1, i.e., {2, ..., c}. then, the model update on the the class 1 at the n-th task, i.e., f 1 ∇θf (1) LINEBREAK n − f 1 n−1, becomes 0 (x(cid:48))(θn − θn−1) = ∇θf (1) LINEBREAK n − f (c) LINEBREAK ∇θf (c) LINEBREAK because ∇θf (c) = 0 (c (cid:54)= c(cid:48)) in the infinite-width limit (jacot et al., 2018; yang, 2019). thus, we can deal with each head independently and analyze the generalization by setting c = 1 without loss of generality. this indicates that in the ntk regime, interaction between different heads do not cause knowledge transfer and forgetting. one may wonder if there are any non-trivial knowledge transfer and forgetting in such a regime. contrary to such intuition, we reveal that when the subsequent task revisits previous classes (targets), the generalization shows interesting increase and decrease. LINEBREAK 1we use the term “class”, although the regression problem is assumed in ntk theory. usually, ntk studies LINEBREAK solve the classification problem by regression with a target y(c) = {0, 1}. LINEBREAK learning curve on single-task training LINEBREAK to evaluate the generalization performance of (4), we extend the following theory to our sequential training. bordelon et al. (2020) obtained an analytical expression of the generalization for ntk regression on a single task (2) as follows. assume that training samples are generated in an i.i.d. manner ( xµ ∼ p(x)) and that labels are generated from a square integrable target function ¯f : LINEBREAK ¯f (x) = LINEBREAK ¯wiψi(x), LINEBREAK yµ = ¯f (xµ) + εµ LINEBREAK where ¯wi are constant coefficients and ε represents gaussian noise with (cid:104)εµεν(cid:105) = δµνσ2. we define ψi(x) := LINEBREAK ηiφi(x) with basis functions φi(x) given by mercer’s decomposition: LINEBREAK dx(cid:48)p (x(cid:48)) θ (x, x(cid:48)) φi (x(cid:48)) = ηiφi(x) LINEBREAK here, ηi denotes ntk’s eigenvalue and we assume the finite trance of ntk (cid:80) i ηi < ∞. we set η0 = 0 in the main text to avoid complicated notations. we can numerically compute eigenvalues by using the gauss-gegenbauer quadrature. generalization error is expressed by where f ∗ is a trained model and (cid:104)· · · (cid:105)d is the average e1 := over training samples. bordelon et al. (2020) derived a typical-case evaluation of the generalization error by using the replica method: for a sufficiently large n , we have asymptotically LINEBREAK (cid:68)(cid:82) dxp(x) (cid:0) ¯f (x) − f ∗(x)(cid:1)2(cid:69) LINEBREAK d LINEBREAK ηi ¯w2 i LINEBREAK κ κ + n ηi LINEBREAK although the replica method takes a large sample size n , bordelon et al. (2020); canatar et al. (2021) reported that the analytical expression (8) coincides well with empirical results even for small n . the constants κ and γ are defined as follows and characterize the increase and decrease of e1: LINEBREAK ηi κ + n ηi LINEBREAK the κ is a positive solution of the first equation and obtained by numerical computation. the γ satisfies 0 < γ < 1 by definition. for n = αdl (α > 0, l ∈ n, d (cid:29) 1), we can analytically solve it and obtain more detailed evaluation. for example, a positive κ decreases to zero as the sample size increases and e1 also decreases for σ2 = 0. for σ2 > 0, the generalization error shows multiple descent depending on the decay of eigenvalue spectra. since multiple descent is not a main topic of this paper, we briefly summarize it in section a.5 of the supplementary materials. LINEBREAK learning curves between two tasks LINEBREAK in this section, we analyze the ntk formulation of continual learning (4) between two tasks (k = 2). one can also regard this setting as transfer learning. we sequentially train the model from task a to task b, and each one has a target function defined by LINEBREAK ¯fa(x) = LINEBREAK i LINEBREAK ¯wa,iψi(x), ¯fb(x) = LINEBREAK i LINEBREAK ¯wb,iψi(x), LINEBREAK [ ¯wa,i, ¯wb,i] ∼ n (0, ηi LINEBREAK i αiθ(x(cid:48) LINEBREAK the target functions are dependent on each other and belong to the reproducing kernel hilbert space (rkhs). by denoting the rkhs by h, one can interpret the target similarity ρ as the inner product (cid:104) ¯fa, ¯fb(cid:105)h/((cid:107) ¯fa(cid:107)h(cid:107) ¯fb(cid:107)h) = ρ. these targets have dual representation such as ¯f (x) = (cid:80) i, x) with i.i.d. gaussian variables αi (bordelon et al., 2020), as summarized in section a) + εµ e.1. we generate training samples by yµ b) + εµ b (µ = 1, ..., nb), although we focus on the noise-less case (σ = 0) in this section. input samples xµ a and xµ b are i.i.d. and generated by the same distribution p(x). we can measure the generalization error in two ways: generalization error on subsequent task b and that on previous task a: LINEBREAK a (µ = 1, ..., na) and yµ LINEBREAK b = ¯fb(xµ LINEBREAK a = ¯fa(xµ LINEBREAK ea→b(ρ) = LINEBREAK eback LINEBREAK a→b(ρ) = LINEBREAK dxp(x)( ¯fb(x) − fa→b(x))2 LINEBREAK dxp(x)( ¯fa(x) − fa→b(x))2 LINEBREAK where we write f2 as fa→b to emphasize the sequential training from a to b. the notation eback a→b(ρ) is referred to as backward transfer (lopez-paz & ranzato, 2017). large negative backward transfer is known as catastrophic forgetting. we take the average (cid:104)· · · (cid:105) over training samples of two tasks {da, db}, and target coefficients ¯w. in fact, we can set ¯w as constants, and it is unnecessary to take the average. to avoid complicated notation, we take the average in the main text. we then obtain the following result. theorem 1. using the replica method under sufficiently large na and nb, for σ = 0, we have LINEBREAK ea→b(ρ) = LINEBREAK eback LINEBREAK a→b(ρ) = LINEBREAK i LINEBREAK i LINEBREAK eb,i, LINEBREAK i + LINEBREAK eb,i LINEBREAK where we define qa,i = κa/(κa + naηi), qb,i = κb/(κb + nbηi), eb,i = q2 fγb (a, b) = b(a − 2) + b2(1 − a)/(1 − γb). LINEBREAK i /(1 − γb) and LINEBREAK the constants κa and γa (κb and γb, respectively) are given by setting n = na(nb) in (9). the detailed derivation is given in section a. technically speaking, we use the following lemma: lemma 2. denote the trained model (2) on single task a as fa = (cid:80) following cost function: e = (cid:10)(cid:80) i φi(w∗ da replica method under a sufficiently large na, we have LINEBREAK i w∗ a,iψi, and define the for arbitrary constants φi and ui. using the LINEBREAK (cid:20) ( ¯wa,i − ui)2 − 2 ¯wa,i( ¯wa,i − ui)qa,i + LINEBREAK e = LINEBREAK i LINEBREAK a,i + LINEBREAK ηina κ2 a LINEBREAK q2 a,i LINEBREAK φi, LINEBREAK where ea denotes generalization error e1 on single task a. LINEBREAK for example, we can see that ea is a special case of e with φi = ηi and u = ¯wa, and that ea→b(ρ) is reduced to φi = q2 i /(1 − γb) and u = ¯wb after certain calculation. LINEBREAK spectral bias. the generalization errors obtained in theorem 1 are given by the summation over spectral modes like the single-task case. the eb,i corresponds to the i-th mode of generalization error (8) on single task b. the study on the single task (bordelon et al., 2020) revealed that as the sample size increases, the modes of large eigenvalues decreases first. this is known as spectral bias and clarifies the inductive bias of the ntk regression. put the eigenvalues in descending order, i.e., λi ≥ λi+1. when d is sufficiently large and nb = αdl (α > 0, l ∈ n), the error of each mode is asymptotically given by eb,i = 0 (i < l) and η2 i (i > l). we see that the spectral bias also holds in ea→b because it is a weighted sum over eb,i. in contrast, eback a→b includes a constant term 2(1 − ρ)η2 LINEBREAK i . this constant term causes catastrophic forgetting, as we show later. LINEBREAK transition from negative to positive transfer LINEBREAK we now look at more detailed behaviors of generalization errors obtained in theorem 1. we first discuss the role of the target similarity ρ for improving generalization. figure 1(a) shows the comparison of the generalization between single-task training and sequential training. solid lines show theory, and markers show experimental results of trained neural networks in the ntk regime. we trained the model (1) with relu activation, l = 3, and ml = 4, 000 by using the gradient descent over 50 trials. more detailed settings of our experiments are summarized in section e. because we set na = nb = 100, we have ea = eb. the point is that both ea→b(ρ) and eback a→b(ρ) are lower than ea(= eb) for large ρ. this means that the sequential training degrades generalization if the targets are dissimilar, that is, negative transfer. in particular, eback a→b(ρ) rapidly deteriorates for the dissimilarity of targets. note that both ea→b and eback a→b are linear functions of ρ. figure 1(a) indicates that the latter has a large slope. we can gain quantitative insight into the critical value of ρ for the negative transfer as follows. LINEBREAK knowledge transfer. the following asymptotic equation gives us the critical value for ea→b: LINEBREAK ea→b(ρ)/eb ∼ 2(1 − ρ) LINEBREAK f or na (cid:29) nb. LINEBREAK figure 1: (a) transitions from positive to negative transfer caused by target similarity ρ. we set na = nb. (b) learning curves show negative transfer (ea→b/eb) in a highly non-linear way depending on unbalanced sample sizes. we changed na and set nb = 103. LINEBREAK in the context of transfer learning, it is a straightforward algebra leads to this (section a.3). reasonable that the target domain has a limited sample size compared to the first task. for ρ > 1/2, we have ea→b < eb, that is, previous task a contributes to improving the generalization performance on subsequent task b (i.e., positive transfer). for ρ < 1/2, however, negative transfer appears. LINEBREAK the following sufficient condition for the negative transfer is also noteworthy. by evaluating ea→b > eb, we can prove that for any na and nb, the negative transfer always appears for LINEBREAK γa). LINEBREAK (16) this is just a sufficient condition and may be loose. for example, we asymptotically have the critical target similarity ρ = 1/2 > ρ∗ for na (cid:29) nb. nevertheless, this sufficient condition is attractive in the sense that it clarifies the unavoidable negative transfer for the small target similarity. backward transfer. the eback i independent of sample sizes. note that qa and qb decrease to zero for large sample sizes (bordelon et al., 2020), and we have a→b(ρ) ∼ (cid:80) eback i (1 − ρ). in contrast, ea converges to zero for a large na. therefore, the intersection between eback a→b(ρ) and ea reach ρ = 1 as na and nb increase. this means that when we have a sufficient number of training samples, negative backward transfer (eback a→b(ρ) > ea) occurs even for very similar targets. figure 1(a) confirms this result, and figure 6 in section a.6 shows more detailed learning curves of backward transfer. catastrophic forgetting seems literally “catastrophic” in the sense that the backward transfer rapidly deteriorates by the subtle target dissimilarity. LINEBREAK a→b(0) includes the constant term (cid:80) LINEBREAK self-knowledge transfer LINEBREAK we have shown that target similarity is a key factor for knowledge transfer. we reveal that the sample size is another key factor. to clarify the role of sample sizes, we focus on the same target function (ρ = 1) in the following analysis. we refer to the knowledge transfer in this case as self-knowledge transfer to emphasize the network learning the same function by the same head. as is the same in ρ < 1, the knowledge obtained in the previous task is transferred as the network’s initialization for the subsequent training and determines the eventual performance. LINEBREAK positive transfer by equal sample sizes. we find that positive transfer is guaranteed under equal sample sizes, that is, na = nb. to characterize the advantage of the sequential training, we compare it with a model average: (fa + fb)/2, where fa (fb) means the model obtained by a single-task training on a (b). note that since the model is a linear function of the parameter in the ntk regime, this average is equivalent to that of the trained parameters: (θa + θb)/2. after straightforward calculation in section d, the generalization error of the model average is given by LINEBREAK eave = (1 − γb/2) eb. (17) sequential training and model average include information of both tasks a and b; thus, it is interesting to compare it with ea→b. we find proposition 3. for ρ = 1 and any na = nb, LINEBREAK ea→b(1) < eave < ea = eb. LINEBREAK the derivation is given in section d. this proposition clarifies the superiority of sequential training over single-task training and even the average. the first task contributes to the improvement on the second task; thus, we have positive transfer. LINEBREAK negative transfer by unbalanced sample sizes. while equal sample size leads to positive transfer, the following unbalanced sample sizes cause the negative transfer of self-knowledge: LINEBREAK (19) the derivation is based on jensen’s inequality (section a.3). while ea→b and eb asymptotically decrease to zero for the large nb, their ratio remains finite. because 0 < γa < 1, ea→b(1) > eb. it indicates that the small sample size of task a leads to a bad initialization of subsequent training and makes the training on task b hard to find a better solution. LINEBREAK f or nb (cid:29) na. LINEBREAK figure 1(b) summarizes the learning curves which depend on sample sizes in a highly non-linear way. solid lines show theory, and markers show the results of ntk regression over 100 trials. the figure shows excellent agreement between theory and experiments. although we have complicated transitions from positive to negative transfer, our theoretical analyses capture the basic characteristics of the learning curves. for self-knowledge transfer (ρ = 1), we can achieve positive transfer at na/nb = 1, as shown in proposition 3, and for large na/nb, as shown in (15). in contrast, negative transfer appears for small na/nb, as shown in (19). for ρ < 1, large na/nb produces positive transfer for ρ < 1/2, as shown in (15). LINEBREAK if we set a relatively large σ > 0, the learning curve may become much more complicated due to multiple descent. figure 5 in section a.5 confirms the case in which multiple descent appears in ea→b. the curve shape is generally characterized by the interaction among target similarity, self-knowledge transfer depending on sample size, and multiple descent caused by the noise. LINEBREAK self-knowledge forgetting LINEBREAK we have shown in section 4.1 that backward transfer is likely to cause catastrophic forgetting for ρ < 1. we show that even for ρ = 1, sequential training causes forgetting. that is, the training on task b degrades generalization even though both tasks a and b learn the same target. we have eback a→b(1) = ea→b(1) by definition, and proposition 3 tells us that ea→b < ea. therefore, no forgetting appears for equal sample sizes. in contrast, we have LINEBREAK f or na (cid:29) nb. LINEBREAK (20) one can obtain this asymptotic equation in the same manner as (19) since ea→b(1) is a symmetric function in terms of indices a and b. combining (20) with (15), we have ea < ea→b(1) (cid:28) eb. sequential training is better than using only task b, but training only on the first task is the best. one can say that the model forgets the target despite learning the same one. we call this self-knowledge forgetting. in the context of continual learning, many studies have investigated the catastrophic forgetting caused by different heads (i.e., in the situation of incremental learning). our results suggest that even the sequential training on the same task and the same head shows such forgetting. intuitively speaking, the self-knowledge forgetting is caused by the limited sample size of task b. note that we have ea→b(1) = (cid:80) a,ieb,i/(1 − γa). the generalization error of single-task training on task b (eb,i) takes a large value for a small nb and this causes the deterioration of ea→b as well. figure 2 confirms the self-knowledge forgetting in ntk regression. we set na = nb as the red line and nb = 100 as the yellow line. the dashed line shows the point where forgetting appears. LINEBREAK figure 2: self-knowledge forgetting: unbalanced sample sizes degrade generalization. LINEBREAK learning curves of many tasks LINEBREAK we can generalize the sequential training between two tasks to that of more tasks. for simplicity, let us focus on the self-knowledge transfer (ρ = 1) and equal sample sizes. applying lemma 2 recursively from task to task, we can evaluate generalization defined by en = (cid:10)(cid:82) dxp(x)( ¯f (x) − fn(x))2(cid:11) d. LINEBREAK theorem 4. assume that (i) (xn, yn) (n = 1, ..., k) are given by the same distribution xn ∼ p (x) and target yn = (cid:80) LINEBREAK i ¯wiψ(xn) + εn. (ii) sample sizes are equal: nn = n . for n = 1, ..., k, (1 − γ)2 ˜q(cid:62)qn−1 ˜q + rn+1σ2, q := diag (cid:0)q2(cid:1) + LINEBREAK n LINEBREAK where qi = κ/(κ + ηin ), ˜qi = ηiq2 i and diag(q2) denotes a diagonal matrix whose entries are q2 i . the noise term rn is a positive constant. in the noise-less case (σ = 0), the learning curve shows monotonic decrease: en+1 ≤ en. if all eigenvalues are positive, we have LINEBREAK en+1 < en LINEBREAK see section b for details of derivation. the learning curve (i.e., generalization error to the number of tasks) monotonically decreases for the noise-less case. the monotonic decrease comes from λmax(q) < 1. this result means that the self-knowledge is transferred and accumulated from task to task and contributes in improving generalization. it also ensures that no self-knowledge forgetting appears. we can also show that rn converges to a positive constant term for a large n and the contribution of noise remains as a constant. LINEBREAK krr-like expression. the main purpose of this work was to address the generalization of the continually trained model fn. as a side remark, we show another expression of fn: θ (x1) LINEBREAK o LINEBREAK ... θ (xn, x1) LINEBREAK o ... o θ (xn) LINEBREAK y1 ... yn LINEBREAK this easily comes from comparing the update (4) with a formula for the inversion of triangular block matrices (section c). one can see this expression as an approximation of krr, where the upper triangular block of ntk is set to zero. usual modification of krr is diagonal, e.g., l2 regularization and block approximation, and it seems that the generalization error of this type of model has never been explored. our result revealed that this model provides non-trivial sample size dependencies such as self-knowledge transfer and forgetting. LINEBREAK experiments LINEBREAK although theorem 4 guarantees the monotonic learning curve for equal sizes, unbalanced sample sizes should cause a non-monotonic learning curve. we empirically confirmed this below. LINEBREAK synthetic data. first, we empirically confirm en on synthetic data (10). figure 3(a1) confirms the claim of theorem 4 that the generalization error monotonically decreases for σ = 0 as the task number increases. dashed lines are theoretical values calculated using the theorem, and points with error bars were numerically obtained by fn (4) over 100 trials. for σ > 0, the decrease was suppressed. we set σ2 = {0, 10−5, 10−4, 10−3} and ni = 100. figure 3(a2) shows self-knowledge forgetting. when the first task has a large sample size, the generalization error by the second task can increase for small subsequent sample sizes ni. for smaller ni, there was a tendency for the error to keep increasing and taking higher errors than that of the first task during several tasks. in practice, one may face a situation where the model is initialized by the first task training on many samples and then trained in a continual learning manner under a memory constraint. the figure suggests that if the number of subsequent tasks is limited, we need only the training on the first task. if we have a sufficiently large number of tasks, generalization eventually improves. LINEBREAK mlp on mnist / resnet-18 on cifar-10. we mainly focus on the theoretical analysis in the ntk regime, but it will be interesting to investigate whether our results also hold in more practical settings of deep learning. we trained mlp (fully-connected neural networks with 4 hidden layers) and resnet-18 with stochastic gradient descent (sgd) and cross-entropy loss. we set the number of epochs sufficient for the training error to converge to zero for each task. we confirmed that they show qualitatively similar results as in the ntk regime. we randomly divided the dataset into tasks without overlap of training samples. figures 3(b1,c1) show the monotonic decrease for an equal sample size and that the noise suppressed the decrease. we set ni = 500 and generated the noise by the label corruption with a corruption probability {0, 0.2, ..., 0.8} (zhang et al., 2017). the vertical axis means the error, i.e., 1 − (test accuracy [%])/100. figures 3(b2,c2) show that unbalanced sample sizes caused the non-monotonic learning curve, similar to ntk regression. LINEBREAK figure 3: (a1)-(c1) learning curves for equal sample sizes. for noise-less case, they monotonically decreased (orange lines). for noisy case, decrease was suppressed (grey lines; we plotted learning curves for several σ2 and those with larger test errors correspond to larger σ2). we trained mlp on mnist and resnet-18 on cifar-10. (a2)-(c2) learning curves for unbalanced sample sizes were non-monotonic (n1 = 4, 000 for ntk regression, n1 = 104 for sgd training of mlp and resnet-18). numbers in the legend mean nn LINEBREAK discussion LINEBREAK we provided novel quantitative insight into knowledge transfer and forgetting in the sequential training of neural networks. even in the ntk regime, where the model is simple and linearized, learning curves show rich and non-monotonic behaviors depending on both target similarity and sample size. in particular, learning on the same target shows successful self-knowledge transfer or undesirable forgetting depending on the balance of sample sizes. these results indicate that the performance of the sequentially trained model is more complicated than we thought, but we can still find some universal laws behind it. LINEBREAK there are other research directions to be explored. while we focused on reporting novel phenomena on transfer and forgetting, it is also important to develop algorithms to achieve better performance. to mitigate catastrophic forgetting, previous studies proposed several strategies such as regularization, parameter isolation, and experience replay (mirzadeh et al., 2020). evaluating such strategies with theoretical backing would be helpful for further development of continual learning. for example, orthogonal projection methods modify gradient directions (doan et al., 2021), and replay methods allow the reuse of the previous samples. we conjecture that these could be analyzed by extending our calculations in a relatively straightforward way. it would also be interesting to investigate richer but complicated situations required in practice, such as streaming of non-i.i.d. data and distribution shift (aljundi et al., 2019). the current work and other theories in continual learning or transfer learning basically assume the same input distribution between different tasks (lee et al., 2021; tripuraneni et al., 2020). extending these to the case with an input distribution shift will be essential for some applications including domain incremental learning. our analysis may also be extended to topics different from sequential training. for example, self-distillation uses trained model’s outputs for the subsequent training and plays an interesting role of regularization (mobahi et al., 2020). LINEBREAK while our study provides universal results, which do not depend on specific eigenvalue spectra or architectures, it is interesting to investigate individual cases. studies on ntk eigenvalues have made remarkable progress, covering shallow and deep relu neural networks (geifman et al., 2020; chen & xu, 2020), skip connections (belfer et al., 2021), and cnns (favero et al., 2021). we expect that our analysis and findings will serve as a foundation for further understanding and development on theory and experiments of sequential training. LINEBREAK reproducibility statement LINEBREAK the main contributions of this work are theoretical claims, and we clearly explained their assumptions and settings in the main text. complete proofs of the claims are given in the supplementary materials. for experimental results of training deep neural networks, we used only already-known models and algorithms implemented in pytorch. all of the detailed settings, including learning procedures and hyperparameters, are clearly explained in section e. LINEBREAK acknowledgments LINEBREAK this work was funded by jst act-x grant number jpmjax190a and jsps kakenhi grant number 19k20366. LINEBREAK references LINEBREAK alia abbaras, benjamin aubin, florent krzakala, and lenka zdeborová. rademacher complexity and spin glasses: a link between the replica and statistical theories of learning. in mathematical and scientific machine learning (msml), pp. 27–54. pmlr, 2020. LINEBREAK rahaf aljundi, klaas kelchtermans, and tinne tuytelaars. task-free continual learning. in ieee/cvf LINEBREAK conference on computer vision and pattern recognition (cvpr), pp. 11254–11263, 2019. LINEBREAK yuval belfer, amnon geifman, meirav galun, and ronen basri. spectral analysis of the neural LINEBREAK tangent kernel for deep residual networks. arxiv preprint arxiv:2104.03093, 2021. LINEBREAK mehdi abbana bennani, thang doan, and masashi sugiyama. generalisation guarantees for continual LINEBREAK learning with orthogonal gradient descent. arxiv preprint arxiv:2006.11942, 2020. LINEBREAK blake bordelon, abdulkadir canatar, and cengiz pehlevan. spectrum dependent learning curves in kernel regression and wide neural networks. in international conference on machine learning (icml), pp. 1024–1034. pmlr, 2020. LINEBREAK abdulkadir canatar, blake bordelon, and cengiz pehlevan. spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks. nature communications, 12(1):1–12, 2021. LINEBREAK lin chen and sheng xu. deep neural tangent kernel and laplace kernel have the same rkhs. in LINEBREAK international conference on learning representations (iclr), 2020. LINEBREAK rainer dietrich, manfred opper, and haim sompolinsky. statistical mechanics of support vector LINEBREAK networks. physical review letters, 82(14):2975, 1999. LINEBREAK thang doan, mehdi abbana bennani, bogdan mazoure, guillaume rabusseau, and pierre alquier. a theoretical analysis of catastrophic forgetting through the ntk overlap matrix. in international conference on artificial intelligence and statistics (aistats), pp. 1072–1080. pmlr, 2021. LINEBREAK sebastian farquhar and yarin gal. towards robust evaluations of continual learning. arxiv preprint LINEBREAK alessandro favero, francesco cagnetta, and matthieu wyart. locality defeats the curse of dimensionality in convolutional teacher-student scenarios. arxiv preprint arxiv:2106.08619, 2021. LINEBREAK amnon geifman, abhay yadav, yoni kasten, meirav galun, david jacobs, and ronen basri. on the similarity between the laplace and neural tangent kernels. in advances in neural information processing systems (neurips), pp. 1451–1461, 2020. LINEBREAK raia hadsell, dushyant rao, andrei a rusu, and razvan pascanu. embracing change: continual LINEBREAK learning in deep neural networks. trends in cognitive sciences, 2020. LINEBREAK arthur jacot, franck gabriel, and clément hongler. neural tangent kernel: convergence and generalization in neural networks. in advances in neural information processing systems (neurips), pp. 8571–8580, 2018. LINEBREAK james kirkpatrick, razvan pascanu, neil rabinowitz, joel veness, guillaume desjardins, andrei a rusu, kieran milan, john quan, tiago ramalho, agnieszka grabska-barwinska, et al. overcoming catastrophic forgetting in neural networks. proceedings of the national academy of sciences, 114 (13):3521–3526, 2017. LINEBREAK jaehoon lee, lechao xiao, samuel s schoenholz, yasaman bahri, jascha sohl-dickstein, and jeffrey pennington. wide neural networks of any depth evolve as linear models under gradient descent. in advances in neural information processing systems (neurips), pp. 8572–8583, 2019. LINEBREAK sebastian lee, sebastian goldt, and andrew saxe. continual learning in the teacher-student setup: impact of task similarity. in international conference on machine learning (icml), pp. 6109– 6119. pmlr, 2021. LINEBREAK david lopez-paz and marc’aurelio ranzato. gradient episodic memory for continual learning. in LINEBREAK advances in neural information processing systems (nips), pp. 6467–6476, 2017. LINEBREAK michael mccloskey and neal j cohen. catastrophic interference in connectionist networks: the sequential learning problem. in psychology of learning and motivation, volume 24, pp. 109–165. elsevier, 1989. LINEBREAK seyed iman mirzadeh, mehrdad farajtabar, dilan gorur, razvan pascanu, and hassan ghasemzadeh. linear mode connectivity in multitask and continual learning. in international conference on learning representations (iclr), 2020. LINEBREAK hossein mobahi, mehrdad farajtabar, and peter l bartlett. self-distillation amplifies regularization in hilbert space. in advances in neural information processing systems (neurips), pp. 3351–3361, 2020. LINEBREAK preetum nakkiran, gal kaplun, yamini bansal, tristan yang, boaz barak, and ilya sutskever. deep double descent: where bigger models and more data hurt. in international conference on learning representations (iclr), 2020. LINEBREAK anastasia pentina and christoph lampert. a pac-bayesian bound for lifelong learning. LINEBREAK in LINEBREAK international conference on machine learning (icml), pp. 991–999. pmlr, 2014. LINEBREAK vinay venkatesh ramasesh, ethan dyer, and maithra raghu. anatomy of catastrophic forgetting: hidden representations and task semantics. in international conference on learning representations (iclr), 2020. LINEBREAK stefano spigler, mario geiger, and matthieu wyart. asymptotic learning curves of kernel methods: empirical data versus teacher–student paradigm. journal of statistical mechanics: theory and experiment, 2020(12):124001, 2020. LINEBREAK nilesh tripuraneni, michael jordan, and chi jin. on the theory of transfer learning: the importance of task diversity. in advances in neural information processing systems (neurips), pp. 7852–7862, 2020. LINEBREAK greg yang. scaling limits of wide neural networks with weight sharing: gaussian process behavior, gradient independence, and neural tangent kernel derivation. arxiv preprint arxiv:1902.04760, 2019. LINEBREAK greg yang and etai littwin. tensor programs iib: architectural universality of neural tangent kernel training dynamics. in international conference on machine learning (icml), pp. 11762–11772. pmlr, 2021. LINEBREAK chiyuan zhang, samy bengio, moritz hardt, benjamin recht, and oriol vinyals. understanding deep learning requires rethinking generalization. in international conference on learning representations (iclr), 2017. LINEBREAK supplementary materials LINEBREAK a sequential training between two tasks LINEBREAK a.1 notations LINEBREAK the kernel ridge(-less) regression is given by LINEBREAK f ∗ = arg min LINEBREAK f ∈h LINEBREAK (f (xµ) − yµ)2 + LINEBREAK where n is the sample size and h is the reproducing kernel hilbert space (rkhs) induced by the neural tangent kernel θ. we assume that the input samples xµ are generated from a probabilistic distribution p(x) and that the ntk has finite trace, i.e., (cid:82) dxp(x)θ(x, x) < ∞. mercer’s decomposition of θ is expressed by (cid:90) LINEBREAK dx(cid:48)p (x(cid:48)) θ (x, x(cid:48)) φi (x(cid:48)) = ηiφi(x) LINEBREAK in other words, we have θ(x(cid:48), x) = (cid:80)∞ is given by LINEBREAK i=0 ηiφi(x(cid:48))φi(x). note that a function belonging to rkhs LINEBREAK f (x) = LINEBREAK aiφi(x) LINEBREAK with (cid:107)f (cid:107)2 i=0 a2 regression is given by LINEBREAK i=0 i /ηi < ∞. then, using the orthonormal bases {φi}∞ LINEBREAK i=0, the solution of the LINEBREAK f ∗(x) = LINEBREAK i LINEBREAK i ψi(x), w∗ = (cid:0)ψψ(cid:62) + λi(cid:1)−1 w∗ LINEBREAK ψy LINEBREAK where ψi(x) := ntk regime and take the ridge-less limit (λ → 0). LINEBREAK ηiφi(x). each column of ψ is given by φ(xµ) (µ = 1, ..., n ). we focus on the LINEBREAK the sequentially trained model (4) between tasks a and b is written as LINEBREAK fa→b(x) − fa(x) = θ(x, xb)θ(xb)−1 (yb − fa(xb)) , fa(x) = θ(x, xa)θ(xa)−1ya. LINEBREAK the model fa is trained on single task a and represented by LINEBREAK with LINEBREAK fa(x) = w∗(cid:62) LINEBREAK a ψ(x) LINEBREAK w∗ LINEBREAK a = lim λ→0 LINEBREAK argminwa ha(wa), LINEBREAK ha(wa) := LINEBREAK na(cid:88) LINEBREAK a ψ(xµ LINEBREAK a) − yµ LINEBREAK a LINEBREAK µ=1 eq. (s.9 ) is the objective function equivalent to (s.1 ) because (cid:104)fa, fa(cid:105)h = (cid:107)wa(cid:107)2 2. similarly, we can represent fa→b by the series expansion with the bases of rkhs. note that the right-hand side of (s.5 ) is equivalent to the kernel ridge-less regression on input samples xb and labels yb − fa(b). we have LINEBREAK fa→b(x) = (w∗ LINEBREAK a + w∗ LINEBREAK b)(cid:62)ψ(x) LINEBREAK with LINEBREAK w∗ LINEBREAK b = lim λ→0 LINEBREAK argminwb h(wb, w∗ LINEBREAK a), LINEBREAK h(wb, w∗ LINEBREAK a) := LINEBREAK nb(cid:88) LINEBREAK bψ(xµ LINEBREAK b) − (yµ LINEBREAK b − w∗(cid:62) LINEBREAK a ψ(xµ LINEBREAK a.2 proof of theorem 1. LINEBREAK a.2.1 knowledge transfer ea→b LINEBREAK first, we take the average over training samples of task b conditioned by task a, that is, LINEBREAK ea→b|a := LINEBREAK dxp(x)( ¯fb(x) − (w∗ LINEBREAK a + w∗ LINEBREAK dxp(x)((w∗ LINEBREAK b − ( ¯wb − w∗ LINEBREAK db LINEBREAK db LINEBREAK where the set of task b’s training samples is denoted by db. we have LINEBREAK note that the objective function h(wb, w∗ LINEBREAK a) is transformed to LINEBREAK ea→b = (cid:104)ea→b|a(cid:105)da . LINEBREAK h(wb, w∗ LINEBREAK a) = LINEBREAK nb(cid:88) LINEBREAK (wb − ( ¯wb − w∗ LINEBREAK a))(cid:62)ψ(x(µ) b ) LINEBREAK comparing (s.14 ) and (s.16 ), one can see that the average over task b conditioned by task a is equivalent to single-task training with the target function ( ¯wb − w∗ a)(cid:62)ψ(x). therefore, by using (8), we immediately obtain LINEBREAK ηi( ¯wb,i − w∗ LINEBREAK κb κb + nbηi LINEBREAK ea→b|a = LINEBREAK i LINEBREAK φi( ¯wb,i − w∗ LINEBREAK i LINEBREAK next, we take the average of (s.18 ) over task a. only ¯w∗ the single-task training (s.8 ). this corresponds to lemma 2 with u = ¯wb and φi = ηiq2 we obtain LINEBREAK a depends on the task a and is determined by b,i/(1 − γb). LINEBREAK ea→b = LINEBREAK i LINEBREAK ( ¯wa,i − ¯wb,i)2 − 2 ¯wa,i( ¯wa,i − ¯wb,i)qa,i LINEBREAK ¯wa,i + LINEBREAK ηina κ2 a LINEBREAK j LINEBREAK a,jq2 LINEBREAK a,j LINEBREAK a,i LINEBREAK ηiq2 b,i 1 − γb LINEBREAK na κ2 a LINEBREAK i LINEBREAK a,iq2 LINEBREAK b,i + LINEBREAK although this is a general result that holds for any ¯wa and ¯wb, it is a bit complicated and seems not easy to give an intuitive explanation. let us take the average over (cid:21) LINEBREAK [ ¯wa,i, ¯wb,i] ∼ n (0, ηi LINEBREAK the generalization error is then simplified to LINEBREAK i LINEBREAK eb,i LINEBREAK na κ2 a LINEBREAK i LINEBREAK a,iq2 LINEBREAK b,i + LINEBREAK where we used (cid:104)w2 LINEBREAK b,i(cid:105)w = ηi and (cid:104)wa,i, wb,i(cid:105)w = ρ. LINEBREAK a.2.2 backward transfer LINEBREAK backward transfer is measured by the prediction on the previous task a: LINEBREAK eback LINEBREAK a→b := LINEBREAK dxp(x)( ¯fa(x) − fa→b(x))2 LINEBREAK dxp(x)((w∗ LINEBREAK b − ( ¯wa − w∗ LINEBREAK first, we take the average over task b, LINEBREAK eback LINEBREAK a→b|a = LINEBREAK dxp(x)((w∗ − ( ¯wa − w∗ LINEBREAK db LINEBREAK this corresponds to lemma 2 with the replacement φi ← ηi and u ← ¯wa − w∗ a. recall that the objective function of ntk regression was given by (s.16). the target ¯wa in lemma 2 is replaced as ¯wa ← ¯wb − w∗ LINEBREAK a. we then have LINEBREAK eback LINEBREAK a→b|a = LINEBREAK (cid:34) ( ¯wb,i − ¯wa,i)2 − 2( ¯wb,i − w∗ LINEBREAK a,i)( ¯wb,i − ¯wa,i)qb,i LINEBREAK i LINEBREAK ( ¯wb,i − w∗ LINEBREAK ηinb κ2 b LINEBREAK ηj( ¯wb,j − w∗ LINEBREAK q2 b,i LINEBREAK ηi LINEBREAK = γb LINEBREAK ηi( ¯wb,i − ¯wa,i)2 + LINEBREAK i γb 1 − γb LINEBREAK ηiq2 b,i 1 − γb LINEBREAK i LINEBREAK wa,i − ( ¯wb,i − LINEBREAK 1 − γb qb,i LINEBREAK ( ¯wb,i − ¯wa,i)) LINEBREAK next, we take the average over da. since the first and third terms of (s.27 ) are independent of da, we need to evaluate only the second term. the second term corresponds to lemma 2 with φi = ηiq2 LINEBREAK b,i/(1 − γb) and ui = ¯wb,i − (1 − γb)/qb,i( ¯wb,i − ¯wa,i). we obtain LINEBREAK eback LINEBREAK a→b = LINEBREAK eback LINEBREAK a→b|a LINEBREAK da LINEBREAK = γb LINEBREAK i LINEBREAK ηi( ¯wb,i − ¯wa,i)2 + LINEBREAK (cid:34) ( ¯wa,i − ¯wb,i)2(qb,i − (1 − γb))2 LINEBREAK i LINEBREAK − 2 ¯wa,i( ¯wa,i − ¯wb,i)(qb,i − (1 − γb))qa,iqb,i LINEBREAK a,i + LINEBREAK ηina κ2 a LINEBREAK j LINEBREAK na κ2 a LINEBREAK i LINEBREAK a,jq2 LINEBREAK b,i LINEBREAK a,iq2 LINEBREAK b,i + LINEBREAK finally, by taking the average over (s.20 ), we have LINEBREAK eback LINEBREAK i LINEBREAK i (qb,i − 1 + γb) LINEBREAK qb,iqa,i 1 − γb LINEBREAK na κ2 a LINEBREAK i LINEBREAK a,iq2 LINEBREAK b,i + LINEBREAK a,iq2 LINEBREAK b,i LINEBREAK i LINEBREAK 1 + qb,i(qa,i − 2) + LINEBREAK i LINEBREAK a,iq2 LINEBREAK na κ2 a LINEBREAK i LINEBREAK a,iq2 LINEBREAK b,i + LINEBREAK a.2.3 lemma 2 lemma 2. suppose training on single task a, the target of which is given by ¯f = (cid:80) denote the trained model (2) as f ∗ = (cid:80) i w∗ a,iψi. define the following cost function: (cid:42) LINEBREAK i ¯wa,iψi, and LINEBREAK e = LINEBREAK φi(w∗ LINEBREAK a,i − ui)2 LINEBREAK for arbitrary constants φi and ui. using the replica method under a sufficiently large na, we have LINEBREAK i LINEBREAK da LINEBREAK e = LINEBREAK ( ¯wa,i − ui)2 − 2 ¯wa,i( ¯wa,i − ui)qa,i LINEBREAK a,i + LINEBREAK ηina κ2 a LINEBREAK a,jq2 LINEBREAK q2 a,i LINEBREAK φi. LINEBREAK proof. the process of derivation is similar to canatar et al. (2021), but we have additional constants φi and ui. they cause several differences in the detailed form of equations. LINEBREAK define LINEBREAK z[j] = LINEBREAK dwa exp(−βha(wa) + j LINEBREAK e(wa)) LINEBREAK where e(wa) = (cid:10)(cid:80) LINEBREAK i φi(wa,i − ui)2(cid:11) LINEBREAK da LINEBREAK . we omit the index a in the following. we have LINEBREAK e = lim β→∞ LINEBREAK ∂ ∂j LINEBREAK to evaluate (cid:104)log z(cid:105), we use the replica method (a.k.a. replica trick): LINEBREAK the point of the replica method is that we first calculate z n for n ∈ n then take the limit of n to zero by treating it as a real number. in addition, we calculate the average (cid:104)z n(cid:105)d under a replica symmetric ansätz and a gaussian approximation by following the calculation procedure of the previous works (dietrich et al., 1999; bordelon et al., 2020; canatar et al., 2021). LINEBREAK we have LINEBREAK dwn exp LINEBREAK (wa − u)(cid:62) φ (wa − u) LINEBREAK {xµ,εµ} , LINEBREAK q := exp LINEBREAK (cid:0)(wa LINEBREAK a − ¯wa)(cid:62)ψ(xµ) − εµ(cid:1)2 LINEBREAK a=1 a=1 dwa and φ is a diagonal matrix whose diagonal entries given by φi. LINEBREAK where we define dwn = (cid:81)n we take the shift of wa → wa + ¯w. then, nβ 2 LINEBREAK dwn exp(− (cid:124) LINEBREAK · exp( LINEBREAK a LINEBREAK {xµ,εµ} , LINEBREAK q = exp(− LINEBREAK β 2λ ¯k := ¯w − jn φ( ¯w − u). LINEBREAK first, let us calculate (cid:104)q(cid:105){xµ,εµ}. this term is exactly the same as appeared in the previous works (bordelon et al., 2020; canatar et al., 2021). to describe notations, we overview their derivation. define qa = wa(cid:62)ψ (x) + ε, which are called order parameters. we approximate the probability distribution of qa by a multivariate gaussian: LINEBREAK exp LINEBREAK (qa − µa) [c −1]ab LINEBREAK (cid:0)qb − µb(cid:1) LINEBREAK a,b LINEBREAK p ({qa}) = LINEBREAK with LINEBREAK c ab := (cid:10)qaqb(cid:11) LINEBREAK where σab = σδab, (cid:104)· · · (cid:105)x denotes the average over p(x) and λ is a diagonal matrix whose entries are ηi. we have 0 in (s.41 ) since η0 corresponds to the constant shift φ0(x) = 1. training samples are i.i.d. and we omitted the index µ. we then have (cid:32) LINEBREAK log det LINEBREAK i + LINEBREAK c LINEBREAK i + LINEBREAK c LINEBREAK where i denotes the identity matrix. define conjugate variables {ˆµa, ˆc ab} by the following identity: LINEBREAK dµadˆµadc abd ˆc ab LINEBREAK a≥b LINEBREAK × exp LINEBREAK −n LINEBREAK a LINEBREAK ˆµa (cid:0)µa − wa LINEBREAK (cid:1) − n LINEBREAK a≥b LINEBREAK ˆc ab (cid:0)c ab − wa(cid:62)λwb − σab(cid:1) LINEBREAK where c denotes an uninteresting constant and we took the conjugate variables on imaginary axes. LINEBREAK next, we perform the integral over wn. eq. (s.37 ) becomes LINEBREAK dwn LINEBREAK a≥b LINEBREAK dωab exp(−n ( LINEBREAK ˆµaµa + LINEBREAK a LINEBREAK a≥b LINEBREAK ˆc ab(c ab − σab))) exp[−n g − gs] LINEBREAK where dωab = dµadˆµadc abd ˆc ab and define LINEBREAK g = LINEBREAK log det LINEBREAK i + LINEBREAK c LINEBREAK i + LINEBREAK c LINEBREAK exp(−gs) = exp( LINEBREAK a LINEBREAK wa(cid:62)φwa − βk(cid:62)wa)) LINEBREAK × exp LINEBREAK n LINEBREAK a LINEBREAK ˆµawa LINEBREAK a≥b LINEBREAK ˆc abwa(cid:62)λwb LINEBREAK we can represent (cid:82) dwn exp(−gs) by (cid:90) LINEBREAK dwn exp(−gs) = LINEBREAK dxi exp LINEBREAK where xi ∈ rn denotes a vector [w1 (i = 0, 1, ...). we defined LINEBREAK i i , ..., wn i , ..., wa LINEBREAK x(cid:62) i LINEBREAK ˆqixi − βb(cid:62) LINEBREAK i xi LINEBREAK i ](cid:62) and i is the index of kernel’s eigenvalue mode LINEBREAK ˆqi = (1 − φijn )in − LINEBREAK ηin β LINEBREAK ( ˜c + diag( ˜c)), LINEBREAK bi = ¯ki1n LINEBREAK where in is an n × n identity matrix and 1n is an n-dimensional vector whose all entries are 1. the gs term includes φ and c that are specific to our study. when φ = η and u = ¯w, it is reduced to previous works (bordelon et al., 2020; canatar et al., 2021). taking the integral over {xi}, we have LINEBREAK that is, LINEBREAK dwn exp(−gs) = c LINEBREAK exp( LINEBREAK gs = LINEBREAK log det ˆqi − LINEBREAK replica symmetry and saddle-point method LINEBREAK i bi)/ LINEBREAK b(cid:62) i LINEBREAK det ˆqi. LINEBREAK b(cid:62) i LINEBREAK i bi. LINEBREAK next, we carry out the integral (s.47 ) by the saddle-point method. assume the replica symmetry: r = c aa, ˆr = ˆc aa, LINEBREAK c = c a(cid:54)=b, ˆc = ˆc a(cid:54)=b. LINEBREAK µ = µa, ˆµ = ˆµa, LINEBREAK the following three terms are the same as in the previous works: (cid:19) LINEBREAK (r − c) LINEBREAK c LINEBREAK c LINEBREAK det LINEBREAK i + LINEBREAK i + LINEBREAK λ (r − c) LINEBREAK ˆc ab(c ab − σab) = n LINEBREAK βc λ + β (r − c) LINEBREAK i − LINEBREAK βc λ + β (r − c) + nβc LINEBREAK a≥b LINEBREAK where 11(cid:62) denotes a matrix whose all entries are 1. regarding the leading term of order n (n → 0), LINEBREAK = n log LINEBREAK (r − c) LINEBREAK + n LINEBREAK βc λ + β (r − c) LINEBREAK log det LINEBREAK i + LINEBREAK i + LINEBREAK c LINEBREAK c LINEBREAK nµ2 λ (r − c) LINEBREAK furthermore. we have LINEBREAK ˆqi = (1 − φijn − LINEBREAK ηin β LINEBREAK (2ˆr − ˆc))in − LINEBREAK ηin ˆc β LINEBREAK after straightforward algebra, the leading terms become LINEBREAK with LINEBREAK log det ˆqi = n ln gi − n LINEBREAK n gi LINEBREAK ηin ˆc giβ LINEBREAK gi := 1 − φijn − LINEBREAK ηin β LINEBREAK substituting these leading terms into (s.45 ), we obtain (cid:104)z n(cid:105)d = c (cid:82) dθ exp(−nn s(θ)) with LINEBREAK s(θ) = − LINEBREAK ( ¯w − u)(cid:62)φ( ¯w − u) LINEBREAK log β (r − c) + LINEBREAK c + µ2 r − c LINEBREAK (ln gi − ( LINEBREAK i )/gi) − LINEBREAK where θ denotes a set of variables {r, ˆr, c, ˆc, µ, ˆµ}. here, we take n (cid:29) 1 and use the saddle-point method. we calculate saddle-point equations ∂s(θ∗)/∂θ = 0 and obtain LINEBREAK ηin ˆc β LINEBREAK ηin ˆc β LINEBREAK ˆr = LINEBREAK ˆc = LINEBREAK r = LINEBREAK c = LINEBREAK ηi g2 i β ηi g2 i β LINEBREAK ηi gi LINEBREAK from (s.70 ) and (s.71 ), we also have LINEBREAK r − c = − LINEBREAK β(r − c) = LINEBREAK ηi gi LINEBREAK substituting (s.64 ) and (s.72 ) into (s.73 ), we obtain the implicit function for κ: LINEBREAK ηi w (φi) LINEBREAK , w (φi) := κ(1 − φijn ) + ηin. LINEBREAK using κ and w , the saddle-point equations become LINEBREAK ˆr = LINEBREAK ˆc = LINEBREAK r = c + LINEBREAK substituting back these quantities into (s.65 ), we obtain LINEBREAK s(θ∗) = − LINEBREAK ( ¯w − u)(cid:62)φ( ¯w − u) + LINEBREAK ln κ + LINEBREAK ln gi − LINEBREAK ¯k2 i gi LINEBREAK σ2 + const. LINEBREAK recall (cid:104)z n(cid:105)d ≈ exp(−nn s(θ∗)). we have LINEBREAK generalization error LINEBREAK we evaluate LINEBREAK 2 βn note that w, g, κ and ¯k depend on j. at the point of j = 0, LINEBREAK e = lim β→∞ LINEBREAK ∂ ∂j LINEBREAK = − lim β→∞ LINEBREAK ∂ ∂j LINEBREAK ∂w (φi) ∂j LINEBREAK = −φin κ + LINEBREAK ∂κ ∂j LINEBREAK ∂gi ∂j LINEBREAK ∂κ ∂j LINEBREAK ∂¯ki ∂j LINEBREAK = −(φi + LINEBREAK ηi)n, LINEBREAK ∂κ ∂j LINEBREAK = −n φi( ¯wi − ui). LINEBREAK substituting (s.83 -s.86 ) into (s.82 ), we obtain LINEBREAK e = LINEBREAK ( ¯wi − ui)2 − 2 ¯wi( ¯wi − ui)qi + LINEBREAK i + LINEBREAK where ξ0 is LINEBREAK i LINEBREAK i φi LINEBREAK with w0 = κ + n η0. when η0 = 0, we have ξ0 = 0. note that the additional term ξ0 is not specific to our case but also appeared in the previous work (canatar et al., 2021). we have ξ0 = o(1/η0) for a large η0 and ξ0 is often negligibly small. LINEBREAK a.3 equations for understanding negative transfer LINEBREAK a.3.1 derivation of equation 15 LINEBREAK first, let us evaluate the term including qa,i = κa/(κa + naηi). note that κa is a monotonically decreasing function of na because LINEBREAK ∂κa ∂na LINEBREAK i LINEBREAK ηi (κa + naηi)2 LINEBREAK i LINEBREAK which comes from the implicit function theorem. let us write κa at a finite na = c as κa(c). we then have LINEBREAK qa,i ≤ LINEBREAK κa(c) naηi LINEBREAK for na > c. next, we evaluate LINEBREAK i LINEBREAK qa,ieb,i + LINEBREAK i LINEBREAK eb,i. LINEBREAK the second term is negligibly small for a sufficiently large na > c because LINEBREAK i LINEBREAK qa,ieb,i ≤ LINEBREAK ηiq2 b,i 1 − γb LINEBREAK κa(c) na LINEBREAK κa(c) na i i=0 ηi/(κ + ηin )2. the third term is γa 1 − γa LINEBREAK ea 1 − γb LINEBREAK eb,i ≤ LINEBREAK κb. LINEBREAK κ2 a na LINEBREAK it decreases to zero as na increases. thus, we have ea→b(ρ) ∼ LINEBREAK note that we have 1 − γ = κ (cid:80) q2 a,i 1 − γa LINEBREAK i where we used qb,i ≤ 1. 2(1 − ρ)eb. LINEBREAK a.3.2 derivation of equation 19 LINEBREAK ea→b(1) eb LINEBREAK b,iη2 i LINEBREAK a,iq2 i q2 LINEBREAK b,iη2 i LINEBREAK i na LINEBREAK κa i q2 LINEBREAK where the second line comes from jensen’s inequality. using (s.90 ), we have LINEBREAK i ≤ LINEBREAK i LINEBREAK ηi, LINEBREAK i LINEBREAK for nb ≥ c. since we assumed the finite trance of ntk (i.e., (cid:80) (s.96 ) is finite and converges to zero for a sufficiently large nb. therefore, we have LINEBREAK i ηi < ∞), the left-hand side of LINEBREAK in contrast, ea→b/eb ≤ 1/(1 − γa) since qa ≤ 1. thus, the ratio is sandwiched by 1/(1 − γa). LINEBREAK ea→b(1) eb LINEBREAK a.3.3 sufficient condition for the negative transfer LINEBREAK let us denote the i-th mode of ea→b as ea→b,i and that of eb as eb,i. from ea→b,i > eb,i, we have LINEBREAK where f (q) is a quadratic function and takes the minimum at q∗ = (1 − ρ)(1 − γ). the condition f (q) > 0 holds if and only if LINEBREAK solving this, we find ρ < LINEBREAK a.4 proof of proposition 3. LINEBREAK for na = nb, we have qa,i = qb,i = qi. then, LINEBREAK and the generalization error of single-task training is given by LINEBREAK ea→b(1) = LINEBREAK i LINEBREAK e = LINEBREAK i LINEBREAK model average is obtained in section d and we have eave = (1 − γ/2)e < e because 0 < γ < 1. thus, we only need to evaluate the relation between eave and ea→b: γ (cid:88) 2 LINEBREAK eave − ea→b = (1 − LINEBREAK i − LINEBREAK where we defined LINEBREAK i LINEBREAK i LINEBREAK i LINEBREAK i LINEBREAK i (2 − n ai) − LINEBREAK i LINEBREAK ai := LINEBREAK ηi κ + ηin LINEBREAK and used qi = 1 − ain and γ = n (cid:80) cubic function: LINEBREAK i . we can provide a lower bound of f by using the following LINEBREAK g(ai) := n 2a2 LINEBREAK i (2 − n ai). LINEBREAK we have 0 ≤ ai ≤ 1/n by definition. let us consider a lower bound of g by using its tangent line at ai = t/n (0 ≤ t ≤ 1), that is, n t(4 − 3t)ai − 2t2(1 − t). define LINEBREAK h(ai) := g(ai) − (n t(4 − 3t)ai − 2t2(1 − t)). we have h(0) = 2t2(1 − t) ≥ 0. since h(1/n ) = −2(t − 1)2(t − 1/2), we need t ≤ 1/2 to guarantee h(ai) ≥ 0 for all 0 ≤ ai ≤ 1/n . here, note that h is a cubic function of ai and has two fixed points ai = t/n and (4 − 3t)/(3n ). we can see that for t ≤ 1/2, h has the local minimum at ai = t/n and LINEBREAK (s.106) therefore, we have h(ai) ≥ 0 for all 0 ≤ ai ≤ 1/n when the fixed constant t satisfies t ≤ 1/2. thus, we have the lower bound of g: LINEBREAK using this lower bound, we have LINEBREAK f = LINEBREAK i LINEBREAK aig(ai) − LINEBREAK where we used γ = n (cid:80) LINEBREAK i ai = 1. by setting t = γ/2, we obtain LINEBREAK f ≥ LINEBREAK therefore, we have eave > ea→b. LINEBREAK a.5 multiple descent LINEBREAK figure 5: theoretical values of ea→b(1). (left) noise-less case (σ2 = 0), (right) noisy case (σ2 = 10−5). we set d = 100 and other settings are the same as in figure 1. in noise-less case, generalization error monotonically decrease as na or nb increases. in contrast, when noise is added, it shows multiple descents. LINEBREAK we overview the multiple descent of e1 investigated in canatar et al. (2021). it appears for σ > 0. let us set nb = αdl (α > 0, l ∈ n, d (cid:29) 1), which is called the l-th learning stage. we have eb,i = 0 (i < l), eb,l(α) and η2 i (i > l). eb,l(α) is a function of α, and becomes a one-peak curve depending on the noise and the decay of kernel’s eigenvalue spectrum. because each learning stage has a one-peak curve, the whole learning curve shows multiple descents as the sample size increases. roughly speaking, the appearance of the multiple descent is controlled by γ. the γ is determined by the kernel’s spectrum and sample size n . for example, previous studies showed that if we assume the l-th learning stage, γ is a non-monotonic function of α, the maximum of which is γ = 1/( k>l ¯ηk/¯ηl, where ¯η is a normalized eigenvalue of the kernel (canatar et al., 2021). this tells us that γ repeats the increase and decrease depending on the increase of the learning stage as is shown in figure 4. roughly speaking, this non-monotonic change of γ leads to the multiple descent. LINEBREAK figure 4: typical behaviors of κ and γ. LINEBREAK (cid:112)¯λl + 1)2 for a constant ¯λl = (cid:80) LINEBREAK in sequential training, eb,l(α) can similarly cause multiple descent as in single tasks because ea→b is a weighted summation over eb,i. figure 5 is an example in which noise causes multiple decreases and increases depending on the sample sizes. we set ρ = 1 and obtained the theoretical values by (s.22 ). while ea→b(1) is a symmetric function of indices a and b for σ = 0, it is not for σ > 0. depending on na and nb, the learning “surface” becomes much more complicated than the learning curve of a single task. LINEBREAK a.6 additional experiment on backward transfer LINEBREAK figure 6 shows the learning curves of backward transfer. solid lines show theory, and markers show the mean and interquartile range of ntk regression over 100 trials. the figure shows excellent agreement between theory and experiments. as is shown in section 4.1, subtle target dissimilarity (ρ < 1) causes negative backward transfer (i.e., catastrophic forgetting). for a large na, eback a→b(ρ < 1) approaches a non-zero constant while ea approaches zero. thus, we have eback a→b > ea even for the target similarity close to 1. when sample sizes are unbalanced (na (cid:29) nb), the learning curve shows negative transfer even for ρ = 1. this is the self-knowledge forgetting revealed in (20). the ratio eback LINEBREAK a→b(1)/ea takes a constant larger than 1, that is, 1/(1 − γb). LINEBREAK figure 6: negative backward transfer easily appears depending on target similarity and sample sizes. we changed na and set nb = 102. we set d = 20 and other experimental details are the same as in figure 1(b). LINEBREAK b proof of theorem 4. LINEBREAK b.1 learning curve of many tasks LINEBREAK eq. (4) is written as LINEBREAK fn(x) = LINEBREAK θ(x, xk)θ(xk)−1(yk − fk−1(xk)). LINEBREAK each term of this summation is equivalent to the kernel ridge-less regression on input samples xk and labels yk − fk−1(xk). therefore, we can represent fn by LINEBREAK fn(x) = LINEBREAK k ψ(x) LINEBREAK k=1 with the minimization of the objective function h: LINEBREAK w∗ LINEBREAK n = lim λ→0 LINEBREAK argminwn h(wn, w∗ LINEBREAK h(wn, w∗ LINEBREAK nn(cid:88) LINEBREAK nn(cid:88) LINEBREAK the generalization error is LINEBREAK n ψ(xµ) − (yµ LINEBREAK n − LINEBREAK k ψ(xµ)) LINEBREAK (wn − ( ¯w − LINEBREAK w∗ LINEBREAK k))(cid:62)ψ(xµ) − εµ n LINEBREAK dxp(x)( ¯f (x) − fn+1(x))2 LINEBREAK d LINEBREAK dxp(x)((w∗ LINEBREAK w∗ LINEBREAK d LINEBREAK where d = {d1, ..., dn}. LINEBREAK since the data samples are independent of each other among different tasks, we can apply lemma 2 sequentially from wn+1 to w1. first, we take the average over the (n + 1)-th task, that is, LINEBREAK dxp(x)((w∗ LINEBREAK w∗ LINEBREAK this corresponds to lemma 2 with φ = η and u = ¯wa = ¯w − (cid:80)n LINEBREAK k. we have LINEBREAK with LINEBREAK φ1,i( ¯wi − LINEBREAK w∗ LINEBREAK here, κn, γn and qn,k are determined by nn. next, we take the average over the n-th task: LINEBREAK (cid:11) dn,εn LINEBREAK i LINEBREAK n,i − ( ¯wi − LINEBREAK w∗ LINEBREAK dn LINEBREAK this corresponds to lemma 2 with φ = φ1 and u = ¯wa = ¯w − (cid:80)n−1 LINEBREAK k. we obtain LINEBREAK with LINEBREAK w∗ LINEBREAK n,i + LINEBREAK ηiq2 n,i LINEBREAK j LINEBREAK n,j, LINEBREAK j LINEBREAK n,j. LINEBREAK similarly, we can take the averages from the (n − 1)-th task to the first task, and obtain LINEBREAK φm+1,i = φm,iq2 LINEBREAK n−m+1,i + LINEBREAK n−m+1,i LINEBREAK j LINEBREAK ηjφm,jq2 LINEBREAK n−m+1,j LINEBREAK for m = 1, ..., n, and LINEBREAK j LINEBREAK ηjφm,jq2 LINEBREAK n−m+1,j. LINEBREAK they are general results for any nn. by setting nn = n for all n, we can obtain a simpler formulation. in a vector representation, φn+1 is explicitly written as LINEBREAK (cid:20) diag(q2) + LINEBREAK ˜q. LINEBREAK finally, by taking the average over ¯wi ∼ n (0, ηi) which is the one-dimensional case of (s.20 ), we have LINEBREAK (cid:20) diag(q2) + LINEBREAK with LINEBREAK (cid:20) diag(q2) + LINEBREAK ˜q + LINEBREAK b.2 monotonic decrease of en LINEBREAK for σ2 = 0, we have
| 24
|
[
108,
677.5010784,
190.5130394,
688.8888828
] |
H0oaWl6THa.pdf
| 2,022
| 0
|
LINEBREAK hybrid local sgd for federated learning with heterogeneous communications LINEBREAK yuanxiong guo the university of texas at san antonio san antonio, texas 78249 usa [email protected] LINEBREAK ying sun pennsylvania state university state college, pa 16801 usa [email protected] LINEBREAK rui hu & yanmin gong the university of texas at san antonio san antonio, texas 78249 usa {rui.hu@my.,yanmin.gong@}utsa.edu LINEBREAK abstract LINEBREAK communication is a key bottleneck in federated learning where a large number of edge devices collaboratively learn a model under the orchestration of a central server without sharing their own training data. while local sgd has been proposed to reduce the number of fl rounds and become the algorithm of choice for fl, its total communication cost is still prohibitive when each device needs to communicate with the remote server repeatedly for many times over bandwidthlimited networks. in light of both device-to-device (d2d) and device-to-server (d2s) cooperation opportunities in modern communication networks, this paper proposes a new federated optimization algorithm dubbed hybrid local sgd (hlsgd) in fl settings where devices are grouped into a set of disjoint clusters with high d2d communication bandwidth. hl-sgd subsumes previous proposed algorithms such as local sgd and gossip sgd and enables us to strike the best balance between model accuracy and runtime. we analyze the convergence of hl-sgd in the presence of heterogeneous data for general nonconvex settings. we also perform extensive experiments and show that the use of hybrid model aggregation via d2d and d2s communications in hl-sgd can largely speed up the training time of federated learning. LINEBREAK introduction LINEBREAK federated learning (fl) is a distributed machine learning paradigm in which multiple edge devices or clients cooperate to learn a machine learning model under the orchestration of a central server, and enables a wide range of applications such as autonomous driving, extended reality, and smart manufacturing (kairouz et al., 2021). communication is a critical bottleneck in fl as the clients are typically connected to the central server over bandwidth-limited networks. standard optimization methods such as distributed sgd are often not suitable in fl and can cause high communication costs due to the frequent exchange of large-size model parameters or gradients. to tackle this issue, local sgd, in which clients update their models by running multiple sgd iterations on their local datasets before communicating with the server, has emerged as the de facto optimization method in fl and can largely reduce the number of communication rounds required to train a model (mcmahan et al., 2017; stich, 2019). LINEBREAK however, the communication benefit of local sgd is highly sensitive to non-iid data distribution as observed in prior work (rothchild et al., 2020; karimireddy et al., 2020). intuitively, taking many local iterations of sgd on local dataset that is not representative of the overall data distribution will lead to local over-fitting, which will hinder convergence. in particular, it is shown in (zhao et al., 2018) that the convergence of local sgd on non-iid data could slow down as much as proportionally to the number of local iteration steps taken. therefore, local sgd with a large aggregation period LINEBREAK can converge very slow on non-iid data distribution, and this may nullify its communication benefit (rothchild et al., 2020). LINEBREAK local sgd assumes a star network topology where each device connects to the central server for model aggregation. in modern communication networks, rather than only communicating with the server over slow communication links, devices are increasingly connected to others over fast communication links. for instance, in 5g-and-beyond mobile networks, mobile devices can directly communicate with their nearby devices via device-to-device links of high data rate (asadi et al., 2014; yu et al., 2020). also, edge devices within the same local-area network (lan) domain can communicate with each other rapidly without traversing through slow wide-area network (wan) (yuan et al., 2020). this gives the potential to accelerate the fl convergence under non-iid data distribution by leveraging fast d2d cooperation so that the total training time can be reduced in fl over bandwidth-limited networks. LINEBREAK motivated by the above observation, this paper proposes hybrid local sgd (hl-sgd), a new distributed learning algorithm for fl with heterogeneous communications, to speed up the learning process and reduce the training time. hl-sgd extends local sgd with fast gossip-style d2d communication after local iterations to mitigate the local over-fitting issue under non-iid data distribution and accelerate convergence. a hybrid model aggregation scheme is designed in hl-sgd to integrate both fast device-to-device (d2d) and slow device-to-server (d2s) cooperations. we analyze the convergence of hl-sgd in the presence of heterogeneous data for general nonconvex settings, and characterize the relationship between the optimality error bound and algorithm parameters. our algorithm and analysis are general enough and subsume previously proposed sgd variations such as distributed sgd, local sgd and gossip sgd. LINEBREAK specifically, we consider the fl setting in which all devices are partitioned into disjoint clusters, each of which includes a group of connected devices capable of communicating with each other using fast d2d links. the clustering can be a natural result of devices belonging to different lan domains so that those devices connected to the same lan domain are considered as one cluster. in another example, clustering is based on the geographic locations of mobile devices so that devices in a cluster are connected to each other through d2d communication links. LINEBREAK in summary, the paper makes the following main contributions: LINEBREAK • we propose a novel distributed learning algorithm for fl called hl-sgd to address the communication challenge of fl over bandwidth-limited networks by leveraging the availability of fast d2d links to accelerate convergence under non-iid data distribution and reduce training time. LINEBREAK • we provide the convergence analysis of hl-sgd under general assumptions about the loss function, data distribution, and network topology, generalizing previous results on distributed sgd, local sgd, and gossip sgd. LINEBREAK • we conduct extensive empirical experiments on two common benchmarks under realistic network settings to validate the established theoretical results of hl-sgd. our experimental results show that hl-sgd can largely accelerate the learning process and speed up the runtime. LINEBREAK background and related work LINEBREAK large-scale machine learning based on distributed sgd has been well studied in the past decade, but often suffers from large network delays and bandwidth limits (bottou et al., 2018). considering that communication is a major bottleneck in federated settings, local sgd has been proposed recently to reduce the communication frequency by running sgd independently in parallel on different devices and averaging the sequences only once in a while (stich, 2019; lin et al., 2019; haddadpour et al., 2019; yu et al., 2019; wang et al., 2021). however, they all assume the client-server architecture and do not leverage the fast d2d communication capability in modern communication networks. some studies (liu et al., 2020; abad et al., 2020; castiglia et al., 2021) develop hierarchical fl algorithms that first aggregate client models at local edge servers before aggregating them at the cloud server or with neighboring edge servers, but they still rely on d2s communication links only and suffer from the scalability and fault-tolerance issues of centralized setting. on the other hand, while existing works on decentralized or gossip sgd consider d2d communications (tsitsiklis, 1984; boyd et al., 2006), they assume a connected cluster with homogeneous communication links and will converge LINEBREAK very slow on the large and sparse network topology that is typically found in fl settings. unlike previous works, hl-sgd leverages both d2s and d2d communications in the system. LINEBREAK some recent studies aim to encapsulate variants of sgd under a unified framework. specifically, a cooperative sgd framework is introduced in (wang & joshi, 2021) that includes communication reduction through local sgd steps and decentralized mixing between clients under iid data distribution. a general framework for topology-changing gossip sgd under both iid and non-iid data distributions is proposed in (koloskova et al., 2020). note that all of the above works assume undirected network topology for communications in every iteration. in comparison, our proposed hl-sgd is different: the d2s communication is asymmetric due to the use of device sampling and model broadcasting in each global aggregation round and cannot be modeled in an undirected graph. therefore, the convergence analysis of hl-sgd does not fit into the prior frameworks and is much more challenging. moreover, our major focus is on the runtime of the algorithm rather than its convergence speed in iterations. LINEBREAK system model LINEBREAK in this section, we introduce the fl system model, problem formulation, and assumptions we made. LINEBREAK notation. all vectors in this paper are column vectors by default. for convenience, we use 1 to denote the all-ones vector of appropriate dimension, 0 to denote the all-zeros vector of appropriate dimension, and [n] to denote the set of integers {1, 2, . . . , n} with any positive integer n. let (cid:107)·(cid:107) denote the (cid:96)2 vector norm and frobenius matrix norm and (cid:107)·(cid:107)2 denote the spectral norm of a matrix. we consider a fl system consisting of a central server and k disjoint clusters of edge devices. devices in each cluster k ∈ [k] can communicate with others across an undirected and connected graph gk = (v, ek), where vk denotes the set of edge devices in the cluster, and edge (i, j) ∈ ek denotes that the pair of devices i, j ∈ vk can communicate directly using d2d as determined by the communication range of d2d links. besides, each device can directly communicate with the central server using d2s links. denote the set of all devices in the system as v := (cid:83) k∈[k] vk, the number of devices in each cluster k ∈ [k] as n := |vk|, and the total number of devices in the system as n := (cid:80) LINEBREAK k∈[k] n 1. LINEBREAK the fl goal of the system is to solve an optimization problem of the form: LINEBREAK min x∈rd LINEBREAK f (x) := LINEBREAK i∈v LINEBREAK fi(x) := LINEBREAK ¯fk(x), LINEBREAK k∈[k] LINEBREAK := ez∼di[(cid:96)i(x; z)] LINEBREAK := where fi(x) (1/n) (cid:80) fi(x) is the local objective function of cluster k, and di is the data distribution of device i. here (cid:96)i is the (non-convex) loss function defined by the learning model and z represents a data sample from data distribution di. LINEBREAK is the local objective function of device i, ¯fk(x) LINEBREAK i∈vk LINEBREAK when applying local sgd to (1) in fl with heterogeneous communications, the communications between the server and devices in fl are all through d2s links that are bandwidth-limited, particularly for the uplink transmissions. therefore, the incurred communication delay is high. due to the existing of high-bandwidth d2d links that are much more efficient than low-bandwidth d2s links, it would be highly beneficial if we can leverage d2d links to reduce the usage of d2s links such that the total training time can be reduced. this motivates us to design a new learning algorithm for fl with heterogeneous communications. LINEBREAK hybrid local sgd LINEBREAK in this section, we present our hl-sgd algorithm suitable for the fl setting with heterogeneous communications. algorithm 1 provides pseudo-code for our algorithm. LINEBREAK at the beginning of r-th global communication round, the server broadcasts the current global model xr to all devices in the system via cellular links (line 4). note that in typical fl systems, the down LINEBREAK 1for presentation simplicity, we assume each cluster contains the same number of devices here. the results LINEBREAK of this paper can be extended to the case of clusters with different device numbers as well. LINEBREAK algorithm 1 hl-sgd: hybrid local sgd input: initial global model x0, learning rate η, communication graph gk and mixing matrix wk for all clusters k ∈ [k], and fraction of sampled devices in each cluster p. output: final global model xr 1: for each round r = 0, . . . , r − 1 do 2: 3: 4: 5: 6: LINEBREAK xr,0 i = xr for s = 0, . . . , τ − 1 do LINEBREAK for each device i ∈ vk in parallel do LINEBREAK for each cluster k ∈ [k] in parallel do LINEBREAK compute a stochastic gradient gi over a mini-batch ξi sampled from di xr,s+ 1 i xr,s+1 i LINEBREAK i − ηgi(xr,s i ) (wk)i,jxr,s+ 1 LINEBREAK = xr,s = (cid:80) LINEBREAK j LINEBREAK j∈n k i LINEBREAK (cid:46) local update LINEBREAK (cid:46) gossip averaging LINEBREAK end for LINEBREAK end for LINEBREAK end for for each cluster k ∈ [k] do m ← max(p · n, 1) sr end for xr+1 = 1 k LINEBREAK k∈[k] LINEBREAK xr,τ i LINEBREAK i∈sr k LINEBREAK k ← (random set of m clients in vk) LINEBREAK (cid:46) device sampling LINEBREAK (cid:46) global aggregation LINEBREAK link communication is much more efficient than uplink communication due to the larger bandwidth allocation and higher data rate. therefore, devices only consume a smaller amount of energy when receiving data from the server compared with transmitting data to the server. LINEBREAK i LINEBREAK after that, devices in each cluster initialize their local models to be the received global model and run τ iterations of gossip-based sgd via d2d links to update their local models in parallel (lines 5– 9). let xr,s denote the local model of device i at the r-th local iteration of s-th round. here each gossip-based sgd iteration consists of two steps: (i) sgd update, performed locally on each device (lines 6–7), followed by a (ii) gossip averaging, where devices average their models with their neighbors (line 8). in the gossip averaging protocol, n k i denotes the neighbors of device i, including itself, on the d2d communication graph gk of cluster k, and wk ∈ [0, 1]n×n denotes the mixing matrix of cluster k with each element (wk)i,j being the weight assigned by device i to device j. note that (wk)i,j > 0 only if devices i and j are directly connected via d2d links. next, a set sr k of m devices are sampled uniformly at random (u.a.r.) with probability p without replacement from each cluster k ∈ [k] by the server (lines 13–14), and their final updated local models {xr,τ k} are sent to the server via d2s links. after that, the server updates the global model xr+1 by averaging the received local models from all sampled devices (line 16). note that only m devices per cluster will upload their models to the server in each round to save the usage of expensive d2s uplink transmissions. the intuition is that after multiple iterations of gossip-based sgd, devices have already reached approximate consensus within each cluster, and the sampled average can well represent the true average. by trading d2d local aggregation for d2s global aggregation, the total communication cost can be reduced. we will empirically validate such benefits later in the experiments. LINEBREAK , ∀i ∈ sr LINEBREAK i LINEBREAK it is worth noting that hl-sgd inherits the privacy benefits of classic fl schemes by keeping the raw data on device and sharing only model parameters. moreover, hl-sgd is compatible with existing privacy-preserving techniques in fl such as secure aggregation (bonawitz et al., 2017; guo & gong, 2018), differential privacy (mcmahan et al., 2018; hu et al., 2020; 2021), and shuffling (girgis et al., 2021) since only the sum rather than individual values is needed for the local and global model aggregation steps. LINEBREAK runtime analysis of hl-sgd. we now present a runtime analysis of hl-sgd. here we ignore the communication time of downloading models from the server by each device since the download bandwidth is often much larger than upload bandwidth for the d2s communication in practice (?). in each round of hl-sgd, we denote the average time taken by a device to compute a local update, LINEBREAK perform one round of d2d communication and one round of d2s communication as ccp, cd2d and cd2s, respectively. assume the uplink bandwidth between the server and devices is fixed and evenly shared among the sampled devices in each round, then cd2s is linearly proportional to the sampling ratio p. similarly, ccp depends on the d2d network topology gk and typically increases with the maximum node degree ∆(gk). the total runtime of hl-sgd after r communication rounds is LINEBREAK r × [τ × (ccp + cd2d) + cd2s] . LINEBREAK the specific values of ccp, cd2d and cd2s depend on the system configurations and applications. in comparison, the total runtime of local sgd after r communication rounds is r × [τ × ccp + cd2s]. LINEBREAK previous algorithms as special cases. when devices do not communicate with each other, i.e., wk = i, ∀k ∈ [k], and sampling ratio p = 1, hl-sgd reduces to distributed sgd (when τ = 1) or local sgd (when τ > 1) where each device only directly communicates with the server with d2s links. also, when τ → ∞, hl-sgd reduces to gossip sgd where devices only cooperate with their neighboring devices through a gossip-based communication protocol with d2d links to update their models without relying on the server. therefore, hl-sgd subsumes existing algorithms and enables us to strike the best balance between runtime and model accuracy by tuning τ , wk, and p. however, due to the generality of hl-sgd, there exist significantly new challenges in its convergence analysis, which constitutes one of the main contributions of this paper as elaborated in the following section. LINEBREAK convergence analysis of hl-sgd LINEBREAK in this section, we analyze the convergence of hl-sgd with respect to the gradient norm of the objective function f (·), specifically highlighting the effects of τ and p. before stating our results, we make the following assumptions: assumption 1 (smoothness). each local objective function fi : rd → r is l-smooth for all i ∈ v, i.e., for all x, y ∈ rd, LINEBREAK ∀i ∈ v. LINEBREAK assumption 2 (unbiased gradient and bounded variance). the local mini-batch stochastic gradient in algorithm 1 is unbiased, i.e., eξi[gi(x)] = ∇fi(x), and has bounded variance, i.e., eξi(cid:107)gi(x) − ∇fi(x)(cid:107)2 ≤ σ2, ∀x ∈ rd, i ∈ v, where the expectation is over all the local minibatches. LINEBREAK assumption 3 (mixing matrix). for any cluster k ∈ [k], the d2d network is strongly connected and the mixing matrix wk ∈ [0, 1]n×n satisfies wk1 = 1, 1(cid:62)wk = 1(cid:62), null(i − wk) = span(1). we also assume ||wk − (1/n)11(cid:62)||2 ≤ ρk for some ρk ∈ [0, 1). assumption 4 (bounded intra-cluster dissimilarity). there exists a constant (cid:15)k ≥ 0 such that (1/n) (cid:80) k for any x ∈ rd and k ∈ [k]. if local functions are identical to each other within a cluster, then we have (cid:15)k = 0. assumption 5 (bounded inter-cluster dissimilarity). there exist constants α ≥ 1, (cid:15) ≥ 0 such that (1/k) (cid:80) k∈[k] (cid:107)∇ ¯fk(x)(cid:107)2 ≤ α2 (cid:107)∇f (x)(cid:107)2 + (cid:15)2 g for any x ∈ rd. if local functions are identical to each other across all clusters, then we have α = 1, (cid:15)g = 0. LINEBREAK i∈vk LINEBREAK assumptions 1–3 are standard in the analysis of sgd and decentralized optimization (bottou et al., 2018; koloskova et al., 2019). assumptions 4–5 are commonly used in the federated optimization literature to capture the dissimilarities of local objectives (koloskova et al., 2020; wang et al., 2020). LINEBREAK main results LINEBREAK we now provide the main theoretical results of the paper in theorem 1 and theorem 2. the detailed proofs are provided in the appendices. define the following constants: LINEBREAK ρmax = max k∈[k] LINEBREAK ρk, LINEBREAK dτ,ρ = min LINEBREAK and let LINEBREAK max LINEBREAK theorem 1 (full device participation). let assumptions 1–5 hold, and let l, σ, ¯(cid:15)l, (cid:15)g, dτ,ρ, ρmax, r0, r1, and r2 be as defined therein. if the learning rate η satisfies LINEBREAK η = min LINEBREAK then for any r > 0, the iterates of algorithm 1 with full device participation for hl-sgd satisfy LINEBREAK min r,s LINEBREAK σ n τ r LINEBREAK where ¯xr,s = 1 n LINEBREAK i=1 xr,s LINEBREAK i LINEBREAK l + τ (cid:0) 1 (τ r) LINEBREAK max LINEBREAK in the following, we analyze the iteration complexity of hl-sgd and compare it with those of some classic and state-of-the-art algorithms relevant to our setting in table 1. first, we consider two extreme cases of hl-sgd where ρmax = 0 and ρk = 1, ∀k ∈ [k], and show that our analysis recovers the best known rate of local sgd. LINEBREAK fully connected d2d networks. in this case, ρmax = 0, and each cluster can be viewed as a single device, and thus hl-sgd reduces to local sgd with k devices. substuting ρmax = 0 into (6), /(τ r)2/3 + the iteration complexity of hl-sgd reduces to o(σ/ 1/r). this coincides with the complexity of local sgd provided in table 1 with device number k and stochastic gradient variance σ2/n thanks to the fully intra-cluster averaging. LINEBREAK disconnected d2d networks. substituting ρmax = 1 into (6), the iteration complexity of hl-sgd becomes o(σ/ (cid:0)τ 2((cid:15)2 n devices, stochastic gradient variance σ2, and gradient heterogeneity of order (cid:15)2 LINEBREAK in this case, hl-sgd reduces to local sgd with n devices. n τ r + /(τ r)2/3 + 1/r). this coincides with the complexity of local sgd with LINEBREAK table 1: comparison of iteration complexity. 2 (cid:19) LINEBREAK local sgd LINEBREAK gossip sgd LINEBREAK o LINEBREAK o LINEBREAK gossip pga (chen et al., 2021) o LINEBREAK hl-sgd (this work) LINEBREAK o LINEBREAK n τ r LINEBREAK n τ r LINEBREAK n τ r LINEBREAK n τ r LINEBREAK c LINEBREAK (τ r) LINEBREAK + τ τ r LINEBREAK + c LINEBREAK (τ r) LINEBREAK + ρdτ,ρ(cid:48) τ r LINEBREAK maxdτ,ρ¯(cid:15)2 (τ r) LINEBREAK l) LINEBREAK max)σ2) LINEBREAK + τ τ r LINEBREAK next, we compare the complexities of hl-sgd, local sgd, gossip sgd and gossip pga. LINEBREAK comparison to local sgd. comparing (6) and the complexity of local sgd, we can see the intracluster d2d communication provably improves the iteration complexity by reducing the transient iterations. this is reflected in the smaller coefficient associated with the o((τ r)−2/3) term. in particular, improving d2d communication connectivity will lead to a smaller ρmax and consequently, mitigate the impact of both local data heterogeneity and stochastic noise on the convergence rate. LINEBREAK 1the convergence rates for gossip sgd and local sgd are from (koloskova et al. (2020)). the parameters in the table are given by the following: σ2: stochastic gradient variance; ρ: network connectivity; (cid:15)2: data heterogeneity of order (cid:15)2 LINEBREAK k=0 ρk, dτ,ρ(cid:48) = min{1/(1 − ρ), τ }. note that dτ,ρ (cid:54)= dτ,ρ(cid:48) . LINEBREAK comparison to gossip sgd. under the condition that ρ = ρmax, i.e., the connectivity of d2d network in gossip sgd is the same as that of hl-sgd, table 1 shows hl-sgd outperforms gossip sgd when τ /n ≤ ρ2/(1−ρ). in other words, hl-sgd is beneficial for weakly connected networks, which is the case in fl settings where a large number of devices are often loosely connected or disconnected into several disjoint clusters via d2d communications only. LINEBREAK comparison to gossip pga. gossip pga improves local sgd by integrating gossiping among all devices in one round using a connected network. compared to gossip sgd, gossip pga has one extra full averaging step with period τ . the complexity of gossip pga improves both by reducing the transient iterations. hl-sgd (full participation) differs from gossip pga in the sense that gossiping is performed within multiple clusters instead of a single one. the benefit comes from the fact that for many commonly used d2d network topologies, the spectral gap 1 − ρ decreases as the network size decreases, see table 2. therefore, when employing the same d2d network topology, hl-sgd enjoys a smaller connectivity number ρmax than ρ. considering the scenario where τ and n are fixed while the cluster number k grows, the total device number n = nk grows and hence ρ → 1 for gossip pga. in the case when τ = dτ,ρ(cid:48) ≈ cτ,ρ, the fastest decaying o(1/τ r) terms are comparable for both algorithms. however, the o((τ r)−2/3) term of gossip gpa can be larger than that of hl-sgd since ρ increases with n . this observation shows for large-scale networks, it is advantageous to use hl-sgd with multiple connected clusters instead of gossip gpa with a single cluster under the d2d network topology. LINEBREAK our next result shows the iteration complexity of hl-sgd with partial device participation. we assume the devices participate in synchronizing their models at the end of each fl round following the sampling rule given by assumption 6. assumption 6 (sampling strategy). each sr {1, . . . , n} without replacement. furthermore, sr theorem 2 (partial device participation). let assumptions 1–6 hold, and let l, σ, ¯(cid:15)l, (cid:15)g, dτ,ρ, ρmax, r0, r1, and r2 be as defined therein. if the network connectivity satisfies LINEBREAK k contains a subset of m indices uniformly sampled from LINEBREAK k(cid:48) for all (k, r) (cid:54)= (k(cid:48), r(cid:48)). LINEBREAK k is independent of sr(cid:48) LINEBREAK ρmax ≤ 1 − 1/τ, (7) then for suitably chosen learning rate η, the iterates of algorithm 1 with partial device participation for hl-sgd satisfy e(cid:107)∇f (¯xr,s)(cid:107)2 LINEBREAK =o LINEBREAK σ + e((cid:15)g, ¯(cid:15)l, σ, ρmax) n τ r LINEBREAK where ¯xr,s = 1 n LINEBREAK i=1 xr,s LINEBREAK i LINEBREAK max LINEBREAK (τ r) LINEBREAK max{1, gpdτ,ρρmax} r LINEBREAK gdτ,ρ + ρmaxdτ,ρ¯(cid:15)2 LINEBREAK pdτ,ρρmaxn + LINEBREAK and LINEBREAK gp = LINEBREAK n − m m(n − 1) LINEBREAK p = gp + LINEBREAK n m LINEBREAK compared to theorem 1, theorem 2 shows partial device participation deteriorates the rate n τ r). from the expression of e, we observe that as ρmax → 0, by o(e((cid:15)g, ¯(cid:15)l, σ, ρmax)/ e((cid:15)g, ¯(cid:15)l, σ, ρmax) vanishes, which indicates that the loss caused by device sampling can be compensated by increasing network connectivity uniformly for all clusters. the next corollary finds the critial ρmax so that e 2 = o(1), and the order of convergence rate of partial device participation matches that of the full participation case. corollary 1. under the same assumptions as theorem 2, if the network connectivity satisfies 1 4n LINEBREAK min{m, τ − 1}. LINEBREAK ρmax ≤ LINEBREAK then LINEBREAK min r,s LINEBREAK σ + (cid:15)g + ¯(cid:15)l n τ r LINEBREAK l + τ (cid:0) 1 (τ r) LINEBREAK max LINEBREAK corollary 1 reveals the tradeoff between sampling intensity and network connectivity. more connected d2d networks result in smaller ρmax, and thus (11) can be satisfied by a smaller m. this means we can sample fewer devices at the end of each round and reduce the d2s communication delay when the d2d network is more connected. LINEBREAK experimental evaluation LINEBREAK experimental settings LINEBREAK we use two common datasets in fl literature (mcmahan et al., 2017; reddi et al., 2021; wang et al., 2020): federated extended mnist (caldas et al., 2019) (femnist) and cifar-10 (krizhevsky et al., 2009). the 62-class femnist is built by partitioning the data in extended mnist (cohen et al., 2017) based on the writer of the digit/character and has a naturally-arising device partitioning. cifar-10 is partitioned across all devices using a dirichlet distribution dir(0.1) as done in (hsu et al., 2019; yurochkin et al., 2019; reddi et al., 2021; wang et al., 2020). we evaluate our algorithms by training cnns on both datasets, and the cnn models for femnist and cifar-10 were taken from (caldas et al., 2019) and (mcmahan et al., 2017) with around 6.5 and 1 million parameters, respectively. for each dataset, the original testing set (without partitioning) is used to evaluate the generalization performances of the trained global model. LINEBREAK we consider a fl system consisting of a central server and 32 devices. the devices are evenly divided into four clusters, and each cluster has a ring topology by default, which provides a conservative estimation for the cluster connectivity and convergence speed. in our experiments, the mixing matrix of each cluster wk is set according to the metropolis-hastings weights (nedi´c et al., 2018). according to the real-world measurements in (yuan et al., 2020; yang et al., 2021), we set the average time for a device to perform a local update, a round of d2d communication under ring topology, and a round of d2s communication with one device sampled per cluster to be ccp = 0.01h, cd2d(∆ = 2) = 0.005h and cd2s(p = 1/8) = 0.05h, respectively, in the runtime model (2). for arbitrary device sampling ratio and d2d network topology, we consider a linear-scaling rule (wang et al., 2019) and let cd2d(∆) = (∆/2) × 0.005h and cd2s(p) = 8p × 0.05h. LINEBREAK we compare hl-sgd with local sgd in the experiments. for local sgd, devices will only communicate with the central server periodically. in all experiments, we let the local iteration period τ to be the same for both local sgd and hl-sgd to have a fair comparison. on the femnist dataset, we fix the batch size as 30 and tune the learning rate η from {0.005, 0.01, 0.02, 0.05, 0.08} for each algorithm separately. on the cifar-10 dataset, we fix the batch size as 50 and tune η from {0.01, 0.02, 0.05, 0.08, 0.1} for each algorithm separately. we run each experiment with 3 random seeds and report the average. all experiments in this paper are conducted on a linux server with 4 nvidia rtx 8000 gpus. the algorithms are implemented by pytorch. more details are provided in appendix f. LINEBREAK experimental results LINEBREAK (a) femnist LINEBREAK (b) femnist LINEBREAK (c) cifar-10 LINEBREAK (d) cifar-10 LINEBREAK figure 1: convergence rate and runtime comparisons of hl-sgd and local sgd under ring topology when τ = 50 and p = 1 for femnist and cifar-10 datasets. (a) and (c) show how the accuracy changes over communication round; (b) and (d) show how the accuracy changes over runtime. we first compare the convergence speed and runtime of hl-sgd and local sgd while fixing τ = 50 and p = 1. we measure the best test accuracy of the global model on the server in every fl round. figure 1 shows the convergence process. from the figure, we can observe that hl-sgd can largely accelerate the model convergence while improving model accuracy in fl. on femnist, the best accuracy of hl-sgd achieved over 100 rounds is 4.78% higher than that of local sgd (i.e., 83.76% LINEBREAK vs. 79.94%), and its runtime necessary to achieve a target test accuracy of 75% is only 17.64% of that of the baseline (i.e., 5.67× speedup). on cifar-10, the best accuracy of hl-sgd achieved over 100 rounds is 9.32% higher than that of local sgd (i.e., 68.71% vs. 63.68%), and its runtime necessary to achieve a target test accuracy of 60% is 15.67% less than that of local sgd (i.e., 1.186× speedup). LINEBREAK figure 2: convergence rate (left) and runtime (right) comparisons of hl-sgd and local sgd on cifar-10 under different τ and ring topology when p = 1. LINEBREAK next, to give a more comprehensive analysis on the runtime benefits of hl-sgd, we vary τ from {5, 10, 20, 50} and compare the performances of hl-sgd and local sgd on cifar-10 in figure 2. from the figure, we can observe that hl-sgd can consistently outperform local sgd across a wide range of τ . in particular, on cifar-10, the best accuracy of hl-sgd achieved over 100 rounds is 2.49%, 3.99%, 4.05%, and 7% higher than that of local sgd, respectively, as τ increases from 5 to 50. at the same time, the runtime of hl-sgd needed to achieve a target test accuracy of 60% is 9.66%, 19.76%, 33.46%, and 45.88% less than that of local sgd, respectively. LINEBREAK (a) femnist LINEBREAK (b) femnist LINEBREAK (c) cifar-10 LINEBREAK (d) cifar-10 LINEBREAK figure 3: effect of sampling ratio p on the convergence rate and runtime of hl-sgd under ring topology when τ = 50 for femnist and cifar-10 datasets. (a) and (c) show how the accuracy changes over communication round in hl-sgd; (b) and (d) show how the accuracy changes over runtime. LINEBREAK finally, we investigate how the sampling ratio p affects the performance of hl-sgd. we select p from {0.125, 0.25, 0.5, 1}, corresponding to sampling {1, 2, 4, 8} devices from each cluster to upload models to the server. figure 3 depicts the best value of test accuracy achieved over all prior rounds. as can be observed from the figures, sampling one device per cluster only results in slightly lower model accuracy, e.g., neligible and 1.92% drop compared to full participation on femnist and cifar-10, respectively. this matches the theoretical result in corollary 1 that device sampling does not affect the order of convergence rate under certain conditions. however, decreasing p can lead to faster training speed due to its shorter d2s communication delay as observed in figures 3b and 3d. in practice, the optimal value of p needs to be tuned to strike a good balance between model accuracy and runtime. LINEBREAK conclusion LINEBREAK in this paper, we have proposed a new optimization algorithm called hl-sgd for fl with heterogeneous communications. our algorithm leverages the d2d communication capabilities among edge device to accelerate the model convergence while improving model accuracy in fl. we have provided the theoretical convergence analysis of hl-sgd and conducted experiments to demonstrate the benefits of hl-sgd. in the future, we plan to extend hl-sgd to handle straggler issues under device heterogeneity and provide rigorous privacy protection for hl-sgd. LINEBREAK acknowledgments LINEBREAK the work of y. guo was supported in part by nsf under the grant cns-2106761. the work of y. sun was partially supported by the office of naval research under the grant n00014-21-1-2673. the work of r. hu and y. gong was supported in part by nsf under the grants cns-2047761 and cns-2106761. LINEBREAK references LINEBREAK mehdi salehi heydar abad, emre ozfatura, deniz gunduz, and ozgur ercetin. hierarchical fedin ieee international conference on LINEBREAK erated learning across heterogeneous cellular networks. acoustics, speech and signal processing (icassp), pp. 8866–8870. ieee, 2020. LINEBREAK arash asadi, qing wang, and vincenzo mancuso. a survey on device-to-device communication in LINEBREAK cellular networks. ieee communications surveys & tutorials, 16(4):1801–1819, 2014. LINEBREAK keith bonawitz, vladimir ivanov, ben kreuter, antonio marcedone, h brendan mcmahan, sarvar patel, daniel ramage, aaron segal, and karn seth. practical secure aggregation for privacypreserving machine learning. in proceedings of the 2017 acm sigsac conference on computer and communications security, pp. 1175–1191, 2017. LINEBREAK l´eon bottou, frank e. curtis, and jorge nocedal. optimization methods for large-scale machine LINEBREAK stephen boyd, arpita ghosh, balaji prabhakar, and devavrat shah. randomized gossip algorithms. LINEBREAK sebastian caldas, sai meher karthik duddu, peter wu, tian li, jakub koneˇcn`y, h brendan mcmahan, virginia smith, and ameet talwalkar. leaf: a benchmark for federated settings. in workshop on federated learning for data privacy and confidentiality, 2019. LINEBREAK timothy castiglia, anirban das, and stacy patterson. multi-level local sgd: distributed sgd for heterogeneous hierarchical networks. in international conference on learning representations, 2021. LINEBREAK yiming chen, kun yuan, yingya zhang, pan pan, yinghui xu, and wotao yin. accelerating gossip in proceedings of the 38th international conference on LINEBREAK sgd with periodic global averaging. machine learning, pp. 1791–1802. pmlr, 2021. LINEBREAK gregory cohen, saeed afshar, jonathan tapson, and andre van schaik. emnist: extending in 2017 international joint conference on neural networks LINEBREAK mnist to handwritten letters. (ijcnn), pp. 2921–2926. ieee, 2017. LINEBREAK antonious girgis, deepesh data, suhas diggavi, peter kairouz, and ananda theertha suresh. shuffled model of differential privacy in federated learning. in international conference on artificial intelligence and statistics, pp. 2521–2529. pmlr, 2021. LINEBREAK yuanxiong guo and yanmin gong. practical collaborative learning for crowdsensing in the internet of things with differential privacy. in 2018 ieee conference on communications and network security (cns), pp. 1–9. ieee, 2018. LINEBREAK farzin haddadpour, mohammad mahdi kamani, mehrdad mahdavi, and viveck cadambe. local in advances in LINEBREAK sgd with periodic averaging: tighter analysis and adaptive synchronization. neural information processing systems, pp. 11082–11094, 2019. LINEBREAK tzu-ming harry hsu, hang qi, and matthew brown. measuring the effects of non-identical data LINEBREAK distribution for federated visual classification. arxiv preprint arxiv:1909.06335, 2019. LINEBREAK rui hu, yuanxiong guo, hongning li, qingqi pei, and yanmin gong. personalized federated learning with differential privacy. ieee internet of things journal, 7(10):9530–9539, 2020. LINEBREAK rui hu, yanmin gong, and yuanxiong guo. federated learning with sparsification-amplified privacy and adaptive optimization. in proceedings of the thirtieth international joint conference on artificial intelligence, ijcai-21, pp. 1463–1469, 2021. LINEBREAK peter kairouz, h brendan mcmahan, brendan avent, aur´elien bellet, mehdi bennis, arjun nitin bhagoji, kallista bonawitz, zachary charles, graham cormode, rachel cummings, et al. advances and open problems in federated learning. foundations and trends® in machine learning, 14(1–2):1–210, 2021. LINEBREAK sai praneeth karimireddy, satyen kale, mehryar mohri, sashank reddi, sebastian stich, and ananda theertha suresh. scaffold: stochastic controlled averaging for federated learning. in international conference on machine learning, pp. 5132–5143. pmlr, 2020. LINEBREAK anastasia koloskova, sebastian stich, and martin jaggi. decentralized stochastic optimization and in international conference on machine LINEBREAK gossip algorithms with compressed communication. learning, pp. 3478–3487, 2019. LINEBREAK anastasia koloskova, nicolas loizou, sadra boreiri, martin jaggi, and sebastian stich. a unified theory of decentralized sgd with changing topology and local updates. in international conference on machine learning, pp. 5381–5393. pmlr, 2020. LINEBREAK alex krizhevsky, geoffrey hinton, et al. learning multiple layers of features from tiny images. LINEBREAK tao lin, sebastian u stich, kumar kshitij patel, and martin jaggi. don’t use large mini-batches, LINEBREAK use local sgd. in international conference on learning representations, 2019. LINEBREAK lumin liu, jun zhang, sh song, and khaled b letaief. client-edge-cloud hierarchical federated LINEBREAK learning. in ieee international conference on communications, pp. 1–6. ieee, 2020. LINEBREAK brendan mcmahan, eider moore, daniel ramage, seth hampson, and blaise aguera y arcas. communication-efficient learning of deep networks from decentralized data. in artificial intelligence and statistics, pp. 1273–1282. pmlr, 2017. LINEBREAK h brendan mcmahan, daniel ramage, kunal talwar, and li zhang. learning differentially private recurrent language models. in international conference on learning representations, 2018. LINEBREAK angelia nedi´c, alex olshevsky, and michael g rabbat. network topology and communicationcomputation tradeoffs in decentralized optimization. proceedings of the ieee, 106(5):953–976, 2018. LINEBREAK sashank j. reddi, zachary charles, manzil zaheer, zachary garrett, keith rush, jakub koneˇcn´y, sanjiv kumar, and hugh brendan mcmahan. adaptive federated optimization. in international conference on learning representations, 2021. LINEBREAK daniel rothchild, ashwinee panda, enayat ullah, nikita ivkin, ion stoica, vladimir braverman, joseph gonzalez, and raman arora. fetchsgd: communication-efficient federated learning with sketching. in international conference on machine learning, pp. 8253–8265. pmlr, 2020. LINEBREAK sebastian urban stich. local sgd converges fast and communicates little. in international con LINEBREAK ference on learning representations, 2019. LINEBREAK john nikolas tsitsiklis. problems in decentralized decision making and computation. technical report, massachusetts inst of tech cambridge lab for information and decision systems, 1984. LINEBREAK jianyu wang and gauri joshi. cooperative sgd: a unified framework for the design and analysis of local-update sgd algorithms. journal of machine learning research, 22(213):1–50, 2021. LINEBREAK jianyu wang, anit kumar sahu, zhouyi yang, gauri joshi, and soummya kar. matcha: speeding up decentralized sgd via matching decomposition sampling. in 2019 sixth indian control conference, pp. 299–300. ieee, 2019. LINEBREAK jianyu wang, qinghua liu, hao liang, gauri joshi, and h vincent poor. tackling the objective inconsistency problem in heterogeneous federated optimization. advances in neural information processing systems, 33:7611–7623, 2020. LINEBREAK jianyu wang, zachary charles, zheng xu, gauri joshi, h brendan mcmahan, maruan al-shedivat, galen andrew, salman avestimehr, katharine daly, deepesh data, et al. a field guide to federated optimization. arxiv preprint arxiv:2107.06917, 2021. LINEBREAK chengxu yang, qipeng wang, mengwei xu, zhenpeng chen, kaigui bian, yunxin liu, and xuanzhe liu. characterizing impacts of heterogeneity in federated learning upon large-scale smartphone data. in proceedings of the web conference 2021, pp. 935–946, 2021. LINEBREAK bicheng ying, kun yuan, yiming chen, hanbin hu, pan pan, and wotao yin. exponential graph is provably efficient for decentralized deep training. advances in neural information processing systems, 34, 2021. LINEBREAK hao yu, sen yang, and shenghuo zhu. parallel restarted sgd with faster convergence and less communication: demystifying why model averaging works for deep learning. in proceedings of the aaai conference on artificial intelligence, volume 33, pp. 5693–5700, 2019. LINEBREAK zhe yu, yanmin gong, shimin gong, and yuanxiong guo. LINEBREAK joint task offloading and resource allocation in uav-enabled mobile edge computing. ieee internet of things journal, 7(4):3147– 3159, 2020. LINEBREAK jinliang yuan, mengwei xu, xiao ma, ao zhou, xuanzhe liu, and shangguang wang. hierarchical federated learning through lan-wan orchestration. arxiv preprint arxiv:2010.11612, 2020. LINEBREAK mikhail yurochkin, mayank agarwal, soumya ghosh, kristjan greenewald, nghia hoang, and yasaman khazaeni. bayesian nonparametric federated learning of neural networks. in international conference on machine learning, pp. 7252–7261. pmlr, 2019. LINEBREAK yue zhao, meng li, liangzhen lai, naveen suda, damon civin, and vikas chandra. federated LINEBREAK learning with non-iid data. arxiv preprint arxiv:1806.00582, 2018. LINEBREAK a preliminaries LINEBREAK intra-cluster dynamics. to facilitate the analysis, we introduce matrices xk ∈ rn×d and gk ∈ rn×d constructed by stacking respectively xi and gi for i ∈ vk row-wise. similarly, we define the pseudo-gradient ∇fk(xk) ∈ rn×d associated to cluster k by stacking ∇fi(xi) for i ∈ vk row-wise. in addition, define the following intra-cluster averages for each cluster k: LINEBREAK i∈vk LINEBREAK xi LINEBREAK and LINEBREAK i∈vk LINEBREAK gi. LINEBREAK the update within each cluster then can be written compactly in matrix form as LINEBREAK k − ηgr,s k ), since each wk is bi-stochastic, we obtain the following update of the intra-cluster average LINEBREAK = wk(x r,s LINEBREAK x r,s+1 k LINEBREAK ¯xr,s+1 k LINEBREAK = ¯xr,s LINEBREAK k − η · ¯gr,s k . LINEBREAK we proceed to derive the update of the intra-cluster consensus error. define the averaging matrix LINEBREAK j = LINEBREAK multiplying both sides of (14) from the left by (i −j) leads to the following update of the consensus error: LINEBREAK k LINEBREAK = (i − j)wk(x r,s LINEBREAK k − ηgr,s k ) LINEBREAK = (wk − j)(x r,s = (wk − j)(x r,s LINEBREAK k − ηgr,s k ) k,⊥ − ηgr,s k ). LINEBREAK global average dynamics. define the global average among all xi’s as LINEBREAK xi. LINEBREAK then accordingly to (15) we have the following update of ¯x for all s = 0, . . . , τ − 1: LINEBREAK ¯xr,s+1 = LINEBREAK n¯xr,s+1 k LINEBREAK n (¯xr,s LINEBREAK k − η¯gr,s k ) LINEBREAK (xr,s LINEBREAK i − ηgr,s LINEBREAK i ) = ¯xr,s − η LINEBREAK gr,s i LINEBREAK filtration. let g = [g1; . . . ; gk] ∈ rn ×d be the matrix constructed by stacking all the stochastic gradients. we introduce the following filtration LINEBREAK (cid:1) . LINEBREAK therefore we have xr,0 i ∈ fr,s−1 for 1 ≤ s ≤ τ . for simplicity the conditional expectation e( · |fr,s) is denoted as er,s, and we define the noise in the stochastic gradient as LINEBREAK i = xr ∈ fr for r ≥ 1, and xr,s LINEBREAK ξr,s i LINEBREAK (cid:44) gr,s LINEBREAK i − ∇fi(xr,s i ). LINEBREAK since at the end of round r all nodes are picked with equal probability, the sampling procedure preserves average in expectation: LINEBREAK er,τ −2xr+1 = e(e(xr+1|fr,τ −1)|fr,τ −2) LINEBREAK e LINEBREAK = e LINEBREAK = e LINEBREAK e LINEBREAK xr,τ i LINEBREAK i(i ∈ sr LINEBREAK k)xr,τ LINEBREAK i LINEBREAK i∈sr k LINEBREAK i∈vk LINEBREAK = er,τ −2(¯xr,τ ) LINEBREAK where the last equality holds since p(cid:0)i ∈ sr LINEBREAK k|i ∈ vk LINEBREAK (cid:1) = m n . LINEBREAK b convergence analysis LINEBREAK to prove the convergence we first establish in sec. b.1 that the objective value ef (xr) is descending at each round r, up to some consensus error terms. subsequently, bounds on the error terms are provided in sec. b.2-b.4. based on these results, the proof of convergence of algorithm 1 with full and partial device participation are given in sec. b.5 and b.6, respectively. the proofs of the main propositions are given in sec. c and that of the supporting lemmas are deferred to sec. d. LINEBREAK b.1 objective descent LINEBREAK lemma 1. let {xr,s then the following inequality holds for all r ∈ n+: LINEBREAK i } be the sequence generated by algorithm 1 under assumptions 1-6. if η > 0, LINEBREAK ef (xr+1) LINEBREAK ≤ ef (xr) − LINEBREAK e LINEBREAK ∇fi(xr,s i ) LINEBREAK e LINEBREAK ∇ ¯fk(¯xr,s k ) LINEBREAK e LINEBREAK ∇fi(xr,s LINEBREAK i ) − LINEBREAK e LINEBREAK + e LINEBREAK proof. the proof is a standard application of the descent lemma and the sampling rule applied at iteration τ to obtain xr+1. see appendix d.1. LINEBREAK lemma 1 shows the objective value f (xr) is descending in expectation up to the following error terms: LINEBREAK ∇ ¯fk(¯xr,s k ) LINEBREAK ∇ ¯fk(¯xr,s LINEBREAK k ) − LINEBREAK ∇fi(xr,s i ) LINEBREAK in the sequel, we will show these quantities can be bounded by the optimality gap measured in terms of the gradient norms (cid:107)∇f (¯xr,s)(cid:107)2, (cid:107)(1/k) (cid:80)k LINEBREAK k=1 ∇ ¯fk(¯xr,s LINEBREAK i=1 ∇fi(xr,s LINEBREAK b.2 bounding t1, t2 and t3. LINEBREAK define LINEBREAK ρmax = max LINEBREAK ρk. LINEBREAK therefore it holds 0 ≤ ρmax ≤ 1 by assumption 3. LINEBREAK since each fi is l-smooth by assumption 1, we have ¯fk and f are also l-smooth. using this fact and the convexity of (cid:107) · (cid:107)2 we can bound t1, t2 and t3 as LINEBREAK ∇ ¯fk(¯xr,s LINEBREAK k ) − LINEBREAK l2e(cid:107)¯xr,s − ¯xr,s LINEBREAK k − xr,s LINEBREAK i∈vk LINEBREAK (cid:13) (cid:13)¯xr,s − ¯xr,s l2e (cid:13) LINEBREAK k LINEBREAK ∇ ¯fk(¯xr,s LINEBREAK k ) − LINEBREAK ∇fi(xr,s i ) LINEBREAK i∈vk LINEBREAK k − xr,s LINEBREAK clearly, in order to bound t1,2,3 we first need to bound the inter-cluster consensus error (cid:107)¯xr,s − ¯xr,s k (cid:107) and the intra-cluster consensus error (cid:107)¯xr,s i (cid:107). lemma 2 (inter-cluster consensus error bound). let {xr,s rithm 1 under assumptions 1, 2, 3, and 5. if the learning rate η > 0 satisfies LINEBREAK i } be the sequence generated by algo LINEBREAK k − xr,s LINEBREAK then for all s = 0, . . . , τ − 1 it holds LINEBREAK k LINEBREAK where LINEBREAK proof. see appendix d.2. LINEBREAK e(cid:107)¯xr,s − ¯xr,s LINEBREAK k,⊥ LINEBREAK n LINEBREAK g LINEBREAK lemma 3 (intra-cluster consensus error bound). let {xr,s rithm 1 under assumptions 1-5. if η > 0, then for all s = 0, . . . , τ − 1 it holds LINEBREAK i } be the sequence generated by algo LINEBREAK max k∈[k] LINEBREAK max, LINEBREAK where ρmax is defined in (25) and LINEBREAK ρl (cid:44) max LINEBREAK k(1 + ζk)(cid:9) , LINEBREAK with ζk > 0 being a free parameter to be chosen properly for all k = 1, . . . , k. LINEBREAK proof. see appendix d.3. LINEBREAK combining lemma 2 and 3 we can obtain the following bound on the sum of intra- and interconsensus errors using gradient (cid:107)∇f (¯xr,s)(cid:107)2. proposition 1. let {xr,s learning rate η > 0 satisfies LINEBREAK i } be the sequence generated by algorithm 1 under assumptions 1-5. if the LINEBREAK then for all s = 0, . . . , τ − 1 it holds LINEBREAK k LINEBREAK maxdτ,ρ LINEBREAK maxdτ,ρ¯(cid:15)2 l LINEBREAK where LINEBREAK dτ,ρ (cid:44) min LINEBREAK and c1 > 0 is some universal constant. LINEBREAK proof. see appendix c.1. LINEBREAK notice that according to (26) the gradient difference terms in lemma 1 can be bounded as LINEBREAK ∇fi(xr,s i ) LINEBREAK ∇ ¯fk(¯xr,s k ) LINEBREAK e LINEBREAK ∇fi(xr,s LINEBREAK i ) − LINEBREAK l2e(cid:107)¯xr,s − ¯xr,s LINEBREAK i∈vk LINEBREAK k − xr,s LINEBREAK (cid:13) (cid:13)¯xr,s − ¯xr,s l2e (cid:13) LINEBREAK k LINEBREAK i∈vk LINEBREAK k − xr,s LINEBREAK e(cid:107)¯xr,s − ¯xr,s LINEBREAK for all s = 1, . . . , τ . therefore proposition 1 immediately leads to the following result. corollary 2. under the same setting as proposition 1, it holds LINEBREAK ∇ ¯fk(¯xr,s k ) LINEBREAK e LINEBREAK ∇fi(xr,s LINEBREAK i ) − LINEBREAK maxdτ,ρ LINEBREAK maxdτ,ρ¯(cid:15)2 l LINEBREAK conclude LINEBREAK we this section by providing a er(cid:107)x r,τ −1 1 k,⊥ (cid:107)2 that will be useful in bounding t5. n proposition 2. under the same setting as proposition 1, if ρmax ≤ 1 − 1 LINEBREAK separate bound on the LINEBREAK τ , then we have LINEBREAK consensus LINEBREAK error LINEBREAK e LINEBREAK dτ,ρ τ LINEBREAK for some universal constant c2 > 0. LINEBREAK proof. see appendix c.2. LINEBREAK proposition 2 shows that the average intra-cluster consensus error 1 n the network connectivity improves, and vanishes if ρmax goes to zero. LINEBREAK k,⊥ (cid:107)2 decreases as LINEBREAK b.3 bounding t4 LINEBREAK proposition 3. under the same setting as lemma 1, we have LINEBREAK for s = 0, . . . , τ − 1 and r ∈ n+. LINEBREAK proof. recall the algorithmic update at iteration s for all s = 0, . . . , τ − 1: LINEBREAK x r,s+1 k ¯xr,s+1 k LINEBREAK k − ηwkgr,s LINEBREAK k LINEBREAK = wkx r,s = ¯xr,s LINEBREAK k − η¯gr,s k . LINEBREAK therefore, it holds under assumption 2 that LINEBREAK (gr,s LINEBREAK i ± ∇fi(xr,s i ) LINEBREAK = e LINEBREAK η n LINEBREAK =e LINEBREAK η n LINEBREAK b.4 bounding t5 LINEBREAK we provide the bound on t5 separately for the full device participation and partial participation cases. LINEBREAK full participation. LINEBREAK when the sampling probability p = 1, we have LINEBREAK xr,τ i = ¯xr,τ . LINEBREAK in this case, it follows from proposition 3 that LINEBREAK ∇fi(xr,τ −1 i LINEBREAK partial participation. LINEBREAK we proceed to bound t5 for LINEBREAK define p = m/n. recall the algorithmic update at iteration τ − 1: LINEBREAK x r,τ LINEBREAK k = wkx r,τ −1 LINEBREAK k LINEBREAK − ηwkgr,τ −1 LINEBREAK k LINEBREAK and LINEBREAK i∈sr k LINEBREAK xr,τ i = LINEBREAK i∈sr k LINEBREAK xr,τ i LINEBREAK therefore, with (wk)i,j being the ij-th element of matrix wk we have under assumption 2: LINEBREAK i∈sr k LINEBREAK xr,τ i − ¯xr,τ −1 LINEBREAK =e LINEBREAK =e LINEBREAK = e LINEBREAK i∈sr k LINEBREAK j∈vk LINEBREAK (wk)i,j(xr,τ −1 LINEBREAK j LINEBREAK − ηgr,τ −1 j LINEBREAK )(cid:1) − ¯xr,τ −1 LINEBREAK i∈vk LINEBREAK i∈vk LINEBREAK i(i ∈ sr LINEBREAK (wk)i,j(xr,τ −1 LINEBREAK j LINEBREAK − η∇fj(xr,τ −1 LINEBREAK j LINEBREAK )(cid:1) − ¯xr,τ −1 LINEBREAK j∈vk LINEBREAK i(i ∈ sr LINEBREAK (wk)i,j(∇fj(xr,τ −1 LINEBREAK j LINEBREAK ) − gr,τ −1 j LINEBREAK )(cid:1) LINEBREAK j∈vk LINEBREAK proposition 4. let {xr,s learning rate η > 0 satisfies LINEBREAK i } be the sequence generated by algorithm 1 under assumptions 1-6. if the LINEBREAK then we have the following bounds on a2,1: LINEBREAK ∇ ¯fk(¯xr,τ −1 k
| 17
|
[
231.736,
226.6410828,
279.9145791,
241.6588556
] |
6OphWWAE3cS.pdf
| 2,023
| 1
|
LINEBREAK particle-based variational inference with preconditioned functional gradient flow LINEBREAK hanze dong⋆, xi wang‡, yong lin†, tong zhang⋆† ⋆ department of mathematics, hkust † department of computer science and engineering, hkust ‡ college of information and computer science, umass amherst LINEBREAK abstract LINEBREAK particle-based variational inference (vi) minimizes the kl divergence between model samples and the target posterior with gradient flow estimates. with the popularity of stein variational gradient descent (svgd), the focus of particlebased vi algorithms has been on the properties of functions in reproducing kernel hilbert space (rkhs) to approximate the gradient flow. however, the requirement of rkhs restricts the function class and algorithmic flexibility. this paper offers a general solution to this problem by introducing a functional regularization term that encompasses the rkhs norm as a special case. this allows us to propose a new particle-based vi algorithm called preconditioned functional gradient flow (pfg). compared to svgd, pfg has several advantages. it has a larger function class, improved scalability in large particle-size scenarios, better adaptation to ill-conditioned distributions, and provable continuous-time convergence in kl divergence. additionally, non-linear function classes such as neural networks can be incorporated to estimate the gradient flow. our theory and experiments demonstrate the effectiveness of the proposed framework. LINEBREAK introduction LINEBREAK sampling from unnormalized density is a fundamental problem in machine learning and statistics, especially for posterior sampling. markov chain monte carlo (mcmc) (welling & teh, 2011; hoffman et al., 2014; chen et al., 2014) and variational inference (vi) (ranganath et al., 2014; jordan et al., 1999; blei et al., 2017) are two mainstream solutions: mcmc is asymptotically unbiased but sample-exhausted; vi is computationally efficient but usually biased. recently, particle-based vi algorithms (liu & wang, 2016; detommaso et al., 2018; liu et al., 2019) tend to minimize the kullback-leibler (kl) divergence between particle samples and the posterior, and absorb the advantages of both mcmc and vi: (1) non-parametric flexibility and asymptotic unbiasedness; (2) sample efficiency with the interaction between particles; (3) deterministic updates. thus, these algorithms are competitive in sampling tasks, such as bayesian inference (liu & wang, 2016; feng et al., 2017; detommaso et al., 2018), probabilistic models (wang & liu, 2016; pu et al., 2017). LINEBREAK given a target distribution p∗(x), particle-based vi aims to find g(t, x), so that starting with x0 ∼ p0, the distribution p(t, x) of the following method: dxt = g(t, xt)dt, converges to p∗(x) as t → ∞. by the continuity equation (jordan et al., 1998), we can capture the evolution of p(t, x) by LINEBREAK ∂p(t, x) ∂t LINEBREAK = −∇ · (p(t, x)g(t, x)) . LINEBREAK in order to measure the “closeness” between p(t, ·) and p∗, we typically adopt the kl divergence, LINEBREAK dkl(t) = LINEBREAK p(t, x) ln LINEBREAK p(t, x) p∗(x) LINEBREAK dx. LINEBREAK using chain rule and integration by parts, we have LINEBREAK ddkl(t) dt LINEBREAK p(t, x)[∇ · g(t, x) + g(t, x)⊤∇x ln p∗(x)]dx, LINEBREAK which captures the evolution of kl divergence. LINEBREAK to minimize the kl divergence, one needs to define a “gradient” to update the particles as our g(t, x). the most standard approach, wasserstein gradient (ambrosio et al., 2005), defines a gradient for p(t, x) in the wasserstein space, which contains probability measures with bounded second moments. in particular, for any functional l that maps probability density p(t, x) to a non-negative scalar, we say that the particle density p(t, x) follows the wasserstein gradient flow of l if g(t, x) is the gradient field of l2(rd)-functional derivative of l (villani, 2009). for kl divergence, the solution is ∇ ln p∗(x) p(t,x) . however, the computation of deterministic and time-inhomogeneous wasserstein gradient is non-trivial. it is necessary to restrict the function class of g(t, x) to obtain a tractable form. LINEBREAK stein variational gradient descent (svgd) is the most popular particle-based algorithm, which provides a tractable form to update particles with the kernelized gradient flow (chewi et al., 2020; liu, 2017). it updates particles by minimizing the kl divergence with a functional gradient measured in rkhs. by restricting the functional gradient with bounded rkhs norm, it has an explicit formulation: g(t, x) can be obtained by minimizing eq. (3). nonetheless, there are still some limitations due to the restriction of rkhs: (1) the expressive power is limited because kernel method is known to suffer from the curse of dimensionality (geenens, 2011); (2) with n particles, the o(n2) computational overhead of kernel matrix is required. further, we identify another crucial limitation of svgd: the kernel design is highly non-trivial. even in the simple gaussian case, where particles start with n (0, i) and p∗ = n (µ∗, σ∗), commonly used kernels such as linear and rbf kernel, have fundamental drawbacks in svgd algorithm (example 1). LINEBREAK our motivation originates from functional gradient boosting (friedman, 2001; nitanda & suzuki, 2018; johnson & zhang, 2019). for each p(t, x), we find a proper function as g(t, x) in the function class f to minimize eq. (3). in this context, we design a regularizer for the functional gradient to approximate variants of “gradient” explicitly. we propose a regularization family to penalize the particle distribution’s functional gradient output. for well-conditioned −∇2 ln p∗ 1, we can approximate the wasserstein gradient directly; for ill-conditioned −∇2 ln p∗, we can adapt our regularizer to approximate a preconditioned one. thus, our functional gradient is an approximation to the preconditioned wasserstein gradient. regarding the function space, we do not restrict the function in rkhs. instead, we can use non-linear function classes such as neural networks to obtain a better approximation capacity. the flexibility of the function space can lead to a better sampling algorithm, which is supported by our empirical results. LINEBREAK contributions. we present a novel particle-based vi framework that incorporates functional gradient flow with general regularizers. we leverage a special family of regularizers to approximate the preconditioned wasserstein gradient flow, which proves to be more effective than svgd. the functional gradient in our framework explicitly approximates the preconditioned wasserstein gradient, making it well-suited to handle ill-conditioned cases and delivering provable convergence rates. additionally, our proposed algorithm eliminates the need for the computationally expensive o(n2) kernel matrix, resulting in increased computational efficiency for larger particle sizes. both theoretical and empirical results demonstrate the superior performance of our framework and proposed algorithm. LINEBREAK analysis LINEBREAK xg(t, x) denote its jacobian matrix, divergence, hessian w.r.t. x. ∂p(t,x) LINEBREAK notations. in this paper, we use x to denote particle samples in rd. the distributions are assumed to be absolutely continuous w.r.t. the lebesgue measure. the probability density function of the posterior is denoted by p∗. p(t, x) (or pt) refers to particle distribution at time t. for scalar function p(t, x), ∇xp(t, x) denotes its gradient w.r.t. x. for vector function g(t, x), ∇xg(t, x), ∇x · g(t, x), ∇2 denotes the partial derivative w.r.t. t. without ambiguity, ∇ stands for ∇x for conciseness. notation ∥x∥2 h stands for x⊤hx and ∥x∥i is denoted by ∥x∥. notation ∥ · ∥hd denotes the rkhs norm on rd. we let g(t, x) belong to a vector-valued function class f, and find the best functional gradient direction. inspired by the gradient boosting algorithm for regression and classification problems, we approximate the gradient flow by a function g(t, x) ∈ f with a regularization term, which solves the LINEBREAK and ∂g(t,x) LINEBREAK ∂t LINEBREAK ∂t LINEBREAK 1for any positive-definite matrix, the condition number is the ratio of the maximal eigenvalue to the minimal LINEBREAK eigenvalue. a low condition number is well-conditioned, while a high condition number is ill-conditioned. LINEBREAK hd (linear) LINEBREAK hd (rbf) LINEBREAK (e) optimal transport LINEBREAK figure 1: illustration of the functional gradient g(t, x) compared with optimal transport. (a)-(d) denotes the corresponding q of the regularized functional gradient. (a)-(b) are svgd algorithms with linear and rbf kernel. optimal transport denotes the direction of the shortest path towards p∗. LINEBREAK (a) q(f ) = 1 LINEBREAK hd (linear) LINEBREAK (b) q(f ) = 1 LINEBREAK hd (rbf) LINEBREAK (c) q(f ) = 1 LINEBREAK (d) q(f ) = 1 LINEBREAK figure 2: evolution of particle distribution from n ([0, 0]⊤, i) to n ([20, 20]⊤, diag(100, 1)) (first row: evolution of particle mean µt; second row: particle distribution p(5, x) at t = 5) LINEBREAK following minimization formulation: LINEBREAK g(t, x) = arg min LINEBREAK f ∈f LINEBREAK p(t, x)[∇ · f (x) + f (x)⊤∇ ln p∗(x)]dx + q(f ) LINEBREAK where q(·) is a regularization term that limit the output magnitude of f . this regularization term also implicitly determines the underlying “distance metric” used to define the gradient estimates g(t, x) in our framework. when q(x) = 1 2 LINEBREAK (cid:82) p(t, x)∥f (x)∥2dx, eq. (4) is equivalent to LINEBREAK g(t, x) = arg min LINEBREAK f ∈f LINEBREAK p(t, x) LINEBREAK f (x) − ∇ ln LINEBREAK p∗(x) pt(x) LINEBREAK dx. LINEBREAK pt(x) ∈ f, we have g(t, x) = ∇ ln p∗(x) LINEBREAK if f is well-specified, i.e., ∇ ln p∗(x) pt(x) , which is the direction of wasserstein gradient flow. interestingly, despite the computational intractability of wasserstein gradient, eq. (4) provides a tractable variational approximation. for rkhs, we will show that svgd is a special case of eq. (4), where q(f ) = 1 hd (sec. 3.2.1). we point out that rkhs norm usually fails to regularize the functional gradient properly since it is fixed for any p(t, x). our next example shows that svgd is a suboptimal solution for gaussian case. example 1. consider that p(t, ·) is n (µt, σt), p∗ is n (µ∗, σ∗). we consider the svgd algorithm with linear kernel, rbf kernel, and regularized functional gradient formulation with q(f ) = 2 ept∥f ∥2, and q(f ) = 1 1 . starting with n (0, i), fig. 1 plots the g(0, x) with different q and the optimal transport direction; the path of µt and p(5, x) are illustrated in fig. 2. the detailed mathematical derivations and analytical results are provided in appendix a.2. LINEBREAK example 1 shows the comparison of different regularizations for the functional gradient. for rkhs norm, we consider the most commonly used kernels: linear and rbf. fig. 1 shows the g(0, x) of different regularizers: only q(f ) = 1 approximates the optimal transport direction, while other g(0, x) deviates significantly. svgd with linear kernel underestimates the gradient of large-variance directions; svgd with rbf kernel even suffers from gradient vanishing in low-density area. fig. 2 demonstrates the path of µt with different regularizers. for linear kernel, due to the LINEBREAK curl component (µ∗µ⊤ term in linear svgd is non-symmetric; see appendix for details), p(5, x) t is rotated with an angle. for rbf kernel, the functional gradient of svgd is not linear, leading to slow convergence. the l2 regularizer is suboptimal due to the ill-conditioned σ∗. we can see that q(f ) = 1 LINEBREAK produces the optimal path for µt (the line segment between µ0 and µ∗). LINEBREAK general regularization LINEBREAK inspired by the gaussian case, we consider the general form LINEBREAK q(f (x)) = LINEBREAK p(t, x)∥f (x)∥2 LINEBREAK h dx LINEBREAK where h is a symmetric positive definite matrix. proposition 1 shows that with eq. (6), the resulting functional gradient is the approximation of preconditioned wasserstein gradient flow. it also implies the well-definedness and existence of g(t, x) when f is closed, since ∥ · ∥h is lower bounded by 0. proposition 1. consider the case that q(f ) = 1 h dx, where h is a symmetric 2 positive definite matrix. then the functional gradient defined by eq. (4) is equivalent as LINEBREAK (cid:82) p(t, x)∥f (x)∥2 LINEBREAK g(t, x) = arg min LINEBREAK f ∈f LINEBREAK p(t, x) LINEBREAK p∗(x) p(t, x) LINEBREAK h LINEBREAK dx LINEBREAK remark. our regularizer is similar to the bregman divergence in mirror descent. we can further extend q(·) with a convex function h(·) : r → [0, ∞), where the regularizer is defined by q(f (x)) = epth(f (x)). we can adapt more complex geometry in our framework with proper h(·). LINEBREAK convergence analysis LINEBREAK equilibrium condition. to provide the theoretical guarantees, we show that the stationary distribution of our g(t, x) update is p∗. meanwhile, the evolution of kl-divergence is well-defined (without the explosion of functional gradient) and descending. we list the regularity conditions below. LINEBREAK [a1] (regular function class) the discrepancy induced by function class f is positive-definite: for any q ̸= p, there exists f ∈ f such that eq[∇ · f (x) + f (x)⊤∇ ln p(x)] > 0. for f ∈ f and c ∈ r, cf ∈ f, and f is closed. the tail of f is regular: lim∥x∥→∞ f (θ, x)p∗(x) = 0 for f ∈ f. [a2] (l-smoothness) for any x ∈ rd, p∗(x) > 0 and p(t, x) > 0 are l-smooth densities, i.e., ∥∇ ln p(x) − ∇ ln p(y)∥ ≤ l∥x − y∥, with ep∥x∥2 < ∞. LINEBREAK particularly, [a1] is similar to the positive definite kernel in rkhs, which guarantees the decrease of kl divergence. [a2] is designed to make the gradient well-defined: rhs of eq. (3) is finite. proposition 2. under [a1], [a2], when we update xt as eq. (7), we have −∞ < ddkl p(t, x) ̸= p∗(x). i.e., g(t, x) = 0 if and only if p(t, x) = p∗(x). LINEBREAK dt < 0 for all LINEBREAK proposition 2 shows that the continuous dynamics of our g(t, x) is well-defined and the kl divergence along the dynamics is descending. the only stationary distribution for p(t, x) is p∗(x). LINEBREAK convergence rate. the convergence rate of our framework mainly depends on (1) the capacity of function class f; (2) the complexity of p∗. in this section, we analyze that when the approximation error is small and the target p∗ is log-sobolev, the kl divergence converges linearly. [a3] (ϵ-approximation) for any t > 0, there exists ft(x) ∈ f and ϵ < 1, such that LINEBREAK p(t, x) LINEBREAK p(t, x) p∗(x) LINEBREAK h LINEBREAK dx ≤ ϵ LINEBREAK p(t, x) LINEBREAK ∇ ln LINEBREAK p(t, x) p∗(x) LINEBREAK dx LINEBREAK [a4] the target p∗ satisfies µ-log-sobolev inequality (µ > 0): for any differentiable function g, we have ep∗ ep∗ LINEBREAK (cid:2)g2 ln g2(cid:3) − ep∗ LINEBREAK (cid:2)g2(cid:3) ln ep∗ LINEBREAK specifically, [a3] is the error control of gradient approximation. with universal approximation theorem (hornik et al., 1989), any continuous function can be estimated by neural networks, which indicates the existence of such a function class. [a4] is a common assumption in sampling literature. it is more general than strongly concave assumption (vempala & wibisono, 2019). LINEBREAK theorem 1. under [a1]-[a4], for any t > 0, we assume that the largest eigenvalue, λmax(h) = m. (cid:13) 2 then we have ddkl(t) (cid:13) (cid:13) LINEBREAK and dkl(t) ≤ exp(−(1 − ϵ)µt/m)dkl(0). LINEBREAK ept LINEBREAK p∗(x) LINEBREAK theorem 1 shows that when p∗ is log-sobolev, our algorithm achieves linear convergence rate with a function class powerful enough to approximate the preconditioned wasserstein gradient. moreover, considering the discrete algorithm, we have to make sure that the step size is proper, i.e., ∥h −1∇2 ln p∗(x)∥ ≤ c, for some constant c > 0. thus, the preconditioned h = −c∇2 ln p∗ is better than plain one h = cli, since (−∇2 ln p∗)−1 ⪰ l−1i. for better understanding, we have provided a gaussian case discretized proof in appendix a.6 to illustrate this phenomenon. LINEBREAK pfg: preconditioned functional gradient flow LINEBREAK algorithm 1 pfg: preconditioned functional gradient flow input: unnormalized target distribution p∗(x) = e−u (x), fθ(x) : rd → rd, initial particles (parameters) LINEBREAK i=1, θ0, iteration parameter t, t ′, step size η, η′, regularization function h(·). LINEBREAK {xi for t = 1, . . . , t do assign θ0 for t′ = 1, · · · , t ′ do LINEBREAK end assign θt = θt1 t LINEBREAK end return: optimized particles {xi LINEBREAK t }n LINEBREAK algorithm LINEBREAK compute ˆl(θ) = 1 n t = θt′−1 update θt′ LINEBREAK t LINEBREAK (cid:0)h(fθ(xi (cid:80)n t)) + fθ(xi − η′∇ ˆl(θt′−1 ); LINEBREAK t LINEBREAK t) · ∇u (xi LINEBREAK t) − ∇ · fθ(xi LINEBREAK t)(cid:1) LINEBREAK and update particles xi LINEBREAK t = xi LINEBREAK t + η (cid:0)fθt (xi LINEBREAK t)(cid:1) for all i = 1, · · · , n; LINEBREAK we will realize our algorithm with parametric fθ (such as neural networks) and discretize the update. parametric function class. we can let f = {fθ(x) : θ ∈ θ} and apply g(t, x) = fˆθt LINEBREAK ˆθt = arg min LINEBREAK p(t, x)[−∇ · fθ(x) − fθ(x)⊤∇ ln p∗(x) + LINEBREAK (x), such that (cid:21) h ]dx LINEBREAK where h is a symmetric positive definite matrix estimated at time t. eq. (8) is a direct result from eq. (4) and (6). the parametric function class allows fθ to be optimized by iterative algorithms. LINEBREAK choice of h. considering the posterior mean trajectory, it is equivalent to the conventional optimization, so that −∇2 ln p∗ is ideal (newton’s method) to implement discrete algorithms. we use diagonal fisher information estimators for efficient computation as adagrad (duchi et al., 2011). we approximate the preconditioner h for all particles at each time step t by moving averaging. LINEBREAK discrete update. we can present our algorithm by discretizing eq. (4) and (8). given x0 ∼ p0, we (xk), where ˆθk is obtained by eq. (8) with (stochastic) gradient update xk as xk+1 = xk + ηfˆθk descent. the integral over p(k, x) is estimated by particle samples. full procedure is presented in alg. 1, where the regularizer h is 1 LINEBREAK h by default. LINEBREAK comparison with svgd LINEBREAK 3.2.1 svgd from a functional gradient view LINEBREAK for simplicity, we prove the case under finite-dimensional feature map2, ψ(x) : rd → rh. we assume that f = {w ψ(x) : w ∈ rd×h}, and let kernel k(x, y) = ψ(x)⊤ψ(y), q(f ) = 1 hd = 1 2 ∥w ∥2 f , where rkhs norm is the frobenius norm of w . the solution is defined by ˆwt = arg min w ∈rd×h LINEBREAK p(t, x) trace[w ∇ψ(x) + w ψ(x)∇ ln p∗(x)⊤]dx + LINEBREAK 2infinite-dimensional version is provided in appendix a.7. LINEBREAK which gives ˆwt = (cid:82) p(t, x′)[∇ψ(x′)⊤ + ∇ ln p∗(x′)ψ(x′)⊤]dx′. this implies that LINEBREAK g(t, x) = ˆwtψ(x) = LINEBREAK p(t, y)[∇yk(y, x) + ∇ ln p∗(y)k(y, x)]dy, LINEBREAK which is equivalent to svgd. for linear function classes, such as rkhs, q can be directly applied to the parameters, such as w here. the regularization of svgd is 1 f (the norm defined in rkhs). for non-linear function classes, such as neural networks, the rkhs norm cannot be defined. LINEBREAK 3.2.2 limitations of svgd LINEBREAK kernel function class. as in section 3.2.1, rkhs only contains linear combination of the feature map functions, which suffers from curse of dimensionality (geenens, 2011). on the other hand, some non-linear function classes, such as neural network, performs well on high dimensional data (lecun et al., 2015). the extension to non-linear function classes is needed for better performance. gradient preconditioning in svgd. in example 1, when −∇2 ln p∗ is ill-conditioned, pfg algorithm follows the shortest path from µ0 to µ∗. although svgd can implement preconditioning matrices as (wang et al., 2019), due to the curl component and time-dependent jacobian of dµt/dt, any symmetric matrix cannot provide optimal preconditioning (detailed derivation in appendix). LINEBREAK suboptimal convergence rate. for log-sobolev p∗, svgd with commonly used bounded smoothing kernels (such as rbf kernel) cannot reach the linear convergence rate (duncan et al., 2019) and the explicit kl convergence rate is unknown yet. meanwhile, the wasserstein gradient flow converges linearly. when the function class is sufficiently large, pfg converges provably faster than svgd. LINEBREAK computational cost. for svgd, main computation cost comes from the kernel matrix: with n particles, we need o(n2) memory and computation. our algorithm uses an iterative approximation to optimize g(t, x), whose memory cost is independent of n and computational cost is o(n) (bertsekas et al., 2011). the repulsive force between particles is achieved by ∇ · f operator on each particle. LINEBREAK experiment
| 5
|
[
108.299,
375.6116768,
194.1824456,
387.5668768
] |
OxNQXyZK-K8.pdf
| 2,023
| 1
|
LINEBREAK boosting multiagent reinforcement learning via permutation invariant and permutation equivariant networks LINEBREAK jianye hao1 2, xiaotian hao1, hangyu mao2, weixun wang1, yaodong yang3, dong li2, yan zheng1, zhen wang4 1college of intelligence and computing, tianjin university, 2noah’s ark lab, huawei 3the chinese university of hong kong, 4northwestern polytechnical university LINEBREAK abstract LINEBREAK the state space in multiagent reinforcement learning (marl) grows exponentially with the agent number. such a curse of dimensionality results in poor scalability and low sample efficiency, inhibiting marl for decades. to break this curse, we propose a unified agent permutation framework that exploits the permutation invariance (pi) and permutation equivariance (pe) inductive biases to reduce the multiagent state space. our insight is that permuting the order of entities in the factored multiagent state space does not change the information. specifically, we propose two novel implementations: a dynamic permutation network (dpn) and a hyper policy network (hpn). the core idea is to build separate entity-wise pi input and pe output network modules to connect the entity-factored state space and action space in an end-to-end way. dpn achieves such connections by two separate module selection networks, which consistently assign the same input module to the same input entity (guarantee pi) and assign the same output module to the same entity-related output (guarantee pe). to enhance the representation capability, hpn replaces the module selection networks of dpn with hypernetworks to directly generate the corresponding module weights. extensive experiments in smac, smacv2, google research football, and mpe validate that the proposed methods significantly boost the performance and the learning efficiency of existing marl algorithms. remarkably, in smac, we achieve 100% win rates in almost all hard and super-hard scenarios (never achieved before). LINEBREAK introduction
| 0
|
[
126.82956,
282.1966768,
205.9888518,
294.1518768
] |
9ITXiTrAoT.pdf
| 2,021
| 1
|
LINEBREAK multi-timescale representation learning in lstm language models LINEBREAK shivangi mahto∗ department of computer science the university of texas at austin austin, tx, usa [email protected] LINEBREAK javier s. turek brain-inspired computing lab intel labs hillsboro, or, usa [email protected] LINEBREAK vy a. vo brain-inspired computing lab intel labs hillsboro, or, usa [email protected] LINEBREAK alexander g. huth depts. of computer science & neuroscience the university of texas at austin austin, tx, usa [email protected] LINEBREAK abstract LINEBREAK language models must capture statistical dependencies between words at timescales ranging from very short to very long. earlier work has demonstrated that dependencies in natural language tend to decay with distance between words according to a power law. however, it is unclear how this knowledge can be used for analyzing or designing neural network language models. in this work, we derived a theory for how the memory gating mechanism in long short-term memory (lstm) language models can capture power law decay. we found that unit timescales within an lstm, which are determined by the forget gate bias, should follow an inverse gamma distribution. experiments then showed that lstm language models trained on natural english text learn to approximate this theoretical distribution. further, we found that explicitly imposing the theoretical distribution upon the model during training yielded better language model perplexity overall, with particular improvements for predicting low-frequency (rare) words. moreover, the explicit multi-timescale model selectively routes information about different types of words through units with different timescales, potentially improving model interpretability. these results demonstrate the importance of careful, theoretically-motivated analysis of memory and timescale in language models. LINEBREAK introduction
| 0
|
[
126.82956,
250.1666768,
205.9888518,
262.1218768
] |
6iEoTr-jeB7.pdf
| 2,023
| 1
|
LINEBREAK learning continuous normalizing flows for faster convergence to target distribution via ascent regularizations LINEBREAK shuangshuang chen1,2 sihao ding2 yiannis karayiannidis3 mårten björkman1 1 school of electrical engineering and computer science, royal institute of technology 2 ai lab, volvo car corporation 3 department of automatic control, lund university {shuche, celle}@kth.se, [email protected], [email protected] LINEBREAK abstract LINEBREAK normalizing flows (nfs) have been shown to be advantageous in modeling complex distributions and improving sampling efficiency for unbiased sampling. in this work, we propose a new class of continuous nfs, ascent continuous normalizing flows (acnfs), that makes a base distribution converge faster to a target distribution. as solving such a flow is non-trivial and barely possible, we propose a practical implementation to learn flexibly parametric acnfs via ascent regularization and apply it in two learning cases: maximum likelihood learning for density estimation and minimizing reverse kl divergence for unbiased sampling and variational inference. the learned acnfs demonstrate faster convergence towards the target distributions, therefore, achieving better density estimations, unbiased sampling and variational approximation at lower computational costs. furthermore, the flows show to stabilize themselves to mitigate performance deterioration and are less sensitive to the choice of training flow length t . LINEBREAK introduction LINEBREAK normalizing flows (nfs) provide a flexible way to define an expressive but tractable distribution which only requires a base distribution and a chain of bijective transformations (papamakarios et al., 2021). neural ode (chen et al., 2018) extends discrete normalizing flows (dinh et al., 2014; 2016; papamakarios et al., 2017; ho et al., 2019) to a new continuous-time analogue by defining the transformation via a differential equation, substantially expanding model flexibility in comparison to the discrete alternatives. (grathwohl et al., 2018; chen and duvenaud, 2019) propose a computationally cheaper way to estimate the trace of jacobian to accelerate training, while other methods focus on increasing flow expressiveness by e.g. augmenting with additional states (dupont et al., 2019; massaroli et al., 2020), or adding stochastic layers between discrete nfs to alleviate the topological constraint (wu et al., 2020). recent diffusion models like (hodgkinson et al., 2020; ho et al., 2020; song et al., 2020; zhang and chen, 2021) extend the scope of continuous normalizing flows (cnfs) with stochastic differential equations (sdes). although these diffusion models significantly improve the quality of the generated images, the introduced diffusion comes with costs: some models no longer allow for tractable density estimation; or the practical implementations of these models rely on a long chain of discretizations, thus needing relatively more computations than tractable cnf methods, which can be critical for some use cases such as online inference. LINEBREAK (finlay et al., 2020; onken et al., 2021; yang and karniadakis, 2020) introduce several regularizations to learn simpler dynamics using optimal transport theory, which decrease the number of discretization steps in integration and thus reduce training time. (kelly et al., 2020) extends the l2 transport cost to regularize any arbitrary order of dynamics. although these regularizations are beneficial for decreasing the computational costs of simulating flows, they do not improve the slow convergence of density to the target distributions like trained vanilla cnf models shown in figure 1. to accelerate the flow convergence, steer (ghosh et al., 2020) and to-flow (du et al., 2022) propose to optimize flow length t in two different approaches: steer randomly samples the length during training while to-flow establishes a subproblem for t during training. to understand the effectiveness of LINEBREAK figure 1: distribution transformations of two learned flows for 1d gaussian mixture from a gaussian distribution at t ∈ [0, 4t ]. although the two flows reach similar densities at t , the density of acnf converges faster to the target distribution before t and diverges slower after t than that of cnf. color indicates the density of true gaussian mixture. LINEBREAK figure 2: the log-likelihood estimates of trained vanilla cnf models with various flow length tn and the steepest acnf with dynamics defined in eq.(6) at different t on 2-moon distribution. all vanilla cnf models reach their maximum around tn and deteriorate rapidly afterwards while the log-likelihood estimate of acnf elevates rapidly at initial and increases monotonically. LINEBREAK these methods, we train multiple neural ode models with different flow length tn for a 2-moon distribution and examine these flows by the estimated log-likelihoods in figure 2. although sampling or optimizing t dynamically performs a model selection during training and leads models to reach higher estimates at shorter flows, it cannot prevent the divergence after tn. furthermore, shorter flows are more limited in expressiveness for higher maximum likelihoods and sensitive to flow length. LINEBREAK in this work, we present a new family of cnfs, ascent continuous normalizing flows (acnfs), to address the aforementioned problems. acnf concerns a flow that transforms a base distribution monotonically to a target distribution, and the dynamics is imposed to follow the steepest acnf. however, solving such a steepest flow is non-trivial and barely possible. we propose a practical implementation to learn parametric acnfs via ascent regularization. learned acnfs exhibit three main beneficial behaviors: 1) faster convergence to target distribution with less computation; 2) self-stabilization to mitigate flow deterioration; and 3) insensitivity to flow training length t . we demonstrate these behaviors in three use cases: modeling data distributions; learning annealed samplers for unbiased sampling; and learning a tractable but more flexible variational approximation. LINEBREAK continuous normalizing flows LINEBREAK considering a time-t transformation z(t) = φt(x) on the initial value x, i.e. z(0) = x, the change of variable theorem reveals the relation between the transformed distribution pt(z(t)) and p(x): LINEBREAK pt(z(t)) = (cid:12) LINEBREAK (cid:12)det (cid:0)j −1 LINEBREAK φt LINEBREAK (x)(cid:1) |p(x), LINEBREAK where jφt is the jacobian matrix of φt. as φt normalizes x towards some base distribution, pt(z(t)) is referred to as the normalized distribution at time t, starting from the data distribution p(x). LINEBREAK continuous normalizing flow is the infinitesimal limit of the chain of discrete flows and the infinitesimal transformation is specified by an ordinary differential equation (ode): LINEBREAK dz(t) dt LINEBREAK dφt(x) dt LINEBREAK = f (z(t), t). LINEBREAK the instantaneous change of variable theorem (chen et al., 2018, theorem 1) shows the infinitesimal changes of log pt(z(t)) is: LINEBREAK d log pt(z(t)) dt LINEBREAK = −∇ · f (z(t), t). LINEBREAK figure 3: upper: transformations on variables and densities on normalization and sampling directions. lower left: data samples (orange) and the grid of states (blue) transformations along normalization direction. lower right: density estimation ˜pt along sampling direction. thus, the log-normalized distribution log pt(z(t)) can be obtained by integrating eq.(3) backwards with a common approximation to the base distribution µ, i.e. pt ≈ µ: (cid:90) t LINEBREAK log pt(z(t)) = log pt (z(t )) − LINEBREAK ∇ · f (z(τ ), τ )dτ ≈ log µ(z(t )) − LINEBREAK ∇ · f (z(τ ), τ )dτ, LINEBREAK t LINEBREAK t LINEBREAK where z(t) = x + (cid:82) t 0 f (z(τ ), τ )dτ . the accuracy of log p0(x), obtained by the right hand side, depends on the approximation error of pt to µ and the error can vary at different z(t ). to avoid the problems in analysis and investigate how flow length affects on modeled distribution, we introduce ˜pt(x), estimating density of a t-length flow φt, which is shown via the change of variable theorem: (4) as indicated by eq.(4) and figure 3, ˜pt initiates at the base distribution, i.e. ˜p0(x) = µ(x). combining eq.(1) and eq.(4), the estimated density ˜pt relates to normalized distribution pt(z(t)) as: LINEBREAK (cid:12)det (jφt(x)) |µ(φt(x)). LINEBREAK ˜pt(x) = (cid:12) LINEBREAK ˜pt(x) p(x) LINEBREAK µ(φt(x)) pt(φt(x)) LINEBREAK µ(z(t)) pt(z(t)) LINEBREAK it shows that as pt → µ, ˜pt(x) → p(x). when there exists a flow, of which the normalized density is equal to the base distribution, i.e. pt = µ, then the estimated likelihood becomes exact to the data distribution, i.e. ˜pt (x) = p(x). like the instantaneous change of variable theorem in eq.(3), we derive the infinitesimal change of time-t estimated log-likelihood: proposition 1 (instantaneous change of log-likelihood estimate). let z(t) be a finite continuous random variable at time t as the solution of a differential equation dz(t) dt = f (z(t), t) with initial value z(0) = x. assuming that ˜p0 = µ at t = 0 and f is uniformly lipschitz continuous in z and t, then the change in estimated log-likelihood log ˜pt(x) at t follows a differential equation: LINEBREAK d log ˜pt(x) dt LINEBREAK = ∇ · f (z(t), t) + ∇ log µ(z(t)) · f (z(t), t). LINEBREAK proof. see appendix a.1 for detailed derivation and its relation to eq.(3). unlike the integral for log pt(z(t)) that relies on the approximation and requires to solve the whole trajectory z(τ ), τ ∈ [0, t ], log ˜pt(x) can be evaluated exactly simultaneously with z(t) for any or/and different t: LINEBREAK log ˜pt(x) = log µ(x) + LINEBREAK (∇ · f (z(τ ), τ ) + ∇ log µ(z(τ )) · f (z(τ ), τ )) dτ. LINEBREAK ascent continuous normalizing flows LINEBREAK by using kl divergence as distance measure of distributions, we have the following duality: LINEBREAK kl(p(x)||˜pt(x)) = const − LINEBREAK p(x) log ˜pt(x)dx = kl(pt(z(t))||µ(z(t))), LINEBREAK that maximum likelihood learning of ˜pt (x) for data samples from p(x) is equivalent to minimizing 1) the forward kl divergence between p(x) and ˜pt(x) as the first equality; 2) the reverse kl divergence in normalization direction as the second equality. we can measure the rates of kl divergences or the expected log-likelihood by their time derivative, and define ascent continuous normalizing flows (acnfs) that monotonically decrease kl divergence or increase the expected log-likelihood , i.e. LINEBREAK ∂ ∂t LINEBREAK p(x) log ˜pt(x)dx ≥ 0; or LINEBREAK ∂ ∂t LINEBREAK kl(pt(z(t))||µ(z(t))) ≤ 0. LINEBREAK by applying total variation, we can find the dynamics for the steepest descent of reverse kl divergence or the steepest ascent of the expected log-likelihood: LINEBREAK theorem 1 (dynamics for steepest ascent continuous normalizing flows). let z(t) be a finite continuous random variable and the solution of a differential equation dz(t) dt = f (z(t), t) with initial value z(0) = x. its probability pt(z(t)) subjects to the continuity equation ∂tpt + ∇ · (ptf ) = 0. the dynamics of the steepest flow for decreasing kl(pt(z(t))||µ(z(t))) is LINEBREAK f ∗(z(t), t) = ∇ log µ(z(t)) − LINEBREAK ∇pt(z(t)) pt(z(t)) LINEBREAK = ∇ log µ(z(t)) − ∇ log pt(z(t)). LINEBREAK proof. see appendix a.2 for detailed derivation. the steepest dynamics is the difference between two gradients: ∇ log µ and ∇ log pt w.r.t. state z(t). there are a few important implications of eq.(6): 1) the dynamics is time-variant as pt evolves along the flow of z(t); 2) the dynamics at time t only depends on the current state z(t), thus no history is needed; 3) the flow is initiated at the difference between ∇ log µ(x) and ∇ log p(x), gradually slows down and eventually stops when pt converges to µ. the convergence rate of the steepest flow can also be proven as the negative fisher divergence, ∂kl(pt∥µ)/∂t = −f(pt||µ) = −ept∥∇ log µ(z) − log pt(z)∥2 2, therefore this optimal deterministic cnf is related to (overdamped) langevin diffusion, see appendix a.3 for the derivation of convergence rate and detailed discussion of their relation. LINEBREAK this optimal flow also can be considered as a special instance of wasserstein gradient flow (ambrosio et al., 2005) with kl divergence as the energy functional. previous works (finlay et al., 2020; yang and karniadakis, 2020; onken et al., 2021) apply the optimal transport theory to regularize flow dynamics in euclidean space, while wasserstein gradient flow or eq.(6 instead regularizes flow in probability measure space. we refer readers to (ambrosio et al., 2005) for accessible introduction. in some special cases, the flow can be solved by introducing an auxiliary potential, v (z, t) = pt(z)/µ(z), which has a partial differential equation (pde): LINEBREAK ∂v (z, t) ∂t LINEBREAK =∆v (z, t) + 2∇ log µ(z) · ∇v (z, t) + ∇ log v (z, t) · ∇v (z, t), LINEBREAK with the initial condition v (z(0), 0) = p0(z(0)) µ(z(0)) = p(x) µ(x) . see appendix a.4 for its derivation. solving this pde for pt(z(t)) is non-trivial as the closed form solution is typically unknown. jko integration is practically used in literature (mokrov et al., 2021; fan et al., 2021) for the solution, which approximates the dynamics of density pt by its time discretization. however, it requires to know the initial condition while p(x) is generally unknown and needs to be modeled for data. (tabak and vanden-eijnden, 2010) proposes to approximate p(x) by the spatial discretization of samples, which hardly can be scaled up even for intermediate dimensions. LINEBREAK to tackle these difficulties and accelerate unregulated flows for faster convergence, we propose ascent regularization to learn parametric acnfs, as inspired by previous works (yang and karniadakis, 2020; onken et al., 2021; finlay et al., 2020; kelly et al., 2020; ghosh et al., 2020) that enforce flows with certain behaviors via regularization in training. ascent regularization penalizes the difference between the parametric dynamics and the steepest dynamics by ∥fθ − f ∗∥2 2, which needs to evaluate score function ∇ log pt(z(t)). therefore, we propose the instantaneous change of the score function: LINEBREAK theorem 2 (instantaneous change of score function). let z(t) be a finite continuous random variable with probability density pt(z(t)) at time t. let dz(t) dt = f (z(t), t) be a differential equation describing a continuous-in-time transformation of z(t). assuming that f is uniformly lipschitz continuous in z and t, the infinitesimal change in the gradient of log-density at t is LINEBREAK d∇ log pt(z(t)) dt LINEBREAK = −∇ log pt(z(t)) LINEBREAK ∂f (z(t), t) ∂z(t) LINEBREAK − ∇ (∇ · f (z(t), t)) . LINEBREAK proof. see appendix a.5 for detailed derivation. ∇ log p(z(t), t) follows a linear matrix differential equation, where the linear coefficient is the jacobian and the bias term is the gradient of divergence. to be noted, an alternative proof can be found in concurrent work (lu et al., 2022, theorem d.1). LINEBREAK we discuss the training of acnfs in two different learning cases: maximum likelihood learning for data modeling and density estimation in section 4; minimizing reverse kl divergence for learning annealed samplers for unbiased sampling in section 5 . LINEBREAK algorithm 1 maximum likelihood learning of acnf with ascent regularization require: data samples x = {xj}j=1,...,m , parameteric dynamics of flow fθ, length of flow t , ascent regularization coefficient λ, mini-batch size n , base distribution µ initialize θ while θ is not converged do LINEBREAK sample a mini-batch of n data xi ∼ x integrate augmented states LINEBREAK [zi(t), log ˜pt(xi)] forward with initial value [xi, log µ(xi)] from 0 to t LINEBREAK integrate augmented states LINEBREAK [zi(t), ∇ log pt(zi(t))] backwards with initial value [zi(t ), ∇ log µ(zi(t ))] from t to 0 compute loss function l in eq.(9) and LINEBREAK ∇θl by adjoint sensitivity method LINEBREAK update θ by gradient descent algorithm LINEBREAK end while LINEBREAK algorithm 2 training acnf as annealed sampler for unbiased sampling with ascent regularization LINEBREAK require: target distribution π = γ/z, LINEBREAK parameteric dynamics of flow fθ, length of flow t , number of samples n , ascent regularization coefficient λ, base distribution µ initialize θ while θ is not converged do sample zi(0) ∼ p0 = µ evaluate log µ(zi(0)) and ∇ log µ(zi(0)) integrate augmented states LINEBREAK [zi(t), log pt(zi(t)), ∇ log pt(zi(t))] with initial 0), ∇ log µ(zi value [zi LINEBREAK 0)] from 0 to t LINEBREAK 0, log µ(zi LINEBREAK evaluate LINEBREAK log w(zi(t )) = log γ(zi(t )) − log pt (zi(t )) compute loss function l in eq.(10) and ∇θl LINEBREAK by adjoint sensitivity method LINEBREAK update θ by gradient descent algorithm LINEBREAK end while LINEBREAK maximum likelihood learning of acnf for density estimation
| 4
|
[
108.299,
458.0856768,
499.5925538,
470.0408768
] |
1_OGWcP1s9w.pdf
| 2,023
| 1
|
LINEBREAK learning fair graph representations via automated data augmentations LINEBREAK hongyi ling, zhimeng jiang, youzhi luo, shuiwang ji∗, na zou∗ texas a&m university college station, tx 77843, usa {hongyiling,zhimengj,yzluo,sji,nzou1}@tamu.edu LINEBREAK abstract LINEBREAK we consider fair graph representation learning via data augmentations. while this direction has been explored previously, existing methods invariably rely on certain assumptions on the properties of fair graph data in order to design fixed strategies on data augmentations. nevertheless, the exact properties of fair graph data may vary significantly in different scenarios. hence, heuristically designed augmentations may not always generate fair graph data in different application scenarios. in this work, we propose a method, known as graphair, to learn fair representations based on automated graph data augmentations. such fairness-aware augmentations are themselves learned from data. our graphair is designed to automatically discover fairness-aware augmentations from input graphs in order to circumvent sensitive information while preserving other useful information. experimental results demonstrate that our graphair consistently outperforms many baselines on multiple node classification datasets in terms of fairness-accuracy trade-off performance. in addition, results indicate that graphair can automatically learn to generate fair graph data without prior knowledge on fairness-relevant graph properties. our code is publicly available as part of the dig package (https://github.com/divelab/dig). LINEBREAK introduction LINEBREAK recently, graph neural networks (gnns) attract increasing attentions due to their remarkable performance (gao et al., 2021; gao & ji, 2019; liu et al., 2021a;b; yuan et al., 2021) in many applications, such as knowledge graphs (hamaguchi et al., 2017), molecular property prediction (liu et al., 2022; 2020; han et al., 2022a) and social media mining (hamilton et al., 2017). despite recent advances in graph representation learning (grover & leskovec, 2016; kipf & welling, 2017; 2016; gilmer et al., 2017; han et al., 2022b), these gnn models may inherit or even amplify bias from training data (dai & wang, 2021), thereby introducing prediction discrimination against certain groups defined by sensitive attributes, such as race and gender. such discriminative behavior may lead to serious ethical and societal concerns, thus limiting the applications of gnns to many real-world high-stake tasks, such as criminal justice (suresh & guttag, 2019), job hunting (mehrabi et al., 2021), healthcare (rajkomar et al., 2018), and credit scoring (feldman et al., 2015; petrasic et al., 2017). hence, it is highly desirable to learn fair graph representations without discriminatory biases (dong et al., 2022; zhang et al., 2022; kang et al., 2022; dai et al., 2022). LINEBREAK a primary issue (mehrabi et al., 2021; olteanu et al., 2019) in fairness is that training data usually contain biases, which is the source of discriminative behavior of models. thereby, many existing works (agarwal et al., 2021; kose & shen, 2022; spinelli et al., 2021) propose to learn fair graph representations by modifying training data with fairness-aware graph data augmentations. these methods propose some graph data properties that are beneficial to fair representation learning, and then adopt heuristic graph data augmentation operations, including node feature masking and edge perturbation, to refine graph data. however, the proposed graph properties (spinelli et al., 2021; kose & shen, 2022) may not be appropriate for all graph datasets due to the diverse nature of graph data. for example, balanced inter/intra edges (kose & shen, 2022) may destroy topology LINEBREAK ∗equal senior contributions LINEBREAK structures of social networks, leading to the loss of important information. even if the proposed graph properties are effective, the best graph properties may vary significantly in different scenarios. hence, it is highly desirable to automatically discover dataset-specific fairness-aware augmentation strategies among different datasets with a single framework. to this end, a natural question is raised: LINEBREAK can we achieve fair graph representation learning via automated data augmentations? LINEBREAK in this work, we attempt to address this question via proposing graphair, a novel automated graph augmentation method for fair graph representation learning. a primary challenge is how to achieve fairness and informativeness simultaneously in the augmented data. as we intentionally avoid assuming prior knowledge on what types of graphs are considered fair, we propose to employ an adversary model to predict sensitive attributes from augmented graph data. a fair augmented graph should prevent the adversary model from identifying the sensitive attributes. in addition, we propose to retain useful information from original graphs by using contrastive learning to maximize the agreement between original and augmented graphs. experimental results demonstrate that graphair consistently outperforms many baselines on multiple node classification datasets in terms of fairness-accuracy trade-off performance. LINEBREAK background and related work LINEBREAK fair graph representation learning LINEBREAK in this work, we study the problem of fair graph representation learning. let g = {a, x, s} be a graph with n nodes. here, a ∈ {0, 1}n×n is the adjacency matrix, and aij = 1 if and only if there exists an edge between nodes i and j. x = [x1, · · · , xn]t ∈ rn×d is the node feature matrix, where each xi ∈ rd is the d-dimensional feature vector of node i. s ∈ {0, 1}n is the vector containing sensitive attributes (e.g., gender or race) of nodes that should not be captured by machine learning models to make decisions. our target is to learn a fair graph representation model f : (a, x) → h ∈ rn×d′ , and the learned representation h = f (a, x) is fed into a classification model θ : h → ˆy ∈ {0, 1}n to predict the binary label of nodes in g. particularly, for an ideal fair model f , the output representation h should result in a prediction ˆy that satisfies the fairness criteria. in general, there exist several different definitions of fairness criteria, including group fairness (dwork et al., 2012; rahmattalabi et al., 2019; jiang et al., 2022b), individual fairness (kang et al., 2020; dong et al., 2021; petersen et al., 2021), and counterfactual fairness (agarwal et al., 2021; ma et al., 2022). in this work, we focus on group fairness, which is defined as LINEBREAK p( ˆyi|si = 0) = p( ˆyi|si = 1), LINEBREAK where ˆyi is the prediction for node i, and si is the sensitive attribute of node i. note that even though the sets of node attributes or features in x and s are disjoint, correlations may exist between (a, x) and s. hence, even if s is not explicitly exposed to f , f may implicitly infer parts of s from (a, x) and produce biased representation h, thereby making the prediction ˆy unfair. how to prevent models from intentionally fitting these correlations is the central problem to be solved in achieving fair graph representation learning. LINEBREAK currently, several studies have proposed different strategies to achieve fair graph representation learning. an early study (rahman et al., 2019) proposes to train the model through fair random walks. some recent studies (li et al., 2020; laclau et al., 2021) propose to reduce prediction discrimination through optimizing adjacency matrices, which can improve fairness for link prediction tasks. in addition, adversarial learning is another popular strategy to achieve fairness on node representation learning tasks. many studies (fisher et al., 2020; dai & wang, 2021; bose & hamilton, 2019) adopt adversarial learning to filter out sensitive attribute information from the learned node representations. overall, most existing methods learn fair representations via altering model training strategy with fairness regularization. however, a primary issue in fairness learning lies in the fact that training data usually possess bias. hence, an alternative and highly desirable solution is to modify data through data augmentations, thus enabling models to learn fair representations easily. in this work, we design a learnable graph augmentation method to reduce bias in graph data, leading to more effective fairness-aware representation learning on graphs. LINEBREAK graph data augmentations LINEBREAK inspired by the success of data augmentations in computer vision and natural language processing, graph data augmentation (zhao et al., 2022) attracts increasing attention in academia. most studies (you et al., 2020; zhu et al., 2020; wang et al., 2021; veliˇckovi´c et al., 2019; you et al., 2021; rong et al., 2020) are based on uniformly random modifications of graph adjacency matrices or node features, such as masking node features, dropping edges, or cropping subgraphs. in addition, recent studies (luo et al., 2023; zheng et al., 2020; luo et al., 2021; zhao et al., 2021; chen et al., 2020) design learnable data augmentation methods to enhance task-relevant information in augmented graphs. note that none of the above methods are fairness-aware and only a few studies have investigated fairness-aware graph augmentations. spinelli et al. (2021) argue that the tendency of nodes with the same sensitive attribute to connect leads to prediction discrimination. thereby, they propose a biased edge drop algorithm to reduce such tendency in graphs, resulting in fairness improvement on prediction tasks. agarwal et al. (2021) design a graph data augmentation method in the contrastive learning framework via modifying sensitive attributes. kose & shen (2022) study correlations between sensitive attributes and learned node representations, and propose several graph augmentations to minimize an upper bound of the correlations to achieve fairness. however, these fairness-aware augmentation methods are all based on some strong assumptions or definitions about the properties that fair graph data should have. such assumptions or definitions may not hold in different scenarios, so in practice, empirical comparisons are needed to find out the best choice. in addition, these heuristic augmentation operations may accidentally remove most of the useful information from the graph. for instance, both edge drop algorithms proposed by kose & shen (2022) and spinelli et al. (2021) may drop most of the edges and destroys the graph structure in some cases. hence, in practice, these methods do not consistently achieve good performance on all datasets. LINEBREAK fairness via automated data augmentations LINEBREAK while previous fairness-aware graph data augmentations all rely on manually defined and fixed fairness-relevant augmentation strategies, we explore a more adaptive and effective method to discover fairness-aware graph augmentations by automated augmentation models. note that though automated graph augmentations have been applied to some graph representation tasks (luo et al., 2023; 2021; zhao et al., 2021), they have not been studied in fair graph representation learning. in this work, we propose graphair, an automated graph augmentation method for fair graph representation learning. graphair uses an automated augmentation model to generate new graphs with fair topology structures and node features while preserving the most informative components from input graphs. the augmentation model is trained end-to-end with multiple optimization objectives in order to circumvent sensitive information while retaining other useful information simultaneously. to the best of our knowledge, graphair is the first automated graph augmentation method addressing group fairness with a theoretical guarantee of fairness and informativeness. LINEBREAK automated graph augmentations LINEBREAK we first present the details of the augmentation process. given an input graph g = {a, x, s}, we use the automated augmentation model g to generate a new graph g′ = {a′, x ′, s} as LINEBREAK ta, tx = g(a, x), a′ = ta(a), x ′ = tx (x). (2) here, ta is the edge perturbation transformation, which maps a to the new adjacency matrix a′ by removing existing edges and adding new edges. tx is the node feature masking transformation, which produces the new node feature matrix x ′ by setting some values of x to zero. ta and tx contain the exact transformations for each edge and node feature in g. in other words, the augmentation model g decides whether there is an edge connecting any two nodes in g and whether each value in x should be set to zero or not. in the augmentation model g, a gnn-based augmentation encoder genc : (a, x) → z ∈ rn×dr is first used to extract dr-dimensional embeddings z for nodes in g. we adopt graph convolutional network (gcn) (kipf & welling, 2017) as the gnn encoder here. afterward, the exact transformations for each edge and node feature are performed as described below. LINEBREAK edge perturbation. given the embedding z, an multi-layer perceptron (mlp) model mlpa first computes the hidden embeddings za ∈ rn×dr′ from z, then an inner-product decoder computes the LINEBREAK edge probability matrix (cid:102)a′ ∈ rn×n, where the value (cid:102)a′ ij at the i-th row, j-th column of the matrix (cid:102)a′ denotes the predicted probability that an edge exists between the nodes i and j in g′. finally, the output adjacency matrix a′ is obtained by sampling from the bernoulli distribution parameterized with the probabilities in (cid:102)a′. formally, this process can be described as LINEBREAK za = mlpa(z), (cid:102)a′ = σ (cid:0)zaz t LINEBREAK a LINEBREAK (cid:1) , a′ LINEBREAK ij ∼ bernoulli LINEBREAK ij LINEBREAK for i, j = 1, · · · , n, LINEBREAK where σ(·) is the sigmoid function. LINEBREAK node feature masking. given the embedding z, an mlp model mlpx first computes the mask probability matrix (cid:102)m ∈ rn×d, where the value (cid:102)mij at the i-th row, j-th column of the matrix (cid:102)m denotes the predicted probability that the j-th feature of node i is not set to zero. afterward, the mask matrix m is sampled from the bernoulli distribution parameterized with the probabilities in (cid:102)m , and the new feature matrix x ′ is obtained by multiplying x by m . this process can be formally described as LINEBREAK zx = mlpx (z), (cid:102)m = σ(zx ), mij ∼ bernoulli LINEBREAK for i, j = 1, · · · , n, x ′ = m ⊙x, (4) LINEBREAK where ⊙ is the hadamard product, and σ(·) is the sigmoid function. note that the bernoulli sampling for adjacency matrix a′ and mask matrix m are non-differentiable. to make the augmentation model g end-to-end trainable, we adopt the commonly-used trick to approximate the bernoulli sampling in eq. (3) and (4). specifically, we relax the bernoulli sampling procedure by the gumbel-softmax reparameterization trick (jang et al., 2017; maddison et al., 2017; 2014). given a probability (cid:101)p computed from a parameterized model φ, the relaxed bernoulli sampling calculates a continuous approximation ˆp = , where τ is a temperature LINEBREAK hyperparameter and g ∼ gumbel(0, 1) is a random variable sampled from the standard gumbel distribution. for the forward propagation, the discrete value p = ⌊ ˆp + 1 2 ⌋ is used as the result sampled from the bernoulli distribution with the probability (cid:101)p . for the backward propagation, a straight-through gradient estimator (bengio et al., 2013) is used, which approximates the gradient as ∇φ ˆp ≈ ∇φp . LINEBREAK adversarial training LINEBREAK as our objective is to generate fair augmentations to reduce bias, the ideal augmentation model g should satisfy the fairness property. in other words, it should assign low probabilities to graph elements (edges, node features) that cause prediction bias. however, we cannot achieve it via supervised training because there is no ground truth indicating which graph elements lead to prediction bias and should be modified. to tackle this issue, we propose to use an adversarial learning based method to implicitly optimize the model to learn to mitigate bias in the input graph. specifically, we use an adversary model k : (a′, x ′) → ˆs ∈ [0, 1]n to predict the sensitive attribute s from the new adjacency matrix a′ and new node feature matrix x ′ generated by the augmentation model g. the adversary model k and the augmentation model g are jointly trained via an adversarial fashion. in this process, k is optimized to maximize the prediction accuracy of the sensitive attribute, while g is optimized to mitigate bias in a′ and x ′ so that it is difficult for the adversary model k to identify sensitive attribute information from a′ and x ′. formally, this adversarial training process can be described as the following optimization problem: LINEBREAK min g LINEBREAK max k LINEBREAK ladv = min LINEBREAK g LINEBREAK max k LINEBREAK silog ˆsi + (1 − si)log LINEBREAK where ˆsi is the prediction of the sensitive attribute of node i by the adversary model k. 1 LINEBREAK contrastive training LINEBREAK we note that only using the adversarial training may cause the augmentation model g to collapse into trivial solutions. for instance, g may learn to always generate a complete graph and set all node LINEBREAK 1here we use negative binary cross-entropy loss, so the adversary model k aims to maximize ladv. LINEBREAK figure 1: an overview of our framework. LINEBREAK i) as exp (sim(hi, h′ j)/τ (cid:1) + (cid:80)n LINEBREAK features to zero, which contains no bias, since all nodes are equivalent. such augmented graphs are not informative at all because they lose all the information from the input graphs. to make the augmentation model g satisfy the informativeness property, i.e., preserving the most informative components of the input graph in the generated graphs, we additionally use a contrastive learning objective during training. given the input graph g = {a, x, s} and the augmented graph g′ = {a′, x ′, s}, we first use a gnn-based representation encoder f to extract node representations h = f (a, x) and h ′ = f (a′, x ′) from g and g′, respectively. afterward, we optimize the augmentation model g and the representation encoder f jointly by minimizing a contrastive objective, which maximizes the similarity between the representations of the same node in h and h ′. specifically, let hi and h′ i denote the representation of node i in h and h ′, respectively. for node i, we consider (hi, h′ i) as a positive pair, and (hi, hj) and (hi, h′ j) for any node j other than i as negative pairs. we define the representation similarity as sim(hi, h′ j) = c(t(hi), t(h′ j)), where c is the cosine similarity and t is a non-linear projection implemented with a two-layer mlp model. we follow zhu et al. (2020) to define the contrastive objective for any positive pair (hi, h′ LINEBREAK l(hi, h′ LINEBREAK i) = −log LINEBREAK j=1 exp (cid:0)sim(hi, h′ LINEBREAK i)/τ ) 1[j̸=i]exp (sim(hi, hj)/τ ) LINEBREAK where τ denotes the temperature parameter, 1[j̸=i] ∈ {0, 1} is the indicator function whose value is 1 if and only if j ̸= i. the overall contrastive objective is computed over the positive pairs (hi, h′ i) and (h′ LINEBREAK i, hi) for all nodes as LINEBREAK lcon = LINEBREAK [l(hi, h′ LINEBREAK i) + l(h′ LINEBREAK i, hi)] . LINEBREAK to prevent the augmentation model g from generating graphs that deviate too much from input graphs, we add a reconstruction-based regularization term to the overall training objective. specifically, let lbce and lmse denote binary cross-entropy loss and mean squared error loss, respectively, and the regularization term is defined as LINEBREAK lreconst = lbce(a, (cid:102)a′) + λlmse(x, x ′) n (cid:88) LINEBREAK (cid:104) aijlog LINEBREAK ij LINEBREAK + (1 − aij)log LINEBREAK ij LINEBREAK f , LINEBREAK where λ is a hyperparameter, and ∥ · ∥f denotes the frobenius norm of matrix (golub & van loan, 1996). LINEBREAK to sum up, the overall training process can be described as the following min-max optimization procedure, LINEBREAK min f,g LINEBREAK max k LINEBREAK l = min f,g LINEBREAK max k LINEBREAK αladv + βlcon + γlreconst, LINEBREAK where α, β, γ are hyperparameters. the parameters of augmentation model g, adversary model k, and representation encoder f are jointly optimized with this min-max optimization procedure. in each training step, we first update the parameters of f and g to minimize l while keeping k fixed, then update the parameters of k to maximize ladv while keeping f and g fixed. see figure 1 for an overview of our proposed graphair method. the training algorithm is summarized in appendix b. LINEBREAK discussions LINEBREAK graphair learns different fairness-aware augmentation strategies for different graph datasets by the automated augmentation model, thereby eliminating the negative effect of fixed fairness-relevant augmentation strategies (spinelli et al., 2021; agarwal et al., 2021; kose & shen, 2022). in addition, graphair mitigates bias by modifying both graph topology structures and node features, while some existing studies (spinelli et al., 2021) only consider one of them. we demonstrate these advantages through extensive empirical studies in section 4.2 and 4.3. furthermore, we show in section 3.5 and 3.6 that the used training objectives can be theoretically proven to help the augmentation model generate new graphs with fair topology structures and node features, and preserve the most informative components from the input graph simultaneously. specifically, we use adversarial and contrastive learning to optimize the augmentation model to satisfy the fairness and informativeness properties, respectively. LINEBREAK theoretical analysis of fairness LINEBREAK following madras et al. (2018), we quantify the unfairness of a classifier d : (a′, x ′) → [0, 1]n using demographic parity distance. given a graph g′ = (a′, x ′, s), let ˆy = d(a′, x ′) ∈ [0, 1]n denote the prediction of the classifier d and ˆyi is the prediction of node i. the demographic parity distance is defined as ∆dp (d) ≜ |ei∼s0 ( ˆyi)−ej∼s1 ( ˆyj)|, where s0 and s1 denote the set of nodes whose sensitive attributes are 0 and 1, respectively. note that ∆dp (d) = 0 if ˆy ⊥ s, i.e., the group fairness discussed in section 2.1 is satisfied. the following theorem shows that minimizing the optimal adversarial loss is equivalent to minimizing the unfairness of the classifier d, so minimizing the performance of the adversary model can indeed encourage the augmentation model to generate fair graphs. theorem 1. let g′, k, s be defined as above. for any downstream task, we consider a classifier d : (a′, x ′) → ˆy ∈ [0, 1]n predicting label y ∈ {0, 1}n using g′ as input. assume the adversarial loss for each sample is bounded, i.e., there exists constant m so that |silog ˆsi +(1−si)log | ≤ m holds for each sample. then we show that the demographic parity ∆dp (d) is bounded by the n(1−e−m ) , where n′ optimal adversarial objective value ladv represents the maximal number of samples with the same sensitive attributes. LINEBREAK n(1−em ) ∆dp (d) − n′m LINEBREAK ∗ ≥ n′m LINEBREAK ∗, i.e., ladv LINEBREAK detailed proof of this theorem is given in appendix a.1. LINEBREAK theoretical analysis of informativeness LINEBREAK we quantify the amount of information obtained about one random variable by observing the other random variable by mutual information. we show in the following theorem that minimizing the contrastive loss lcon is equivalent to maximizing a lower bound of the mutual information i(g; g′) between the original graph g and the augmented graph g′, thus achieving informativeness. theorem 2. let g, g′, h and h ′ be defined as above. our contrastive objective is a lower bound of mutual information between the input graph g and the augmented graph g′. formally, LINEBREAK −lcon ≤ i(g; g′). LINEBREAK detailed proof of this theorem is given in appendix a.2. LINEBREAK complexity analysis LINEBREAK graphair shares the same time and space complexity as the gnn architecture of the representation encoder f during inference because only f is used to compute node representations. during training, LINEBREAK table 1: comparisons between our method and baselines on node classification tasks in terms of accuracy and fairness. the best results are shown in bold. LINEBREAK method LINEBREAK nba LINEBREAK pokec-z LINEBREAK acc ↑ LINEBREAK ∆dp ↓ LINEBREAK ∆eo ↓ LINEBREAK acc ↑ LINEBREAK ∆dp ↓ LINEBREAK ∆eo ↓ LINEBREAK acc ↑ LINEBREAK pokec-n LINEBREAK ∆dp ↓ LINEBREAK fairwalk LINEBREAK grace LINEBREAK gca LINEBREAK fairdrop LINEBREAK nifty LINEBREAK fairaug LINEBREAK graphair LINEBREAK graphair computes the adjacency matrix a′ and the pairwise similarity in the contrastive loss, thus having a space complexity of o(n2), where n is the number of nodes. fortunately, we can easily adopt the graph sampling-based batch training method proposed by zeng et al. (2020) to perform mini-batch training and reduce the space complexity to o(m2), where m is the batch size. more details on mini-batch training are given in appendix c. LINEBREAK experiments
| 6
|
[
108.299,
463.1206768,
200.0834953,
475.0758768
] |
0g0X4H8yN4I.pdf
| 2,023
| 0
|
LINEBREAK what learning algorithm is in-context learning? investigations with linear models LINEBREAK ekin aky ¨urek1,2,a. dale schuurmans1 LINEBREAK jacob andreas∗2 tengyu ma∗1,3,b denny zhou∗1 LINEBREAK 1google research LINEBREAK 2mit csail LINEBREAK 3 stanford university LINEBREAK ∗collaborative advising LINEBREAK abstract LINEBREAK neural sequence models, especially transformers, exhibit a remarkable capacity for in-context learning. they can construct new predictors from sequences of labeled examples (x, f (x)) presented in the input without further parameter updates. we investigate the hypothesis that transformer-based in-context learners implement standard learning algorithms implicitly, by encoding smaller models in their activations, and updating these implicit models as new examples appear in the context. using linear regression as a prototypical problem, we offer three sources of evidence for this hypothesis. first, we prove by construction that transformers can implement learning algorithms for linear models based on gradient descent and closed-form ridge regression. second, we show that trained in-context learners closely match the predictors computed by gradient descent, ridge regression, and exact least-squares regression, transitioning between different predictors as transformer depth and dataset noise vary, and converging to bayesian estimators for large widths and depths. third, we present preliminary evidence that in-context learners share algorithmic features with these predictors: learners’ late layers non-linearly encode weight vectors and moment matrices. these results suggest that in-context learning is understandable in algorithmic terms, and that (at least in the linear case) learners may rediscover standard estimation algorithms. LINEBREAK introduction LINEBREAK one of the most surprising behaviors observed in large neural sequence models is in-context learning (icl; brown et al., 2020). when trained appropriately, models can map from sequences of (x, f (x)) pairs to accurate predictions f (x′) on novel inputs x′. this behavior occurs both in models trained on collections of few-shot learning problems (chen et al., 2022; min et al., 2022) and surprisingly in large language models trained on open-domain text (brown et al., 2020; zhang et al., 2022; chowdhery et al., 2022). icl requires a model to implicitly construct a map from in-context examples to a predictor without any updates to the model’s parameters themselves. how can a neural network with fixed parameters to learn a new function from a new dataset on the fly? LINEBREAK this paper investigates the hypothesis that some instances of icl can be understood as implicit implementation of known learning algorithms: in-context learners encode an implicit, contextdependent model in their hidden activations, and train this model on in-context examples in the course of computing these internal activations. as in recent investigations of empirical properties of icl (garg et al., 2022; xie et al., 2022), we study the behavior of transformer-based predictors (vaswani et al., 2017) on a restricted class of learning problems, here linear regression. unlike in past work, our goal is not to understand what functions icl can learn, but how it learns these functions: the specific inductive biases and algorithmic properties of transformer-based icl. LINEBREAK in section 3, we investigate theoretically what learning algorithms transformer decoders can implement. we prove by construction that they require only a modest number of layers and hidden units to train linear models: for d-dimensional regression problems, with o(d) hidden size and constant depth, a transformer can implement a single step of gradient descent; and with o(d2) hidden size LINEBREAK acorrespondence to [email protected]. ekin is a student at mit, and began this work while he was intern LINEBREAK at google research. code and reference implementations are released at this web page LINEBREAK bthe work is done when tengyu ma works as a visiting researcher at google research. LINEBREAK and constant depth, a transformer can update a ridge regression solution to include a single new observation. intuitively, n steps of these algorithms can be implemented with n times more layers. LINEBREAK in section 4, we investigate empirical properties of trained in-context learners. we begin by constructing linear regression problems in which learner behavior is under-determined by training data (so different valid learning rules will give different predictions on held-out data). we show that model predictions are closely matched by existing predictors (including those studied in section 3), and that they transition between different predictors as model depth and training set noise vary, behaving like bayesian predictors at large hidden sizes and depths. finally, in section 5, we present preliminary experiments showing how model predictions are computed algorithmically. we show that important intermediate quantities computed by learning algorithms for linear models, including parameter vectors and moment matrices, can be decoded from in-context learners’ hidden activations. LINEBREAK a complete characterization of which learning algorithms are (or could be) implemented by deep networks has the potential to improve both our theoretical understanding of their capabilities and limitations, and our empirical understanding of how best to train them. this paper offers first steps toward such a characterization: some in-context learning appears to involve familiar algorithms, discovered and implemented by transformers from sequence modeling tasks alone. LINEBREAK preliminaries LINEBREAK training a machine learning model involves many decisions, including the choice of model architecture, loss function and learning rule. since the earliest days of the field, research has sought to understand whether these modeling decisions can be automated using the tools of machine learning itself. such “meta-learning” approaches typically treat learning as a bi-level optimization problem (schmidhuber et al., 1996; andrychowicz et al., 2016; finn et al., 2017): they define “inner” and “outer” models and learning procedures, then train an outer model to set parameters for an inner procedure (e.g. initializer or step size) to maximize inner model performance across tasks. LINEBREAK recently, a more flexible family of approaches has gained popularity. in in-context learning (icl), meta-learning is reduced to ordinary supervised learning: a large sequence model (typically implemented as a transformer network) is trained to map from sequences [x1, f (x1), x2, f (x2), ..., xn] to predictions f (xn) (brown et al., 2020; olsson et al., 2022; laskin et al., 2022; kirsch & schmidhuber, 2021). icl does not specify an explicit inner learning procedure; instead, this procedure exists only implicitly through the parameters of the sequence model. icl has shown impressive results on synthetic tasks and naturalistic language and vision problems (garg et al., 2022; min et al., 2022; zhou et al., 2022). LINEBREAK past work has characterized what kinds of functions icl can learn (garg et al., 2022; laskin et al., 2022) and the distributional properties of pretraining that can elicit in-context learning (xie et al., 2021; chan et al., 2022). but how icl learns these functions has remained unclear. what learning algorithms (if any) are implementable by deep network models? which algorithms are actually discovered in the course of training? this paper takes first steps toward answering these questions, focusing on a widely used model architecture (the transformer) and an extremely well-understood class of learning problems (linear regression). LINEBREAK the transformer architecture LINEBREAK transformers (vaswani et al., 2017) are neural network models that map a sequence of input vectors x = [x1, . . . , xn] to a sequence of output vectors y = [y1, . . . , yn]. each layer in a transformer maps a matrix h (l) (interpreted as a sequence of vectors) to a sequence h (l+1). to do so, a transformer layer processes each column h(l) i of h (l) in parallel. here, we are interested in autoregressive (or “decoder-only”) transformer models in which each layer first computes a self-attention: LINEBREAK ai = attention(h(l) i = w f [b1, . . . , bm] LINEBREAK ; w f , w q, w k, w v ) LINEBREAK where each b is the response of an “attention head” defined by: (cid:17) LINEBREAK bj = softmax LINEBREAK (w q LINEBREAK j hi)⊤(w k LINEBREAK j h:i) LINEBREAK (w v LINEBREAK j h:i) . LINEBREAK then applies a feed-forward transformation: LINEBREAK h(l+1) i LINEBREAK = ff(ai; w1, w2) = w1σ(w2λ(ai + h(l) LINEBREAK i )) + ai + h(l) LINEBREAK i LINEBREAK here σ denotes a nonlinearity, e.g. a gaussian error linear unit (gelu; hendrycks & gimpel, 2016): LINEBREAK σ(x) = LINEBREAK 1 + erf LINEBREAK and λ denotes layer normalization (ba et al., 2016): LINEBREAK λ(x) = LINEBREAK x − e[x] (cid:112)var[x] LINEBREAK where the expectation and variance are computed across the entries of x. to map from x to y, a transformer applies a sequence of such layers, each with its own parameters. we use θ to denote a model’s full set of parameters (the complete collection of w matrices across layers). the three main factors governing the computational capacity of a transformer are its depth (the number of layers), its hidden size (the dimension of the vectors h), and the number of heads (denoted m above). LINEBREAK training for in-context learning LINEBREAK we study transformer models directly trained on an icl objective. (some past work has found that icl also “emerges” in models trained on general text datasets; brown et al., 2020.) to train a transformer t with parameters θ to perform icl, we first define a class of functions f, a distribution p(f ) supported on f, a distribution p(x) over the domain of functions in f, and a loss function l. we then choose θ to optimize the auto-regressive objective, where the resulting tθ is an in-context learner: LINEBREAK l (f (xi), tθ ([x1, f (x1) . . . , xi])) LINEBREAK arg min θ LINEBREAK e x1,...,xn∼p(x) f ∼p(f ) LINEBREAK linear regression LINEBREAK our experiments focus on linear regression problems. in these problems, f is the space of linear functions f (x) = w⊤x where w, x ∈ rd, and the loss function is the squared error l(y, y′) = (y − y′)2. linear regression is a model problem in machine learning and statistical estimation, with diverse algorithmic solutions. it thus offers an ideal test-bed for understanding icl. given a dataset with inputs x = [x1, . . . , xn] and y = [y1, . . . , yn], the (regularized) linear regression objective: LINEBREAK l(w⊤xi, yi) + λ∥w∥2 2 LINEBREAK i LINEBREAK is minimized by: w∗ = (x ⊤x + λi)−1x ⊤y LINEBREAK with λ = 0, this objective is known as ordinary least squares regression (ols); with λ > 0, it is known as ridge regression (hoerl & kennard, 1970). (as discussed further in section 4, ridge regression can also be assigned a bayesian interpretation.) to present a linear regression problem to a transformer, we encode both x and f (x) as d + 1-dimensional vectors: ˜xi = [0, xi], ˜yi = [yi, 0d], where 0d denotes the d-dimensional zero vector. LINEBREAK what learning algorithms can a transformer implement? LINEBREAK for a transformer-based model to solve eq. (9) by implementing an explicit learning algorithm, that learning algorithm must be implementable via eq. (1) and eq. (4) with some fixed choice of transformer parameters θ. in this section, we prove constructively that such parameterizations exist, giving concrete implementations of two standard learning algorithms. these proofs yield upper bounds on how many layers and hidden units suffice to implement (though not necessarily learn) each algorithm. proofs are given in appendices a and b. LINEBREAK preliminaries LINEBREAK it will be useful to first establish a few computational primitives with simple transformer implementations. consider the following four functions from rh×t → rh×t : mov(h; s, t, i, j, i′, j′): selects the entries of the sth column of h between rows i and j, and copies them into the tth column (t ≥ s) of h between rows i′ and j′, yielding the matrix: LINEBREAK h:i−1,t h:,:t hi′:j′,s h:,t+1: hj,t LINEBREAK mul(h; a, b, c, (i, j), (i′, j′), (i′′, j′′)): in each column h of h, interprets the entries between i and j as an a × b matrix a1, and the entries between i′ and j′ as a b × c matrix a2, multiplies these matrices together, and stores the result between rows i′′ and j′′, yielding a matrix in which each column has the form [h:i′′−1, a1a2, hj′′:]⊤. div(h; (i, j), i′, (i′′, j′′)): in each column h of h, divides the entries between i and j by the absolute value of the entry at i′, and stores the result between rows i′′ and j′′, yielding a matrix in which every column has the form [h:i′′−1, hi:j/|hi′|, hj′′:]⊤. aff(h; (i, j), (i′, j′), (i′′, j′′), w1, w2, b): in each column h of h, applies an affine transformation to the entries between i and j and i′ and j′, then stores the result between rows i′′ and j′′, yielding a matrix in which every column has the form [h:i′′−1, w1hi:j + w2hi′:j′ + b, hj′′:]⊤. lemma 1. each of mov, mul, div and aff can be implemented by a single transformer decoder layer: in eq. (1) and eq. (4), there exist matrices w q, w k, w v , w f , w1 and w2 such that, given a matrix h as input, the layer’s output has the form of the corresponding function output above. 1 LINEBREAK with these operations, we can implement building blocks of two important learning algorithms. LINEBREAK gradient descent LINEBREAK rather than directly solving linear regression problems by evaluating eq. (10), a standard approach to learning exploits a generic loss minimization framework, and optimizes the ridge-regression objective in eq. (9) via gradient descent on parameters w. this involves repeatedly computing updates: LINEBREAK w′ = w − α LINEBREAK (cid:16) l(w⊤xi, yi) + λ∥w∥2 2 LINEBREAK ∂ ∂w LINEBREAK = w − 2α(xw⊤x − yx + λw) LINEBREAK for different examples (xi, yi), and finally predicting w′⊤xn on a new input xn. a step of this gradient descent procedure can be implemented by a transformer: theorem 1. a transformer can compute eq. (11) (i.e. the prediction resulting from single step of gradient descent on an in-context example) with constant number of layers and o(d) hidden space, where d is the problem dimension of the input x. specifically, there exist transformer parameters θ such that, given an input matrix of the form: LINEBREAK the transformer’s output matrix h (l) contains an entry equal to w′⊤xn (eq. (11)) at the column index where xn is input. LINEBREAK closed-form regression LINEBREAK another way to solve the linear regression problem is to directly compute the closed-form solution eq. (10). this is somewhat challenging computationally, as it requires inverting the regularized covariance matrix x ⊤x + λi. however, one can exploit the sherman–morrison formula (sherman & morrison, 1950) to reduce the inverse to a sequence of rank-one updates performed example-byexample. for any invertible square a, LINEBREAK (cid:0)a + uv⊤(cid:1)−1 LINEBREAK 1we omit the trivial size preconditions, e.g. mul: (i − j = a ∗ b, i′ − j′ = b ∗ c, i′′ − j′′ = c ∗ d). LINEBREAK because the covariance matrix x ⊤x in eq. (10) can be expressed as a sum of rank-one terms each involving a single training example xi, this can be used to construct an iterative algorithm for computing the closed-form ridge-regression solution. theorem 2. a transformer can predict according to a single sherman–morrison update: LINEBREAK w′ = (cid:0)λi + xix⊤ LINEBREAK i LINEBREAK xiyi = LINEBREAK i λ LINEBREAK i LINEBREAK λ xix⊤ i 1 + x⊤ i LINEBREAK i λ i λ xi LINEBREAK xiyi LINEBREAK with constant layers and o(d2) hidden space. more precisely, there exists a set of transformer parameters θ such that, given an input matrix of the form in eq. (12), the transformer’s output matrix h (l) contains an entry equal to w′⊤xn (eq. (14)) at the column index where xn is input. LINEBREAK discussion. there are various existing universality results for transformers (yun et al., 2020; wei et al., 2021), and for neural networks more generally (hornik et al., 1989). these generally require very high precision, very deep models, or the use of an external “tape”, none of which appear to be important for in-context learning in the real world. results in this section establish sharper upper bounds on the necessary capacity required to implement learning algorithms specifically, bringing theory closer to the range where it can explain existing empirical findings. different theoretical constructions, in the context of meta-learning, have been shown for linear self-attention models (schlag et al., 2021), or for other neural architectures such as recurrent neural networks (kirsch & schmidhuber, 2021). we emphasize that theorem 1 and theorem 2 each show the implementation of a single step of an iterative algorithm; these results can be straightforwardly generalized to the multi-step case by “stacking” groups of transformer layers. as described next, it is these iterative algorithms that capture the behavior of real learners. LINEBREAK what computation does an in-context learner perform? LINEBREAK the previous section showed that the building blocks for two specific procedures—gradient descent on the least-squares objective and closed-form computation of its minimizer—are implementable by transformer networks. these constructions show that, in principle, fixed transformer parameterizations are expressive enough to simulate these learning algorithms. when trained on real datasets, however, in-context learners might implement other learning algorithms. in this section, we investigate the empirical properties of trained in-context learners in terms of their behavior. in the framework of marr’s (2010) “levels of analysis”, we aim to explain icl at the computational level by identifying the kind of algorithms to regression problems that transformer-based icl implements. LINEBREAK behavioral metrics LINEBREAK determining which learning algorithms best characterize icl predictions requires first quantifying the degree to which two predictors agree. we use two metrics to do so: LINEBREAK squared prediction difference. given any learning algorithm a that maps from a set of input– output pairs d = [x1, y1, . . . , xn, yn] to a predictor f (x) = a(d)(x), we define the squared prediction difference (spd): LINEBREAK spd(a1, a2) = LINEBREAK e d=[x1,...]∼p(d) x′∼p(x) LINEBREAK where d is sampled as in eq. (8). spd measures agreement at the output level, regardless of the algorithm used to compute this output. LINEBREAK implicit linear weight difference. when ground-truth predictors all belong to a known, parametric function class (as with the linear functions here), we may also investigate the extent to which different learners agree on the parameters themselves. given an algorithm a, we sample a context dataset d as above, and an additional collection of unlabeled test inputs dx ′ = {x′ i}. we i, yielding a predictor-specific dataset da = {(x′ then compute a’s prediction on each x′ i, ˆyi)} = (cid:8)(cid:0)xi, a(d)(x′ i)(cid:1)(cid:9) encapsulating the function learned by a. next we compute the implied parameters: LINEBREAK ˆwa = arg min LINEBREAK w LINEBREAK (ˆyi − w⊤x′ LINEBREAK i LINEBREAK (a) predictor–icl fit w.r.t. prediction differences. LINEBREAK (b) predictor–icl fit w.r.t implicit weights. figure 1: fit between icl and standard learning algorithms: we plot (dimension normalized) spd and ilwd values between textbook algorithms and icl on noiseless linear regression with d = 8. gd(α) denotes one step of batch gradient descent and sgd(α) denotes one pass of stochastic gradient descent with learning rate α. ridge(λ) denotes ridge regression with regularization parameter λ. under both evaluations, in-context learners agree closely with ordinary least squares, and are significantly less well approximated by other solutions to the linear regression problem. LINEBREAK we can then quantify agreement between two predictors a1 and a2 by computing the distance between their implied weights in expectation over datasets: LINEBREAK ilwd(a1, a2) = ededx ′ ∥ ˆwa1 − ˆwa2 ∥2 2 . when the predictors are not linear, ilwd measures the difference between the closest linear predictors (in the sense of eq. (16)) to each algorithm. for algorithms that have linear hypothesis space (e.g. ridge regression), we will use the actual value of ˆwa instead of the estimated value. LINEBREAK experimental setup LINEBREAK we train a transformer decoder autoregresively on the objective in eq. (8). for all experiments, we perform a hyperparameter search over depth l ∈ {1, 2, 4, 8, 12, 16}, hidden size w ∈ {16, 32, 64, 256, 512, 1024} and heads m ∈ {1, 2, 4, 8}. other hyper-parameters are noted in appendix d. for our main experiments, we found that l = 16, h = 512, m = 4 minimized loss on a validation set. we follow the training guidelines in garg et al. (2022), and trained models for 500, 000 iterations, with each in-context dataset consisting of 40 (x, y) pairs. for the main experiments we generate data according to p(w) = n (0, i) and p(x) = n (0, i). LINEBREAK results LINEBREAK icl matches ordinary least squares predictions on noiseless datasets. we begin by comparing a (l = 16, h = 512, m = 4) transformer against a variety of reference predictors: LINEBREAK • k-nearest neighbors: in the uniform variant, models predict ˆyi = 1 3 LINEBREAK j yj, where j is the top-3 closest data point to xi where j < i. in the weighted variant, a weighted average ˆyi ∝ 1 j |xi − xj|−2yj is calculated, normalized by the total weights of the yjs. 3 LINEBREAK • one-pass stochastic gradient descent: ˆyi = w⊤ LINEBREAK i xi where wi is obtained by stochastic gradient descent on the previous examples with batch-size equals to 1: wi = wi−1 − 2α(x⊤ LINEBREAK • one-step batch gradient descent: ˆyi = w⊤ LINEBREAK i xi where wi is obtained by one of step gradient descent on the batch of previous examples: wi = w0 − 2α(x ⊤w⊤x − x ⊤y + λw0). • ridge regression: we compute ˆyi = w′⊤xi where w′⊤ = (x ⊤x + λi)−1x ⊤y . we LINEBREAK denote the case of λ = 0 as ols. LINEBREAK the agreement between the transformer-based icl and these predictors is shown in fig. 1. as can be seen, there are clear differences in fit to predictors: for almost any number of examples, normalized spd and ilwd are small between the transformer and ols predictor (with squared error less than 0.01), while other predictors (especially nearest neighbors) agree considerably less well. LINEBREAK when the number of examples is less than the input dimension d = 8, the linear regression problem is under-determined, in the sense that multiple linear models can exactly fit the in-context training LINEBREAK figure 2: icl under uncertainty: with problem dimension d = 8, and for different values of prior variance τ 2 and data noise σ2, we display (dimension-normalized) mspd values for each predictor pair, where mspd is the average spd value over underdetermined region of the linear problem. brightness is proportional with mspd . icl most closely follows the minimum-bayes-risk ridge regression output for all σ2 LINEBREAK τ 2 values. LINEBREAK dataset. in these cases, ols regression selects the minimum-norm weight vector, and (as shown in fig. 1), the in-context learner’s predictions are reliably consistent with this minimum-norm predictor. why, when presented with an ambiguous dataset, should icl behave like this particular predictor? one possibility is that, because the weights used to generate the training data are sampled from a gaussian centered at zero, icl learns to output the minimum bayes risk solution when predicting under uncertainty. building on these initial findings, our next set of experiments investigates whether icl is behaviorally equivalent to bayesian inference more generally. LINEBREAK icl matches the minimum bayes risk predictor on noisy datasets. to more closely examine the behavior of icl algorithms under uncertainty, we add noise to the training data: now we [x1, f (x1) + ϵ1, . . . , xn, f (xn) + ϵn] where each present the in-context dataset as a sequence: ϵi ∼ n (0, σ2). recall that ground-truth weight vectors are themselves sampled from a gaussian distribution; together, this choice of prior and noise mean that the learner cannot be certain about the target function with any number of examples. LINEBREAK standard bayesian statistics gives that the optimal predictor for minimizing the loss in eq. (8) is: LINEBREAK ˆy = e[y|x, d]. LINEBREAK this is because, conditioned on x and d, the scalar ˆy(x, d) := e[y|x, d] is the minimizer of the loss e[(y − ˆy)2|x, d], and thus the estimator ˆy is the minimzier of e[(y − ˆy)2] = ex,d[e[(y − ˆy)2|x, d]]. for linear regression with gaussian priors and gaussian noise, the bayesian estimator in eq. (18) has a closed-form expression: LINEBREAK ˆw = LINEBREAK x ⊤x + LINEBREAK x ⊤y ; LINEBREAK ˆy = ˆw⊤x . LINEBREAK note that this predictor has the same form as the ridge predictor from section 2.3, with the regularization parameter set to σ2 in the presence of noisy labels, does icl match this bayesian τ 2 . predictor? we explore this by varying both the dataset noise σ2 and the prior variance τ 2 (sampling w ∼ n (0, τ 2)). for these experiments, the spd values between the in-context learner and various regularized linear models is shown in fig. 2. as predicted, as variance increases, the value of the ridge parameter that best explains icl behavior also increases. for all values of σ2, τ 2, the ridge parameter that gives the best fit to the transformer behavior is also the one that minimizes bayes risk. these experiments clarify the finding above, showing that icl in this setting behaviorally matches minimum-bayes-risk predictor. we also note that when the noise level σ → 0+, the bayes predictor converges to the ordinary least square predictor. therefore, the results on noiseless datasets studied in the beginning paragraph of this subsection can be viewed as corroborating the finding here in the setting with σ → 0+. LINEBREAK icl exhibits algorithmic phase transitions as model depth increases. the two experiments above evaluated extremely high-capacity models in which (given findings in section 3) computational constraints are not likely to play a role in the choice of algorithm implemented by icl. but what about smaller models—does the size of an in-context learner play a role in determining the learning algorithm it implements? to answer this question, we run two final behavioral experiments: one in which we vary the hidden size (while optimizing the depth and number of heads as in section 4.2), then vary the depth of the transformer (while optimizing the hidden size and number of heads). these experiments are conducted without dataset noise. LINEBREAK (a) linear regression problem with d = 8 LINEBREAK (b) linear regression problem with d = 16 LINEBREAK figure 3: computational constraints on icl: we show spd averaged over underdetermined region of the linear regression problem. in-context learners behaviorally match ordinary least squares predictors if there is enough number of layers and hidden sizes. when varying model depth (left background), algorithmic “phases” emerge: models transition between being closer to gradient descent, (red background), ridge regression (green background), and ols regression (blue). LINEBREAK results are shown in fig. 3. when we vary the depth, learners occupy three distinct regimes: very shallow models (1l) are best approximated by a single step of gradient descent (though not wellapproximated in an absolute sense). slightly deeper models (2l-4l) are best approximated by ridge regression, while the deepest (+8l) models match ols as observed in fig. 3. similar phase shift occurs when we vary hidden size in a 16d problem. interestingly, we can read hidden size requirements to be close to ridge-regression-like solutions as h ≥ 16 and h ≥ 32 for 8d and 16d problems respectively, suggesting that icl discovers more efficient ways to use available hidden state than our theoretical constructions requiring o(d2). together, these results show that icl does not necessarily involve minimum-risk prediction. however, even in models too computationally constrained to perform bayesian inference, alternative interpretable computations can emerge. LINEBREAK does icl encode meaningful intermediate quantities? LINEBREAK section 4 showed that transformers are a good fit to standard learning algorithms (including those constructed in section 3) at the computational level. but these experiments leave open the question of how these computations are implemented at the algorithmic level. how do transformers arrive at the solutions in section 4, and what quantities do they compute along the way? research on extracting precise algorithmic descriptions of learned models is still in its infancy (cammarata et al., 2020; mu & andreas, 2020). however, we can gain insight into icl by inspecting learners’ intermediate states: asking what information is encoded in these states, and where. LINEBREAK to do so, we identify two intermediate quantities that we expect to be computed by gradient descent and ridge-regression variants: the moment vector x ⊤y and the (min-norm) least-square estimated weight vector wols, each calculated after feeding n exemplars. we take a trained in-context learner, freeze its weights, then train an auxiliary probing model (alain & bengio, 2016) to attempt to recover the target quantities from the learner’s hidden representations. specifically, the probe model takes hidden states at a layer h (l) as input, then outputs the prediction for target variable. we define a probe with position-attention that computes (appendix e): LINEBREAK α = softmax(sv) ˆv = ffv(α⊤wvh (l)) LINEBREAK figure 4: probing results on d = 4 problem: both moments x ⊤y (top) and least-square solution wols (middle) are recoverable from learner representations. plots in the left column show the accuracy of the probe for each target in different model layers. dashed lines show the best probe accuracies obtained on a control task featuring a fixed weight vector w = 1. plots in the right column show the attention heatmap for the best layer’s probe, with the number of input examples on the x-axis. the value of the target after n exemplars is decoded primarily from the representation of yn, or, after n = d examplars, uniformly from yn≥4. LINEBREAK we train this probe to minimize the squared error between the predictions and targets v: l(v, ˆv) = |v − ˆv|2. the probe performs two functions simultaneously: its prediction error on held-out representations determines the extent to which the target quantity is encoded, while its attention mask, α identifies the location in which the target quantity is encoded. for the ff term, we can insert the function approximator of our choosing; by changing this term we can determine the manner in which the target quantity is encoded—e.g. if ff is a linear model and the probe achieves low error, then we may infer that the target is encoded linearly. LINEBREAK for each target, we train a separate probe for the value of the target on each prefix of the dataset: i.e. one probe to decode the value of w computed from a single training example, a second probe to decode the value for two examples, etc. results are shown in fig. 4. for both targets, a 2layer mlp probe outperforms a linear probe, meaning that these targets are encoded nonlinearly (unlike the constructions in section 3). however, probing also reveals similarities. both targets are decoded accurately deep in the network (but inaccurately in the input layer, indicating that probe success is non-trivial.) probes attend to the correct timestamps when decoding them. as in both constructions, x ⊤y appears to be computed first, becoming predictable by the probe relatively early in the computation (layer 7); while w becomes predictable later (around layer 12). for comparison, we additionally report results on a control task in which the transformer predicts ys generated with a fixed weight vector w = 1 (so no icl is required). probes applied to these models perform significantly worse at recovering moment matrices (see appendix e for details). LINEBREAK conclusion LINEBREAK we have presented a set of experiments characterizing the computations underlying in-context learning of linear functions in transformer sequence models. we showed that these models are capable in theory of implementing multiple linear regression algorithms, that they empirically implement this range of algorithms (transitioning between algorithms depending on model capacity and dataset noise), and finally that they can be probed for intermediate quantities computed by these algorithms. LINEBREAK while our experiments have focused on the linear case, they can be extended to many learning problems over richer function classes—e.g. to a network whose initial layers perform a non-linear feature computation. even more generally, the experimental methodology here could be applied to larger-scale examples of icl, especially language models, to determine whether their behaviors are also described by interpretable learning algorithms. while much work remains to be done, our results offer initial evidence that the apparently mysterious phenomenon of in-context learning can be understood with the standard ml toolkit, and that the solutions to learning problems discovered by machine learning researchers may be discovered by gradient descent as well. LINEBREAK acknowledgements LINEBREAK we thank evan hernandez, andrew drozdov, ed chi for their feedback on the early drafts of this paper. at mit, ekin aky¨urek is supported by an mit-amazon sciencehub fellowship and by the mit-ibm watson ai lab. LINEBREAK references LINEBREAK guillaume alain and yoshua bengio. understanding intermediate layers using linear classifier probes. arxiv preprint, abs/1610.01644, 2016. url https://arxiv.org/abs/1610.01644. LINEBREAK marcin andrychowicz, misha denil, sergio gomez colmenarejo, matthew w. hoffman, david pfau, tom schaul, and nando de freitas. learning to learn by gradient descent by gradient descent. in daniel d. lee, masashi sugiyama, ulrike von luxburg, isabelle guyon, and roman garnett (eds.), advances in neural information processing systems 29: annual conference on neural information processing systems 2016, december 5-10, 2016, barcelona, spain, pp. 3981–3989, 2016. url https://proceedings.neurips.cc/paper/2016/hash/ fb87582825f9d28a8d42c5e5e5e8b23d-abstract.html. LINEBREAK jimmy lei ba, jamie ryan kiros, and geoffrey e hinton. layer normalization. arxiv preprint, LINEBREAK tom b. brown, benjamin mann, nick ryder, melanie subbiah, jared kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, sandhini agarwal, ariel herbert-voss, gretchen krueger, tom henighan, rewon child, aditya ramesh, daniel m. ziegler, jeffrey wu, clemens winter, christopher hesse, mark chen, eric sigler, mateusz litwin, scott gray, benjamin chess, jack clark, christopher berner, sam mccandlish, alec radford, ilya sutskever, and dario amodei. language models are few-shot learners. in hugo larochelle, marc’aurelio ranzato, raia hadsell, maria-florina balcan, and hsuan-tien lin (eds.), advances in neural information processing systems 33: annual conference on neural information processing systems 2020, neurips 2020, december 6-12, 2020, virtual, 2020. url https://proceedings.neurips.cc/paper/2020/hash/ 1457c0d6bfcb4967418bfb8ac142f64a-abstract.html. LINEBREAK nick cammarata, shan carter, gabriel goh, chris olah, michael petrov, ludwig schubert, chelsea LINEBREAK voss, ben egan, and swee kiat lim. thread: circuits. distill, 5(3):e24, 2020. LINEBREAK stephanie cy chan, adam santoro, andrew k lampinen, jane x wang, aaditya singh, pierre h richemond, jay mcclelland, and felix hill. data distributional properties drive emergent fewshot learning in transformers. arxiv preprint, abs/2205.05055, 2022. url https://arxiv.org/ abs/2205.05055. LINEBREAK chi chen, maosong sun, and yang liu. mask-align: self-supervised neural word alignment. in proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: long papers), pp. 4781–4791, online, 2021. association for computational linguistics. doi: 10.18653/v1/ 2021.acl-long.369. url https://aclanthology.org/2021.acl-long.369. LINEBREAK yanda chen, ruiqi zhong, sheng zha, george karypis, and he he. meta-learning via lanin proceedings of the 60th annual meeting of the associaguage model in-context tuning. tion for computational linguistics (volume 1: long papers), pp. 719–730, dublin, ireland, 2022. association for computational linguistics. doi: 10.18653/v1/2022.acl-long.53. url https://aclanthology.org/2022.acl-long.53. LINEBREAK aakanksha chowdhery, sharan narang, jacob devlin, maarten bosma, gaurav mishra, adam roberts, paul barham, hyung won chung, charles sutton, sebastian gehrmann, et al. palm: scaling language modeling with pathways. arxiv preprint, abs/2204.02311, 2022. url https://arxiv.org/abs/2204.02311. LINEBREAK chelsea finn, pieter abbeel, and sergey levine. model-agnostic meta-learning for fast adaptation of deep networks. in doina precup and yee whye teh (eds.), proceedings of the 34th international conference on machine learning, icml 2017, sydney, nsw, australia, 6-11 august 2017, volume 70 of proceedings of machine learning research, pp. 1126–1135. pmlr, 2017. url http://proceedings.mlr.press/v70/finn17a.html. LINEBREAK shivam garg, dimitris tsipras, percy liang, and gregory valiant. what can transformers learn LINEBREAK in-context? a case study of simple function classes. arxiv, abs/2208.01066, 2022. LINEBREAK dan hendrycks and kevin gimpel. gaussian error linear units (gelus). LINEBREAK arxiv preprint, LINEBREAK arthur e hoerl and robert w kennard. ridge regression: biased estimation for nonorthogonal LINEBREAK kurt hornik, maxwell stinchcombe, and halbert white. multilayer feedforward networks are uni LINEBREAK versal approximators. neural networks, 2(5):359–366, 1989. LINEBREAK louis kirsch and j¨urgen schmidhuber. meta learning backpropagation and improving it. advances LINEBREAK michael laskin, luyu wang, junhyuk oh, emilio parisotto, stephen spencer, richie steigerwald, dj strouse, steven hansen, angelos filos, ethan brooks, et al. in-context reinforcement learning with algorithm distillation. arxiv preprint, abs/2210.14215, 2022. url https://arxiv.org/ abs/2210.14215. LINEBREAK david marr. vision: a computational investigation into the human representation and processing of LINEBREAK visual information. mit press, 2010. LINEBREAK sewon min, mike lewis, luke zettlemoyer, and hannaneh hajishirzi. metaicl: learning to learn in proceedings of the 2022 conference of the north american chapter of the asin context. sociation for computational linguistics: human language technologies, pp. 2791–2809, seattle, united states, 2022. association for computational linguistics. doi: 10.18653/v1/2022. naacl-main.201. url https://aclanthology.org/2022.naacl-main.201. LINEBREAK jesse mu and jacob andreas. LINEBREAK compositional explanations of neurons. LINEBREAK in hugo larochelle, marc’aurelio ranzato, raia hadsell, maria-florina balcan, and hsuan-tien lin (eds.), advances in neural annual conferinformation processing systems 33: information processing systems 2020, neurips 2020, december 6ence on neural url https://proceedings.neurips.cc/paper/2020/hash/ 12, 2020, virtual, 2020. c74956ffb38ba48ed6ce977af6727275-abstract.html. LINEBREAK catherine olsson, nelson elhage, neel nanda, nicholas joseph, nova dassarma, t. j. henighan, benjamin mann, amanda askell, yushi bai, anna chen, tom conerly, dawn drain, deep ganguli, zac hatfield-dodds, danny hernandez, scott johnston, andy jones, john kernion, liane lovitt, kamal ndousse, dario amodei, tom b. brown, jack clark, jared kaplan, sam mccandlish, and christopher olah. in-context learning and induction heads. 2022. LINEBREAK imanol schlag, kazuki irie, and j¨urgen schmidhuber. linear transformers are secretly fast weight in marina meila and tong zhang (eds.), proceedings of the 38th internaprogrammers. tional conference on machine learning, icml 2021, 18-24 july 2021, virtual event, volume 139 of proceedings of machine learning research, pp. 9355–9366. pmlr, 2021. url http://proceedings.mlr.press/v139/schlag21a.html. LINEBREAK juergen schmidhuber, jieyu zhao, and marco a wiering. simple principles of metalearning. 1996. LINEBREAK jack sherman and winifred j morrison. adjustment of an inverse matrix corresponding to a change in one element of a given matrix. the annals of mathematical statistics, 21(1):124–127, 1950. LINEBREAK ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n. gomez, in isabelle guyon, ulrike lukasz kaiser, and illia polosukhin. attention is all you need. von luxburg, samy bengio, hanna m. wallach, rob fergus, s. v. n. vishwanathan, and roman garnett (eds.), advances in neural information processing systems 30: annual conference on neural information processing systems 2017, december 4-9, 2017, long beach, ca, usa, pp. 5998–6008, 2017. url https://proceedings.neurips.cc/paper/2017/hash/ 3f5ee243547dee91fbd053c1c4a845aa-abstract.html. LINEBREAK colin wei, yining chen, and tengyu ma. statistically meaningful approximation: a case study on approximating turing machines with transformers. arxiv preprint, abs/2107.13163, 2021. url https://arxiv.org/abs/2107.13163. LINEBREAK sang michael xie, aditi raghunathan, percy liang, and tengyu ma. an explanation of in-context learning as implicit bayesian inference. arxiv preprint, abs/2111.02080, 2021. url https: //arxiv.org/abs/2111.02080. LINEBREAK sang michael xie, aditi raghunathan, percy liang, and tengyu ma. an explanation of in-context LINEBREAK learning as implicit bayesian inference. arxiv, abs/2111.02080, 2022. LINEBREAK chulhee yun, srinadh bhojanapalli, ankit singh rawat, sashank j. reddi, and sanjiv kumar. are transformers universal approximators of sequence-to-sequence functions? in 8th international conference on learning representations, iclr 2020, addis ababa, ethiopia, april 26-30, 2020. openreview.net, 2020. url https://openreview.net/forum?id=byxrm0ntvr. LINEBREAK susan zhang, stephen roller, naman goyal, mikel artetxe, moya chen, shuohui chen, christopher dewan, mona diab, xian li, xi victoria lin, todor mihaylov, myle ott, sam shleifer, kurt shuster, daniel simig, punit singh koura, anjali sridhar, tianlu wang, and luke zettlemoyer. opt: open pre-trained transformer language models, 2022. LINEBREAK kaiyang zhou, jingkang yang, chen change loy, and ziwei liu. learning to prompt for vision LINEBREAK language models. international journal of computer vision, 130(9):2337–2348, 2022. LINEBREAK a theorem 1 LINEBREAK the operations for 1-step sgd with single exemplar can be expressed as following chain (please see proofs for the transformer implementation of these operations (lemma 1) in appendix c): LINEBREAK this will map: LINEBREAK we can verify the chain of operator step-by-step. in each step, we show only the non-zero rows. LINEBREAK (move x) LINEBREAK (w⊤x) LINEBREAK (w⊤x − y) LINEBREAK (x(w⊤x − y)) LINEBREAK (write w) LINEBREAK w LINEBREAK w LINEBREAK w LINEBREAK w LINEBREAK (w′) LINEBREAK (move w′) LINEBREAK we obtain the updated prediction in the last hidden unit of the third time-step. LINEBREAK generalizing to multiple steps of sgd. since w′ is written in the hidden states, we may repeat this iteration to obtain ˆy3 = w′′⊤x3 where w′′ is the one step update w′ − 2α(x2w′⊤x2 − y2x2 + λw, requiring a total of o(n) layers for a single pass through the dataset where n is the number of examplers. LINEBREAK as an empirical demonstration of this procedure, the accompanying code release contains a reference implementation of sgd defined in terms of the base primitive provided in an anymous links https://icl1.s3.us-east-2.amazonaws.com/theory/{primitives,sgd,ridge}.py (to preserve the anonymity we did not provide the library dependencies). this implementation predicts ˆyn = w⊤ n xn, where wn is the weight vector resulting from n − 1 consecutive sgd updates on previous examples. it can be verified there that the procedure requires o(n + d) hidden space. note that, it is not o(nd) because we can reuse spaces for the next iteration for the intermediate variables, an example of this performed in (w′) step above highlighted with blue color. LINEBREAK b theorem 2
| 14
|
[
108.299,
328.6166768,
189.6176,
340.5718768
] |
XXTyv1zD9zD.pdf
| 2,023
| 2
|
LINEBREAK packed-ensembles for efficient uncertainty estimation LINEBREAK olivier laurent,1,2,* adrien lafage,2,* enzo tartaglione,3 geoffrey daniel,1 jean-marc martinez,1 andrei bursuc4 & gianni franchi2, † LINEBREAK universit´e paris-saclay, cea, sgls,1 u2is, ensta paris, institut polytechnique de paris,2 ltci, t´el´ecom paris, institut polytechnique de paris,3 valeo.ai4 LINEBREAK abstract LINEBREAK deep ensembles (de) are a prominent approach for achieving excellent performance on key metrics such as accuracy, calibration, uncertainty estimation, and out-of-distribution detection. however, hardware limitations of real-world systems constrain to smaller ensembles and lower-capacity networks, significantly deteriorating their performance and properties. we introduce packed-ensembles (pe), a strategy to design and train lightweight structured ensembles by carefully modulating the dimension of their encoding space. we leverage grouped convolutions to parallelize the ensemble into a single shared backbone and forward pass to improve training and inference speeds. pe is designed to operate within the memory limits of a standard neural network. our extensive research indicates that pe accurately preserves the properties of de, such as diversity, and performs equally well in terms of accuracy, calibration, out-of-distribution detection, and robustness to distribution shift. we make our code available at github.com/enstau2is/torch-uncertainty. LINEBREAK figure 1: evaluation of computation cost vs. performance trade-offs for multiple uncertainty quantification techniques on cifar-100. the y-axis and x-axis respectively show the accuracy and inference time in images per second. the circle area is proportional to the number of parameters. optimal approaches are closer to the top-right corner. packed-ensembles strikes a good balance between predictive performance and speed. LINEBREAK introduction LINEBREAK real-world safety-critical machine learning decision systems such as autonomous driving (levinson et al., 2011; mcallister et al., 2017) impose exceptionally high reliability and performance requirements across a broad range of metrics: accuracy, calibration, robustness to distribution shifts, uncertainty estimation, and computational efficiency under limited hardware resources. despite significant improvements in performance in recent years, vanilla deep neural networks (dnns) still LINEBREAK *equal contribution LINEBREAK † corresponding author - [email protected] LINEBREAK exhibit several shortcomings, notably overconfidence in both correct and wrong predictions (nguyen et al., 2015; guo et al., 2017; hein et al., 2019). deep ensembles (lakshminarayanan et al., 2017) have emerged as a prominent approach to address these challenges by leveraging predictions from multiple high-capacity neural networks. by averaging predictions or by voting, de achieves high accuracy and robustness since potentially unreliable predictions are exposed via the disagreement between individuals. thanks to the simplicity and effectiveness of the ensembling strategy (dietterich, 2000), de have become widely used and dominate performance across various benchmarks (ovadia et al., 2019; gustafsson et al., 2020). LINEBREAK de meet most of the real-world application requirements except computational efficiency. specifically, de are computationally demanding in terms of memory storage, number of operations, and inference time during both training and testing, as their costs grow linearly with the number of individuals. their computational costs are, therefore, prohibitive under tight hardware constraints. LINEBREAK this limitation of de has inspired numerous approaches proposing computationally efficient alternatives: multi-head networks (lee et al., 2015; chen & shrivastava, 2020), ensemble-imitating layers (wen et al., 2019; havasi et al., 2020; ram´e et al., 2021), multiple forwards on different weight subsets of the same network (gal & ghahramani, 2016; durasov et al., 2021), ensembles of smaller networks (kondratyuk et al., 2020; lobacheva et al., 2020), computing ensembles from a single training run (huang et al., 2017; garipov et al., 2018), and efficient bayesian neural networks (maddox et al., 2019; franchi et al., 2020). these approaches typically improve storage usage, train cost, or inference time at the cost of lower accuracy and diversity in the predictions. LINEBREAK an essential property of ensembles to improve predictive uncertainty estimation is related to the diversity of its predictions. perrone & cooper (1992) show that the independence of individuals is critical to the success of ensembling. fort et al. (2019) argue that the diversity of de, due to randomness from weight initialization, data augmentation and batching, and stochastic gradient updates, is superior to other efficient ensembling alternatives, despite their predictive performance boosts. few approaches manage to mirror this property of de in a computationally efficient manner close to a single dnn (in terms of memory usage, number of forward passes, and image throughput). LINEBREAK in this work, we aim to design a dnn architecture that closely mimics properties of ensembles, in particular, having a set of independent networks, in a computationally efficient manner. previous works propose ensembles composed of small models (kondratyuk et al., 2020; lobacheva et al., 2020) and achieve performances comparable to a single large model. we build upon this idea and devise a strategy based on small networks trying to match the performance of an ensemble of large networks. to this end, we leverage grouped convolutions (krizhevsky et al., 2012) to delineate multiple subnetworks within the same network. the parameters of each subnetwork are not shared across subnetworks, leading to independent smaller models. this method enables fast training and inference times while predictive uncertainty quantification is close to de (figure 1). LINEBREAK in summary, our contributions are the following: LINEBREAK • we propose packed-ensembles (pe), an efficient ensembling architecture relying on LINEBREAK grouped convolutions, as a formalization of structured sparsity for deep ensembles; LINEBREAK • we extensively evaluate pe regarding accuracy, calibration, ood detection, and distribution shift on classification and regression tasks. we show that pe achieves state-of-the-art predictive uncertainty quantification. LINEBREAK • we thoroughly study and discuss the properties of pe (diversity, sparsity, stability, behavior LINEBREAK of subnetworks) and release our pytorch implementation. LINEBREAK background LINEBREAK in this section, we present the formalism for this work and offer a brief background on grouped convolutions and ensembles of dnns. appendix a summarizes the main notations in table 3. LINEBREAK background on convolutions LINEBREAK the convolutional layer (lecun et al., 1989) consists of a series of cross-correlations between feature maps hj ∈ rcj ×hj ×wj regrouped in batches of size b and a weight tensor ωj ∈ rcj+1×cj ×s2 LINEBREAK j LINEBREAK figure 2: overview of the considered architectures: (left) baseline vanilla network; (center) deep ensembles; (right) packed-ensembles-(α, m = 3, γ = 2). LINEBREAK with cj, hj, wj three integers representing the number of channels, the height and the width of hj respectively. cj+1 and sj are also two integers corresponding to the number of channels of hj+1 (the output of the layer) and the kernel size. finally, j is the layer’s index and will be fixed in the following formulae. the bias of convolution layers will be omitted in the following for simplicity. hence the output value of the convolution layer, denoted ⊛, is: LINEBREAK zj+1(c, :, :) = (hj ⊛ ωj)(c, :, :) = LINEBREAK ωj(c, k, :, :) ⋆ hj(k, :, :), LINEBREAK where c ∈ is the index of the considered channel of the output feature map, ⋆ is the classical 2d cross-correlation operator, and zj is the pre-activation feature map such that hj = ϕ(zj) with ϕ an activation function. LINEBREAK to embed an ensemble of subnetworks, we leverage grouped convolutions, already used in resnext (xie et al., 2017) to train several dnn branches in parallel. the grouped convolution operation with γ groups and weights ωi j is given in (2), γ dividing cj for all layers. any output channel c is produced by a specific group (set of filters), identified by the integer (cid:106) γc cj+1 LINEBREAK (cid:107) , which only uses 1 LINEBREAK γ of the input channels: LINEBREAK γ ∈ rcj+1× LINEBREAK cj γ ×s2 LINEBREAK zj+1(c, :, :) = (hj ⊛ ωj LINEBREAK γ)(c, :, :) LINEBREAK ωj LINEBREAK γ (c, k, :, :) ⋆ hj LINEBREAK k + LINEBREAK (cid:23) cj γ LINEBREAK the grouped convolution layer is mathematically equivalent to a classical convolution where the weights are multiplied element-wise by the binary tensor maskm ∈ {0, 1}cj+1×cj ×s2 j such that maskj LINEBREAK = m for each group m ∈ LINEBREAK . the complete LINEBREAK m(k, l, :, :) = 1 if LINEBREAK layer mask is finally defined as maskj = rewritten as zj+1 = hj ⊛ (cid:0)ωj ◦ maskj(cid:1), where ◦ is the hadamard product. LINEBREAK maskj LINEBREAK m and the grouped convolution can therefore be LINEBREAK background on deep ensembles LINEBREAK for an image classification problem, let us define a dataset d = {xi, yi}|d| i=1 containing |d| pairs of i ∈ rc0×h0×w0 and one-hot-encoded labels yi ∈ rnc modeled as the realization samples xi = h0 of a joint distribution p(x,y ) where nc is the number of classes in the dataset. the input data xi is processed via a neural network fθ which is a parametric probabilistic model such that ˆyi = fθ(xi) = p (y = yi|x = xi; θ). this approach consists in considering the prediction ˆyi as parameters of a multinoulli distribution. LINEBREAK figure 3: equivalent architectures for packed-ensembles. (a) corresponds to the first sequential version, (b) to the version with the rearrange operation and grouped convolutions and (c) to the final version beginning with a full convolution. LINEBREAK to improve the quality of both predictions and estimated uncertainties, as well as the detection of ood samples, lakshminarayanan et al. (2017) propose to ensemble m randomly initialized dnns as a large predictor called deep ensembles. these ensembles can be seen as a discrete approximation of the intractable bayesian marginalization on the weights, according to wilson & izmailov (2020). if we note {θm}m −1 m=0 the set of trained weights for the m dnns, deep ensembles consists in averaging the predictions of these m dnns as in equation (3). LINEBREAK p (yi|xi, d) = LINEBREAK p (yi|xi, θm) LINEBREAK packed-ensembles LINEBREAK this section describes how to train multiple subnetworks using grouped convolution efficiently. then, we explain how our new architectures are equivalent to training several networks in parallel. LINEBREAK revisiting deep ensembles LINEBREAK although deep ensembles provide undisputed benefits, they also come with the significant drawback that the training time and the memory usage in inference increase linearly with the number of networks. to alleviate these problems, we propose assembling small subnetworks, which are essentially dnns with fewer parameters. moreover, while ensembles to this day have mostly been trained sequentially, we suggest leveraging grouped convolutions to massively accelerate their training and inference computations thanks to their smaller size. the propagation of grouped convolutions with m groups, m being the number of subnetworks in the ensemble, ensures that the subnetworks are trained independently while dividing their encoding dimension by a factor m . more details on the usefulness of grouped convolutions to train ensembles can be found in subsection 3.3. LINEBREAK to create packed-ensembles (illustrated in figure 2), we build on small subnetworks but compensate for the dramatic decrease of the model capacity by multiplying the width by the hyperparameter α, which can be seen as an expansion factor. hence, we propose packed-ensembles-(α, m, 1) as a flexible formalization of ensembles of small subnetworks. for an ensemble of m subnetworks, packed-ensembles-(α, m, 1) therefore modifies the encoding dimension by a factor α m and the inference of our ensemble is computed with the following formula, omitting the index i of the sample: LINEBREAK ˆy = LINEBREAK p (y|θα,m, x) with θα,m = {ωj LINEBREAK α ◦ maskj LINEBREAK m}j, LINEBREAK where ωj,α is the weight of the layer j of dimension (αcj+1) × (αcj) × s2 j . LINEBREAK figure 4: diagram representation of a subnetwork mask: maskj, with m = 2, j an integer corresponding to a fully connected layer LINEBREAK in the following, we introduce another hyperparameter γ corresponding to the number of groups of each subnetwork of the packed-ensembles, creating another level of sparsity. these groups are also called ”subgroups” and are applied to the different subnetworks. formally, we denote our technique packed-ensembles-(α, m, γ), with the hyperparameters in the parentheses. in this work, we consider a constant number of subgroups across the layers; therefore, γ divides αcj for all j. LINEBREAK computational cost LINEBREAK for a convolutional layer, the number of parameters involving cj input channels, cj+1 output channels, kernels of size sj and γ subgroups is equal to m × LINEBREAK the same formula applies to dense layers as 1 × 1 convolutions. two cases emerge when the m , the number of architectures of the subnetworks are fully convolutional or dense. parameters in the ensemble equals the number of parameters in a single model. with α = m , each subnetwork corresponds to a single model (and their ensemble is therefore equivalent in size to de). LINEBREAK if α = LINEBREAK implementation details
| 4
|
[
132.15924,
340.2390784,
247.2774465,
350.2016784
] |
3k5CUGDLNdd.pdf
| 2,023
| 0
|
LINEBREAK benchmarking offline reinforcement learning on real-robot hardware LINEBREAK nico gürtler1, sebastian blaes1, pavel kolev1, felix widmaier1, manuel wüthrich2, stefan bauer3, bernhard schölkopf 1, and georg martius1 LINEBREAK 1max planck institute for intelligent systems∗ 2harvard university 3kth stockholm LINEBREAK abstract LINEBREAK learning policies from previously recorded data is a promising direction for realworld robotics tasks, as online learning is often infeasible. dexterous manipulation in particular remains an open problem in its general form. the combination of offline reinforcement learning with large diverse datasets, however, has the potential to lead to a breakthrough in this challenging domain analogously to the rapid progress made in supervised learning in recent years. to coordinate the efforts of the research community toward tackling this problem, we propose a benchmark including: i) a large collection of data for offline learning from a dexterous manipulation platform on two tasks, obtained with capable rl agents trained in simulation; ii) the option to execute learned policies on a real-world robotic system and a simulation for efficient debugging. we evaluate prominent open-sourced offline reinforcement learning algorithms on the datasets and provide a reproducible experimental setup for offline reinforcement learning on real systems. visit https://sites.google.com/view/ benchmarking-offline-rl-real for more details. LINEBREAK introduction LINEBREAK reinforcement learning (rl) (sutton et al., 1998) holds great potential for robotic manipulation and other real-world decision-making problems as it can solve tasks autonomously by learning from interactions with the environment. when data can be collected during learning, rl in combination with high-capacity function approximators can solve challenging high-dimensional problems (mnih et al., 2015; lillicrap et al., 2016; silver et al., 2017; berner et al., 2019). however, in many cases online learning is not feasible because collecting a large amount of experience with a partially trained policy is either prohibitively expensive or unsafe (dulac-arnold et al., 2020). examples include autonomous driving, where suboptimal policies can lead to accidents, robotic applications where the hardware is likely to get damaged without additional safety mechanisms, and collaborative robotic scenarios where humans are at risk of being harmed. LINEBREAK offline reinforcement learning (offline rl or batch rl) (lange et al., 2012) tackles this problem by learning a policy from prerecorded data generated by experts or handcrafted controllers respecting the system’s constraints. independently of how the data is collected, it is essential to make the best possible use of it and to design algorithms that improve performance with the increase of available data. this property has led to unexpected generalization in computer vision (krizhevsky et al., 2012; he et al., 2016; redmon et al., 2016) and natural language tasks (floridi & chiriatti, 2020; devlin et al., 2018) when massive datasets are employed. with the motivation to learn similarly capable decision-making systems from data, the field of offline rl has gained considerable attention. progress is currently measured by benchmarking algorithms on simulated domains, both in terms of data collection and evaluation. LINEBREAK ∗correspondence to [email protected] LINEBREAK figure 1: the trifinger manipulation platform (wüthrich et al., 2021; bauer et al., 2022). left: the robot has 3 arms with 3 dof each. the cube is constrained by a bowl-shaped arena, allowing for unattended data collection. right: a cluster of these robots for parallel data collection and evaluation. LINEBREAK yet, real-world data differs from simulated data qualitatively and quantitatively in several aspects (dulac-arnold et al., 2020). first, observations are noisy and sometimes faulty. second, real-world systems introduce delays in the sensor readings and often have different sampling rates for different modalities. third, the action execution can also be delayed and can get quantized by low-level hardware constraints. fourth, real-world environments are rarely stationary. for instance, in autonomous robotics, battery voltages might drop, leading to reduced motor torques for the same control command. similarly, thermal effects change sensor readings and motor responses. abrasion changes friction behavior and dust particles can change object appearances and sensing in general. fifth, contacts are crucial for robotic manipulation but are only insufficiently modeled in current physics simulations, in particular for soft materials. lastly, physical robots have individual variations. LINEBREAK since real-world data is different from simulated data, it is important to put offline rl algorithms to the test on real systems. we propose challenging robotic manipulation datasets recorded on real robots for two tasks: object pushing and object lifting with reorientation on the trifinger platform (wüthrich et al., 2021). to study the differences between real and simulated environments, we also provide datasets collected in simulation. our benchmark of state-of-the-art offline rl algorithms on these datasets reveals that they are able to solve the moderately difficult pushing task while their performance on the more challenging lifting task leaves room for improvement. in particular, there is a much larger gap between the performance of the expert policy and offline-learned policies on the real system compared to the simulated system. this underpins the importance of real-world benchmarks for offline rl. we furthermore study the impact of adding suboptimal trajectories to expert data and find that all algorithms are ‘distracted’ by them, i.e., their success rate drops significantly. this identifies an important open challenge for the offline rl community: robustness to suboptimal trajectories. LINEBREAK importantly, a cluster of trifinger robots is set up for evaluation of offline-learned policies for which remote access can be requested for research purposes. with our dataset and evaluation platform, we therefore aim to provide a breeding ground for future offline rl algorithms. LINEBREAK the trifinger platform LINEBREAK we use a robot cluster that was initially developed and build for the real robot challenge in 2020 and 2021 (bauer et al., 2022). the robots that constitute the cluster are an industrial-grade adaptation of a robotic platform called trifinger, an open-source hardware and software design introduced in wüthrich et al. (2021), see fig. 1.the robots have three arms mounted at a 120 degrees radially symmetric arrangement with 3 degrees of freedom (dof) each. the arms are actuated by outrunner brushless motors with a 1:9 belt-drive, yielding high agility, low friction, and good force feedback (details on the actuator modules can be found in grimminger et al. (2020)). pressure sensors inside the elastic fingertips provide basic tactile feedback. the working area, where objects can be manipulated, is encapsulated by a high barrier to ensure that the object stays inside the arena even during aggressive motions. this is essential for operation without human supervision. the robot is inside a closed housing that is well lit by top-mounted led panels making the images taken by three high-speed global shutter cameras consistent. the cameras are distributed between the arms to ensure objects are always seen by any camera. we study dexterous manipulation of a cube whose pose is estimated by a visual tracking system with 10 hz. LINEBREAK figure 2: overview of our approach. policies are trained with domain randomization in a parallel simulation using isaac gym (makoviychuk et al., 2021) and then deployed in the pybullet (coumans & bai, 2016) simulation and on the real system without fine-tuning to collect the datasets. we train state-of-the-art offline rl algorithms on these datasets and evaluate them on the respective system, i.e, the simulator or the real-robot cluster. LINEBREAK to abstract away the low-level details, we developed a software with a simple gym (brockman et al., 2016) interface in python that can interact with the robots at a maximal rate of 1 khz in position control or torque control mode (see (wüthrich et al., 2021) for details). we use a control frequency of 50 hz and torque control for this work. we have a custom object tracking tool to provide position and orientation of a single colored cube in the environment, allowing algorithms to work without visual input. LINEBREAK on top of this interface, we have developed a submission system that allows users to submit jobs to a cluster of these robots for unattended remote execution. this setup was specifically adapted for ease of use in the offline rl setting and was extensively tested. we will provide researchers with access to the robot cluster, which will allow them to evaluate the policies they trained on the dataset proposed herein. to ease development and study the fundamental differences between simulated and real world data, we provide a corresponding simulated environment using pybullet (coumans & bai, 2016). LINEBREAK to summarize, the hardware and software have the following three key properties: i) physically capable of dexterous manipulation; ii) robust enough for running and evaluating learning methods, and iii) easy to use (robot hardware and simulator) and integrated in existing code frameworks. LINEBREAK the trifinger datasets LINEBREAK we consider two tasks that involve a colored cube: pushing the cube to a target location and lifting the cube to a desired location and orientation. to create behavioral datasets for these tasks on the trifinger platform, we need expert policies, which we obtain using reinforcement learning in a parallel simulation environment with domain randomization. fig. 2 visualizes the entire procedure – from training to data collection to offline learning. in this section, we describe the tasks and the data collection while sec. 4 is dedicated to benchmarking offline rl algorithms on the collected data. LINEBREAK dexterous manipulation tasks LINEBREAK we consider two tasks on the trifinger platform that require dexterous manipulation of a cube: LINEBREAK push the goal is to move the cube to a target location. this task does not require the agent to align the orientation of the cube; the reward is based only on the desired and the achieved position. LINEBREAK lift the cube has to be picked up and moved to a target pose in the air which includes position and orientation. this requires flipping the cube on the ground, obtaining a stable grasp, lifting it to a target location and rotating it to match the target orientation. LINEBREAK following prior work (hwangbo et al., 2019; allshire et al., 2022) we define the reward by applying a logistic kernel k(x) = (b + 2) (exp(a∥x∥) + b + exp(−a∥x∥))−1 to the difference between desired and achieved position (for the push task) or the desired and achieved corner points of the cube (for LINEBREAK the lift task). the parameters a and b control the length scale over which the reward decays and how sensitive it is for small distances x, respectively. this yields a smooth, dense and bounded reward, see appendix b.3 for details. we define success in the pushing task as reaching the goal position with a tolerance of 2 cm. for the lifting task we additionally require to not deviate more than 22 degrees from the goal orientation. LINEBREAK we note that pushing is more challenging than it may appear due to inelastic collisions between the soft fingertips and the cube which are not modeled in rigid body physics simulators. furthermore, the performance of policies can be quite sensitive to the value of sliding friction. lifting is, however, even more challenging as flipping the cube based on a noisy object-pose with a low refresh rate is error-prone, learning the right sequence of behaviors requires long-term credit assignment and dropping the cube often results in loosing all progress in an episode. LINEBREAK training expert policies LINEBREAK we train expert policies with online rl in simulation which we then use for data collection on the real system (fig. 2). we build on prior work which achieved sim-to-real transfer for a dexterous manipulation task on the trifinger platform (allshire et al., 2022). this approach replicates the real system in a fast, gpu-accelerated rigid body physics simulator (makoviychuk et al., 2021) and trains with an optimized implementation (makoviichuk & makoviychuk, 2022) of proximal policy optimization (schulman et al., 2017) with a high number of parallel actors. we furthermore adopt their choice of a control frequency of 50 hz and use torque control to enable direct control of the fingers. the sensor input is the proprioceptive sensor information and the object pose. in order to obtain policies that are robust enough to work on the real system, domain randomization (tobin et al., 2017; mandlekar et al., 2017; peng et al., 2018) is applied: for each episode, physics parameters like friction coefficients are sampled from a distribution that is likely to contain the parameters of the real environment. additionally, noise is added to the observations and actions to account for sensor noise and the stochasticity of the real robot. furthermore, random forces are applied to the cube to obtain a policy that is robust against perturbations, as in (andrychowicz et al., 2020). the object and goal poses are represented by keypoints, i.e., the cartesian coordinates of the corners of the cube. this choice was empirically shown to accelerate training compared to separately encoding position and orientation in cartesian coordinates and a quaternion (allshire et al., 2022). LINEBREAK to improve the robustness of the trained policies across the different robot instances and against other real-world effects like tracking errors due to accumulating dust, we modified the implementation of allshire et al. (2022) in several ways. while the original code correctly models the 10 hz refresh rate of the object pose estimate, we found it beneficial to also simulate the delay between the time when the camera images are captured and when they are provided to the agent. this delay typically ranges between 100 ms and 200 ms. we furthermore fully randomize the initial orientation of the cube and use a hand-crafted convex decomposition of the barrier collision mesh to avoid artifacts of the automatic decomposition, to which the policy can overfit. for the pushing task we penalized rapid changes in the cube position and orientation as sliding and flipping the cube transfers less well to the real system than moving it in a slow and controlled manner. we observed that policies trained with rl in simulation tend to output oscillatory actions, which does not transfer well to the real system and causes stronger wear effects (mysore et al., 2021). to avoid this, we penalized changing the action which led to smoother movements and better performance. for the lift task we additionally consider a policy which was trained with an exponential moving average on the actions as we observed that vibrations on the real robot can lead to slipping and dropping (see fig. s14 (b)). these vibrations might be caused by elastic deformations of the robot hardware and the complex contact dynamics between the soft fingertips and the cube that are not modeled in simulation. as also observed in wang et al. (2022), the performance on the real system varies significantly with training seeds. we evaluated 20 seeds on the real system and used the best one for data collection. more details on training in simulation can be found in the appendix c.1. LINEBREAK data collection LINEBREAK we collected data for the pushing and lifting tasks both in a pybullet (coumans & bai, 2016) simulation (joshi et al., 2020) and on the real system, as shown in fig. 2. to ensure that the data collection procedures are identical, we run the same code with the simulator backend and with the LINEBREAK figure 3: an example behavior of our expert policy on the lifting task. the robot is grasping and reorienting the object to reach the desired target location and orientation (transparent cube). LINEBREAK real-robot backend on six trifinger platforms (fig. 1). we observed that policies learned in simulation struggle with retrieving the cube from the barrier on the real robot1. to alleviate this problem, we employ a predefined procedure to push the cube away from the barrier between episodes. the resulting starting positions together with the target positions are visualized in fig. s12. during data collection, self-tests are performed at regular intervals to ensure that all robots are fully functional. LINEBREAK for the dataset to be useful to the community, it should be possible to evaluate offline-learned policies on the real robots. as machine learning models can be computationally demanding, we wait for a fixed time interval between receiving a new observation and starting to apply the action based on this observation. this time budget is allocated for running the policy without deviating from the control frequency used for data collection. we choose 10 ms for the push task and 2 ms for the lift task as we found training with bigger delays difficult. note that our expert policies run in less than 1 ms. LINEBREAK we provide as much information about the system as possible in the observations. the robot state is captured by joint angles, angular velocities, recorded torques, fingertip forces, fingertip positions, fingertip velocities (both obtained via forward kinematics), and the id of the robot. the object pose is represented by a position, a quaternion encoding orientation, the keypoints, the delay of the camera images for tracking and the tracking confidence. the observation additionally contains the last action, which is applied during the fixed delay between observation and action. the desired and achieved goal are also included in the observation and contain either a position for the push task or keypoints for the lift task. some observations provide redundant information; however, we believe this simplifies working with the datasets, as we provide user-friendly python code that implements filtering as well as automatically converting observations to a flat array. moreover, we additionally publish a version of each dataset with camera images from three viewpoints. we believe that directly learning from these image datasets is an exciting challenge for the community2 and that they are moreover valuable in their own right as a large collection of robotic manipulation video footage. LINEBREAK for each task we consider pure expert data (expert), mixed data recorded with a range of training checkpoints (mixed), a combination of 50% expert trajectories and 50% trajectories recorded with a weaker policy with additive gaussian noise on the actions (weak&expert) and the 50% expert data in weak&expert (half-expert). we run the same policies in simulation and on the real system. an exemplary expert behavior for the lift task is shown in fig. 3. episodes last for 15 s for the push task and 30 s for the lift task as reorienting, grasping and lifting the cube requires more time. for the push task, we collect 16 h of interaction for each dataset, corresponding to 3840 episodes and 2.8 million transitions. for the more demanding lift task, we collect 20 h of robot interactions corresponding to 2400 episodes and 3.6 million transitions. the half-expert datasets contain the expert data that is included in the corresponding weak&expert datasets to isolate the effects of reducing the amount of expert data and adding suboptimal trajectories. the average success rates are provided next to the offline learning results in table 1 and 2 (see data column). in appendix b, we give a detailed analysis along with a specification (table s4) and statistics (table s5) of the offline rl datasets. LINEBREAK benchmarking offline reinforcement learning algorithms LINEBREAK we benchmark offline rl algorithms on pairs of simulated and real datasets and study the impact of data quality on their performance. we limit our evaluation to the best algorithms provided in the LINEBREAK 1possibly because the object tracking performance is slightly worse at the barrier or the dynamics of the LINEBREAK outstretched fingers aligns less well between simulation and reality. LINEBREAK 2at the time of writing we cannot benchmark on these datasets since the robot cluster does not provide LINEBREAK gpu-access at the moment. this will likely change in the near future. LINEBREAK push LINEBREAK lift LINEBREAK figure 4: average normalized success rates and returns (light colors) on real robots. each quantity is normalized by the dataset mean and averaged over all push or lift datasets. LINEBREAK table 1: pushing: success rate on the trifinger-push datasets. ‘data’ denotes the mean over the dataset. average and standard deviation over five training seeds. a star ∗ indicates significance w.r.t. all other methods using welch’s t-test with p < 0.05. LINEBREAK push-datasets LINEBREAK sim-expert sim-half-expert sim-weak&expert sim-mixed LINEBREAK real-expert real-half-expert real-weak&expert real-mixed LINEBREAK data LINEBREAK bc LINEBREAK crr LINEBREAK awac LINEBREAK cql LINEBREAK iql LINEBREAK open-source library d3rlpy (seno & imai, 2021) to keep the required robot time for the evaluation of the trained policies manageable. namely, we benchmark the following algorithms: bc (bain & sammut, 1995; pomerleau, 1991; ross et al., 2011; torabi et al., 2018), crr (wang et al., 2020), awac (nair et al., 2020), cql (kumar et al., 2020), and iql (kostrikov et al., 2021b). we report results for two sets of hyperparameters: the default values (except for cql for which we performed a grid search on push-sim-expert as the default parameters did not learn) and the results of a grid search on lift-sim-weak&expert (marked by †). details about the hyperparamters and their optimization are in appendix c.3. we think that the performance at the default hyperparameters is highly relevant for offline rl on real data as optimizing the hyperparameters without a simulator is often infeasible. LINEBREAK results LINEBREAK we train with five different seeds for each algorithm and evaluate with a fixed set of randomly sampled goals. details about the policy evaluation on the simulated and real set-up can be found in appendix d. we report success rates in the main text and returns in appendix a. LINEBREAK the benchmarking results for the push task are summarized in table 1. most of the offline rl algorithms perform well but the performance on the real data is generally worse. an exception to this pattern is cql which performs poorly on the simulated push task and gains some performance on the real data, perhaps due to the broader data distribution of the stochastic real-world environment. as expected bc performs well on the expert datasets but cannot exceed the dataset success rate on the weak&expert data, unlike crr, awac, and iql. on the expert data, crr and awac match the performance of the expert policy in simulation but fall slightly behind on the real data. interestingly, the performance of crr is not negatively impacted by weak trajectories (e.g. 84% on real-weak&expert compared to 78% on real-half-expert, where the latter only contains the expert data portion). we provide insights into how the behavior policy compares to an offline-trained policy for the push task in fig. 6 (b) and (c). LINEBREAK the more challenging lift task separates the algorithms more clearly as summarized in table 2. cql does not reach a non-zero success rate at all, despite our best efforts to optimize the hyperparameters (see appendix c.3). this is in line with the results reported in mandlekar et al. (2021) where cql failed to learn on the datasets corresponding to more complex manipulation tasks. kumar et al. (2021) furthermore discusses the sensitivity of cql to the choice of hyperparameters, especially on robotic data. while the best algorithms come close to matching the performance of the expert on lift-simexpert, they fall short of reaching the dataset success rate on the real-robot data (lift-real-expert). LINEBREAK table 2: lifting: success rate on the trifinger-lift datasets. ‘data’ denotes the mean over the dataset. average and standard deviation over five training seeds. experiments with hyperparameters optimized on sim-weak&expert are marked with a †. stars ∗ and ∗∗ indicate significance w.r.t. second best welch’s t-test with p < 0.05 and p < 0.01, respectively. LINEBREAK bc LINEBREAK crr LINEBREAK awac LINEBREAK cql LINEBREAK iql LINEBREAK lift-datasets LINEBREAK sim-expert sim-half-expert sim-weak&expert sim-mixed sim-expert† sim-half-expert† sim-weak&expert† sim-mixed† LINEBREAK real-smooth-expert real-expert real-half-expert real-weak&expert real-mixed real-expert† real-half-expert† real-weak&expert† real-mixed† LINEBREAK data LINEBREAK lift-sim-expert LINEBREAK lift-sim-half-expert LINEBREAK lift-sim-weak&expert LINEBREAK bc† LINEBREAK crr† LINEBREAK awac† LINEBREAK cql† LINEBREAK iql† LINEBREAK figure 5: success rates during offline rl training on the simulated lift task. the black dashed line indicates the performance of the expert dataset, and the red dashed line depicts average success rate of the weak&expert dataset. shaded areas indicate the interval between the 0.25 and 0.75 quantiles. learning curves for all experiments are shown in appendix a.6. LINEBREAK on the real-smooth-expert dataset the success rates are, on average, slightly lower, probably due to the non-markovian behavior policy. the returns are generally higher, however, likely due to the smoothed expert reaching higher returns (see table s2). LINEBREAK on the lift-weak&expert datasets all algorithms perform significantly worse than on the expert data. this effect is most pronounced on the real robot data and calls the ability of the algorithms to make good use of the 50% expert trajectories into question. to verify that the performance drop is not due to only half of the expert data being available, we also train solely on the expert trajectories contained in the weak&expert dataset. we refer to this dataset as half-expert. we find that the resulting policy performs significantly better, ruling out that the performance drop on the lift-weak&expert dataset is exclusively caused by a lack of data. fig. 5 shows that this is true for the simulated lift datasets as well. we conclude that the benchmarked offline rl algorithms still exhibit bc-like behavior, i.e., they are distracted by suboptimal data. their poor performance on the mixed datasets further underpins their reliance on imitation of a consistent expert as all algorithms struggle to learn from the data collected by a range of training checkpoints (see tables 1 and 2 and learning curves in section a.6). LINEBREAK the lift datasets, in particular those recorded on the real robots, generally contain more useful sub-trajectories than apparent from the success rate, which is defined as achieving the goal pose at the end of an episode. for example, during 87% of all episodes in the lift-real-expert dataset the goal pose is achieved at some point but the best algorithm crr achieves a success rate of only 57%. this suggests that these datasets have an untapped potential for trajectory stitching. as the observations LINEBREAK (a) impact of noise LINEBREAK (b) speed of the cube LINEBREAK (c) momentary success LINEBREAK expert LINEBREAK bc† LINEBREAK crr† LINEBREAK awac† LINEBREAK cql† LINEBREAK iql† LINEBREAK figure 6: analysis of policy behavior. (a) success rate for simulated lifting after training on data with varying relative environment noise scale (1.0 corresponds to the noise level of the real system). the dashed lines indicate the performance on the real system. (b) average speed of the cube over a pushing episode on the real system. some offline rl algorithms learn to move the cube faster than the expert. (c) momentary success during a pushing episode on the real system: the fraction of episodes during which the goal was achieved at a given point in time (trained on expert data). LINEBREAK are furthermore noisy and do not contain estimates of the velocity of the cube, training recurrent policies could potentially lead to an increase in performance. LINEBREAK to investigate the impact of noise on the performance of offline rl policies and the expert, we collected datasets in simulation for up to twice the noise amplitudes measured on the real system. fig. 6 (a) shows that the performance of the expert and the offline rl policies degrades only slowly when increasing the noise scale, ruling out that noise is the sole explanation for the performance gap between simulated and real system. as delays in the observation and action execution are already implemented in the simulated environment, we conclude that other factors like more complex contact dynamics and elastic deformations of the fingertips and robot limbs are likely causing the larger performance gap between data and learned policies on the real robots. LINEBREAK to test how well the policies learned from the datasets generalize over instances of the robot hardware, we evaluated on a hold-out robot which was not used for data collection. we did not see a significant difference in performance (see appendix a.3 for details on this experiment) suggesting that the datasets cover enough variations in the robot hardware to enable generalization to unseen robots. LINEBREAK in summary, crr and awac generally perform best on the proposed datasets with iql also being competitive after hyperparameter optimization. the performance gap between expert and offline rl is in general bigger on the real system, perhaps due to more challenging dynamics. LINEBREAK related work LINEBREAK offline rl: the goal of offline rl (levine et al., 2020; prudencio et al., 2022) is to learn effective policies without resorting to an online interaction by leveraging large and diverse datasets covering a sufficient amount of expert transitions. this approach is particularly interesting if interactions with the environment are either prohibitively costly or even dangerous. LINEBREAK offline rl faces a fundamental challenge, known as the distributional shift (ds) problem, originating from two sources. there is a distribution mismatch in training, as we use the behavioral data for training, but the learned policy would create a different state-visitation distribution. the second problem is that during policy improvement, the learned policy requires an evaluation of the q-function on unseen actions (out of distribution). an over-estimation of the q-value on these out-of-distribution samples leads to learning of a suboptimal policy. LINEBREAK several algorithmic schemes were proposed for addressing the ds problem: i) constraining the learned policy to be close to the behavior data (fujimoto et al., 2019; kumar et al., 2019b; zhang et al., 2021; kostrikov et al., 2021a); ii) enforcing conservative estimates of future rewards (kumar et al., 2020; yu et al., 2021; cheng et al., 2022); and iii) model-based methods that estimate the uncertainty via ensembles (janner et al., 2019; kidambi et al., 2020). LINEBREAK additionally, other approaches include: implicitly tackling the ds problem via (advantage-weighted) variants of behavioral cloning (nair et al., 2020; wang et al., 2020; chen et al., 2020; fujimoto & gu, 2021) or even completely bypassing it either by removing the off-policy evaluation and LINEBREAK performing a constrained policy improvement using an on-policy q estimate of the behavior policy (brandfonbrener et al., 2021), or by approximating the policy improvement step implicitly by learning on-data state value function (kostrikov et al., 2021b). an orthogonal research line considers combining importance sampling and off-policy techniques (nachum et al., 2019b;a; zhang et al., 2020; xu et al., 2021), and recently (chen et al., 2021; janner et al., 2021) investigated learning an optimal trajectory distribution via transformer architectures. LINEBREAK the simplest strategy for learning from previously collected data is behavioral cloning (bc), which is fitting a policy to the data directly. offline rl can outperform bc: i) on long-horizon tasks with mixed expert data, e.g., trajectories collected via an expert and a noisy-expert; and ii) with expert or near expert data, when there is a mismatch between the initial and the deployment state distribution. LINEBREAK rl for dexterous manipulation: reinforcement learning was recently successfully applied to dexterous manipulation on real hardware (openai et al., 2018; 2019; allshire et al., 2022; wang et al., 2022). these results rely on training with online rl in simulation, however, and are consequently limited by the fidelity of the simulator. while domain randomization (tobin et al., 2017; mandlekar et al., 2017; peng et al., 2018) can account for a mismatch between simulation and reality in terms of physics parameters, it cannot compensate oversimplified dynamics. the challenges of real-world environments have been recognized and partly modeled in simulated environments (dulac-arnold et al., 2020). to overcome the sim-to-real gap entirely, however, data from real-world interactions is still required, in particular for robotics problems involving contacts. LINEBREAK offline rl datasets: while offline rl datasets with data from simulated environments, like d4rl (fu et al., 2020) and rl unplugged (gulcehre et al., 2020), have propelled the field forward, the lack of real-world robotics data has been recognized (behnke, 2006; bonsignorio & del pobil, 2015; calli et al., 2015; amigoni et al., 2015; murali et al., 2019). complex contact dynamics, soft deformable fingertips and vibrations are particularly relevant for robotic manipulation but are not modeled sufficiently well in simulators used by the rl community (todorov et al., 2012; makoviychuk et al., 2021; freeman et al., 2021). recently, three small real-world datasets with human demonstrations for a robot arm with a gripper (using operational space control) have been proposed (mandlekar et al., 2021). two of them require only basic lifting and dropping while the third, more challenging task could not be solved with the available amount of data. for more challenging low-level physical manipulation, a dataset suitable for offline rl is still missing. we therefore provide the first real-robot dataset for dexterous manipulation which is sufficiently large for offline rl (one order of magnitude more data on real robots than prior work (mandlekar et al., 2021)) and for which learned policies can easily be evaluated remotely on a real-robot platform. LINEBREAK affordable open-source platforms: our hardware platform is open source. other affordable robotic open-source platforms are, for instance, a manipulator (yang et al., 2019), a simple robotic hand and quadruped (ahn et al., 2020). since it is hard to set up and maintain such platforms, we provide access to our real platform upon request, and hope that this will bring the field forward. LINEBREAK remote benchmarks: for mobile robotics, pickem et al. (2017) propose the robotarium, a remotely accessible swarm robotics research platform, and kumar et al. (2019a) offer offworld gym consisting of two navigation tasks with a wheeled robot. similarly, duckietown (paull et al., 2017) hosts the ai driving olympics (ai-do-team, 2022). LINEBREAK conclusion LINEBREAK we present benchmark datasets for robotic manipulation that are intended to help improving the state-of-the-art in offline reinforcement learning. to record datasets, we trained capable policies using online learning in simulation with domain randomization. our analysis and evaluation on two tasks, push and lift, show that offline rl algorithms still leave room for improvement on data from real robotic platforms. we identified two factors that could translate into increased performance on our datasets: trajectory stitching and robustness to non-expert trajectories. further, our analysis indicates that noise and delay alone cannot explain the larger gap between dataset and offline rl performance on real systems, underpinning the importance of real-robot benchmarks. LINEBREAK we invite the offline rl community to train their algorithms with the new datasets and test the empirical performance of the latest offline rl algorithms, e.g. (kostrikov et al., 2021a; xu et al., 2021; kumar et al., 2021; cheng et al., 2022), on real-robot hardware. LINEBREAK author contributions LINEBREAK n.g., s.bl., p.k., m.w., s.ba., b.s., and g.m. conceived the idea, methods and experiments. g.m. initiated the project, m.w., s.ba. and b.s. conceived the robotic platform. f.w. implemented the low-level robot control and parts of the submission system. n.g. trained the expert policies and created the datasets. n.g., s.bl., and p.k. conducted the offline rl experiments, collected the results and analyzed them under the supervision of g.m. n.g. ran all experiments on the real systems. n.g. and f.w. wrote the software for downloading and accessing the datasets. n.g., s.bl., p.k., f.w. and g.m. drafted the manuscript, and all authors revised it. LINEBREAK acknowledgments LINEBREAK we are grateful for the help of thomas steinbrenner in repairing and maintaining the robot cluster. moreover, feedback by arthur allshire on training expert policies in simulation and by huanbo sun on domain randomization proved valuable. we acknowledge the support from the german federal ministry of education and research (bmbf) through the tübingen ai center (fkz: 01is18039b). georg martius is a member of the machine learning cluster of excellence, exc number 2064/1 – project number 390727645. pavel kolev was supported by the cyber valley research fund and the volkswagen stiftung (no 98 571). we thank the anonymous reviewers for comments which helped improve the presentation of the paper. LINEBREAK reproducibility statement LINEBREAK we publish the datasets we propose as benchmarks (sections 3.3 and b) and provide access to the cluster of real trifinger platforms (section 2) we used for data collection. submissions to the cluster do not require any robotics experience and can be made in the form of a python implementation of a rl policy (section b.5). a simulated version of the trifinger platform (joshi et al., 2020) and a low-cost hardware variant are furthermore publicly available as open source (wüthrich et al., 2021). for offline rl training we moreover use open-source software (seno & imai, 2021). finally, we describe our hyperparameter optimization in detail and provide the resulting hyperparameters in section c.3. LINEBREAK references LINEBREAK michael ahn, henry zhu, kristian hartikainen, hugo ponte, abhishek gupta, sergey levine, and vikash kumar. robel: robotics benchmarks for learning with low-cost robots. in leslie pack kaelbling, danica kragic, and komei sugiura (eds.), proceedings of the conference on robot learning, volume 100 of proceedings of machine learning research, pp. 1300–1313. pmlr, 30 oct–01 nov 2020. LINEBREAK ai-do-team. the ai driving olympics (ai-do). https://www.duckietown.org/research/ LINEBREAK ai-driving-olympics, 2022. LINEBREAK arthur allshire, mayank mittai, varun lodaya, viktor makoviychuk, denys makoviichuk, felix widmaier, manuel wüthrich, stefan bauer, ankur handa, and animesh garg. transferring dexterous manipulation from gpu simulation to a remote real-world trifinger. in 2022 ieee/rsj international conference on intelligent robots and systems (iros), pp. 11802–11809, 2022. LINEBREAK francesco amigoni, emanuele bastianelli, jakob berghofer, andrea bonarini, giulio fontana, nico hochgeschwender, luca iocchi, gerhard kraetzschmar, pedro lima, matteo matteucci, pedro miraldo, daniele nardi, and viola schiaffonati. competitions for benchmarking: task and functionality scoring complete performance assessment. ieee robotics & automation magazine, 22(3):53–61, 2015. LINEBREAK openai: marcin andrychowicz, bowen baker, maciek chociej, rafal jozefowicz, bob mcgrew, jakub pachocki, arthur petron, matthias plappert, glenn powell, alex ray, et al. learning dexterous in-hand manipulation. the international journal of robotics research, 39(1):3–20, 2020. LINEBREAK michael bain and claude sammut. a framework for behavioural cloning. in koichi furukawa, donald michie, and stephen h. muggleton (eds.), machine intelligence 15, intelligent agents [st. catherine’s college, oxford, uk, july 1995], pp. 103–129. oxford university press, 1995. LINEBREAK stefan bauer, manuel wüthrich, felix widmaier, annika buchholz, sebastian stark, anirudh goyal, thomas steinbrenner, joel akpo, shruti joshi, vincent berenz, vaibhav agrawal, niklas funk, julen urain de jesus, jan peters, joe watson, claire chen, krishnan srinivasan, junwu zhang, jeffrey zhang, matthew walter, rishabh madan, takuma yoneda, denis yarats, arthur allshire, ethan gordon, tapomayukh bhattacharjee, siddhartha srinivasa, animesh garg, takahiro maeda, harshit sikchi, jilong wang, qingfeng yao, shuyu yang, robert mccarthy, francisco sanchez, qiang wang, david bulens, kevin mcguinness, noel o’connor, redmond stephen, and bernhard schölkopf. real robot challenge: a robotics competition in the cloud. in douwe kiela, marco ciccone, and barbara caputo (eds.), proceedings of the neurips 2021 competitions and demonstrations track, volume 176 of proceedings of machine learning research, pp. 190–204. pmlr, 06–14 dec 2022. LINEBREAK sven behnke. robot competitions-ideal benchmarks for robotics research. in proc. of iros-2006 workshop on benchmarks in robotics research. institute of electrical and electronics engineers (ieee), 2006. LINEBREAK christopher berner, greg brockman, brooke chan, vicki cheung, przemysław d˛ebiak, christy dennison, david farhi, quirin fischer, shariq hashme, chris hesse, et al. dota 2 with large scale deep reinforcement learning. arxiv preprint arxiv:1912.06680, 2019. LINEBREAK fabio bonsignorio and angel p. del pobil. toward replicable and measurable robotics research [from LINEBREAK the guest editors]. ieee robotics & automation magazine, 22(3):32–35, 2015. LINEBREAK david brandfonbrener, will whitney, rajesh ranganath, and joan bruna. offline rl without off-policy evaluation. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 4933–4946. curran associates, inc., 2021. LINEBREAK greg brockman, vicki cheung, ludwig pettersson, jonas schneider, john schulman, jie tang, and LINEBREAK wojciech zaremba. openai gym. arxiv preprint arxiv:1606.01540, 2016. LINEBREAK berk calli, aaron walsman, arjun singh, siddhartha srinivasa, pieter abbeel, and aaron m dollar. benchmarking in manipulation research: the ycb object and model set and benchmarking protocols. arxiv:1502.03143, february 2015. LINEBREAK lili chen, kevin lu, aravind rajeswaran, kimin lee, aditya grover, misha laskin, pieter abbeel, aravind srinivas, and igor mordatch. decision transformer: reinforcement learning via sequence modeling. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 15084–15097. curran associates, inc., 2021. LINEBREAK xinyue chen, zijian zhou, zheng wang, che wang, yanqiu wu, and keith ross. bail: best-action imitation learning for batch deep reinforcement learning. in h. larochelle, m. ranzato, r. hadsell, m.f. balcan, and h. lin (eds.), advances in neural information processing systems, volume 33, pp. 18353–18363. curran associates, inc., 2020. LINEBREAK ching-an cheng, tengyang xie, nan jiang, and alekh agarwal. adversarially trained actor critic for offline reinforcement learning. in kamalika chaudhuri, stefanie jegelka, le song, csaba szepesvari, gang niu, and sivan sabato (eds.), proceedings of the 39th international conference on machine learning, volume 162 of proceedings of machine learning research, pp. 3852–3878. pmlr, 17–23 jul 2022. LINEBREAK erwin coumans and yunfei bai. pybullet, a python module for physics simulation for games, robotics LINEBREAK and machine learning. http://pybullet.org, 2016. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep bidirectional transformers for language understanding. arxiv preprint arxiv:1810.04805, 2018. LINEBREAK gabriel dulac-arnold, nir levine, daniel j. mankowitz, jerry li, cosmin paduraru, sven gowal, and todd hester. an empirical investigation of the challenges of real-world reinforcement learning. corr, abs/2003.11881, 2020. LINEBREAK luciano floridi and massimo chiriatti. gpt-3: its nature, scope, limits, and consequences. minds LINEBREAK c. daniel freeman, erik frey, anton raichuk, sertan girgin, igor mordatch, and olivier bachem. brax - a differentiable physics engine for large scale rigid body simulation, 2021. url http: //github.com/google/brax. LINEBREAK justin fu, aviral kumar, ofir nachum, george tucker, and sergey levine. d4rl: datasets for deep LINEBREAK data-driven reinforcement learning. corr, abs/2004.07219, 2020. LINEBREAK scott fujimoto and shixiang (shane) gu. a minimalist approach to offline reinforcement learning. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 20132–20145. curran associates, inc., 2021. LINEBREAK scott fujimoto, david meger, and doina precup. off-policy deep reinforcement learning without exploration. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 2052–2062. pmlr, 09–15 jun 2019. LINEBREAK felix grimminger, avadesh meduri, majid khadiv, julian viereck, manuel wüthrich, maximilien naveau, vincent berenz, steve heim, felix widmaier, jonathan fiene, alexander badri-spröwitz, and ludovic righetti. an open torque-controlled modular robot architecture for legged locomotion research. in international conference on robotics and automation (icra), 2020. LINEBREAK caglar gulcehre, ziyu wang, alexander novikov, thomas paine, sergio gómez, konrad zolna, rishabh agarwal, josh s merel, daniel j mankowitz, cosmin paduraru, et al. rl unplugged: a suite of benchmarks for offline reinforcement learning. advances in neural information processing systems, 33:7248–7259, 2020. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 770–778, 2016. LINEBREAK jemin hwangbo, joonho lee, alexey dosovitskiy, dario bellicoso, vassilios tsounis, vladlen koltun, and marco hutter. learning agile and dynamic motor skills for legged robots. science robotics, 4(26):eaau5872, 2019. LINEBREAK michael janner, justin fu, marvin zhang, and sergey levine. when to trust your model: modelbased policy optimization. in h. wallach, h. larochelle, a. beygelzimer, f. d'alché-buc, e. fox, and r. garnett (eds.), advances in neural information processing systems, volume 32. curran associates, inc., 2019. LINEBREAK michael janner, qiyang li, and sergey levine. offline reinforcement learning as one big sequence modeling problem. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 1273–1286. curran associates, inc., 2021. LINEBREAK shruti joshi, felix widmaier, vaibhav agrawal, and manuel wüthrich. https://github.com/ LINEBREAK open-dynamic-robot-initiative/trifinger_simulation, 2020. LINEBREAK rahul kidambi, aravind rajeswaran, praneeth netrapalli, and thorsten joachims. morel: modelbased offline reinforcement learning. in h. larochelle, m. ranzato, r. hadsell, m.f. balcan, and h. lin (eds.), advances in neural information processing systems, volume 33, pp. 21810–21823. curran associates, inc., 2020. LINEBREAK ilya kostrikov, rob fergus, jonathan tompson, and ofir nachum. offline reinforcement learning with fisher divergence critic regularization. in marina meila and tong zhang (eds.), proceedings of the 38th international conference on machine learning, icml 2021, 18-24 july 2021, virtual event, volume 139 of proceedings of machine learning research, pp. 5774–5783. pmlr, 2021a. url http://proceedings.mlr.press/v139/kostrikov21a.html. LINEBREAK ilya kostrikov, ashvin nair, and sergey levine. offline reinforcement learning with implicit LINEBREAK alex krizhevsky, ilya sutskever, and geoffrey e hinton. LINEBREAK imagenet classification with deep convolutional neural networks. in f pereira, c j c burges, l bottou, and k q weinberger (eds.), advances in neural information processing systems 25, pp. 1097–1105. curran associates, inc., 2012. LINEBREAK ashish kumar, toby buckley, john b lanier, qiaozhi wang, alicia kavelaars, and ilya kuzovkin. offworld gym: open-access physical robotics environment for real-world reinforcement learning benchmark and research. arxiv preprint arxiv:1910.08639, 2019a. LINEBREAK aviral kumar, justin fu, matthew soh, george tucker, and sergey levine. stabilizing off-policy q-learning via bootstrapping error reduction. in hanna m. wallach, hugo larochelle, alina beygelzimer, florence d’alché-buc, emily b. fox, and roman garnett (eds.), advances in neural information processing systems 32: annual conference on neural information processing systems 2019, neurips 2019, december 8-14, 2019, vancouver, bc, canada, pp. 11761–11771, 2019b. LINEBREAK aviral kumar, aurick zhou, george tucker, and sergey levine. conservative q-learning for offline reinforcement learning. in hugo larochelle, marc’aurelio ranzato, raia hadsell, maria-florina balcan, and hsuan-tien lin (eds.), advances in neural information processing systems 33: annual conference on neural information processing systems 2020, neurips 2020, december 6-12, 2020, virtual, 2020. LINEBREAK aviral kumar, anikait singh, stephen tian, chelsea finn, and sergey levine. a workflow for offline model-free robotic reinforcement learning. in aleksandra faust, david hsu, and gerhard neumann (eds.), conference on robot learning, 8-11 november 2021, london, uk, volume 164 of proceedings of machine learning research, pp. 417–428. pmlr, 2021. LINEBREAK sascha lange, thomas gabel, and martin riedmiller. batch reinforcement learning. in reinforcement LINEBREAK sergey levine, aviral kumar, george tucker, and justin fu. offline reinforcement learning: tutorial, LINEBREAK review, and perspectives on open problems. corr, abs/2005.01643, 2020. LINEBREAK timothy p. lillicrap, jonathan j. hunt, alexander pritzel, nicolas heess, tom erez, yuval tassa, david silver, and daan wierstra. continuous control with deep reinforcement learning. in international conference on learning representations (iclr), 2016. LINEBREAK denys makoviichuk and viktor makoviychuk. rl-games: a high-performance framework for rein LINEBREAK forcement learning. https://github.com/denys88/rl_games, may 2022. LINEBREAK viktor makoviychuk, lukasz wawrzyniak, yunrong guo, michelle lu, kier storey, miles macklin, david hoeller, nikita rudin, arthur allshire, ankur handa, et al. isaac gym: high performance gpu-based physics simulation for robot learning. arxiv preprint arxiv:2108.10470, 2021. LINEBREAK ajay mandlekar, yuke zhu, animesh garg, li fei-fei, and silvio savarese. adversarially robust policy learning through active construction of physically-plausible perturbations. in ieee int’l conf. on intelligent robots and systems (iros), volume 16, 2017. LINEBREAK ajay mandlekar, danfei xu, josiah wong, soroush nasiriany, chen wang, rohun kulkarni, li feifei, silvio savarese, yuke zhu, and roberto martín-martín. what matters in learning from offline human demonstrations for robot manipulation. in aleksandra faust, david hsu, and gerhard neumann (eds.), conference on robot learning, 8-11 november 2021, london, uk, volume 164 of proceedings of machine learning research, pp. 1678–1690. pmlr, 2021. LINEBREAK volodymyr mnih, koray kavukcuoglu, david silver, andrei a rusu, joel veness, marc g bellemare, alex graves, martin riedmiller, andreas k fidjeland, georg ostrovski, stig petersen, charles beattie, amir sadik, ioannis antonoglou, helen king, dharshan kumaran, daan wierstra, shane legg, and demis hassabis. human-level control through deep reinforcement learning. nature, 518(7540):529–533, february 2015. LINEBREAK adithyavairavan murali, tao chen, kalyan vasudev alwala, dhiraj gandhi, lerrel pinto, saurabh gupta, and abhinav gupta. pyrobot: an open-source robotics framework for research and benchmarking. arxiv: 1906.08236, june 2019. LINEBREAK siddharth mysore, bassel mabsout, renato mancuso, and kate saenko. regularizing action policies in 2021 ieee international conference on LINEBREAK for smooth control with reinforcement learning. robotics and automation (icra), pp. 1810–1816. ieee, 2021. LINEBREAK ofir nachum, yinlam chow, bo dai, and lihong li. dualdice: behavior-agnostic estimation of discounted stationary distribution corrections. in hanna m. wallach, hugo larochelle, alina beygelzimer, florence d’alché-buc, emily b. fox, and roman garnett (eds.), advances in neural information processing systems 32: annual conference on neural information processing systems 2019, neurips 2019, december 8-14, 2019, vancouver, bc, canada, pp. 2315–2325, 2019a. LINEBREAK ofir nachum, bo dai, ilya kostrikov, yinlam chow, lihong li, and dale schuurmans. algaedice: LINEBREAK policy gradient from arbitrary experience. corr, abs/1912.02074, 2019b. LINEBREAK ashvin nair, murtaza dalal, abhishek gupta, and sergey levine. accelerating online reinforcement LINEBREAK learning with offline datasets. corr, abs/2006.09359, 2020. LINEBREAK openai, marcin andrychowicz, bowen baker, maciek chociej, rafal jozefowicz, bob mcgrew, jakub pachocki, arthur petron, matthias plappert, glenn powell, alex ray, jonas schneider, szymon sidor, josh tobin, peter welinder, lilian weng, and wojciech zaremba. learning dexterous in-hand manipulation. arxiv:1808.00177, august 2018. LINEBREAK openai, ilge akkaya, marcin andrychowicz, maciek chociej, mateusz litwin, bob mcgrew, arthur petron, alex paino, matthias plappert, glenn powell, raphael ribas, jonas schneider, nikolas tezak, jerry tworek, peter welinder, lilian weng, qiming yuan, wojciech zaremba, and lei zhang. solving rubik’s cube with a robot hand. arxiv:1910.07113, october 2019. LINEBREAK fabio pardo, arash tavakoli, vitaly levdik, and petar kormushev. time limits in reinforcement LINEBREAK learning. in international conference on machine learning, pp. 4045–4054. pmlr, 2018. LINEBREAK liam paull, jacopo tani, heejin ahn, javier alonso-mora, luca carlone, michal cap, yu fan chen, changhyun choi, jeff dusek, yajun fang, et al. duckietown: an open, inexpensive and flexible platform for autonomy education and research. in 2017 ieee international conference on robotics and automation (icra), pp. 1497–1504. ieee, 2017. LINEBREAK xue bin peng, marcin andrychowicz, wojciech zaremba, and pieter abbeel. sim-to-real transfer of robotic control with dynamics randomization. in 2018 ieee international conference on robotics and automation (icra), pp. 3803–3810. ieee, 2018. LINEBREAK daniel pickem, paul glotfelter, li wang, mark mote, aaron ames, eric feron, and magnus egerstedt. the robotarium: a remotely accessible swarm robotics research testbed. in 2017 ieee international conference on robotics and automation (icra), pp. 1699–1706. ieee, 2017. LINEBREAK dean a pomerleau. efficient training of artificial neural networks for autonomous navigation. neural LINEBREAK rafael figueiredo prudencio, marcos r. o. a. maximo, and esther luna colombini. a survey on offline reinforcement learning: taxonomy, review, and open problems. corr, abs/2203.01387, 2022. LINEBREAK joseph redmon, santosh divvala, ross girshick, and ali farhadi. you only look once: unified, real-time object detection. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 779–788, 2016. LINEBREAK stéphane ross, geoffrey j. gordon, and drew bagnell. a reduction of imitation learning and structured prediction to no-regret online learning. in geoffrey j. gordon, david b. dunson, and miroslav dudík (eds.), proceedings of the fourteenth international conference on artificial intelligence and statistics, aistats 2011, fort lauderdale, usa, april 11-13, 2011, volume 15 of jmlr proceedings, pp. 627–635. jmlr.org, 2011. LINEBREAK john schulman, filip wolski, prafulla dhariwal, alec radford, and oleg klimov. proximal policy LINEBREAK optimization algorithms. arxiv preprint arxiv:1707.06347, 2017. LINEBREAK takuma seno and michita imai. d3rlpy: an offline deep reinforcement learning library. corr, LINEBREAK david silver, julian schrittwieser, karen simonyan, ioannis antonoglou, aja huang, arthur guez, thomas hubert, lucas baker, matthew lai, adrian bolton, et al. mastering the game of go without human knowledge. nature, 550(7676):354–359, 2017. LINEBREAK richard s sutton, andrew g barto, and co-director autonomous learning laboratory andrew g LINEBREAK barto. reinforcement learning: an introduction. mit press, 1998. LINEBREAK josh tobin, rachel fong, alex ray, jonas schneider, wojciech zaremba, and pieter abbeel. domain randomization for transferring deep neural networks from simulation to the real world. in 2017 ieee/rsj international conference on intelligent robots and systems (iros), pp. 23–30. ieee, 2017. doi: 10.1109/iros.2017.8202133. LINEBREAK emanuel todorov, tom erez, and yuval tassa. mujoco: a physics engine for model-based control. in 2012 ieee/rsj international conference on intelligent robots and systems, pp. 5026–5033. ieee, 2012. LINEBREAK faraz torabi, garrett warnell, and peter stone. behavioral cloning from observation. in jérôme lang (ed.), proceedings of the twenty-seventh international joint conference on artificial intelligence, ijcai 2018, july 13-19, 2018, stockholm, sweden, pp. 4950–4957. ijcai.org, 2018. LINEBREAK qiang wang, francisco roldan sanchez, robert mccarthy, david cordova bulens, kevin mcguinness, noel o’connor, manuel wüthrich, felix widmaier, stefan bauer, and stephen j. redmond. dexterous robotic manipulation using deep reinforcement learning and knowledge transfer for complex sparse reward-based tasks. expert systems, n/a(n/a):e13205, 2022. LINEBREAK ziyu wang, alexander novikov, konrad zolna, josh merel, jost tobias springenberg, scott e. reed, bobak shahriari, noah y. siegel, çaglar gülçehre, nicolas heess, and nando de freitas. critic regularized regression. in hugo larochelle, marc’aurelio ranzato, raia hadsell, maria-florina balcan, and hsuan-tien lin (eds.), advances in neural information processing systems 33: annual conference on neural information processing systems 2020, neurips 2020, december 6-12, 2020, virtual, 2020. LINEBREAK manuel wüthrich, felix widmaier, felix grimminger, shruti joshi, vaibhav agrawal, bilal hammoud, majid khadiv, miroslav bogdanovic, vincent berenz, julian viereck, maximilien naveau, ludovic righetti, bernhard schölkopf, and stefan bauer. trifinger: an open-source robot for learning dexterity. in proceedings of the 2020 conference on robot learning (corl), volume 155, pp. 1871–1882. pmlr, 2021. LINEBREAK haoran xu, xianyuan zhan, jianxiong li, and honglei yin. offline reinforcement learning with soft LINEBREAK brian yang, jesse zhang, vitchyr pong, sergey levine, and dinesh jayaraman. replab: a reproducible low-cost arm benchmark platform for robotic learning. arxiv preprint arxiv:1905.07447, 2019. LINEBREAK tianhe yu, aviral kumar, rafael rafailov, aravind rajeswaran, sergey levine, and chelsea finn. combo: conservative offline model-based policy optimization. in marc’aurelio ranzato, alina beygelzimer, yann n. dauphin, percy liang, and jennifer wortman vaughan (eds.), advances in neural information processing systems 34: annual conference on neural information processing systems 2021, neurips 2021, december 6-14, 2021, virtual, pp. 28954–28967, 2021. LINEBREAK chi zhang, sanmukh r. kuppannagari, and viktor k. prasanna. brac+: improved behavior regularized actor critic for offline reinforcement learning. in vineeth n. balasubramanian and ivor w. tsang (eds.), asian conference on machine learning, acml 2021, 17-19 november 2021, virtual event, volume 157 of proceedings of machine learning research, pp. 204–219. pmlr, 2021. LINEBREAK ruiyi zhang, bo dai, lihong li, and dale schuurmans. gendice: generalized offline estimation of stationary values. in 8th international conference on learning representations, iclr 2020, addis ababa, ethiopia, april 26-30, 2020. openreview.net, 2020. LINEBREAK a additional results LINEBREAK this section contains additional experimental results. in particular values for the average returns achieved by the algorithms are reported. these were omitted from the main text as the success rates are easier to interpret. LINEBREAK a.1 returns for the push task LINEBREAK we report the returns achieved on the push task in table s1. note that for the simulated datasets the best performing algorithm in terms of return is not necessarily the same as the best performing one in terms of success rates (see table 1). for instance, awac has the highest average return on sim-expert while crr achieves a higher success rate. this has two reasons. first, the success is measured only at the final step of the episode, while the return is computed as the cumulative reward over time. second, the return is dense as it is computed from the distance between cube and target, while the success rate is a sparse signal. LINEBREAK table s1: push: returns on the trifinger-push datasets. ‘data’ denotes the mean over the dataset. average and standard deviation over five training seeds. LINEBREAK push-datasets LINEBREAK data LINEBREAK bc LINEBREAK crr LINEBREAK awac LINEBREAK cql LINEBREAK iql LINEBREAK sim-expert sim-half-expert sim-weak&expert sim-mixed LINEBREAK real-expert real-half-expert real-weak&expert real-mixed LINEBREAK a.2 returns for the lift task LINEBREAK in this section, we report the returns achieved on the lift task (table s2). interestingly, although iql achieves a significantly higher return on the real-weak&expert dataset than crr, its final success rate is lower. an analysis of the rollout statistics reveals that iql often moves the cube close to the goal pose but not close enough to satisfy the success criteria (defined in section 3). crr, on the other hand, on average deviates further from the goal pose than iql but has a bigger fraction of rollouts in which it satisfies the success criteria. in summary iql does better on average on this dataset but lacks precision in matching the goal pose. LINEBREAK a.3 evaluation on the hold-out robot LINEBREAK to quantify how well the policies obtained with offline rl generalize to unseen hardware, we evaluate them on a holdout robot which was not used for data collection. table s3 shows the results for trifinger-push-real-expert and trifinger-lift-real-expert. the performance of the algorithms on the hold-out robot is within the performance margin of the other robots, suggesting that there is no significant difference between the different robots. LINEBREAK impact of noise on performance LINEBREAK as mentioned in section 4.1, we studied the impact of noise on the performance of the expert and the considered offline rl algorithms by recording a sequence of datasets with increasing noise scale in simulation. a relative noise scale of 1 corresponds to the variance measured on the actions and observations of the real system. fig. s1 shows the success rate and return as a function of the noise scale up to a value of 2. as the performance of the expert and the offline rl policies degrades only slowly when increasing noise, we conclude that the stochasticity of the real system cannot be the only reason for the performance gap between the simulated and the real system. as delays in LINEBREAK table s2: lift: returns on the trifinger-lift datasets. ‘data’ denotes the mean over the dataset. average and standard deviation over five training seeds. LINEBREAK cql LINEBREAK iql LINEBREAK lift-datasets LINEBREAK sim-expert sim-half-expert sim-weak&expert sim-mixed sim-expert† sim-half-expert† sim-weak&expert† sim-mixed† LINEBREAK real-smooth-expert real-expert real-half-expert real-weak&expert real-mixed real-expert† real-half-expert† real-weak&expert† real-mixed† LINEBREAK data LINEBREAK bc LINEBREAK crr LINEBREAK table s3: evaluation on hold-out robot. success rate on the real-expert datasets. LINEBREAK dataset LINEBREAK bc LINEBREAK crr LINEBREAK awac LINEBREAK cql LINEBREAK iql LINEBREAK push-real-expert lift-real-expert LINEBREAK the observation and action execution are already implemented in the simulated environment, we hypothesize that other factors like more complex contact dynamics and elastic deformations of the fingertips and robot limbs are likely causing the larger performance gap between data and learned policies on the real robots. LINEBREAK awac and crr perform consistently over a wide range of noise scales with a slight decrease in performance for high relative noise scales (probably due to a large variance of the estimated object pose). bc and iql seem to struggle with the narrow data distribution generated by a deterministic environment but improve with increasing stochasticity. while the performance of bc drops significantly again for large noise scales, iql becomes competitive in this regime. LINEBREAK expert LINEBREAK bc† LINEBREAK crr† LINEBREAK awac† LINEBREAK cql† LINEBREAK iql† LINEBREAK figure s1: success rate and return for simulated lifting for varying relative environment noise scales (1.0 corresponds to the noise level of the real system) when the algorithms were trained on data recorded with that noise scale using the expert policy. the dashed lines indicate the performance on the real system. LINEBREAK a.5 bar plots LINEBREAK fig. s2 and fig. s3 show bar plots that summarize the performance of the algorithms on the two tasks in the simulated and real environment. before averaging results from different datasets, we normalized the algorithm performance by the dataset performance, i.e., reaching the average success rate or return of the dataset corresponds to a value of 1. LINEBREAK while awac (and iql on the real data) can exceed the behavior policy on average on the push task, all algorithms fall short of matching the dataset performance on the challenging lift datasets. while success rates on the lift-real datasets are particularly low, the returns indicate that crr and iql significantly outperform bc. LINEBREAK since the hyperparameter optimization was done on the lift-sim-weak&expert dataset, it has the biggest impact on the performance on the lift-sim datasets. iql in particular improves considerably there. the increase in performance on the lift-real datasets is considerably smaller, however. this suggests that optimizing the hyperparameters offline rl algorithms in simulation may have limited benefits on real environments. LINEBREAK push-sim LINEBREAK push-real LINEBREAK figure s2: normalized performance for the push task: success rates at the end of episodes (or returns) were normalized to the dataset success rate (or mean return) and then averaged over all datasets corresponding to a task (treating simulated and real data separately). default hyperparameters were used for the push task. LINEBREAK default hyperparameters LINEBREAK optimized hyperparameters LINEBREAK lift-sim LINEBREAK default hyperparameters LINEBREAK optimized hyperparameters LINEBREAK lift-real LINEBREAK figure s3: normalized performance for the lift task: success rates at the end of episodes (or returns) were normalized to the dataset success rate (or mean return) and then averaged over all datasets corresponding to a task (treating simulated and real data separately). LINEBREAK a.6 learning curves LINEBREAK in this section, we provide learning curves for the offline rl algorithms on all datasets. since the evaluation of all training checkpoints on the real robots is prohibitively expensive and time-consuming, we evaluate the checkpoints learned on the real data in the simulated environment. this gives an over-optimistic estimate of the learning performance on the real robots. LINEBREAK for the challenging lift-real-weak&expert task we performed a grid search for each algorithm (bc, crr, awac, cql, iql) and selected the best hyperparameters. we present the grid search in table s7, the corresponding optimal hyperparameters in table s8, and the default hyperparameters in table s9. we note that due to the poor performance of cql, we expanded our grid search specifically for this algorithm (on the push-sim-expert data) and selected the corresponding optimal hyperparameters as its default parameters (see figure s16). our newly performed gridsearch, as mentioned above, was unfortunately not leading to improvements for cql. similar difficulties are reported in kumar et al. (2021) and are tackled via case distinction and appropriate regularization techniques. it would be interesting to test the preceding two algorithmic techniques on our datasets, once their implementation is integrated in the d3rlpy library (seno & imai, 2021). LINEBREAK we proceed by presenting the learning curves for the offline rl algorithms on the datasets: for the lift task in section a.6.1 and for the push task in section a.6.2. shaded areas indicate the interval between the 0.25 and 0.75 quantiles. LINEBREAK a.6.1 lift datasets LINEBREAK optimized hyperparameters† LINEBREAK real-expert LINEBREAK real-half-expert LINEBREAK real-weak&expert LINEBREAK real-mixed LINEBREAK default hyperparameters LINEBREAK real-expert LINEBREAK real-half-expert LINEBREAK real-weak&expert LINEBREAK real-mixed LINEBREAK bc LINEBREAK crr LINEBREAK awac LINEBREAK cql LINEBREAK iql LINEBREAK figure s4: training curves for the lift-real datasets: offline rl algorithms are trained on the real datasets and are evaluated in the simulated environment. success rates and returns for the optimized hyperparameters (in table s8) and the default hyperparameters (in table s9). the selected hyperparameters, by the grid-search procedure (in table s7), optimize the algorithm’s final average return on sim-weak&expert. the black dashed line shows the dataset performance of real-expert and the red dashed line the performance of the real-weak&expert (first 3 columns) and real-mixed (last column). LINEBREAK optimized hyperparameters† LINEBREAK sim-expert LINEBREAK sim-half-expert LINEBREAK sim-weak&expert LINEBREAK sim-mixed LINEBREAK default hyperparameters LINEBREAK sim-expert
| 22
|
[
138.942,
495.2070784,
184.8795486,
505.1696784
] |
e42KbIw6Wb.pdf
| 2,022
| 2
|
LINEBREAK pix2seq: a language modeling framework for object detection LINEBREAK ting chen, saurabh saxena, lala li, david j. fleet, geoffrey hinton google research, brain team LINEBREAK abstract LINEBREAK we present pix2seq, a simple and generic framework for object detection. unlike existing approaches that explicitly integrate prior knowledge about the task, we cast object detection as a language modeling task conditioned on the observed pixel inputs. object descriptions (e.g., bounding boxes and class labels) are expressed as sequences of discrete tokens, and we train a neural network to perceive the image and generate the desired sequence. our approach is based mainly on the intuition that if a neural network knows about where and what the objects are, we just need to teach it how to read them out. beyond the use of task-specific data augmentations, our approach makes minimal assumptions about the task, yet it achieves competitive results on the challenging coco dataset, compared to highly specialized and well optimized detection algorithms.1 LINEBREAK figure 1: illustration of pix2seq framework for object detection. the neural net perceives an image and generates a sequence of tokens that correspond to bounding boxes and class labels. LINEBREAK introduction LINEBREAK visual object detection systems aim to recognize and localize all objects of pre-defined categories in an image. the detected objects are typically described by a set of bounding boxes and associated class labels. given the difficulty of the task, most existing methods, such as (girshick, 2015; ren et al., 2015; he et al., 2017; lin et al., 2017b; carion et al., 2020), are carefully designed and highly customized, with a significant amount of prior knowledge in the choice of architecture and loss function. for example, many architectures are tailored to the use of bounding boxes (e.g., with region proposals (girshick, 2015; ren et al., 2015) and roi pooling (girshick et al., 2014; he et al., 2017)). others are tied to the use of object queries for object binding (carion et al., 2020). loss functions are often similarly tailored to the use of bounding boxes, such as box regression (szegedy et al., 2013; lin et al., 2017b), set-based matching (erhan et al., 2014; carion et al., 2020), or by incorporating LINEBREAK correspondence to: [email protected] 1code and checkpoints available at https://github.com/google-research/pix2seq. LINEBREAK specific performance metrics, like intersection-over-union on bounding boxes (rezatofighi et al., 2019). although existing systems find applications in myriad domains, from self-driving cars (sun et al., 2020), to medical image analysis (jaeger et al., 2020), to agriculture (sa et al., 2016), the specialization and complexity make them difficult to integrate into a larger system, or generalize to a much broader array of tasks associated with general intelligence. LINEBREAK this paper advocates a new approach, based on the intuition that if a neural net knows about where and what the objects are, we just need to teach it to read them out. and by learning to “describe” objects the model can learn to ground the “language” on pixel observations, leading to useful object representations. this is realized with our pix2seq framework (see figure 1). given an image, our model produces a sequence of discrete tokens that correspond to object descriptions (e.g., object bounding boxes and class labels), reminiscent of an image captioning system (vinyals et al., 2015b; karpathy & fei-fei, 2015; xu et al., 2015). in essence, we cast object detection as a language modeling task conditioned on pixel inputs, for which the model architecture and loss function are generic and relatively simple, without being engineered specifically for the detection task. as such, one can readily extend the framework to different domains or applications, or incorporate it into a perceptual system supporting general intelligence, for which it provides a language interface to a wide range of vision tasks. LINEBREAK to tackle the detection task with pix2seq, we first propose a quantization and serialization scheme that converts bounding boxes and class labels into sequences of discrete tokens. we then leverage an encoder-decoder architecture for perceiving pixel inputs and generating the target sequence. the objective function is simply the maximum likelihood of tokens conditioned on pixel inputs and the preceding tokens. while both the architecture and loss function are task-agnostic (without assuming prior knowledge about object detection, e.g., bounding boxes), we can still incorporate task-specific prior knowledge with a sequence augmentation technique, proposed below, that alters both input and target sequences during training. through extensive experimentation, we demonstrate that this simple pix2seq framework can achieve competitive results on the coco dataset compared to highly customized, well established approaches, including faster r-cnn (ren et al., 2015) and detr (carion et al., 2020). by pretraining our model on a larger object detection dataset, its performance can be further improved. LINEBREAK the pix2seq framework LINEBREAK in the proposed pix2seq framework we cast object detection as a language modeling task, conditioned on pixel inputs (figure 1). the system consists of four main components (figure 2): LINEBREAK • image augmentation: as is common in training computer vision models, we use image augmenta LINEBREAK tions to enrich a fixed set of training examples (e.g., with random scaling and crops). LINEBREAK • sequence construction & augmentation: as object annotations for an image are usually represented as a set of bounding boxes and class labels, we convert them into a sequence of discrete tokens. • architecture: we use an encoder-decoder model, where the encoder perceives pixel inputs, and LINEBREAK the decoder generates the target sequence (one token at a time). LINEBREAK • objective/loss function: the model is trained to maximize the log likelihood of tokens conditioned LINEBREAK on the image and the preceding tokens (with a softmax cross-entropy loss). LINEBREAK figure 2: major components of the pix2seq learning framework. LINEBREAK sequence construction from object descriptions LINEBREAK in common object detection datasets, such as pascal voc (everingham et al., 2010), coco (lin et al., 2014), and openimages (kuznetsova et al., 2020), images have variable numbers of objects, represented as sets of bounding boxes and class labels. in pix2seq we express them as sequences of discrete tokens. LINEBREAK while class labels are naturally expressed as discrete tokens, bounding boxes are not. a bounding box is determined by two of its corner points (i.e., top-left and bottom-right), or by its center point plus height and width. we propose to discretize the continuous numbers used to specify the x, y coordinates of corner points (similarly for height and width if the other box format is used). specifically, an object is represented as a sequence of five discrete tokens, i.e. [ymin, xmin, ymax, xmax, c], where each of the continuous corner coordinates is uniformly discretized into an integer between [1, nbins], and c is the class index. we use a shared vocabulary for all tokens, so the vocabulary size is equal to number of bins + number of classes. this quantization scheme for the bounding boxes allows us to use a small vocabulary while achieving high precision. for example, a 600×600 image requires only 600 bins to achieve zero quantization error. this is much smaller than modern language models with vocabulary sizes of 32k or higher (radford et al., 2018; devlin et al., 2018). the effect of different levels of quantization on the placement of bounding boxes is illustrated in figure 3. LINEBREAK with each object description expressed as a short discrete sequence, we next need to serialize multiple object descriptions to form a single sequence for a given image. since order of objects does not matter for the detection task per se, we use a random ordering strategy (randomizing the order objects each time an image is shown). we also explore other deterministic ordering strategies, but we hypothesize that random ordering will work just as well as any deterministic ordering, given a capable neural net and autoregressive modeling (where the net can learn to model the distribution of remaining objects conditioned on those observed). LINEBREAK finally, because different images often have different numbers of objects, the generated sequences will have different lengths. to indicate the end of a sequence, we therefore incorporate an eos token. the sequence construction process with different ordering strategies is illustrated in figure 4. LINEBREAK (a) nbins = 10 LINEBREAK (b) nbins = 50 LINEBREAK (e) original LINEBREAK figure 3: applying the proposed discritization of bounding box on an image of 480 × 640. only a quarter of the image is shown for better clarity. with a small number of bins, such as 500 bins (∼1 pixel/bin), it achieves high precision even for small objects. LINEBREAK figure 4: examples of sequence construction with nbins = 1000, and 0 is eos token. LINEBREAK architecture, objective and inference
| 3
|
[
108.249,
698.0240784,
325.5131575,
707.9866784
] |
n6jl7fLxrP.pdf
| 2,021
| 0
|
LINEBREAK adaptive universal generalized pagerank graph neural network LINEBREAK eli chien & jianhao peng∗ department of electrical and computer engineering university of illinois urbana-champaign, usa {ichien3,jianhao2}@illinois.edu LINEBREAK pan li department of computer science purdue university, usa [email protected] LINEBREAK olgica milenkovic department of electrical and computer engineering university of illinois urbana-champaign, usa [email protected] LINEBREAK abstract LINEBREAK in many important graph data processing applications the acquired information includes both node features and observations of the graph topology. graph neural networks (gnns) are designed to exploit both sources of evidence but they do not optimally trade-off their utility and integrate them in a manner that is also universal. here, universality refers to independence on homophily or heterophily graph assumptions. we address these issues by introducing a new generalized pagerank (gpr) gnn architecture that adaptively learns the gpr weights so as to jointly optimize node feature and topological information extraction, regardless of the extent to which the node labels are homophilic or heterophilic. learned gpr weights automatically adjust to the node label pattern, irrelevant on the type of initialization, and thereby guarantee excellent learning performance for label patterns that are usually hard to handle. furthermore, they allow one to avoid feature over-smoothing, a process which renders feature information nondiscriminative, without requiring the network to be shallow. our accompanying theoretical analysis of the gpr-gnn method is facilitated by novel synthetic benchmark datasets generated by the so-called contextual stochastic block model. we also compare the performance of our gnn architecture with that of several state-ofthe-art gnns on the problem of node-classification, using well-known benchmark homophilic and heterophilic datasets. the results demonstrate that gpr-gnn offers significant performance improvement compared to existing techniques on both synthetic and benchmark data. our implementation is available online.1 LINEBREAK introduction LINEBREAK graph-centered machine learning has received significant interest in recent years due to the ubiquity of graph-structured data and its importance in solving numerous real-world problems such as semisupervised node classification and graph classification (zhu, 2005; shervashidze et al., 2011; l¨u & zhou, 2011). usually, the data at hand contains two sources of information: node features and graph topology. as an example, in social networks, nodes represent users that have different combinations of interests and properties captured by their corresponding feature vectors; edges on the other hand document observable friendship and collaboration relations that may or may not depend on the node features. hence, learning methods that are able to simultaneously and adaptively exploit node features and the graph topology are highly desirable as they make use of their latent connections and thereby improve learning on graphs. LINEBREAK graph neural networks (gnn) leverage their representational power to provide state-of-the-art performance when addressing the above described application domains. many gnns use message LINEBREAK ∗equal contribution 1https://github.com/jianhao2016/gprgnn LINEBREAK passing (gilmer et al., 2017; battaglia et al., 2018) to manipulate node features and graph topology. they are constructed by stacking (graph) neural network layers which essentially propagate and transform node features over the given graph topology. different types of layers have been proposed and used in practice, including graph convolutional layers (gcn) (bruna et al., 2014; kipf & welling, 2017), graph attention layers (gat) (velickovic et al., 2018) and many others (hamilton et al., 2017; wijesinghe & wang, 2019; zeng et al., 2020; abu-el-haija et al., 2019). LINEBREAK however, most of the existing gnn architectures have two fundamental weaknesses which restrict their learning ability on general graph-structured data. first, most of them seem to be tailor-made to work on homophilic (associative) graphs. the homophily principle (mcpherson et al., 2001) in the context of node classification asserts that nodes from the same class tend to form edges. homophily is also a common assumption in graph clustering (von luxburg, 2007; tsourakakis, 2015; dau & milenkovic, 2017) and in many gnns design (klicpera et al., 2018). methods developed for homophilic graphs are nonuniversal in so far that they fail to properly solve learning problems on heterophilic (disassortative) graphs (pei et al., 2019; bojchevski et al., 2019; 2020). in heterophilic graphs, nodes with distinct labels are more likely to link together (for example, many people tend to preferentially connect with people of the opposite sex in dating graphs, different classes of amino acids are more likely to connect within many protein structures (zhu et al., 2020) etc). gnns model the homophily principle by aggregating node features within graph neighborhoods. for this purpose, they use different mechanisms such as averaging in each network layer. neighborhood aggregation is problematic and significantly more difficult for heterophilic graphs (jia & benson, 2020). LINEBREAK second, most of the existing gnns fail to be “deep enough”. although in principle an arbitrary number of layers may be stacked, practical models are usually shallow (including 2-4 layers) as these architectures are known to achieve better empirical performance than deep networks. a widely accepted explanation for the performance degradation of gnns with increasing depth is feature-oversmoothing, which may be intuitively explained as follows. the process of gnn feature propagating represents a form of random walks on “feature graphs,” and under proper conditions, such random walks converge with exponential rate to their stationary points. this essentially levels the expressive power of the features and renders them nondiscriminative. this intuitive reasoning was first described for linear settings in li et al. (2018) and has been recently studied in oono & suzuki (2020) for a setting involving nonlinear rectifiers. LINEBREAK we address these two described weaknesses by combining gnns with generalized pagerank techniques (gpr) within a new model termed gpr-gnn. the gpr-gnn architecture is designed to first learn the hidden features and then to propagate them via gpr techniques. the focal component of the network is the gpr procedure that associates each step of feature propagation with a learnable weight. the weights depend on the contributions of different steps during the information propagation procedure, and they can be both positive and negative. this departures from common nonnegativity assumptions (klicpera et al., 2018) allows for the signs of the weights to adapt to the homophily/heterophily structure of the underlying graphs. the amplitudes of the weights trade-off the degree of smoothing of node features and the aggregation power of topological features. these traits do not change with the choice of the initialization procedure and elucidate the process used to combine node features and the graph structure so as to achieve (near)-optimal predictions. in summary, the gpr-gnn method can simultaneously learn the node label patterns of disparate classes of graphs and prevent feature over-smoothing. LINEBREAK the excellent performance of gpr-gnn is demonstrated empirically, on real world datasets, and further supported through a number of theoretical findings. in the latter setting, we show that the gpr procedure relates to general polynomial graph filtering, which can naturally deal with both high and low frequency parts of the graph signals. in contrast, recent gnn models that utilize personalized pageranks (ppr) with fixed weights (wu et al., 2019; klicpera et al., 2018; 2019) inevitably act as low-pass filters. thus, they fail to learn the labels of heterophilic graphs. we also establish that gpr-gnn can provably mitigate the feature-over-smoothing issue in an adaptive manner even after large-step propagation (i.e., after a large number of propagation steps). hence, the method is able to make use of informative large-step propagation. LINEBREAK to test the performance of gpr-gnn on homophilic and heterophilic node label patterns and determine the trade-off between node and topological feature exploration, we first describe the recently proposed contextual stochastic block model (csbm) (deshpande et al., 2018). the csbm allows for smoothly controlling the “informativeness ratio” between node features and graph topology, LINEBREAK (a) illustration of our proposed gpr-gnn model. LINEBREAK figure 1: (a) hidden state feature extraction is performed by a neural networks using individual node features propagated via gpr. note that both the gpr weights γk and parameter set {θ} of the neural network are learned simultaneously in an end-to-end fashion (as indicated in red). (b)-(c) the learnt gpr weights of the gpr-gnn on real world datasets. cora is homophilic while texas is heterophilic (here, h stands for the level of homophily defined below). an interesting trend may be observed: for the heterophilic case the weights alternate from positive to negative with dampening amplitudes (more examples are provided in section 5). the shaded region corresponds to a 95% confidence interval. LINEBREAK where the graph can vary from being highly homophilic to highly heterophilic. we show that gprgnn outperforms all other baseline methods for the task of semi-supervised node classification on the csbm consistently from strong homophily to strong heterophily. we then proceed to show that gpr-gnn offers state-of-the-art performance on node-classification benchmark real-world datasets which contain both homophilic and heterophilic graphs. due to the space limit, we put all proofs, formal theorem statements, and the conclusion section in the supplement. LINEBREAK preliminaries LINEBREAK let g = (v, e) be an undirected graph with nodes v and edges e. let n denote the number of nodes, assumed to belong to one of c ≥ 2 classes. the nodes are associated with the node feature matrix x ∈ rn×f , where f denotes the number of features per node. throughout the paper, we use xi: to indicate the ith row and x:j to indicate the jth column of the matrix x, respectively. the symbol δij is reserved for the kronecker delta function. the graph g is described by the adjacency matrix a, while ˜a stands for the adjacency matrix for a graph with added self-loops. we let ˜d be the diagonal degree matrix of ˜a and ˜asym = ˜d−1/2 ˜a ˜d−1/2 denote the symmetric normalized adjacency matrix with self-loops. LINEBREAK gpr-gnns: motivation and contributions LINEBREAK k=0 γk ˜ak LINEBREAK generalized pageranks. generalized pagerank (gpr) methods were first used in the context of unsupervised graph clustering where they showed significant performance improvements over personalized pagerank (kloumann et al., 2017; li et al., 2019). the operational principles of gprs can be succinctly described as follows. given a seed node s ∈ v in some cluster of the graph, a one-dimensional feature vector h(0) ∈ rn×1 is initialized according to h(0) v: = δvs. the gpr score is defined as (cid:80)∞ k=0 γkh(k), where the parameters γk ∈ r, k = 0, 1, 2, . . ., are referred to as the gpr weights. clustering of the graph is performed locally by thresholding the gpr score. certain pangrank methods, such as personalized pagerank or heat-kernel pagerank (chung, 2007), are associated with specific choices of gpr weights (li et al., 2019). for an excellent in-depth discussion of pagerank methods, the interested reader is referred to (gleich, 2015). the work in li et al. (2019) recently introduced and theoretically analyzed a special form of gpr termed inverse pr (ipr) and showed that long random walk paths are more beneficial for clustering then previously assumed, provided that the gpr weights are properly selected (note that ipr was developed for homophilic graphs and optimal gpr weights for heterophilic graphs are not currently known). LINEBREAK equivalence of the gpr method and polynomial graph filtering. if we truncate the infinite sum in the definition of gpr at some natural number k, (cid:80)k sym corresponds to a polynomial LINEBREAK k=0 γk ˜ak LINEBREAK graph filter of order k. thus, learning the optimal gpr weights is equivalent to learning the optimal polynomial graph filter. note that one can approximate any graph filter using a polynomial graph filter (shuman et al., 2013) and hence the gpr method is able to deal with a large range of different node label patterns. also, increasing k allows one to better approximate the underlying optimal graph filter. this once again shows that large-step propagation is beneficial. LINEBREAK v∈v LINEBREAK universality with respect to node label patterns: homophily versus heterophily. in their recent work, pei et al. (2019) proposed an index to measure the level of homophily of nodes in a number of neighbors of v ∈ v that have the same label as v graph h(g) = 1 . note that h(g) → 1 cornumber of neighbors of v |v | responds to strong homophily while h(g) → 0 indicates strong heterophily. figures 1 (b) and (c) plot the gpr weights learnt by our gpr-gnn method on a homophilic (cora) and heterophilic (texas) dataset. the learnt gpr weights from cora match the behavior of ipr (li et al., 2019), which verifies that large-step propagation is indeed of great importance for homophilic graphs. the gpr weights learnt from texas behave significantly differently from all known pr variants, taking a number of negative values. these differences in weight patterns are observed under random initialization, demonstrating that the weights are actually learned by the network and not forced by specific initialization. furthermore, the large difference in the gpr weights for these two graph models illustrates the learning power of gpr-gnn and their universal adaptability. LINEBREAK the over-smoothing problem. one of the key components in most gnn models is the graph convolutional layer, described by LINEBREAK h(k) LINEBREAK gcn = relu LINEBREAK ˜asymh(k−1) LINEBREAK gcn w(k) LINEBREAK , ˆpgcn = softmax LINEBREAK ˜asymh(k−1) LINEBREAK gcn w(k) LINEBREAK where h(0) gcn = x and w(k) represents the trainable weight matrix for the kth layer. the key issue that limits stacking multiple layers is the over-smoothing phenomenon: if one were to remove relu in the above expression, limk→∞ ˜ak symh(0) = h(∞), where each row of h(∞) only depends on the degree of the corresponding node, provided that the graph is irreducible and aperiodic. this shows that the model looses discriminative information provided by the node features as the number of layers increases. LINEBREAK mitigating graph heterophily and over-smoothing issues with the gpr-gnn model. gprgnn first extracts hidden state features for each node and then uses gpr to propagate them. the gpr-gnn process can be mathematically described as: LINEBREAK ˆp = softmax(z), z = LINEBREAK γkh(k), h(k) = ˜asymh(k−1), h(0) LINEBREAK i: = fθ(xi:), LINEBREAK where fθ(.) represents a neural network with parameter set {θ} that generates the hidden state features h(0). the gpr weights γk are trained together with {θ} in an end-to-end fashion. the gprgnn model is easy to interpret: as already pointed out, gpr-gnn has the ability to adaptively control the contribution of each propagation step and adjust it to the node label pattern. examining the learnt gpr weights also helps with elucidating the properties of the topological information of a graph (i.e., determining the optimal polynomial graph filter), as illustrated in figure 1 (b) and (c). LINEBREAK placing gpr-gnns in the context of related prior work. among the methods that differ from repeated stacking of gcn layers, appnp (klicpera et al., 2018) represents one of the state-of-theart gnns that is related to our gpr-gnn approach. it can be easily seen that appnp as well as sgc (wu et al., 2019) are special cases of our model since appnp fixes γk = α(1−α)k, γk = (1− α)k, while sgc removes all nonlinearities with γk = δkk, respectively. these two weight choices correspond to personalized pagerank (ppr) (jeh & widom, 2003), which is known to be suboptimal compared to the ipr framework when applied to homophilic node classification (li et al., 2019). fixing the gpr weights makes the model unable to adaptively learn the optimal propagation rules which is of crucial importance: as we will show in section 4, the fixed ppr weights corresponds to low-pass graph filters which makes them inadequate for learning on heterophilic graphs. the recent work (klicpera et al., 2018) showed that fixed ppr weights (appnp) can also provably resolve the over-smoothing problem. however, the way appnp prevents over-smoothing is independent on the node label information. in contrast, the escape of gpr-gnn from over-smoothing is guided by the node label information (theorem 4.2). a detailed discussion of this phenomena along with illustrative examples is delegated to the supplement. LINEBREAK among the gcn-like models, jk-net (xu et al., 2018) exhibits some similarities with gpr-gnn. it also aggregates the outputs of different gcn layers to arrive at the final output. on the other hand, the gcn-cheby method (defferrard et al., 2016; kipf & welling, 2017) is related to polynomial graph filtering, where each convolutional layer propagates multiple steps and the graph filter in both cases, the depth of the models is limited in pracis related to chebyshev polynomials. tice (klicpera et al., 2018) and they are not easy to interpret as our gpr-gnn method. some prior work also emphasizes adaptively learning the importance of different steps (abu-el-haija et al., 2018; berberidis et al., 2018). nevertheless, none of the above works is applicable for semisupervised learning with gnns and considers heterophilic graphs. LINEBREAK theoretical properties of gpr-gnns LINEBREAK graph filtering aspects of gpr-gnns. as mentioned in section 3, the gpr component of the network may be viewed as a polynomial graph filter. let ˜asym = uλut be the eigenvalue decomposition of ˜asym. then, the corresponding polynomial graph filter equals (cid:80)k k=0 γk ˜ak sym = ugγ,k(λ)ut , where gγ,k(λ) is applied element-wise and gγ,k(λ) = (cid:80)k k=0 γkλk. we established the following result. theorem 4.1 (informal). assume that the graph g is connected. if γk ≥ 0 ∀k ∈ {0, 1, ..., k}, (cid:80)k k=0 γk = 1 and ∃k(cid:48) > 0 such that γk(cid:48) > 0, then gγ,k(·) is a low-pass graph filter. also, if γk = (−α)k, α ∈ (0, 1) and k is large enough, then gγ,k(·) is a high-pass graph filter. LINEBREAK by theorem 4.1 and from our discussion in section 3, we know that both appnp and sgc will invariably suppress the high frequency components. thus, they are inadequate for use on heterophilic in contrast, if one allows γk to be negative and learned adaptively the graph filter will graphs. pass relevant high frequencies. this is what allows gpr-gnn to perform exceptionally well on heterophilic graphs (see figure 2(c)). LINEBREAK gpr-gnn can escape from over-smoothing. as already emphasized, one crucial innovation of the gpr-gnn method is to make the gpr weights adaptively learnable, which allows gpr-gnn to avoid over-smoothing and trade node and topology feature informativeness. intuitively, when largestep propagation is not beneficial, it increases the training loss. hence, the corresponding gpr weights should decay in magnitude. this observation is captured by the following result, whose more formal statement and proof are delegated to the supplement due to space limitations. theorem 4.2 (informal). assume the graph g is connected and the training set contains nodes from each of the classes. also assume that k(cid:48) is large enough so that the over-smoothing effect occurs for h(k), ∀k ≥ k(cid:48) which dominate the contribution to the final output z. then, the gradients of γk and γk are identical in sign for all k ≥ k(cid:48). LINEBREAK theorem 4.2 shows that as long as over-smoothing happens, |γk| will approach 0 for all k ≥ k(cid:48) when we use an optimizer such as stochastic gradient descent (sgd) which has a suitable learning rate decay. this reduces the contribution of the corresponding steps h(k) in the final output z. when the weights |γk| are small enough so that h(k) no longer dominates the value of the final output z, the over-smoothing effect is eliminated. LINEBREAK results for new csbm synthetic and real-world datasets LINEBREAK synthetic data. in order to test the ability of label learning of gnns on graphs with arbitrary levels of homophily and heterophily, we propose to use csbms (deshpande et al., 2018) to generate synthetic graphs. we consider the case with two equal-size classes. in csbms, the node features are gaussian random vectors, where the mean of the gaussian depends on the community assignment. the difference of the means is controlled by a parameter µ, while the difference of the edge densities in the communities and between the communities is controlled by a parameter λ. hence µ and λ capture the “relative informativeness” of node features and the graph topology, respectively. moreover, positive λ(cid:48)s correspond to homophilic graphs while negative λ(cid:48)s correspond to heterophilic graphs. the information-theoretic limits of reconstruction for the csbm are characterized in deshpande et al. (2018). the results show that, asymptotically, one needs λ2 + µ2/ξ > 1 to ensure a LINEBREAK vanishing ratio of the misclassified nodes and the total number of nodes, where ξ = n/f and f as before denotes the dimension of the node feature vector. note that given a tolerance value (cid:15) > 0, λ2 + µ2/ξ = 1 + (cid:15) is an arc of an ellipsoid for which λ ≥ 0 and µ ≥ 0. to fairly and continuously control the extent of information carried by the node features and graph topology, we introduce a parameter φ = arctan( λ π . the setting φ = 0 indicates that only node features are informative, while |φ| = 1 indicates that only the graph topology is informative. moreover, φ = 1 corresponds to strongly homophilic graphs while φ = −1 corresponds to strongly heterophilic graphs. note that the values φ and −φ convey the same amount of information regarding graph topology. this is due to the fact that λ2 = (−λ)2. ideally, gnns that are able to optimally learn on both homophilic and heterophilic graph should have similar performances for φ and −φ. due to space limitation we refer the interested reader to (deshpande et al., 2018) for a review of all formal theoretical results and only outline the csbm properties needed for our analysis. additional information is also available in the supplement. LINEBREAK our experimental setup examines the semi-supervised node classification task in the transductive setting. we consider two different choices for the random split into training/validation/test samples, which we call sparse splitting (2.5%/2.5%/95%) and dense splitting (60%/20%/20%), respectively. the sparse splittnig is more similar to the original semi-supervised setting considered in kipf & welling (2017) while the dense setting is considered in pei et al. (2019) for studying heterophilic graphs. we run each experiment 100 times with multiple random splits and different initializations. LINEBREAK methods used for comparisons. we compare gpr-gnn with 6 baseline models: mlp, gcn (kipf & welling, 2017), gat (velickovic et al., 2018), jk-net (xu et al., 2018), gcn-cheby (defferrard et al., 2016), appnp (klicpera et al., 2018), sgc (wu et al., 2019), sage (hamilton et al., 2017) and geom-gcn (pei et al., 2019). for all architectures, we use the corresponding pytorch geometric library implementations (fey & lenssen, 2019). for geom-gcn, we directly use the code provided by the authors2. we could not test geom-gcn on csbm and other datasets not originally tested in the paper due to a preprocessing subroutine that is not publicly available (pei et al., 2019). LINEBREAK the gpr-gnn model setup and hyperparameter tuning. we choose random walk path lengths with k = 10 and use a 2-layer (mlp) with 64 hidden units for the nn component. for the gpr weights, we use different initializations including ppr with α ∈ {0.1, 0.2, 0.5, 0.9}, γk = δ0k or δkk and the default random initialization in pytorch. similarly, for appnp we search the optimal α within {0.1, 0.2, 0.5, 0.9}. for other hyperparameter tuning, we optimize the learning rate over {0.002, 0.01, 0.05} and weight decay {0.0, 0.0005} for all models. for geom-gcn, we use the best variants in the original paper for each dataset. finally, we use gpr-gnn(rand) to describe the results obtained with random initialization of the gpr weights. further experimental settings are discussed in the supplement. LINEBREAK results. we examine the robustness of all baseline methods and gpr-gnn using csbm-generated data with φ ∈ {−1, −0.75, −0.5, ..., 1}, which includes graphs across the heterophily/homophily spectrum. the results are summarized in figure 2. for both the sparse and dense setting, gprgnn significantly outperforms all other baseline models whenever φ < 0 (heterophilic graphs). on the other hand, all baseline gnns can be worse then simple mlp when the graph information is weak (φ = 0, −0.25). this shows that existing gnns cannot apply to arbitrary graphs, while gpr-gnn is clearly more robust. appnp methods have the worst performance on strongly heterophilic graphs. this is in agreement with the result of theorem 4.1 which asserts that appnp intrinsically acts a low-pass filter and is thus inadequate for strong heterophily settings. jknet, gcn-cheby and sage are the only three baseline models that are able to learn strongly heterophilic graphs under dense splitting. this is also to be expected since jknet is the only baseline model that combines results from different steps at the last layer, which is similar to what is done in gpr-gnn. gcn-cheby uses multiple steps in each layers which allows it to partially adapt to heterophilic settings as each layer is related to a polynomial graph filter of higher order compared to that of gcn. sage treats ego-embeddings and embeddings from neighboring nodes differently and does not simply average them out. this allows sage to adapt to the heterophilic case since the ego-embeddings prevent nodes from being overwhelmed by information from their neighbors. nevertheless, jknet, gcn-cheby and sage are not deep in practice. LINEBREAK 2https://github.com/graphdml-uiuc-jlu/geom-gcn LINEBREAK (a) LINEBREAK (b) LINEBREAK (c) LINEBREAK (d) LINEBREAK figure 3: figure (a)-(d) shows the learnt gpr weights by gpr-gnn with random initialization on csbm, dense split. the shaded region indicates 95% confidence interval. LINEBREAK moreover, jknet fails to learn under the sparse splitting model while gcn-cheby and sage fail to learn well when the graph information is strong (|φ| ≥ 0.5), again under the sparse splitting model. LINEBREAK also, we observe that random initialization of our gpr weights only results in slight performance drops under dense splitting. the drop is more evident for sparse splitting setting but our method still outperforms baseline models by a large margin for strongly heterophilic graphs. this is also to be expected as we have less label information in the sparse splitting setting where the implicit bias provided by good gpr initialization is helpful. the implicit bias becomes irrelevant for the dense splitting setting, since the label information is sufficiently rich. LINEBREAK besides the strong performance of gpr-gnn, the other benefit is its interpretability. in figure 3, we demonstrate the learnt gpr weights by our gpr-gnn on csbm with random initialization. when the graph is weak homophilic (φ = 0.25), the learnt gpr weights are decreasing. this is similar to the ppr weights used in appnp, despite that the decaying speed is different. when the graph is strong homophilic (φ = 0.75), the learnt gpr weights are increasing which is significantly different from the ppr weights. this result matches the recent finding in li et al. (2019) and behave similar to ipr proposed by the authors. on the other hand, the learnt gpr weights have zig-zag shape when the graph is heterophilic. this again validates theorem 4.1 as gpr weights with alternating signs correspond to a high-pass filter. interestingly, when φ = −0.25 the magnitude of learnt gpr weight is decreasing. this is because the graph information is weak and the node feature information is more important in this case. it makes sense that the learnt gpr weight focus on the first few steps. hence, we have validated the interpretablity of gpr-gnn. in practice, one can use the learnt gpr weights to better understand the graph structured data at hand. we showcase this benefit in the results of real world benchmark datasets. LINEBREAK figure 2: accuracy of tested models on csbm. error bars indicate 95% confidence interval. LINEBREAK real world benchmark datasets. we use 5 homophilic benchmark datasets available from the pytorch geometric library, including the citation graphs cora, citeseer, pubmed (sen et al., 2008; yang et al., 2016) and the amazon co-purchase graphs computers and photo (mcauley et al., 2015; shchur et al., 2018). we also use 5 heterophilic benchmark datasets tested in pei et al. (2019), including wikipedia graphs chameleon and squirrel, the actor co-occurrence graph, and webpage graphs texas and cornell from webkb3. we summarize the dataset statistics in table 1. LINEBREAK results on real-world datasets. we use accuracy (the micro-f1 score) as the evaluation metric along with a 95% confidence interval. the relevant results are summarized in table 2. for homophilic datasets, we provide results for sparse splitting which is more aligned with the original setting used in kipf & welling (2017); shchur et al. (2018). for the heterophilic datasets, we adopt dense splitting which is used in pei et al. (2019). LINEBREAK 3http://www.cs.cmu.edu/afs/cs.cmu.edu/project/theo-11/www/wwkb LINEBREAK table 1: benchmark dataset properties and statistics. LINEBREAK dataset cora citeseer pubmed computers LINEBREAK photo chameleon squirrel actor texas cornell LINEBREAK classes features nodes edges h(g) LINEBREAK table 2: results on real world benchmark datasets: mean accuracy (%) ± 95% confidence interval. boldface letters are used to mark the best results while underlined boldface letters indicate results within the given confidence interval of the best result. LINEBREAK cora LINEBREAK citeseer LINEBREAK pubmed LINEBREAK computers LINEBREAK photo LINEBREAK chameleon LINEBREAK actor LINEBREAK squirrel LINEBREAK texas LINEBREAK cornell LINEBREAK na LINEBREAK table 2 shows that, in general, gpr-gnn outperforms all tested methods. on homophilic datasets, gpr-gnn achieves the state-of-the-art performance. on heterophilic datasets, gpr-gnn significantly outperforms all the other baseline models. it is important to point out that there are two different patterns to be observed among the heterophilic datasets. on chameleon and squirrel, mlp and appnp perform worse then other baseline methods such as gcn and jknet. in contrast, mlp and appnp outperform the other baseline methods on actor, texas and cornell. we conjecture that this is due to the fact that the graph topology information is strong and weak, respectively. note that these two patterns match the results of the csbm experiments for φ close to −1 and 0, respectively (figure 2). furthermore, the homophily measure h(g) proposed by pei et al. (2019) cannot characterize such differences in heterophilic datasets. we relegate the more detailed discussion of this topic along with illustrative examples to the supplement.for fairness, we also repeated the experiment involving geomgcn on homophilic datasets using a dense split - the observed performance pattern tends to be similar which can be found in supplement. LINEBREAK we also examined the learned gpr weights on real datasets in figure 4. due to space limitations, a more comprehensive gpr weight analysis for other datasets is deferred to the supplement. we can see that learned gpr weights are all positive for homophilic datasets (pubmed and photo). in contrast, some gpr weights learned from heterophilic datasets (actor and squirrel) are negative. these results agree with the patterns observed on csbms. interestingly, the learned weight γ0 has the largest magnitude for the actor dataset. this indicates that most of the information is contained in node features. from table 2 we can also see that mlps indeed outperforms most baseline gnns (this is similar to the case of csbm(φ = −0.25)). on the other hand, gpr weights learned from squirrel have a zig-zag pattern. this implies that graph topology is more informative for squirrel compared to actor. from table 2 we also see that baseline gnns also outperform mlps on squirrel. LINEBREAK escaping from over-smoothing and dynamics of learning gpr weights. to demonstrate the ability of gpr-gnns to escape from over-smoothing, we choose the initial gpr weights to be γk = δkk. this ensures that over-smoothing effects are present with high probability at the very beginning of the learning process. on csbm(φ = −1) with dense splitting, we find that for 96 out of 100 runs, gpr-gnn predicts the same labels for all nodes at epoch 0, which implies that over-smoothing indeed occurs immediately. the final prediction is 98.79% accurate which is much larger than the initial accuracy of 50.07% at epoch 0. similar results can be observed for other datasets and this verifies our theoretical findings. we plot the dynamics of the learned gpr weights in figure 4(e)(h), which shows that the peak at last step is indeed reduced while the gpr weights for other steps are significantly increased in magnitude. more results on the dynamics of learning gpr weights may be found in the supplement. LINEBREAK (a) pubmed LINEBREAK (b) photo LINEBREAK (c) actor LINEBREAK (d) squirrel LINEBREAK (e) epoch= 0 LINEBREAK (f) epoch= 50 LINEBREAK figure 4: figures (a)-(d) show the learned gpr weights of our gpr-gnn method with random initialization on various datasets, for dense splitting. figures (e)-(f) show the learned weights of our gpr-gnn method with initialization δkk on csbm(φ = −1), for dense splitting. the shaded region indicates a 95% confidence interval. LINEBREAK table 3: efficiency on selected real world benchmark datasets: average running time per epoch(ms)/average total running time(s). note that geom-gcn requires a preprocessing procedure so we do not include it in the table. complete efficiency table for all benchmark datasets is in supplementary due to space limit. LINEBREAK cora LINEBREAK pubmed LINEBREAK chameleon LINEBREAK actor LINEBREAK efficiency analysis. we also examine the computational complexity of gpr-gnns compared to other baseline models. we report the empirical training time in table 3. compared to appnp, we only need to learn k+1 additional gpr weights for gpr-gnn, and usually k ≤ 20 (i.e. we choose k = 10 in our experiments). this additional computations are dominated by the computations performed by the neural network module fθ. we can observe from table 3 that indeed gpr-gnn has a running time similar to that of appnp. it is nevertheless worth pointing out that the authors of bojchevski et al. (2020) successfully scaled appnp to operate on large graphs. whether the same techniques may be used to scale gpr-gnns is an interesting open question. LINEBREAK conclusions LINEBREAK we addressed two fundamental weaknesses of existing gnns: failing to act as universal learners by not generalizing to heterophilic graphs and making use of large number of propagation steps. we developed a novel gpr-gnn architecture which combines adaptive generalized pagerank (gpr) scheme with gnns. we theoretically showed that our method does not only mitigates feature oversmoothing but also works on highly diverse node label patterns. we also tested gpr-gnns on both homophilic and heterophilic node label patterns, and proposed a novel synthetic benchmark datasets generated by the contextual stochastic block model. our experiments on real-world benchmark datasets showed clear performance gains of gpr-gnn over the state-of-the-art methods. moreover, we showed that gpr-gnn has desirable interpretability properties which is of independent interest. LINEBREAK acknowledgments LINEBREAK the work was supported in part by the nsf emerging frontiers of science of information grant 0939370 and the nsf cif 1618366 grant. LINEBREAK references LINEBREAK emmanuel abbe. community detection and stochastic block models: recent developments. the LINEBREAK sami abu-el-haija, bryan perozzi, rami al-rfou, and alexander a alemi. watch your step: learning node embeddings via graph attention. in advances in neural information processing systems, pp. 9180–9190, 2018. LINEBREAK sami abu-el-haija, bryan perozzi, amol kapoor, nazanin alipourfard, kristina lerman, hrayr harutyunyan, greg ver steeg, and aram galstyan. mixhop: higher-order graph convolutional architectures via sparsified neighborhood mixing. in international conference on machine learning, pp. 21–29, 2019. LINEBREAK peter w battaglia, jessica b hamrick, victor bapst, alvaro sanchez-gonzalez, vinicius zambaldi, mateusz malinowski, andrea tacchetti, david raposo, adam santoro, ryan faulkner, et al. relational inductive biases, deep learning, and graph networks. arxiv preprint arxiv:1806.01261, 2018. LINEBREAK dimitris berberidis, athanasios nikolakopoulos, and georgios b giannakis. adaptive diffusions for scalable learning over graphs. in mining and learning with graphs workshop @ acm kdd 2018, pp. 1, 8 2018. LINEBREAK aleksandar bojchevski, johannes klicpera, bryan perozzi, martin blais, amol kapoor, michal lukasik, and stephan g¨unnemann. is pagerank all you need for scalable graph neural networks? in acm kdd, mlg workshop, 2019. LINEBREAK aleksandar bojchevski, johannes klicpera, bryan perozzi, amol kapoor, martin blais, benedek r´ozemberczki, michal lukasik, and stephan g¨unnemann. scaling graph neural networks with approximate pagerank. in proceedings of the 26th acm sigkdd international conference on knowledge discovery & data mining, pp. 2464–2473, 2020. LINEBREAK joan bruna, wojciech zaremba, arthur szlam, and yann lecun. spectral networks and locally connected networks on graphs. in international conference on learning representations (iclr2014), cbls, april 2014, pp. http–openreview, 2014. LINEBREAK fan chung. the heat kernel as the pagerank of a graph. proceedings of the national academy of LINEBREAK hoang dau and olgica milenkovic. latent network features and overlapping community discovery via boolean intersection representations. ieee/acm transactions on networking, 25(5):3219– 3234, 2017. LINEBREAK micha¨el defferrard, xavier bresson, and pierre vandergheynst. convolutional neural networks on graphs with fast localized spectral filtering. in advances in neural information processing systems, pp. 3844–3852, 2016. LINEBREAK yash deshpande, subhabrata sen, andrea montanari, and elchanan mossel. contextual stochastic block models. in advances in neural information processing systems, pp. 8581–8593, 2018. LINEBREAK matthias fey and jan eric lenssen. fast graph representation learning with pytorch geometric. LINEBREAK justin gilmer, samuel s schoenholz, patrick f riley, oriol vinyals, and george e dahl. neural message passing for quantum chemistry. in proceedings of the 34th international conference on machine learning-volume 70, pp. 1263–1272. jmlr. org, 2017. LINEBREAK david f gleich. pagerank beyond the web. siam review, 57(3):321–363, 2015. LINEBREAK will hamilton, zhitao ying, and jure leskovec. inductive representation learning on large graphs. LINEBREAK in advances in neural information processing systems, pp. 1024–1034, 2017. LINEBREAK glen jeh and jennifer widom. scaling personalized web search. in proceedings of the 12th inter LINEBREAK national conference on world wide web, pp. 271–279, 2003. LINEBREAK junteng jia and austin benson. outcome correlation in graph neural network regression. arxiv LINEBREAK diederik p kingma and jimmy ba. adam: a method for stochastic optimization. arxiv preprint LINEBREAK thomas n. kipf and max welling. semi-supervised classification with graph convolutional net LINEBREAK works. in international conference on learning representations (iclr), 2017. LINEBREAK johannes klicpera, aleksandar bojchevski, and stephan g¨unnemann. predict then propagate: in international conference on learning LINEBREAK graph neural networks meet personalized pagerank. representations, 2018. LINEBREAK johannes klicpera, stefan weißenberger, and stephan g¨unnemann. diffusion improves graph learn LINEBREAK ing. in advances in neural information processing systems, pp. 13333–13345, 2019. LINEBREAK isabel m kloumann, johan ugander, and jon kleinberg. block models and personalized pagerank. LINEBREAK proceedings of the national academy of sciences, 114(1):33–38, 2017. LINEBREAK pan li, i chien, and olgica milenkovic. optimizing generalized pagerank methods for seedin advances in neural information processing systems, pp. LINEBREAK qimai li, zhichao han, and xiao-ming wu. deeper insights into graph convolutional networks for semi-supervised learning. in thirty-second aaai conference on artificial intelligence, 2018. LINEBREAK linyuan l¨u and tao zhou. link prediction in complex networks: a survey. physica a: statistical LINEBREAK julian mcauley, christopher targett, qinfeng shi, and anton van den hengel. image-based recommendations on styles and substitutes. in proceedings of the 38th international acm sigir conference on research and development in information retrieval, pp. 43–52, 2015. LINEBREAK miller mcpherson, lynn smith-lovin, and james m cook. birds of a feather: homophily in social LINEBREAK networks. annual review of sociology, 27(1):415–444, 2001. LINEBREAK kenta oono and taiji suzuki. graph neural networks exponentially lose expressive power for node LINEBREAK classification. in international conference on learning representations, 2020. LINEBREAK hongbin pei, bingzhe wei, kevin chen-chuan chang, yu lei, and bo yang. geom-gcn: geometric graph convolutional networks. in international conference on learning representations, 2019. LINEBREAK prithviraj sen, galileo namata, mustafa bilgic, lise getoor, brian galligher, and tina eliassi-rad. LINEBREAK collective classification in network data. ai magazine, 29(3):93–93, 2008. LINEBREAK oleksandr shchur, maximilian mumme, aleksandar bojchevski, and stephan g¨unnemann. pitfalls LINEBREAK of graph neural network evaluation. arxiv preprint arxiv:1811.05868, 2018. LINEBREAK nino shervashidze, pascal schweitzer, erik jan van leeuwen, kurt mehlhorn, and karsten m borgwardt. weisfeiler-lehman graph kernels. journal of machine learning research, 12(77):2539– 2561, 2011. LINEBREAK d. i. shuman, s. k. narang, p. frossard, a. ortega, and p. vandergheynst. the emerging field of signal processing on graphs: extending high-dimensional data analysis to networks and other irregular domains. ieee signal processing magazine, 30(3):83–98, 2013. LINEBREAK charalampos tsourakakis. provably fast inference of latent features from networks: with applications to learning social circles and multilabel classification. in proceedings of the 24th international conference on world wide web, pp. 1111–1121, 2015. LINEBREAK petar velickovic, guillem cucurull, arantxa casanova, adriana romero, pietro lia, and yoshua bengio. graph attention networks. in international conference on learning representations, 2018. url https://openreview.net/forum?id=rjxmpikcz. LINEBREAK ulrike von luxburg. a tutorial on spectral clustering. statistics and computing, 17(4):395–416, LINEBREAK wok asiri suranga wijesinghe and qing wang. dfnets: spectral cnns for graphs with feedbacklooped filters. in advances in neural information processing systems, pp. 6007–6018, 2019. LINEBREAK felix wu, amauri souza, tianyi zhang, christopher fifty, tao yu, and kilian weinberger. simplifying graph convolutional networks. in international conference on machine learning, pp. 6861–6871, 2019. LINEBREAK keyulu xu, chengtao li, yonglong tian, tomohiro sonobe, ken-ichi kawarabayashi, and stefanie jegelka. representation learning on graphs with jumping knowledge networks. in international conference on machine learning, pp. 5453–5462, 2018. LINEBREAK zhilin yang, william w cohen, and ruslan salakhutdinov. revisiting semi-supervised learning with graph embeddings. in proceedings of the 33rd international conference on international conference on machine learning-volume 48, pp. 40–48, 2016. LINEBREAK hanqing zeng, hongkuan zhou, ajitesh srivastava, rajgopal kannan, and viktor prasanna. graphsaint: graph sampling based inductive learning method. in international conference on learning representations, 2020. url https://openreview.net/forum?id=bje8pkhfws. LINEBREAK jiong zhu, yujun yan, lingxiao zhao, mark heimann, leman akoglu, and danai koutra. general LINEBREAK izing graph neural networks beyond homophily. arxiv preprint arxiv:2006.11468, 2020. LINEBREAK xiaojin jerry zhu. semi-supervised learning literature survey. technical report, university of LINEBREAK wisconsin-madison department of computer sciences, 2005. LINEBREAK a appendix LINEBREAK a.1 detailed discussion on preventing over-smoothing. LINEBREAK as mentioned in section 4, another method – appnp – can also provably prevents oversmoothing klicpera et al. (2018). the authors of this study use the fact that the ppr propagation will converge to πpprh(0), where πppr = α(in − (1 − α) ˜asym)−1 is independent on the node label information provided in the training data. each row of πpprh(0) still depends on h(0) and thus appnp will not suffer from the over-smoothing effect. however, since πppr is independent of the label information, it can cause undesired consequences that we discuss in what follows. LINEBREAK (a) a graph g. LINEBREAK (b) one example of label assignment. LINEBREAK (c) another example of label assignment. LINEBREAK figure 5: a simple example demonstrating how gpr-gnn escapes over-smoothing. let us consider a simple example shown in figure 5 involving a connected and undirected graph g = (v, e) (figure 5 (a)). consider two different node label assignments shown in figure 5 (b) and figure 5 (c). obviously, the graph topologies depicted in figure 5 (b) and (c) are identical and the only difference is the class label assignment. in figure 5 (b), the graph is homophilic and hence the optimal graph filter should emphasize the low-frequency part of the graph signal. in contrast, in figure 5 (c), the graph is heterophilic as the graph is bipartite with respect to the labels. hence, the optimal graph filter should emphasize the high-frequency part of the graph signal. this example illustrates that the optimal graph filter should depend on both the graph topology and the node label information. recall that the equivalent graph filter that appnp uses in the asymptotic regime is πppr which is independent on the node label information. also, theorem 4.1 established that appnp intrinsically utilizes a low-pass filter. in contrast, gpr-gnn learns the gpr weights guided by the node label information which allows it to account for both cases (homophilic and heterophilic) shown. LINEBREAK a.2 discussion on the insufficiency of homophily measure h(g) LINEBREAK (a) case 1. LINEBREAK (b) case 2. LINEBREAK figure 6: a simple example for explaining the insufficiency of homophily measure h(g). as mentioned in section 5, the homophily measure h(g) is inadequate for characterizing whether a heterophilic graph topology is informative or not. consider two simple examples depicted in fig LINEBREAK ure 6, where the color of the nodes indicates their label. in case 1, blue and green nodes link to all orange and purple nodes. in case 2, blue nodes only link to orange nodes and green nodes only link to purple nodes. from the definition of h(g) one can see that both cases have h(g) = 0, since in both cases nodes do not link to other nodes of the same label. however, it is obvious that the graph topology carries more node label information in case 2 compared to case 1. in fact, for case 1 it is impossible to distinguish blue and green nodes merely from the graph topology (and the same is true of orange and purple nodes). one possible alternative for the homophily measure is the chernoff-hellinger divergence abbe (2017) of the empirical edge probability matrix b; here bij is the empirical probability of an edge with one end node labeled i and the other labeled j. the intuition behind our suggestion lies in the fact that the chernoff-hellinger divergence characterizes the fundamental limit of sbms. however, as many practical graph generative processes may significantly differ from sbms, investigating alternative homophily/heterophily measures is another interesting open problem. LINEBREAK a.3 proof of theorem 4.1 LINEBREAK we first state the formal version of theorem 4.1. theorem a.1 (formal version of theorem 4.1). assume the graph g is connected. let λ1 ≥ λ2 ≥ ... ≥ λn be the eigenvalues of ˜asym. if γk ≥ 0 ∀k ∈ {0, 1, ..., k}, (cid:80)k k=0 γk = 1 and ∃k(cid:48) > 0 such that γk(cid:48) > 0, then |gγ,k(λi)/gγ,k(λ1)| < |λi/λ1| ∀i ≥ 2. also, if γk = (−α)k, α ∈ (0, 1) and k → ∞, then | limk→∞ gγ,k(λi)/ limk→∞ gγ,k(λ1)| > |λi/λ1| ∀i ≥ 2. LINEBREAK note that |gγ,k(λi)/gγ,k(λ1)| < |λi/λ1| ∀i ≥ 2 implies that after applying the graph filter gγ,k, the lowest frequency component (correspond to λ1) further dominates. hence gγ,k acts like a low pass filter in this case. in contrast, | limk→∞ gγ,k(λi)/ limk→∞ gγ,k(λ1)| > |λi/λ1| ∀i ≥ 2 implies that after applying the graph filter, the lowest frequency component (correspond to λ1) no longer dominates. this correspond to the high pass filter case. LINEBREAK proof. we start with the low pass filter result. from basic spectral analysis (von luxburg, 2007) we know that λ1 = 1 and |λi| < 1, ∀i ≥ 2. one can also find the analysis in the proof of our lemma a.2 in the supplement. then by assumption we know that LINEBREAK hence, proving theorem a.1 is equivalent to show LINEBREAK |gγ,k(λi)| < |λi| ∀i ≥ 2. this is obvious since gγ,k(λ) = (cid:80)k k=0 γkλk is a polynomial of order k with nonnegative coefficients. it is easy to check that ∀k ≥ 1, |λ|k < |λ|, ∀|λ| < 1. combine with the fact that all γk’s are nonnegative we have LINEBREAK |gγ,k(λi)| ≤ LINEBREAK γk|λk| = LINEBREAK γk|λ|k LINEBREAK (a) ≤ LINEBREAK γk|λ| = |λ|. LINEBREAK k=0 finally, note that the only possibility that the inequality (a) holds is γk = δ0,k since ∀k ≥ 1, |λ|k < |λ|, ∀|λ| < 1. however, by assumption (cid:80)k k=0 γk = 1 and ∃k(cid:48) > 0 such that γk(cid:48) > 0 we know that this is impossible. hence (a) is a strict inequality <. together we complete the proof for low pass filtering part. LINEBREAK for the high pass filter result, it is not hard to see that LINEBREAK lim k→∞ LINEBREAK gγ,k(λ) = lim k→∞ LINEBREAK γkλk = lim k→∞ LINEBREAK (−αλ)k = LINEBREAK where the last step is due to the fact that α ∈ (0, 1) and thus limk→∞(−αλ)k = 0, ∀|λ| ≤ 1. thus we have LINEBREAK limk→∞ gγ,k(λi) limk→∞ gγ,k(λ1) LINEBREAK (c) > |λi| ∀i ≥ 2. LINEBREAK 1 both strict inequalities (b) and (c) are from the fact that |λi| < 1, ∀i ≥ 2. notably, supλ∈[1,−1) 1+αλ happens at the boundary λ = −1, which corresponds the the bipartite graph. it further shows that the graph filter with respect to the choice γk = (−α)k emphasizes high frequency components and thus it is indeed acting as a high pass filter. LINEBREAK a.4 proof of theorem 4.2 LINEBREAK we start by introducing some additional notation, lemmas and definition before we proceed to the formal statement of theorem 4.2. the label matrix is denoted by y ∈ rn×c, where each row is a one-hot vector. we use 1[β] ∈ rc to denote the argmax of the vector β ∈ rc: we have 1[β]i = 1 if and only if βi = max(β) (ties are broken evenly), and 1[β]i = 0 otherwise. let us replace the softmax(·) with softmaxη(·), where we let softmaxη(β)i = eηβi/((cid:80) j eηβj ) stand for the softmax with a smooth parameter η > 0. note that for η = 1 we recover the standard softmax. with a slight abuse of notation, for the vector β we write exp(β) to denote element-wise exponentiation. we use (cid:104)·, ·(cid:105) to denote the standard euclidean inner product. also we use l for the cross entropy loss where LINEBREAK l = LINEBREAK i∈v LINEBREAK − log( LINEBREAK (cid:68) ˆpi:, yi: LINEBREAK lemma a.2. assume that the nodes in an undirected and connected graph g have one of c labels. then, for k large enough, we have LINEBREAK h(k) LINEBREAK :j = βjπ + ok(1) ∀j ∈ [c], where πi = LINEBREAK ˜dvv LINEBREAK v∈v LINEBREAK and βt = πt h(0). LINEBREAK for any h(0) and large enough k ≤ k, if the label prediction is dominated by h(k), all nodes will have a representation proportional to γkβ. hence, we will arrive at the same label for all nodes. this is what we refer to as the over-smoothing phenomenon. definition a.3 (the over-smoothing phenomenon). first, recall that z = (cid:80) k γkh(k). if oversmoothing occurs in the gpr-gnn for k sufficiently large, we have z:j = c0βjπ, ∀j ∈ [c] for some c0 > 0 if γk > 0 and z:j = −c0βjπ, ∀j ∈ [c] for some c0 > 0 if γk < 0. lemma a.4. let l = (cid:80) ) be the cross entropy loss and let t be the training set. under the same assumption as given in lemma a.2, the gradient of γk for k large enough is ∂l + ok(1). ∂γk lemma a.5. for any real vector β ∈ rc and η > 0 large enough, we have softmaxη(β) = 1[β] + oη(1). LINEBREAK (cid:68) ˆpi: − yi:, β LINEBREAK i∈t li = (cid:80) LINEBREAK (cid:68) ˆpi:, yi: LINEBREAK i∈t −log( LINEBREAK i∈t ηπi LINEBREAK now we are ready to state the formal version of theorem 4.2. theorem a.6 (formal version of theorem 4.2). under the same assumptions as those listed in lemma a.2, if the training set contains nodes from each class, then the gpr-gnn method can always avoid over-smoothing. more specifically, for k, η large enough we have LINEBREAK ∂l ∂γk LINEBREAK ∂l ∂γk LINEBREAK i∈t LINEBREAK i∈t LINEBREAK ηπi LINEBREAK max j∈[c] LINEBREAK βj − β1[yi:] LINEBREAK + ok(1) + oη(1), when γk > 0. LINEBREAK ηπi LINEBREAK min j∈[c] LINEBREAK βj − β1[yi:] LINEBREAK + ok(1) + oη(1), when γk < 0. LINEBREAK note that when γk > 0, (3) ≥ 0 when ignoring the o(1) term. the equality is achieved if and only if maxj∈[c] βj = β1[yi:]. this means that over-smoothing results in a prediction that perfectly aligns with the ground truth label in the training set. however, if our training set contains at least one node from each class then the equality can never be attained. thus, the gradient of γk will always be positive when γk > 0. similarly when γk < 0, (4) ≤ 0 when ignoring the o(1) term. the equality is achieved if and only if minj∈[c] βj = β1[yi:]. by the same reason we know that under the assumption on training set the equality can never be attained. thus, the gradient of γk will always LINEBREAK be negative when γk < 0. finally, it is not hard to check that the gradient is bounded in magnitude. together we have shown that the gradient of γk and γk are of the same sign. this directly implies that |γk| will approach to 0 until we escape from over-smoothing when we use a decreasing learning rate for the optimizer (i.e. sgd). LINEBREAK proof. first, let us assume the over-smoothing takes place and the γk > 0 for the dominate term. by definition a.3, we know that z:j = c0βjπ, ∀j ∈ [c] for some c0 > 0 and k sufficiently large. by lemma a.4 we have LINEBREAK ∂l ∂γk LINEBREAK i∈t LINEBREAK ηπi LINEBREAK eηzi: j∈[c] eηzij LINEBREAK − yi:, β LINEBREAK i∈t LINEBREAK ηπi LINEBREAK eηc0πiβ j∈[c] eηc0πiβj LINEBREAK − yi:, β LINEBREAK where the last step follows from definition a.3. next, by lemma a.5, we may approximate the softmaxη by the true argmax for η > 0 large enough according to LINEBREAK i∈t LINEBREAK i∈t LINEBREAK i∈t LINEBREAK ηπi LINEBREAK max j∈[c] LINEBREAK βj − β1[yi:] LINEBREAK the first equality is due to the fact that c0 > 0 and πi > 0. recall that by lemma a.2, πi = . since we have a self- loop for each node, ˜dii > 0 and thus πi > 0. for the case
| 15
|
[
108,
394.0040828,
504.0014638,
421.4838556
] |
6ve2CkeQe5S.pdf
| 2,023
| 2
|
LINEBREAK medfair: benchmarking fairness for medical imaging LINEBREAK yongshuo zong1, yongxin yang1, timothy hospedales1,2 1 school of informatics, university of edinburgh, 2 samsung ai centre, cambridge {yongshuo.zong, yongxin.yang, t.hospedales}@ed.ac.uk LINEBREAK abstract LINEBREAK a multitude of work has shown that machine learning-based medical diagnosis systems can be biased against certain subgroups of people. this has motivated a growing number of bias mitigation algorithms that aim to address fairness issues in machine learning. however, it is difficult to compare their effectiveness in medical imaging for two reasons. first, there is little consensus on the criteria to assess fairness. second, existing bias mitigation algorithms are developed under different settings, e.g., datasets, model selection strategies, backbones, and fairness metrics, making a direct comparison and evaluation based on existing results impossible. in this work, we introduce medfair, a framework to benchmark the fairness of machine learning models for medical imaging. medfair covers eleven algorithms from various categories, ten datasets from different imaging modalities, and three model selection criteria. through extensive experiments, we find that the under-studied issue of model selection criterion can have a significant impact on fairness outcomes; while in contrast, state-of-the-art bias mitigation algorithms do not significantly improve fairness outcomes over empirical risk minimization (erm) in both in-distribution and out-of-distribution settings. we evaluate fairness from various perspectives and make recommendations for different medical application scenarios that require different ethical principles. our framework provides a reproducible and easy-to-use entry point for the development and evaluation of future bias mitigation algorithms in deep learning. code is available at https://github.com/ys-zong/medfair. LINEBREAK introduction LINEBREAK machine learning-enabled automatic diagnosis with medical imaging is becoming a vital part of the current healthcare system (lee et al., 2017). however, machine learning (ml) models have been found to demonstrate a systematic bias toward certain groups of people defined by race, gender, age, and even the health insurance type with worse performance (obermeyer et al., 2019; larrazabal et al., 2020; spencer et al., 2013; seyyed-kalantari et al., 2021). the bias also exists in models trained from different types of medical data, such as chest x-rays (seyyed-kalantari et al., 2020), ct scans (zhou et al., 2021), skin dermatology images (kinyanjui et al., 2020), etc. a biased decision-making system is socially and ethically detrimental, especially in life-changing scenarios such as healthcare. this has motivated a growing body of work to understand bias and pursue fairness in the areas of machine learning and computer vision (mehrabi et al., 2021; louppe et al., 2017; tartaglione et al., 2021; wang et al., 2020). LINEBREAK informally, given an observation input x (e.g., a skin dermatology image), a sensitive attribute s (e.g., male or female), and a target y (e.g., benign or malignant), the goal of a diagnosis model is to learn a meaningful mapping from x to y. however, ml models may amplify the biases and confounding factors that already exist in the training data related to sensitive attribute s. for example, data imbalance (e.g., over 90% individuals from uk biobank (sudlow et al., 2015) originate from european ancestries), attribute-class imbalance (e.g., in age-related macular degeneration (amd) datasets, subgroups of older people contain more pathology examples than that of younger people (farsiu et al., 2014)), label noise (e.g., zhang et al. (2022) find that label noises in chexpert dataset (irvin et al., 2019) is much higher in some subgroups than the others), etc. bias mitigation algorithms LINEBREAK figure 1: components of medfair benchmark. LINEBREAK therefore aim to help diagnosis algorithms learn predictive models that are robust to confounding factors related to sensitive attribute s (mehrabi et al., 2021). LINEBREAK given the importance of ensuring fairness in medical applications and the special characteristics of medical data, we argue that a systematic and rigorous benchmark is needed to evaluate the bias mitigation algorithms for medical imaging. however, a straightforward comparison of algorithmic fairness for medical imaging is difficult, as there is no consensus on a single metric for fairness of medical imaging models. group fairness (dwork et al., 2012; verma & rubin, 2018) is a popular and intuitive definition adopted by many debiasing algorithms, which optimises for equal performance among subgroups. however, this can lead to a trade-off of increasing fairness by decreasing the performance of the advantaged group, reducing overall utility substantially. doing so may violate the ethical principles of beneficence and non-maleficence (beauchamp, 2003), especially for some medical applications where all subgroups need to be protected. there are also other fairness definitions, including individual fairness (dwork et al., 2012), minimax fairness (diana et al., 2021), counterfactual fairness (kusner et al., 2017), etc. it is thus important to consider which definition should be used for evaluations. LINEBREAK in addition to the use of differing evaluation metrics, different experimental designs used by existing studies prevent direct comparisons between algorithms based on the existing literature. most obviously, each study tends to use different datasets to evaluate their debiasing algorithms, preventing direct comparisons of results. furthermore, many bias mitigation studies focus on evaluating tabular data with low-capacity models (madras et al., 2018; zhao et al., 2019; diana et al., 2021), and recent analysis has shown that their conclusions do not generalise to high-capacity deep networks used for the analysis of image data (zietlow et al., 2022). a crucial but less obvious issue is the choice of model selection strategy for hyperparameter search and early stopping. individual bias mitigation studies are divergent or vague in their model selection criteria, leading to inconsistent comparisons even if the same datasets are used. finally, given the effort required to collect and annotate medical imaging data, models are usually deployed in a different domain than the domain used for data collection. (e.g., data collected at hospital a is used to train a model deployed at hospital b). while the maintenance of prediction quality across datasets has been well studied, it is unclear if fairness achieved within one dataset (in-distribution) holds under dataset shift (out-of-distribution). LINEBREAK in order to address these challenges, we provide the first comprehensive fairness benchmark for medical imaging – medfair. we conduct extensive experiments across eleven algorithms, ten datasets, four sensitive attributes, and three model selection strategies to assess bias mitigation algorithms in both in-distribution and out-of-distribution settings. we report multiple evaluation metrics and conduct rigorous statistical tests to find whether any of the algorithms is significantly better. having trained over 7,000 models using 6,800 gpu-hours, we have the following observations: LINEBREAK • bias widely exists in erm models trained in different modalities, which is reflected in the LINEBREAK predictive performance gap between different subgroups for multiple metrics. LINEBREAK • model selection strategies can play an important role in improving the worst-case perfor LINEBREAK mance. algorithms should be compared under the same model selection criteria. LINEBREAK • the state-of-the-art methods do not outperform the erm with statistical significance in LINEBREAK both in-distribution and out-of-distribution settings. LINEBREAK these results show the importance of a large benchmark suite such as medfair to evaluate progress in the field and to guide practical decisions about the selection of bias mitigation algorithms for deployment. medfair is released as a reproducible and easy-to-use codebase that all experiments in this study can be run with a single command. detailed documentation is provided in order to allow researchers to extend and evaluate the fairness of their own algorithms and datasets, and we will also actively maintain the codebase to incorporate more algorithms, datasets, model selection strategies, etc. we hope our codebase can accelerate the development of bias mitigation algorithms and guide the deployment of ml models in clinical scenarios. LINEBREAK fairness in medicine LINEBREAK problem formulation LINEBREAK we focus on evaluating the fairness of binary classification of medical images. given an image, we predict its diagnosis label in a way that is not confounded by any sensitive attributes (age, sex, race, etc.) so that the trained model is fair and not biased towards a certain subgroup of people. formally, let d ∈ {di}i i be a set of domains, where i is the total number of domains. a domain can represent a dataset collected from a particular imaging modality, hospital, population, etc. consider a domain d = (x , y, s) to be a distribution where we have input sample x ∈ rd over input space x , the corresponding binary label y ∈ {0, 1} over label space y,1 , and sensitive attributes s ∈ {0, 1, ..., m−1} with m classes over sensitive space s. we train a model h ∈ h to output the prediction ˆy ∈ {0, 1}, i.e., h : x → y, where h is the hypothesis class of models. note that for each dataset di, there may exist several sensitive attributes at the same time, e.g., there are metadata of both patients’ age and sex. we only consider one sensitive attribute at one time. LINEBREAK in-distribution given a domain di, assume the input samples xi, their labels yi, and the sensitive attributes si are identically and independently distributed (iid) from a joint probability distribution pi(xi, yi, si). we define the evaluation where the training and testing on the same domain di to be in-distribution, i.e., the training and testing set are from the same distribution. we train models for each combination of algorithms × datasets × sensitive attributes. LINEBREAK out-of-distribution in clinical scenarios, due to the lack of training data, it is common to deploy a model trained in the original dataset to new hospitals/populations that have different data distributions. we define the training on one domain di and testing on the other unseen domain dj to be out-of-distribution settings, where di and dj may have different distribution pi(xi, yi, si) and pj(xj, yj, sj). in this case, we assume domains di and dj must have the same input space (e.g., x-ray imaging), diagnosis labels, and sensitive attributes, but differ in their joint distributions due to collection from different locations or different imaging protocols. we evaluate if bias mitigation algorithms are robust to distribution shift by directly using the model selected from the in-distribution setting of the domain di to test on the domain dj. LINEBREAK fairness definition in medicine LINEBREAK here we consider two most salient fairness definitions for healthcare, i.e., group fairness and maxmin fairness. we argue that one should focus on different fairness definitions depending on the specific clinical application. LINEBREAK group fairness metrics based on group fairness usually aim to achieve parity of predictive performance across protected subgroups. for resource allocation problems that can be considered a zero-sum game due to the limited resources, e.g., prioritising which patients should be sent to a limited number of intensive care units (icus), it is important to consider group fairness to reduce the disparity among different subgroups (related discussions in hellman (2008); barocas & selbst LINEBREAK 1our framework can be easily extended to non-binary classification. LINEBREAK (2016)). we measure the performance gap in diagnosis auc between the advantaged and disadvantaged subgroups as an indicator of group fairness. this is in line with the ”separability” criteria (chen et al., 2021; dwork et al., 2012) that algorithm scores should be conditionally independent of the sensitive attribute given the diagnostic label (i.e., ˆy ⊥ s|y ), which is also adopted by (gardner et al., 2019; fong et al., 2021). on the other hand, zietlow et al. (2022) find that for high-capacity models in computer vision, this is typically achieved by worsening the performance of the advantaged group rather than improving the disadvantaged group, a phenomenon termed as leveling down in philosophy that has incurred numerous criticisms (christiano & braynen, 2008; brown, 2003; doran, 2001). worse, practical implementations often lead to worsening the performance of both subgroups (zietlow et al., 2022), making it pareto inefficient and comprehensively violating beneficence and non-maleficence principles (beauchamp, 2003). thus, we argue that group fairness alone is not sufficient to analyse the trade-off between fairness and utility. LINEBREAK max-min fairness it is another definition of fairness (lahoti et al., 2020) following rawlsian max-min fairness principle (rawls, 2001), which is also studied as minimax group fairness (diana et al., 2021) or minimax pareto fairness (martinez et al., 2020). here, instead of seeking to equalize the error rates among subgroups, it treats the model that reduces the worst-case error rates as the fairer one. it may be a more appropriate definition than group fairness for some medical applications such as diagnosis, as it better satisfies the beneficence and non-maleficence principles (beauchamp, 2003; chen et al., 2018; ustun et al., 2019), i.e., do the best and do no harm. formally, for a model h in the hypothesis class h, denote us(h) to be a utility function for subgroup s. a model h∗ is considered to be max-min fair if it maximizes (max-) the utility of the worst-case (min) group: LINEBREAK h∗ = argmax LINEBREAK h∈h LINEBREAK min s∈s LINEBREAK us(h). LINEBREAK in practice, it is hard to quantify the maximum optimal utility, and therefore we treat a model hk to be fairer than the other model ht if LINEBREAK min s∈s LINEBREAK us(hk) > min s∈s LINEBREAK us(ht). LINEBREAK we measure both group fairness and max-min fairness to give a more comprehensive evaluation for fairness in medical applications. LINEBREAK medfair LINEBREAK we implement a reproducible and easy-to-use codebase medfair to benchmark fairness in machine learning algorithms for medical imaging. in our benchmark, we conduct large-scale experiments in ten datasets, eleven algorithms, up to three sensitive attributes for each dataset, and three model selection criteria, where all the experiments can be run with a single command. we provide source code and detailed documentation, allowing other researchers to reproduce the results and incorporate other datasets and algorithms easily. LINEBREAK datasets LINEBREAK ten datasets are included in medfair: chexpert (irvin et al., 2019), mimic-cxr (johnson et al., 2019), papila (kovalyk et al., 2022), ham10000 (tschandl et al., 2018), fitzpatrick17k (groh et al., 2021), ol3i (chaves et al., 2021), covid-ct-md (afshar et al., 2021), oct (farsiu et al., 2014), adni 1.5t, and adni 3t (petersen et al., 2010), to evaluate the algorithms comprehensively, which are all publicly available to ensure the reproducibility. we consider five important aspects during dataset selection: LINEBREAK imaging modalities. we select datasets covering various 2d and 3d imaging modalities, including x-ray, fundus photography, computed tomography (ct), magnetic resonance imaging (mri), spectral domain optical coherence tomography (sd-oct), and skin dermatology images. LINEBREAK potential sources of bias. we involve datasets that may introduce bias from different sources, including label noise, data/class imbalance, spurious correlation, etc. note that each dataset may contain more than one source of bias. LINEBREAK sensitive attributes. tively and may be biased in clinical practice, including age, sex, race, and skin type. LINEBREAK the selected datasets contain attributes that are commonly treated sensi LINEBREAK table 1: detailed statistics of the datasets. ”# images/scans” listed here are the actual numbers used in this study after removing those missing sensitive attributes. for potential bias, ln, ci, di, and sc represent label noise, class imbalance, data imbalance, and spurious correlation, respectively. LINEBREAK modality LINEBREAK # images LINEBREAK sensitive attribute bias sources LINEBREAK dataset LINEBREAK chexpert LINEBREAK mimic-cxr papila LINEBREAK chest x-ray (2d) LINEBREAK chest x-ray (2d) fundus image (2d) LINEBREAK age, sex, race LINEBREAK age, sex, race age, sex LINEBREAK skin dermatology (2d) LINEBREAK fitzpatrick17k LINEBREAK skin dermatology (2d) LINEBREAK ol3i LINEBREAK heart ct (2d) LINEBREAK covid-ct-md lung ct (3d) LINEBREAK oct LINEBREAK adni 1.5t LINEBREAK adni 3t LINEBREAK sd-oct (3d) LINEBREAK brain mri (3d) LINEBREAK brain mri (3d) LINEBREAK age, sex LINEBREAK skin type LINEBREAK age, sex LINEBREAK age, sex LINEBREAK age LINEBREAK age, sex LINEBREAK age, sex LINEBREAK ln, ci, di LINEBREAK ln, ci, di di, ci LINEBREAK di, ci LINEBREAK ln, di, ci LINEBREAK di, ci, sc LINEBREAK di, ci LINEBREAK di, ci LINEBREAK sc LINEBREAK sc LINEBREAK size of datasets. as the sizes of medical imaging datasets are often limited by privacy issues, etc., it is important to inspect whether the fairness algorithms are effective with different sizes of datasets. the dataset sizes range from 420 ∼ 370, 955 for 2d images and 110 ∼ 550 for 3d scans. LINEBREAK out-of-distribution evaluation. we include two pairs of datasets with the same modality but collected from different locations or different imaging protocols for out-of-distribution evaluations. specifically, we choose two 2d chest x-ray datasets i.e., chexpert and mimic-cxr, and two 3d brain mri datasets i.e., adni 1.5t and adni 3t. LINEBREAK table 1 lists the basic datasets information, and more detailed statistics are provided in appendix b. LINEBREAK algorithms LINEBREAK medfair incorporates 11 algorithms across 5 categories (related work in appendix a): subgroup rebalancing, domain-independence, adversarial training, disentanglement, and domain generalization. we carefully re-implement the following algorithms based on the original official codes: • baseline LINEBREAK – empirical risk minimization (erm) (vapnik, 1999) minimizes the average error across the LINEBREAK dataset without considering the sensitive attributes. LINEBREAK • subgroup rebalancing LINEBREAK – resampling method upsampled the minority groups so that all of the subgroups appear dur LINEBREAK ing training with equal chances. LINEBREAK • domain-independence LINEBREAK – domain independent n-way classifier (domainind) (wang et al., 2020) trains separate clas LINEBREAK sifiers for different subgroups with a shared encoder. LINEBREAK • adversarial training LINEBREAK – learning adversarially fair and transferable representations (laftr) (madras et al., 2018) de-biases the representation by minimizing the ability to recognize sensitive attributes. – conditional learning of fair representation (cfair) (zhao et al., 2019) tries to enforce the LINEBREAK balanced error rate and conditional alignment of representations during training. LINEBREAK – learning not to learn (lnl) (kim et al., 2019) unlearns the bias information iteratively by LINEBREAK minimizing the mutual information between feature representation and bias. LINEBREAK • disentanglement LINEBREAK – entangle and disentangle (end) (tartaglione et al., 2021) disentangles confounders by in LINEBREAK serting an “information bottleneck”, while still passing the useful information. LINEBREAK – orthogonal disentangled representations (odr) (sarhan et al., 2020) disentangles the useful and sensitive representations by enforcing orthogonality constraints for independence. LINEBREAK • domain generalization (dg) LINEBREAK – group distributionally robust optimization (groupdro) (sagawa et al., 2019) minimizes LINEBREAK the worst-case training loss with increased regularization. LINEBREAK – stochastic weight averaging densely (swad) (cha et al., 2021), a state-of-the-art method in dg, aims to find a robust flat minima by a dense stochastic weight sampling strategy. – sharpness-aware minimization (sam) (foret et al., 2020) seeks parameters that lie in neigh LINEBREAK borhoods having uniformly low loss during optimization. LINEBREAK the hyper-parameter tuning strategy is described in appendix b.2.2. LINEBREAK model selection
| 5
|
[
108.249,
578.6280784,
215.6479619,
588.5906784
] |
UseMOjWENv.pdf
| 2,022
| 1
|
LINEBREAK midi-ddsp: detailed control of musical performance via hierarchical modeling LINEBREAK yusong wu1, ethan manilow2,4, yi deng3, rigel swavely4, kyle kastner1, tim cooijmans1, aaron courville1, cheng-zhi anna huang∗1,4 , jesse engel∗4 ∗ equal contribution 1mila, quebec artificial intelligence institute, universit´e de montr´eal, 2northwestern university, 3new york university, 4google brain [email protected] {emanilow, annahuang, jesseengel}@google.com LINEBREAK abstract LINEBREAK musical expression requires control of both what notes are played, and how they are performed. conventional audio synthesizers provide detailed expressive controls, but at the cost of realism. black-box neural audio synthesis and concatenative samplers can produce realistic audio, but have few mechanisms for control. in this work, we introduce midi-ddsp a hierarchical model of musical instruments that enables both realistic neural audio synthesis and detailed user control. starting from interpretable differentiable digital signal processing (ddsp) synthesis parameters, we infer musical notes and high-level properties of their expressive performance (such as timbre, vibrato, dynamics, and articulation). this creates a 3-level hierarchy (notes, performance, synthesis) that affords individuals the option to intervene at each level, or utilize trained priors (performance given notes, synthesis given performance) for creative assistance. through quantitative experiments and listening tests, we demonstrate that this hierarchy can reconstruct high-fidelity audio, accurately predict performance attributes for a note sequence, independently manipulate the attributes of a given performance, and as a complete system, generate realistic audio from a novel note sequence. by utilizing an interpretable hierarchy, with multiple levels of granularity, midi-ddsp opens the door to assistive tools to empower individuals across a diverse range of musical experience. 1 LINEBREAK introduction LINEBREAK generative models are most useful to creators if they can generate realistic outputs, afford many avenues for control, and easily fit into existing creative workflows (huang et al., 2020). deep generative models are expressive function approximators, capable of generating realistic samples in many domains (ramesh et al., 2021; brown et al., 2020; van den oord et al., 2016), but often at the cost of interactivity, restricting users to rigid black-box input-output pairings without interpretable access to the internals of the network. in contrast, structured models chain several stages of interpretable intermediate representations with expressive networks, while still allowing users to interact throughout the hierarchy. for example, these techniques have been especially effective in computer vision and speech, where systems are optimized for both realism and control (lee et al., 2021b; chan et al., 2019; zhang et al., 2019; wang et al., 2018a; morrison et al., 2020; ren et al., 2020). LINEBREAK for music generation, despite recent progress, current tools still fall short of this ideal (figure 1, right). deep networks can either generate realistic full-band audio (dhariwal et al., 2020) or provide detailed controls of attributes such as pitch, dynamics, and timbre (d´efossez et al., 2018; engel et al., LINEBREAK 1online resources: LINEBREAK code: https://github.com/magenta/midi-ddsp audio examples: https://midi-ddsp.github.io/ colab demo: https://colab.research.google.com/github/magenta/midi-ddsp/blob/ main/midi_ddsp/colab/midi_ddsp_demo.ipynb LINEBREAK figure 1: (left) the midi-ddsp architecture. midi-ddsp extracts interpretable features at the performance and synthesis levels, building a modeling hierarchy by learning feature generation at each level. red and blue components indicate encoding and decoding respectively. shaded boxes represent modules with learned parameters. both expression features and notes are extracted directly from synthesis parameters. (right) synthesizers have wide range of control, but struggle to convey realism. neural audio synthesis and concatenative samplers can produce realistic audio, but have limited control. midi-ddsp enables both realistic neural audio synthesis and detailed user control. LINEBREAK 2019; 2020a; hawthorne et al., 2019; wang & yang, 2019) but not both. many existing workflows use the midi specification (association et al., 1996) to conventional dsp synthesizers (chowning, 1973; roads, 1988) provide extensive control but make it difficult to generate realistic instrument timbre, while concatenative samplers (schwarz, 2007) play back high-fidelity recordings of isolated musical notes, but require manually stitching together performances with limited control over expression and continuity. LINEBREAK in this paper, we propose midi-ddsp, a hierarchical generative model of musical performance to provide both realism and control (figure 1, left). similar to conventional synthesizers and samplers that use the midi standard (association et al., 1996), midi-ddsp converts note timing, pitch, and expression information into fine-grained parameter control of ddsp synthesizer modules. LINEBREAK we take inspiration from the hierarchical structure underlying the process of creating music. a composer writes a piece as a series of notes. a performer interprets these notes through a myriad of nuanced, sub-second choices about articulation, dynamics, and expression. these expressive gestures are realized as audio through the short-time pitch and timbre changes of the physical vibration of the instrument. midi-ddsp is built on a similar 3-level hierarchy (notes, performance, synthesis) with interpretable representations at each level. LINEBREAK while the efficient ddsp synthesis representation (low-level) allows for high-fidelity audio synthesis (engel et al., 2020a), users can also control the notes to be played (high-level), and the expression with which they are performed (mid-level). a qualitative example of this is shown in figure 2, where a given performance on violin is manipulated at all three levels (notes, expression, synthesis parameters) to create a new realistic yet personalized performance. LINEBREAK as seen in figure 1 (left), midi-ddsp can be viewed similarly to a multi-level autoencoder. the hierarchy has three separately trainable modules (ddsp inference, synthesis generator, expression generator) and three fixed functions/heuristics (ddsp synthesis, feature extraction, note detection). these modules enable midi-ddsp to conditionally generate at any level of the hierarchy, LINEBREAK figure 2: an example of detailed user control. given an initial generation from the full midi-ddsp model (top), an expert musician can adjust notes (blue), performance attributes (green), and lowlevel synthesis parameters (yellow) to craft a personalized expression of a musical piece (bottom). LINEBREAK providing creative assistance by filling in the details of a performance, synthesizing audio for new note sequences, or even fully automating music generation when paired with a separate note generating model. LINEBREAK it is important to note that the system relies on pitch detection and note detection, so is currently limited to training on recordings of single monophonic instruments. this approach has the potential to be extend to polyphonic recordings via multi-instrument transcription (hawthorne et al., 2021; engel et al., 2020b; bittner et al., 2017) and multi-pitch tracking, which is an exciting avenue to explore for future work. finally, we also show that each stage can be made conditional on instrument identity, training on 13 separate instruments with a single model. LINEBREAK for clarity, we summarize the core contributions of this work: LINEBREAK • we propose midi-ddsp, a 3-level hierarchical generative model of music (notes, performance, synthesis), and train a single model capable of realistic audio synthesis for 13 different instruments. (section 3) LINEBREAK • expression attributes: we introduce heuristics to extract mid-level per-note expression LINEBREAK attributes from low-level synthesis parameters. (figure 4) LINEBREAK • user control: quantitative studies confirm that manipulating the expression attributes creates a corresponding effect in the synthesizer parameters, and we qualitatively demonstrate the detailed control that is available to users manipulating all three levels of the hierarchy. (table 2 and figure 2) LINEBREAK • assistive generation: reconstruction experiments show that midi-ddsp can make assistive predictions at each level of the hierarchy, accurately resynthesizing audio, predicting synthesis parameters from note-wise expression attributes, and auto-regressively predicting note-wise expression attributes from a note sequence. (tables 1a, 1b, 1c) LINEBREAK • realistic note synthesis: an extensive listening study finds that midi-ddsp can synthesize audio from new note sequences (not seen during training) with higher realism than both comparable neural approaches and professional concatenative sampler software. (figure 5) • automatic music generation: we demonstrate that pairing midi-ddsp with a pretrained note generation model enables full-stack automatic music generation. as an example, we use coconet (huang et al., 2017) to generate and synthesize novel 4-part bach chorales for a variety of instruments. (figure 6) LINEBREAK related work LINEBREAK note synthesis. existing neural synthesis models allow either high-level manipulation of note pitch, velocity, and timing (hawthorne et al., 2019; kim et al., 2019; wang & yang, 2019; manzelli et al., LINEBREAK figure 3: separate training procedures for the three modules in midi-ddsp. (left) the ddsp inference module predicts synthesis parameters from audio and is trained via an audio reconstruction loss on the resynthesized audio. (middle) the synthesis generator module predicts synthesis parameters from notes and their expression attributes (shown as a 6-dimensional color map) and is trained via a reconstruction loss and an adversarial loss. (right) the expression generator module autoregressively predicts note expression given a note sequence and is trained with teacher forcing. encoding processes are shown in red, and decoding processes are shown in blue and loss calculations are shown in yellow. thicker arrows indicate the process that is being trained in each level. ground-truth data are shown in solid frames, while model predictions are shown in dashed frames. LINEBREAK 2018), or low-level synthesis parameters (jonason et al., 2020; castellon et al., 2020; blaauw & bonada, 2017). midi-ddsp connects these two approaches by enabling both high-level note controls and low-level synthesis manipulation in a single system. LINEBREAK most related to this work is midi2params (castellon et al., 2020), a hierarchical model that autoregressively predicts frame-wise pitch and loudness contours to drive the original ddsp autoencoder (engel et al., 2020a). midi-ddsp builds on this work by adding an additional level of hierarchy for the note expression, training a new more accurate ddsp base model, and explicitly modeling the synthesizer coefficients output by that model, rather than the pitch and loudness inputs to the model. we extensively compare to our reimplementation of midi2params as a baseline throughout the paper. LINEBREAK hierarchical audio modelling. audio waveforms have dependencies over timescales spanning several orders of magnitude, lending themselves to hierarchical modeling. for example, dieleman et al. (2018) and dhariwal et al. (2020) both choose to encode audio as discrete latent codes at different time resolutions, and apply autoregressive models as priors over those codes. midi-ddsp applies a similar approach in spirit, but constructs a hierarchy based on semantic musical structure (note, performance, synthesis), allowing interpretable manipulation by users. LINEBREAK expressive performance analysis and synthesis. many prior systems pair analysis and synthesis functions to capture expressive performance characteristics (canazza et al., 2004; yang et al., 2016; shih et al., 2017). such methods often use heuristic functions to generate parameters for driving synthesizers or selecting and modifying sample units. midi-ddsp similarly uses feature extraction, but each level is paired with a differentiable neural network function that directly learns the mapping to expression and synthesis controls for more realistic audio synthesis. LINEBREAK model architecture LINEBREAK ddsp synthesis and inference LINEBREAK differentiable digital signal processing (ddsp) (engel et al., 2020a) enables differentiable audio synthesis by using a harmonic plus noise model (serra & smith, 1990). full details are provided in appendix b.1. briefly, an oscillator bank synthesizes a harmonic signal from a fundamental frequency f0(t), a base amplitude a(t), and a distribution over harmonic amplitudes h(t), where the dimensionality of h is the number of harmonics. the noise signal is generated by filtering uniform noise with linearly spaced filter banks, where η(t) represents the magnitude of noise output LINEBREAK figure 4: in midi-ddsp, manipulating note-level expression can effectively change the synthesislevel quantities. we show by taking a test-set sample (middle row) and adjusting each expression control value to lowest (bottom row) and highest (upper row), how each synthesis quantities (rightmost legend) would change. the dashed gray line in each plot indicates the note boundary. LINEBREAK from each filter in time. in this study, we use 60 harmonics and 65 noise filter banks, giving 127 total synthesis parameters each time frame (s(t) = (f0(t), a(t), h(t), η(t))). the final audio is the addition of harmonic and noise signals. LINEBREAK since the synthesis process is differentiable, engel et al. (2020a) demonstrate that it is possible to train a neural network to predict the other synthesis parameters given f0(t) and the loudness of the audio, and optimize a multi-scale spectral loss (wang et al., 2019; engel et al., 2020a) of the resynthesized audio (figure 3 left). f0(t) is extracted by a pre-trained crepe model (kim et al., 2018), and the loudness is extracted via an a-weighting of the power spectrum (hantrakul et al., 2019; mccurdy, 1936). LINEBREAK we extend this work for our ddsp inference module, by providing an additional input features extracted by a cnn (lecun et al., 1998) from log-scale mel-spectrogram of the audio, that produces higher quality resynthesis (table 1a). full architectural details are provided in appendix b.2. LINEBREAK expression controls LINEBREAK we aim to model aspects of expressive performance with a continuous variable. for example, this enables a performer to choose how loud the note should be performed, or how much vibrato to apply. we define a 6-dimensional vector, ei, for each note, ni, where each dimension corresponds to one of the six expression controls (detailed in appendix b.3), scaled within [0, 1]. these are extracted from synthesis parameters s(t) and applied within the ith note, ni, in a note sequence: LINEBREAK volume: controls the volume of a note, extracted by taking average amplitude over a note. LINEBREAK volume fluctuation: determines the magnitude of a volume change across a note. used with the volume peak position described below, this can make a note crescendo or decrescendo. this is extracted by calculating the standard deviation of the amplitude over a note. LINEBREAK volume peak position: controls where, over the duration of a note, the peak volume occurs. zero value corresponds to decrescendo notes, whereas one corresponds to crescendo notes. the volume peak position is extracted by calculating the relative position of maximum amplitude in the note. LINEBREAK vibrato: controls the extent of the vibrato of a note. vibrato is a musical technique defined by pulsating the pitch of a note. vibrato is extracted by applying discrete fourier transform (dft) on the fundamental frequency f0(t) in a note and selecting the peak amplitude. LINEBREAK brightness: controls the timbre of a note where higher values correspond to louder high-frequency harmonics. brightness is determined by calculating the average harmonic centroid of a note. LINEBREAK attack noise: controls how much noise occurs at the start of the note (the attack), e.g., the fluctuation of string and bow. attack noise can determine whether two notes sound consecutively or separately. attack noise is extracted by taking a note’s average noise magnitude in the first ten frames (40ms). LINEBREAK synthesis generator LINEBREAK given the output of the per-note expression controls, ei for i = 1, ..., i notes, and a corresponding note sequence, ni, the synthesis generator predicts the frame-level synthesis parameters that, in turn, generate audio. note expression controls are unpooled (repeated) over the duration of the corresponding note to make a conditioning sequence, c(t) = [(e1, n1), ..., (ei , ni )], with the same length as the fundamental frequency curve, f0(t). LINEBREAK the synthesis generator, gθ, is an autoregressive recurrent neural net (rnn) is used to predict a fundamental frequency, ˆf0(t) given conditioning sequence, and a convolutional generative adversarial network (gan), gφ, is used to predict the other synthesis parameters given conditioning sequence and generated fundamental frequency: LINEBREAK ˆf0(t) = gθ(c(t)), LINEBREAK ˆa(t), ˆh(t), ˆη(t) = gφ(c(t), ˆf0(t)), LINEBREAK where θ denotes trainable parameters in the autoregressive rnn, and φ indicates trainable parameters in the gan. architectural details for both of these details is provided in appendix b.4. the autoregressive rnn is trained using cross-entropy loss lce. the generator of the gan is trained by a multi-scale spectral loss lspec (eq. 13-14) and an adversarial objective consisting of a least-squares gan (lsgan) llsgan (mao et al., 2017) loss and a feature matching loss lf m (appendix b.4, eqs. 15-18) (kumar et al., 2019). thus, the total loss applied to the synthesis generator can be written as: LINEBREAK l = (lce + lspec) + α(llsgan + γlf m) LINEBREAK where α and γ are settable hyperparameters that control the overall gan loss and feature matching loss, respectively. for training, the ground-truth f0(t) is input to the gan, thus there is no gradient from the gan to the autoregressive rnn. LINEBREAK expression generator LINEBREAK the expression generator uses an autoregressive rnn to predict note expression controls from note sequence (appendix b.6). a single-layer bidirectional gru extracts context information from input, and a two-layer autoregressive gru generates note expression. the expression generator is trained by mean square error (mse) loss between ground-truth note expression and teacher-forced prediction (figure 3, right). the note sequence used to train the expression generator can either be extracted or comes from human labels. to show the full potential of midi-ddsp, we use the ground-truth note boundary label from dataset in all experiments for best accuracy. however, in future work note transcription models can be used to provide the note labels. LINEBREAK experiments
| 5
|
[
108.299,
239.6986768,
200.0834953,
251.6538768
] |
b9PoimzZFJ.pdf
| 2,021
| 0
|
LINEBREAK systematic generalisation with group invariant predictions LINEBREAK faruk ahmed1∗, yoshua bengio1,2, harm van seijen3, aaron courville1,2 1 université de montréal, mila, 2cifar fellow, 3microsoft research LINEBREAK abstract LINEBREAK we consider situations where the presence of dominant simpler correlations with the target variable in a training set can cause an sgd-trained neural network to be less reliant on more persistently correlating complex features. when the nonpersistent, simpler correlations correspond to non-semantic background factors, a neural network trained on this data can exhibit dramatic failure upon encountering systematic distributional shift, where the correlating background features are recombined with different objects. we perform an empirical study on three synthetic datasets, showing that group invariance methods across inferred partitionings of the training set can lead to significant improvements at such test-time situations. we also suggest a simple invariance penalty, showing with experiments on our setups that it can perform better than alternatives. we find that even without assuming access to any systematically shifted validation sets, one can still find improvements over an erm-trained reference model. LINEBREAK introduction LINEBREAK if a training set is biased such that an easier-to-learn feature correlates with the target variable throughout the training set, a modern neural network trained with sgd will use that factor to perform predictions, ignoring co-occurring harder-to-learn complex predictive features (shah et al., 2020). without any other criteria, this is arguably desirable behaviour, reflecting occam’s razor. we consider the situation where although such a simpler correlation is a dominant bias in the training set, a minority group exists within the dataset where the bias does not manifest. in such cases, relying on more complex predictive features which more pervasively explain the data can be preferable to simpler ones that only explain most of it. for example, if all chairs are red, redness ought to be a predictive rule for chairhood (without any other criteria for predictions). however, if some chairs are not red, and all chairs have backs and legs, then one can infer that redness is less relevant. LINEBREAK in this paper, we will study object recognition tasks, where the objects correlate strongly with simpler non-semantic background information for a majority of the images, but not for a minority group. there is evidence in the literature that modern cnns tend to fixate on simpler features such as texture (geirhos et al., 2019; brendel & bethge, 2019), canonical pose (alcorn et al., 2019), or contextual background cues (beery et al., 2018). we are assuming that semantic features in a classification context (ones that humans would agree contribute to their labelling of objects) are more likely to persistently correlate with the target variable, while simpler non-semantic background biases are more likely to exhibit non-persistent correlations in real-life data collection processes. based on this assumption, we will use combinations of objects and backgrounds to compare test-time performances corresponding to particular distributional shifts. LINEBREAK consider coloured mnist digits such that there is a dominant, but not universal, correlation between colour and digit identity for a majority of the images. in the situation we are considering, if the biasing colours in the majority group are not recombined with different digits in the minority group, then there is no signal for the model to disregard these biasing factors, which are retained as important predictive rules. this can lead to poor performance at systematic generalisation (lake & baroni, 2018), where an object occurs with another object’s biasing factor, and at semantic anomaly detection (ahmed & courville, 2020), where a novel object appears with one of the biasing factors. in our example LINEBREAK ∗correspondence to [email protected]. LINEBREAK table 1: for a coloured mnist dataset with every digit correlated with a colour 80% of the time, we see poor performance at systematically varying tasks. performance improves if the minority group combines colours from other biased digits - this provides corrective gradients that promote invariance to colour. non-systematic shifts are when unseen colours are used, and anomaly detection is measured by decreased predictive confidence for an unseen digit (see section 2 for more details). LINEBREAK minority colours LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK different recombinations LINEBREAK with coloured mnist, if we colour the minority group digits with the colours used to bias (different) digits in the majority group, we find a marked improvement at systematically shifted tests over the case when the colours in the minority group are different colours altogether (see table 1). LINEBREAK we investigate the role of encouraging robust predictive behaviour across such groups in terms of improved performance at tasks with such distributional shifts. our experiments suggest that training with cross-group invariance penalties can result in models that have learned to be more reliant on persistent complex correlations without being overwhelmed by simpler, yet less stable features, as indicated by improved performance at systematic generalisation and semantic anomaly detection on our synthetic setups. LINEBREAK we find that a recently proposed method (creager et al., 2020) can be effective at inferring the majority and minority groups along a learned feature-bias, and we use this inferred partition to provide us with groups in the training set in our comparative study. we also suggest a new method for encouraging predictions that rely on persistent correlations across such groups, with the intuition that similar predictive behaviour across the groups should be promoted throughout training. with experiments on three synthetic datasets, we compare the performance of recently proposed invariance penalties and methods, and find that our variant can often perform better at tasks involving such test-time distributional shifts. LINEBREAK systematic and non-systematic generalisation LINEBREAK if we assume that data x is generated via a composition c of semantic factors hs and non-semantic factors hn, we can use this decomposition, x = c(hs, hn), to generate test datasets to capture different scenarios. while hn is actually independent of y, we shall have the independence property pd(hn|y) = pd(hn) to not hold when there is bias in the dataset d due to hn–y correlations. LINEBREAK we can evaluate, for a particular target y and our system’s prediction of the target ˆy(x), the average accuracy e(cid:2)1{ˆy(c(hs, hn)) = y}(cid:3), as a measure of generalisation for the following different cases. LINEBREAK (a) tr LINEBREAK (b) tg LINEBREAK (c) ts LINEBREAK (d) tn LINEBREAK (e) ta LINEBREAK figure 1: coloured mnist training and test sets for evaluating generalisation under non-semantic marginal shift and systematic shift, and anomaly detection. (a) training set; (b) in-distribution generalisation set tg, where the test set is coloured following the same scheme as for tr; (c) systematic-shift generalisation set ts, where we colour the test set with the biasing colours, but such that no digit is coloured with its own biasing colour; (d) non-systematic-shift generalisation set tn, where the test is coloured with random colours that are different from any of the colours seen in the training set; and (e) semantic anomaly detection set ta, where we colour the held-out digits of the test set randomly with the biasing colours. LINEBREAK in-distribution generalisation hs ∼ p(hs|y) and hn ∼ p(hn|y): the validation and test sets are assumed to possess the same biases as the training set, in that the class-conditional distribution of non-semantic features in the test set match that of the training set, p(hn|y). generalisation under non-systematic-shift hs ∼ p(hs|y) and hn (cid:54)∼ p(hn)1: this estimates a form of generalisation under distributional shift, where the non-semantic factors are sampled from outside the marginal distribution of hn as present in the training set. generalisation under systematic-shift hs ∼ p(hs|y) and hn ∼ p(hn|y(cid:48)) where y(cid:48) ∼ p(y) s.t. y(cid:48) (cid:54)= y: this estimates another form of generalisation under distributional shift but one where non-semantic factors are sampled with intent to confuse: non-semantic factors for x are sampled from the marginal distribution of a randomly picked different target, y(cid:48) (cid:54)= y. although systematicity, as discussed in fodor & pylyshyn (1988), and systematic generalisation, as discussed in the nlp literature (lake & baroni, 2018; bahdanau et al., 2019) consider recombinations of intra-semantic factors as well, here, in the context of background-agnostic object recognition tasks, we only consider hs − hn recombinations. LINEBREAK semantic anomaly detection hs (cid:54)∼ p(hs) and hn ∼ p(hn): such a datapoint should not be confidently categorised as a known y, even if non-semantic features are shared (ahmed & courville, 2020). we can use these x to evaluate anomaly detection, as indicated by decreased predictive confidence, and measured by the area under the precision-recall curve (hendrycks & gimpel, 2017). LINEBREAK coloured mnist: consider an illustrative dataset with coloured mnist digits. for the training set, tr, mnist digits are coloured with a set of digit-correlated “biasing” colours 80% of the time, and with ten random colours that are different from the biasing colours the remaining 20% of the time. one digit is held out, for testing semantic anomaly detection. see figure 1 for examples of the four test sets corresponding to this setting, and also appendix a for more details on the construction. LINEBREAK improving performance for such scenarios involving distributional shift might come at a cost for indistribution performance, since more robust features might be harder to learn than simpler dominant correlations that hold in-distribution. in real-world deployments where one is likely to encounter unexpected situations, such as in a self-driving car, it can often be preferable to find appropriate trade-offs such that classifiers can indicate reduced confidence upon encountering anomalous objects, or continue to operate in changing environments, while continuing to achieve a desirable degree of in-distribution predictive performance. LINEBREAK predictive group invariance across inferred splits LINEBREAK in general, we do not expect to have direct knowledge of majority and minority groups corresponding to the biasing non-semantic features in a dataset. we will later show how one might infer such groups from the data, but we first describe an invariance penalty assuming we have access to the groups. LINEBREAK learning features that are group invariant would require us to match the (class-conditioned) distribution of features from the majority and minority groups (ganin et al., 2016; li et al., 2018a). in terms of predictive performance, we can alternatively ask for the class-conditioned distributions of features to match in the sense that they lead to the same softmax distributions on average as training progresses, without modifying the last linear layer. this implementation has the advantage of doing away with an adversarial network, and the issues that tend to accompany the training of such models. we shall refer to this objective as predictive group invariance (pgi). intuitively, encouraging matched predictive distributions across the groups with a fixed last layer pushes for over-emphasis on minority-group features in the representation, thus acting as an implicit re-weighting of features in both groups (leading to demoting the relevance of colour in the mnist case, for example). when a persistent feature does exist in both groups, using that feature can lead to equal training rates in regularised networks, satisfying the penalty. LINEBREAK consider a classifier that extracts a feature vector fθ(x), where θ are the parameters of a convolutional neural network for example, with a linear layer w on top. the predictive distribution is then LINEBREAK pw(y|x) = σ(w(cid:62)fθ(x)), LINEBREAK where σ is a softmax, and predictions are made by performing an argmax. LINEBREAK 1in this paper, we imply sampling from outside the support of p when we say h (cid:54)∼ p(h). LINEBREAK given a partition scheme for splitting the images x in our dataset d such that every i-th image x(i) is associated with a partition-label α(i), we define distributions pc, qc for the subsets in class c: LINEBREAK x(i) ∼ pc if α(i) = 0, y(i) = c, x(j) ∼ qc if α(j) = 1, y(j) = c. LINEBREAK we want to minimize empirical risk under the constraint that our feature extractor causes similar predictive distributions on average for pictures of the same object in both partitions. formally, we want to optimise LINEBREAK (cid:96)(θ, w|d), LINEBREAK min θ,w (cid:16) LINEBREAK s.t. θ ∈ argmin LINEBREAK d LINEBREAK e x∼pc LINEBREAK [pw(y|x)], e x∼qc LINEBREAK [pw(y|x)] LINEBREAK , ∀ c, LINEBREAK where (cid:96) is the standard loss function for erm training, for example, the categorical cross-entropy. a softened objective for stochastic optimisation can be approximated as LINEBREAK l(w, θ|d, α) = (cid:96)(θ, w|d) + λ LINEBREAK d LINEBREAK c LINEBREAK e x∼pc LINEBREAK [p ˜w(y|x)], e x∼qc LINEBREAK [p ˜w(y|x)] LINEBREAK ˜w=w (fixed) LINEBREAK since we are comparing distributions, we make the simplest natural choice of d to be the kldivergence, LINEBREAK d LINEBREAK e x∼pc LINEBREAK [p ˜w(y|x)], e x∼qc LINEBREAK [p ˜w(y|x)] LINEBREAK (cid:88) e x∼qc LINEBREAK [p ˜w(y|x)] log LINEBREAK ex∼qc[p ˜w(y|x)] ex∼pc[p ˜w(y|x)] LINEBREAK we use this particular ordering of q(cid:107)p because with our grouping, p consists of examples that are “easy” due to a particular bias, and so the mean predictive distribution for p tends to be correct and low-entropy, while that for q is more high-entropy and inaccurate. we take advantage of the zero-forcing property of this kl divergence, encouraging the mean predictive distribution for q to closely match that of p. it is likely that different choices for d would be better suited for different settings. LINEBREAK partitioning the dataset recently, creager et al. (2020) have considered the question of finding worst-case partitions for invariant learning given a collection of data. the key intuition is that an invariant learning objective, as formulated by irm (arjovsky et al., 2019), is maximally violated by splitting along a spurious correlation when predictions rely exclusively on it in a reference model (see theorem 1 in creager et al. (2020) for details). in our case, this would consist of partitioning into the majority and minority groups given our erm-trained model early on in training as reference. LINEBREAK a soft-partition predicting network is used, g(x, y), conditioned on the input and the target, to maximise the irmv1 penalty (arjovsky et al., 2019), which gives us soft partition-predictions, ˆβ, for the examples, LINEBREAK ˆβ = max LINEBREAK β(i)(e)(cid:96)(σ(φ(x(i))), y(i)) LINEBREAK i LINEBREAK i LINEBREAK where φ(xi) = w(cid:62)fθ(x) are the logits from the reference model, e ∈ {0, 1} indexes the partition, β(i)(e) ∈ [0, 1] signifies the predicted probability for the i-th example being in partition e, such that β(i)(e = 0) + β(i)(e = 1) = 1, and γ is a hyper-parameter. we can then compute the partition α(i) = argmaxe β(i)(e). in our implementation, we condition the partition predicting network g on the features fθ(x) instead of the input x, and use separate networks for each category, i.e. β(i) = gy(i)(fθ(x(i))). we find this to perform better in preliminary experiments, improving training and enabling more light-weight g networks. this also ensures that the same features as the ones used by our erm-trained reference model are used to predict partitions, resulting in partitions corresponding to more consistent learned-feature biases. we provide more details in appendix b.3. LINEBREAK figure 2: (left) coco-on-colours; left block is the majority group, right block is the “unbiased” minority group; (right) coco-on-places. LINEBREAK related work LINEBREAK the dominant perspective towards the issue of unreliable behaviour in novel domains has consisted of treating the problem as that of domain generalisation (blanchard et al., 2011). one hopes to recover stable features by encouraging invariance across data sampled from different domains, so that performance at test-time out-of-distribution (ood) scenarios is less likely to be unstable. LINEBREAK approaches along such lines typically resemble a cross-domain distribution-matching penalty applied to the features being learned, augmenting the usual erm term (ganin et al., 2016; sun & saenko, 2016; heinze-deml & meinshausen, 2017; li et al., 2018; li et al., 2018a;b), and evaluated on datasets that consist of data in different modalities (li et al., 2017; peng et al., 2019; venkateswara et al., 2017), or collected through different means (fang et al., 2013), or in different contexts (beery et al., 2018). LINEBREAK works with the perspective of distributionally robust optimisation (dro) have generally considered using uncertainty sets around training data (ben-tal et al., 2013; duchi & namkoong, 2018) to minimise worst-case losses, which can often have a regularising effect by effectively up-weighting harder examples. more relevant to our discussion, group dro methods have considered uncertainty sets in terms of different groups of data, for example with different cross-group distributions of labels (hu et al., 2018), or groups collected differently (oren et al., 2019), similarly to domain generalisation datasets. LINEBREAK more recently, methods promoting the learning of stable features across data from different environments, or sources, have been proposed by using gradient penalties (arjovsky et al., 2019), risk-based extrapolation (krueger et al., 2020), and masking gradients with opposing signs (parascandolo et al., 2020). LINEBREAK the typical datasets in such existing works are not curated with testing performance under systematic distributional shift in mind, most often not characterising the specific shift in distribution. in recent times, a commonly adopted synthetic dataset is the coloured mnist variant used in arjovsky et al. (2019) – since this particular dataset uses flipped colours for the minority group, which is less of a problem with erm-training, the true digit labels were flipped at a sufficiently high frequency to incapacitate erm performance by forcing reliance on colour. we believe setups such as ours can be better synthetic testbeds for developing ideas, where it is not necessary to alter ground truth labels to expose a failure mode. in general, using better models of dataset bias implies a narrower disconnect with realistic settings, with higher chances of the conclusions carrying over. LINEBREAK experiments LINEBREAK we compare performance with our four test sets - in-distribution, non-systematically shifted, systematically shifted, semantic anomalies - for a range of recently proposed methods for a set of three synthesised datasets. appendix b describes architectural details and training choices. LINEBREAK methods LINEBREAK we compare recent methods aimed at robust predictions across groups, and which do not require changes to network capacity or additional adversaries to impose invariance penalties. we also do not include methods based on advances in self-supervised feature learning, such as carlucci et al. LINEBREAK (2019), since such methods are developed with prior knowledge of the desired invariances, and are thus limited in their generality. LINEBREAK baseline: this is our reference model, trained via ordinary (regularised) empirical risk minimisation (erm) without any invariance penalties added. the choices for architecture and regularisers were made to conform to the way modern networks are typically trained with in-distribution performance in mind (details in appendix b). LINEBREAK irmv1, rex, groupdro: irmv1 (arjovsky et al., 2019) and rex (krueger et al., 2020) are two methods that augment the standard erm term with invariance penalties across data from different sources. groupdro (sagawa et al., 2020) is an algorithm for distributional robustness, which works by weighting groups of data as a function of their relative losses. see appendix c for more details about these methods. LINEBREAK cirmv1, crex, cgroupdro: we implement label-conditional variants of the above algorithms, which, to our knowledge, has not been explored. in the context of multi-class classification it is reasonable to expect that performances might have multi-modal distributions along different categories earlier in training, which suggests stratification by class might improve performance. LINEBREAK reweight: we weight the losses in the biased group down. this is a heuristic form of re-balancing the dataset, while choosing a hyper-parameter for the weight using the validation set, with the weight serving to downweight the losses for the biased group. in preliminary experiments we found this re-weighting variant (king & zeng, 2001) to significantly outperform oversampling the minority group, as suggested in buda et al. (2018), or weighting the grouped losses using their population ratios, as performed for imbalanced classes in cui et al. (2019). LINEBREAK cmmd: following li et al. (2018), we match the mmd (gretton et al., 2012) of the distribution of features. in preliminary experiments, we find a conditional version (as done with adversarial models in (li et al., 2018a)) to perform significantly better, so we only report cmmd results here. LINEBREAK datasets LINEBREAK evaluating performance in an unambiguous manner for the specific kinds of generalisation that we aim to study necessitates controlled test-beds. in order to model these tasks, we use 3 synthetic datasets of progressively higher complexity, approaching photo-realism. LINEBREAK coloured mnist: this is the simplest setting, where the background information exists as part of the object. LINEBREAK coco-on-colours: we superimpose 10 segmented coco (lin et al., 2014) objects on coloured backgrounds. the training set has 800 images per category, with nine in-distribution categories and one held-out category for anomaly detection. validation and test sets have 100 each images per category. see figure 2 (left). this is the most extreme dataset in our experiments in terms of the contrast in complexity between the non-semantic correlating factor (background colour) vs. stable features (objects). LINEBREAK coco-on-places: here we superimpose the same coco objects on scenes from the places dataset (zhou et al., 2017), with the place-scenes acting as the bias (figure 2, right). see appendix a for more details about how these datasets are constructed. while the backgrounds in this dataset are more complex than colour, they still act as biasing factors, as indicated in the relatively poorer performance at systematic generalisation, and were selected due to visually obvious and distinct colour or texture. LINEBREAK results LINEBREAK in all cases, we have used the partition predictor to infer the two groups. the partition accuracies for the three datasets at the end of one epoch of training the base models are in the table below. we tested a more naïve approach by applying k-means clustering to the losses, but found it to under-perform, possibly because it cannot account for a consistent feature bias learned by our reference model. LINEBREAK coloured mnist coco-on-colours coco-on-places LINEBREAK table 2: generalisation results on coloured mnist. LINEBREAK methods LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK base (erm) LINEBREAK irmv1 rex groupdro reweight LINEBREAK cirmv1 crex cgroupdro cmmd LINEBREAK pgi LINEBREAK table 3: generalisation performance on coco-on-colours. LINEBREAK methods LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK base (erm) LINEBREAK irmv1 rex groupdro reweight LINEBREAK pgi LINEBREAK in tables 2,3,4, we find that significant improvements can be achieved using group invariance methods. all hyper-parameters for the results in this set are picked on a validation set consisting of a subset of colours or backgrounds that are different from both the training and test sets, and an equally sized subset of systematically varying colours or backgrounds from the biased majority group. in all cases, the split is learned after one epoch of training, and the various penalties dropped in at this point with a linearly ramped-in penalty co-efficient. details about hyper-parameter selection are in appendix c. LINEBREAK while conditional variants perform better at systematic generalisation for coloured mnist, perhaps owing to our hyper-parameter selection procedure of using a mixed-shift validation set, performance at systematic shift appears to be traded off with non-systematic shift in some cases for the more complex datasets. all aggregates are over 5 trials. LINEBREAK practical considerations for hyper-parameter selection LINEBREAK while we find that with the use of group invariance penalties it is possible to encourage reliance upon complex persistent correlations in the presence of dominant simple biases, this can sometimes come at a cost to in-distribution performance when picking hyper-parameters using validation sets with specific distributional shift. one might reasonably expect that this can be mis-aligned with real-life situations: in practice, one typically does not have access to data corresponding exactly to unexpected scenarios, besides not expecting to encounter situations outside the training distribution nearly as often as situations for which a model has been trained and deployed. a practitioner might wish to aim for a clearer trade-off with such situations, with prior knowledge of how often they might arise compared to in-distribution situations, and with a surrogate validation set to model distributional shift. here, we will simply show that picking hyper-parameters without assuming access to validation sets consisting of systematic distributional shift can still provide improvements over the baseline reference model. we consider three cases. LINEBREAK table 4: generalisation performance on coco-on-places. LINEBREAK methods LINEBREAK base (erm) LINEBREAK irmv1 rex groupdro reweight LINEBREAK cirmv1 crex cgroupdro cmmd LINEBREAK pgi LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK cmmd (oracle split) pgi (oracle split) LINEBREAK table 5: hyper-parameters with different validation sets for coloured mnist LINEBREAK validation LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK ns+s (pgi) ns (pgi) ns+id (pgi) id only (pgi) LINEBREAK base (erm) LINEBREAK ns: hyper-parameters are picked using only the validation set for non-systematic distributional shift (which consists of backgrounds that are different from those in the training set and test sets). this models the situation where we have access to some data that is different from our training data, and is also considered somewhat representative of any shifts we might encounter. LINEBREAK ns + id: hyper-parameters are picked using an (equally-weighted) average of the ns and the in-distribution validation sets. if we have prior knowledge of the likelihood of encountering data from out-distributions in the wild, we could use this prior to use an appropriately sampled validation set for hyper-parameter optimisation. LINEBREAK id only: hyper-parameters are picked using only the in-distribution validation set. LINEBREAK we show results for the different schemes for our method in tables 5, 6, 7. while the accuracies under distributional shift are, as expected, less strong than in the previous set of results (ns+s in the tables), we still find improvements over the reference model, indicating that one can still achieve an improved classifier. LINEBREAK in appendix d, we show similar results with all methods, and include only the best performing method for both generalisation under systematic and non-systematic shift corresponding to the different validation strategies in the tables in this section. LINEBREAK table 6: hyper-parameters with different validation sets for coco-on-colours LINEBREAK validation LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK ns+s (pgi) ns (pgi) ns+id (pgi) id only (cmmd) LINEBREAK base (erm) LINEBREAK table 7: hyper-parameters with different validation sets for coco-on-places LINEBREAK validation LINEBREAK in-distribution non-systematic shift LINEBREAK systematic shift anomaly detection LINEBREAK ns+s (cmmd) ns (cmmd) ns+id (cmmd) id only (pgi) LINEBREAK base (erm)
| 8
|
[
124.62,
616.9072576,
169.6940928,
625.8736576
] |
5cFfz6yMVPU.pdf
| 2,023
| 1
|
LINEBREAK -gnn: incorporating ring priors LINEBREAK o into molecular modeling∗ LINEBREAK 1jinhua zhu, 1kehan wu, 1bohan wang, 2yingce xia, 3shufang xie, 2qi meng, 2lijun wu, 2tao qin, 1wengang zhou, 1houqiang li, 2tie-yan liu 1university of science and technology of china, 2microsoft research ai4science 3gaoling school of artificial intelligence, renmin university of china 1 LINEBREAK @mail.ustc.edu.cn, [email protected], LINEBREAK teslazhu, wu 2018 } { zhwg,lihq { yingce.xia, meq, lijuwu, taoqin, tyliu { LINEBREAK @ustc.edu.cn, [email protected], } LINEBREAK @microsoft.com } LINEBREAK abstract LINEBREAK o LINEBREAK cyclic compounds that contain at least one ring play an important role in drug design. despite the recent success of molecular modeling with graph neural networks (gnns), few models explicitly take rings in compounds into consideration, consequently limiting the expressiveness of the models. in this work, we design a -gnn), that explicitly models rings new variant of gnn, ring-enhanced gnn ( -gnn, each ring is represented in addition to atoms and bonds in compounds. in by a latent vector, which contributes to and is iteratively updated by atom and bond representations. theoretical analysis shows that -gnn is able to distinguish two isomorphic subgraphs lying on different rings using only one layer while conventional graph convolutional neural networks require multiple layers to distinguish, -gnn demonstrating that shows good performance on 11 public datasets. in particular, it achieves state-ofthe-art validation result on the pcqm4mv1 benchmark (outperforming the previous kddcup champion solution) and the drug-drug interaction prediction task on -gnn outperforms strong baselines (without modeldrugbank. furthermore, ing rings) on the molecular property prediction and retrosynthesis prediction tasks. the code is released at https://github.com/o-gnn/o-gnn. LINEBREAK -gnn is more expressive. through experiments, LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK introduction LINEBREAK cyclic compounds, which refers to the molecules that have at least one ring in its system, naturally exist in the chemical space. according to our statistics on 109m compounds from pubchem (kim et al., 2019) which is a widely used chemical library, more than 90% compounds have at least one ring. the rings could be small/simple (e.g., the benzene is a six-member carbon ring, and the pentazole is a five-member nitrogen ring) or large/complex (e.g., the molecule shown in figure 1). rings are important in drug discovery, for example: (1) rings can potentially reduce the flexibility of molecules, reduce the uncertainty when interacting with target proteins, and lock the molecules to their bioactive conformation (sun et al., 2012). (2) macrocyclic compounds, which usually have a ring with more than 12 atoms, play important roles in antibotics design (venugopal & johnson, 2011) and peptide drug design (bhardwaj et al., 2022). LINEBREAK recently, deep neural networks, especially graph neural networks (denoted as gnn) (kipf & welling, 2017; hamilton et al., 2017a), have been widely used in molecular modeling. a gnn takes a graph as input, and messages of different nodes are passed along edges. gnns have made great success in scientific discovery: (1) stokes et al. (2020) train a gnn to predict growth inhibition of escherichia coli and find that halicin is a broad-spectrum bactericidal antibiotic. (2) shan et al. (2022) leverage gnn to model the interactions between proteins, and they eventually obtain possible antibodies for sars-cov-2. in addition, gnns are widely used in drug property prediction (rong et al., 2020), drug-target interaction modeling (torng & altman, 2019), retrosynthesis LINEBREAK ∗this work was done when jinhua zhu, kekan wu and bohan wang were interns at microsoft research LINEBREAK ai4science. correspondence to: yingce xia. LINEBREAK (chen & jung, 2021), etc. however, none of the above work explicitly models the ring information into gnns. from the application’s perspective, they miss an important feature for their tasks. from the machine learning’s perspective, loukas (2020) points out that existing message-passing-based gnns cannot properly capture the ring information when the product of network width and height is not large enough (see the table 1 in loukas (2020)). therefore, with the classic gnns, the ring information in compounds is not well leveraged. LINEBREAK o LINEBREAK o LINEBREAK to tackle this issue, in this work, we propose a new model, ring-enhanced gnn (denoted as -gnn), that explicitly models the ring information in a compound. stands for the rings in molecules and is pronounced the as “o”. generally speaking, -gnn stacks l layers, and each layer sequentially updates edge representations, node representations and ring representations by aggregating their neighbourhood information. we mainly use a self-attention layer for adaptive message passing, and use a feed-forward layer to introduce non-linearity to representations. LINEBREAK o LINEBREAK o LINEBREAK -gnn through we first demonstrate the advantage of o theoretical analysis. -gnn is able to distinguish two isomorphic sub-graphs lying on different rings using only one layer (see figure 2 for the example). on the contrary, if we remove the ring-modeling components from -gnn, such a distinguishability would require multio ple layers (see section 2.3 for detailed analysis). these results demonstrate that -gnn is more expressive than conventional graph convolutional networks in the absence of explicitly modeling rings. LINEBREAK figure 1: paclitaxel, a compound with 7 simple rings. kampan et al. (2015) summarized that the intact taxane ring (i.e., r4, r5, r6) and a four-membered oxetane side ring (i.e., r7) is essential to induce cytotoxic activity. LINEBREAK o LINEBREAK we then conduct experiments on 11 datasets from three tasks, including molecular property prediction, drug-drug interaction prediction and retrosynthesis: LINEBREAK (1) for molecular property prediction, we first conduct experiments on pcqm4mv1, which is to predict the homo-lumo gap of molecules. our method outperforms the champion solution of kddcup on the validation set (shi et al., 2022) (note that test set labels are not -gnn on six datasets from available). next, we verify o moleculenet (wu et al., 2018), which is to predict several pharmaceutical related properties of molecules. -gnn outperforms the corresponding gnn baselines without rings. finally, we conduct experiments on fs-mol (stanley et al., 2021), a few-shot property prediction task, and shows that modeling rings can also improve the prediction accuracy. (2) for drug-drug interaction prediction, which is to predict whether two drugs interacts with each -gnn on drugbank following the previous settings (nyamabo et al., 2021; li et al., other, we test 2022), and achieve state-of-the-art results. (3) for retrosynthesis, we apply -gnn to localretro (chen & jung, 2021), a strong gnn-based method for retrosynthesis. on uspto-50k, our method significantly boosts the accuracy. LINEBREAK figure 2: an illustrative example of theoretical results. the three substructures in the red circles are isomorphic. the second and third substructures lie on different rings (a cyclooctane and an azocane). a regular gnn requires multiple layers to distinguish the three -gnn requires substructures while only one layer due to the ring representations. LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK 2 method LINEBREAK notation and preliminaries LINEBREAK let g = (v, e) denote a molecular graph, where v and e are the collections of nodes/atoms and edges/bonds1. let r denote the collection of rings in g. define v = and LINEBREAK , v|v |} LINEBREAK 1when the context is clear, we use nodes/atoms and edges/bonds alternatively in this work. LINEBREAK n LINEBREAK eij LINEBREAK (i) = LINEBREAK vj { LINEBREAK , where vi is the i-th atom and eij is the bond connecting vi and vj. when the context is e = eij } { (i) denote the neighbors clear, we use i to denote atom vi, and use e(vi, vj) to denote edge eij. let n of atom i, i.e., , where each ri is a simple , r|r|} e ring. a simple ring does not contain any ring structure. for example, for the molecule in figure 3, it has two simple rings as we marked (r1 and r2). the ring (1, 2, 3, 4, 5, 6, 7, 8, 9, 1) is not a simple ring. let r(vi) and r(eij) denote the rings that the atom vi or the bond eij lies on, and v (r) and e(r) denote all the atoms and the bonds lying on ring r. for example, in figure 3, r(v4) = while r(v3) = r2. r(e49) = e(r1) = LINEBREAK while r(e78) = r1. v (r1) = LINEBREAK . define r = } LINEBREAK } and LINEBREAK a graph neural network (gnn) is usually stacked by several identical gnn layers. each gnn layer is composed of an aggregate function and an update function, LINEBREAK where hi is the representation of atom i and h′ different aggregate functions and update functions. details are summarized in appendix d. LINEBREAK (1) i is its updated representation. different gnns have LINEBREAK (i))) , LINEBREAK ∈ n LINEBREAK j LINEBREAK h′ i = update (hi, aggregate(hj LINEBREAK figure 3: the workflow of our method. h (l) tions of bond, atom, ring and the global compound at the l-th layer. LINEBREAK v , h (l) LINEBREAK e , h (l) LINEBREAK r and u (l) denote the representation collec LINEBREAK model LINEBREAK i LINEBREAK , h(l) LINEBREAK ij and h(l) LINEBREAK our model consists of l identical layers with different parameters. the architecture of each layer is shown in figure 3. let h(l) r denote the output representations of atom vi, bond eij and i ring r at the l-th layer, respectively. let u (l) denote the compound representation at the l-th layer. we initialize h(0) via a learnable embedding layer which indicates its atomic type, chirality, degree number, formal charge, hybridization type, and so on. similarly, we initialize h(0) ij with a learnable embedding wich indicates its bond type, stereoisomerism type and whether the bond is conjugated. then we initialize h(0) by concatenating the node and edge embedding and then transform it with r a non-linear layer. last, we initialize the compound representation with a learnable embedding. in each layer, we update representations of nodes, bonds, rings and the compound sequentially. we will frequently use mlp( ), a multi-layer perception network with one hidden layer, to build our model. the inputs of mlp are concatenated as a long vector and processed by the network. LINEBREAK (1) update bond representations: the representation of a bond is updated via the connected atoms, the rings that the bond belongs to and the compound representation from the last layer: LINEBREAK ij = h(l−1) h(l) LINEBREAK ij LINEBREAK + mlp LINEBREAK i LINEBREAK , h(l−1) j LINEBREAK , h(l−1) ij LINEBREAK r∈r(eij ) h(l−1) |r(eij)| LINEBREAK r LINEBREAK (2) update atom representations: we use an attention model to adaptively aggregate bond representations into the centralized atoms. mathematically, LINEBREAK ¯h(l) i = LINEBREAK j∈n (i) LINEBREAK αjwvconcat(h(l) LINEBREAK ij , h(l−1) LINEBREAK j LINEBREAK αj ∝ exp(a⊤leakyrelu(wqh(l−1) LINEBREAK i LINEBREAK i = h(l−1) h(l) LINEBREAK i LINEBREAK + mlp LINEBREAK , ¯h(l) i LINEBREAK + wkconcat(h(l−1) 1 |r(vi)| LINEBREAK h(l−1) r LINEBREAK j LINEBREAK ij ))); LINEBREAK r∈r(vi) LINEBREAK in eqn.(3), the w ’s are the parameters to be learned, and concat denotes concatenating the input vectors as a long one. LINEBREAK (3) update ring representations: the ring representations are updated using mlp networks: LINEBREAK r = h(l−1) h(l) LINEBREAK r LINEBREAK +mlp LINEBREAK h(l−1) r LINEBREAK h(l) i LINEBREAK ij , u (l−1)(cid:17) h(l) LINEBREAK vi∈v (r) LINEBREAK eij ∈e(r) LINEBREAK (4) update the compound representation: LINEBREAK u (l) = u (l−1) + mlp LINEBREAK h(l) i LINEBREAK i,j LINEBREAK h(l) ij , LINEBREAK r∈r LINEBREAK r , u (l−1) h(l) LINEBREAK after stacking l i.e., hg = 1 |v | tion tasks, we can add a classification head to h(l) LINEBREAK o (cid:80)|v | i=1 h(l) LINEBREAK i LINEBREAK -gnn layers, we get the graph representation by a simple average pooling layer, , which could be utilized by graph classification tasks. for node classifica LINEBREAK i LINEBREAK theoretical analysis LINEBREAK o LINEBREAK in this section, we compare the distinguishability between standard gnn (without ring representations) and -gnn. in addition to the notations defined in section 2.1, we define the valued version of a graph g = (v, e) as a triplet valuef (g) = (v, e, f ), where f is a mapping storing feature information and mapping a node or an edge to its corresponding input feature (e.g., a 256-dimension representation). we call f as a feature mapping on g. definition 1 (k-neighbourhood node). for a molecular graph g = (v, e) and two nodes u, v v , we say u is a k-neighbourhood of v if there exists a path in g connecting u and v with length no larger than k. more formally, u is a k-neighbourhood of v if and only if there exists a set of nodes , 1 } vi+1 LINEBREAK k, v0 = v, vt = u, and for any i LINEBREAK v , such that, t LINEBREAK , vt LINEBREAK , t LINEBREAK v0, v1, { n (vi). ∈ LINEBREAK 0) of itself. LINEBREAK we highlight here that v is a 0-neighbourhood node (and thus a k-neighbourhood node with any k definition 2 (k-neighbourhood sub-graph). for a molecular graph g = (v, e) and a node v in g, we define the k-neighbourhood sub-graph of v as the sub-graph composed of all v’s k-neighbourhood node. more formally, we slightly abuse the notations and denote the kneighbourhood sub-graph of v as g(v, k) ≜ (v (v, k), e(v, k)), where LINEBREAK v (v, k) ≜ LINEBREAK u e(v, k) ≜ LINEBREAK v : u is a k-neighbourhood node of v LINEBREAK v (v, k) LINEBREAK ∈ definition 3 (equivalent valued graph). for two valued graphs valuef1 (g1) = (v1, e1, f1) and valuef2(g2) = (v2, e2, f2), we say that they are equivalent if (i). g1 and g2 are isomorphic, i.e., there exists a one-to-one mapping also preserves the value of edges and the the value of nodes, i.e., LINEBREAK v2, such that the edges are preserved; (ii). g1, LINEBREAK u, v LINEBREAK p LINEBREAK p LINEBREAK p LINEBREAK e(u, v) LINEBREAK ⇔ p LINEBREAK ∀ (v)) e( (v)), f1(e(u, v)) = f2(e( LINEBREAK (u), LINEBREAK p LINEBREAK p LINEBREAK (u), LINEBREAK p LINEBREAK (v))). LINEBREAK p LINEBREAK with all the preparations above, we are now ready to define the graph feature extractor and its discriminatory ability. definition 4 (graph feature extractor and its discriminatory ability). we say a mapping φ is a graph feature extractor, if it maps a valued graph valuef (g) to a new feature mapping ˜f on g. we further allow φ to be parameterized as φθ, and call φθ a parameterized graph feature extractor. LINEBREAK for a parameterized graph feature extractor φθ, we say φθ has the discriminatory ability for kneighbourhood sub-graphs, if for any valued graphs (g, f ) and any two nodes u, v in g, if the valued k-neighbourhood sub-graph of u and v (i.e., (g(u, k), f ) and (g(v, k), f )) are equivalent, there exists θ⋆ such that φθ⋆ ((g, f ))(u) = φθ⋆ ((g, f ))(v). in this case, we also say that φθ⋆ can distinguish u and v. LINEBREAK h(l) we point out that i i } { and thus above provides a formal definition of LINEBREAK h(l) i,j} LINEBREAK i,j defined by eqn. (2, 3, 4, 5) is a parameterized feature extractor, LINEBREAK -gnn’s discriminatory ability. LINEBREAK o LINEBREAK the next proposition shows that without the ring representation, the layer to have the has the discriminatory power for k-neighbourhood sub-graphs. proposition 1. without the ring presentation, discriminatory ability for k-neighbourhood sub-graphs. LINEBREAK o LINEBREAK o LINEBREAK -gnn with no more than k layers does not have the LINEBREAK -gnn needs at least k + 1 LINEBREAK o LINEBREAK note that proposition 1 can be easily extended to the conventional graph convolutional neural networks, which only aggregate information from 1-neighborhood nodes. we then show that with the ring representations, proposition 2. if u and v lie on different rings, LINEBREAK -gnn with only one layer has the discriminatory power. LINEBREAK -gnn with only one layer can distinguish them. LINEBREAK o the proofs are deferred to appendix b due to space limitation. from proposition 1 and 2, we can see that -gnn is more expressive than the regular gnn that does not model rings. the regular gnn requires at least k layers to distinguish two isomorphic k-neighborhood sub-graphs on different rings, while -gnn only requires one layer for this purpose (see the example in figure 2). comparing -gnn to a regular gnn with the same number of layers, modeling ring presentations constantly increases the percentages of parameters (irrelevant to k). however, a regular gnn may require k layers to achieve the discriminatory power for k-neighborhood sub-graphs. when k is -gnn will be much more parameter efficient. more discussions are in appendix c.5. large, LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK experiments LINEBREAK to validate the effectiveness of our method, we test -gnn on the following three tasks: molecular property prediction, drug-drug interaction prediction and retrosynthesis. the first two tasks are graph classification tasks, and the third one is a node/link prediction task. LINEBREAK o LINEBREAK application to molecular property prediction LINEBREAK datasets. we work on three datasets for this application: LINEBREAK (1) the homo-lumo energy gap prediction of the pcqm4mv1 dataset (hu et al., 2021). the input is a 2d molecular graph, and the target is its homo-lumo energy gap, which is an essential molecular property in quantum chemistry. pcqm4mv1 has 3045360 and 380670 training and validation data (test labels are not available). the properties are obtained via density function theory. LINEBREAK (2) molecular property prediction on moleculenet dataset (wu et al., 2018). this is a dataset about the prediction of pharmaceutical properties of small molecules. we choose six molecular property prediction tasks (including bbbp, tox21, clintox, hiv, bace and sider), and the data ranges from 1.5k to 41k. LINEBREAK (3) few-shot molecular property prediction of the fs-mol dataset (stanley et al., 2021). fs-mol is made up of 5120 separate assays extracted from chembl27 (https://www.ebi.ac.uk/ chembl/). each assay has 94 molecular-property pairs on average. LINEBREAK training configuration. for pcqm4mv1, we set the number of layers as 12 and hidden dimension as 256, which is selected by the cross-validation method on the training set. for fs-mol, the number of layers are 6 and the hidden dimension is 256. the candidate number of layers and hidden dimensions for moleculenet are . on fs-mol and moleculetnet, } } the hyper-parameters are selected according to validation performance. we train all these tasks on one gpu. the optimizer is adamw (loshchilov & hutter, 2019). more detailed parameters are summarized in table 5 of appendix a. LINEBREAK and LINEBREAK results on pcqm4mv1 the results of pcqm4mv1 are reported in table 1. we compare o gnn with the following baselines: (1) conventional gcn/gin with/without virtual node (marked by “vn”). the results are from hu et al. (2021); (2) confdss (liu et al., 2021), which predicts quantum properties conditioned on low-cost conformer sets; (3) two-branch transformer (xia et al., 2021), which has a regression head and a classification head that learn from each other; (4) graphormer (ying et al., 2021; shi et al., 2022), the champion solution of pcqm4mv1. since LINEBREAK method LINEBREAK gcn gcn + vn gin gin + vn confdss two-branch transformer graphormerbase graphormerlarge -gnn (ours) LINEBREAK o LINEBREAK table 1: validation mae on pcqm4mv1. LINEBREAK figure 4: mae w.r.t. numbers of layers. LINEBREAK (a) number of rings. LINEBREAK (b) number of atoms lying on rings. LINEBREAK (c) maximum ring size. LINEBREAK figure 5: performance improvement over several ring properties. LINEBREAK o LINEBREAK the owners of pcqm4mv1 did not release labels of the test set, we can only compare the results on the validation set. the evaluation metric is the mean absolute error (mae). from table 1, we -gnn achieves the best results among the strong baseline models, which shows the can see that effectiveness of our method. in addition, gin vn, confdss and graphormer do not explicitly use the ring information, and we will combine LINEBREAK -gnn with the strong methods in the future. LINEBREAK o LINEBREAK o LINEBREAK -gnn and “ LINEBREAK -gnn by removing the to investigate the significance of the ring information, we study a variant of -gnn w/o ring”. specifically, -gnn, and denote this variant as “ ring modeling component from it is implemented by removing eqn.(4) and all the hr’s in eqn.(2,3,5). we conduct experiments for -gnn w/o ring” from 2 to 14 layers. the results are in figure 4. we can see that o o by utilizing ring information, the performance is boosted regardless of the number of layers. in -gnn w/o ring, which addition, we find that a 6-layer o -gnn shows the great power of modeling rings in gnn. we also have that o it is noteworthy to point out that w/o ring” in terms of the number of parameters (see figure 10). validation mae of the 14-layer -gnn. note that this phenomenon is also observed in graphormer (shi et al., 2022) that larger models do not always lead to better validation results. we will explore how to train deeper models in the future. LINEBREAK -gnn slightly drops compared to the 12-layer LINEBREAK -gnn is comparable with the 12-layer LINEBREAK -gnn outperforms “ LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK -gnn w/o rings” and LINEBREAK on pcqm4mv1, we also study the average performance improvement w.r.t. several ring properties. the performance improvement is defined as ϵ1 ϵ2, where ϵ1 and ϵ2 denote the validation mae of “ -gnn. the ring properties include: (i) the number of rings in a molecule; o (ii) the number of atoms lying on rings; (iii) the number of atoms in the largest ring. we conduct experiments for the networks with different numbers of layers (l = 2, 6, 12). results are reported in figure 5. we can conclude that overall, as the increase of number of rings, maximum ring sizes and the number of atoms lying on rings, -gnn achieves more improvement compared to the variant without modeling rings. more analyses are in appendix c.4. LINEBREAK o LINEBREAK o LINEBREAK results on moleculenet for moleculenet, we compare with both pretraining and non-pretraining methods. for non-pretraining methods, we compare with the following baselines: (i) gcn (kipf & welling, 2017) with virtual node ; (ii) gin (xu et al., 2018) with virtual node; (iii) -gnn -gnn w/o ring”). for pre-training methods, we select without using ring information (denoted as “ LINEBREAK o LINEBREAK o LINEBREAK dataset # molecules LINEBREAK (hu et al., 2020) g-contextual (liu et al., 2022) g-motif (liu et al., 2022) graphmvp (liu et al., 2022) LINEBREAK gcn + vn gin + vn o-gnn w/o ring LINEBREAK o-gnn (ours) LINEBREAK table 2: test roc-auc (%) performance of different methods on 6 binary classification tasks from moleculenet benchmark. the training, validation and test sets are provided by deepchem. each experiment is independently run for three times. the mean and standard derivation are reported. LINEBREAK several representative graph-based methods: (i) hu et al. (2020) proposed to predict the masked attributes on graphs as well as maintaining the consistency between a subgraph and its neighbors; (ii) gare variants of (rong et al., 2020), which are provided in liu et al. contextual, motif } { (2022). (iii) graphmvp (liu et al., 2022), which is a joint pre-training between 2d molecules and its 3d conformation. the results of (hu et al., 2020), gand graphmvp are all contextual, motif { extracted from liu et al. (2022), since liu et al. (2022) use the same scaffold-based splitting as us. LINEBREAK the results are reported in table 2. we can see that: (i) -gnn outperforms the conventional network architectures like gin and gcn with virtual nodes, which demonstrate the effectiveness of our new architecture; (ii) when comparing with g, graphmvp (liu et al., contextual, motif } { 2022) and hu et al. (2020) which are all pre-training methods, -gnn still outperforms those methods. (more discussion about pre-training methods are left in table 11 of appendix c.5) this -gnn and we will combine it with pre-training in the future. (iii) shows the great potential of comparing -gnn w/o ring, the average improvement overall the six tasks is 1.6. this shows the advantage of using ring information in molecular property prediction. LINEBREAK -gnn and LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK o LINEBREAK results on fs-mol stanley et al. (2021) verify that prototypical networks (pn) performs the best on fs-mol compared with other methods like maml (finn et al., 2017), multi-task learning (mt) and random forest (rf). stanley et al. (2021) use a transformer-like residual network for few-shot classifi-gnn cation. we replace that backbone to our w/o ring”, and the other parts remain unchanged. following stanley et al. (2021), the results with different support set sizes (denoted as ) are reported. a support set consists | of a few examples with input-label pairs used to train models. the evaluation metric is ∆auprc, which is the difference between the auprc (area under the precision-recall curve) and the ratio of the active compounds in that query set. a higher ∆auprc score indicates better classification performance of the model. LINEBREAK -gnn and “ LINEBREAK u,support LINEBREAK |t LINEBREAK o LINEBREAK o LINEBREAK figure 6: results on fs-mol. LINEBREAK the results are in figure 6. we report the mean and the standard derivations for different tasks across various support sizes. we have the following observations: (i) by using -gnn as the backbone model for the prototypical network, the results are boosted for different support set sizes. (ii) the improvement is more significant when the support set size is large. when = 128 and 256, the improvements are 0.014 and 0.016. when reducing the sizes to 16/32/64, their improvements are all around 0.008. we will further improve the results on limited data size in the future. LINEBREAK u,support LINEBREAK |t LINEBREAK o LINEBREAK application to ddi prediction LINEBREAK drug-drug interaction (ddi) prediction is to predict therapeutic output of taking two drugs together, like increasing the risk of some side effects, or the effect is enhanced to take them together. we LINEBREAK focus on the classification task, where the inputs are two drug molecules and one interaction (e.g., inhibition), and the output is 0 or 1 to indicate whether the two drugs have this specific interaction. following nyamabo et al. (2022) and li et al. (2022), we work on the inductive setting of the drugbank dataset (wishart et al., 2018), which has 1, 706 drugs, 86 interaction types, and 191, 808 triplets. to test the generalization ability of the model, we conduct experiments on two settings w.r.t. the drugs: the s1 setting, where neither of the two drugs on the test set appears in the training set; the s2 setting, where one drug is seen in the training set and the other is not. noting that the drug pairs in the test set do not appear in the training set. hence, the drugbank data is split into training and test sets by the visibility of the drugs, and the negative samples are offline generated. we directly use the data provided by nyamabo et al. (2021; 2022), where 20% drugs are first hold as unseen drugs for formulating test set and the rest 80% drugs are used to create the training set. LINEBREAK method LINEBREAK s2 setting (1 known drug + 1 unknown drug) acc auroc LINEBREAK ap LINEBREAK gat-ddi (nyamabo et al., 2021) mhcaddi (deac et al., 2019) mr-gnn (xu et al., 2019) ssi-ddi (nyamabo et al., 2021) gmpnn (nyamabo et al., 2022) msan-gcn (zhu et al., 2022) msn-ddi (li et al., 2022) o-gnn w/o ring LINEBREAK o-gnn (ours) LINEBREAK s1 setting (2 unknown drugs) LINEBREAK acc auroc LINEBREAK ap LINEBREAK table 3: results of drug-drug interaction prediction on drugbank. LINEBREAK to predict the interaction between two drugs, we use one 6-layer -gnn to extract features for the two drugs. specifically, for each drug, we average the node representations output by the last layer as the drug feature. we concatenate the two drug features together, and then multiply the interaction embedding to do the prediction. the detailed parameters are left in table 6 of appendix a. LINEBREAK o LINEBREAK the results are reported in table 3. -gnn significantly outperforms previous baselines in terms of accuracy (denoted as acc), the area under the receiver operating characteristic (auroc), the average precision (ap), and the f1 score. most of previous works use gcn, gin or gat backbones, and they focus on designing comprehensive interaction module (nyamabo et al., 2021; li et al., 2022). by using the advanced -gnn backbone, we can significantly improve the results without designing complex interaction modules. this shows the effectiveness of our method. LINEBREAK o LINEBREAK o LINEBREAK application to retrosynthesis LINEBREAK o LINEBREAK retrosynthesis is to predict the reactants of a given product. various gnns have been applied to this task. for example, gln (dai et al., 2019) use gnns to predict the distributions of candidate reaction templates and reactants. graphretro (somnath et al., 2021) and g2g (shi et al., 2020) use gnns to predict where to break a bond and how to add the fragments to complete the synthons. to demonstrate the ability of our -gnn, we combine our method with localretro (chen & jung, 2021), the current best graph-based model for retrosynthesis (without using pre-training). localretro uses gnn to predict the possible templates for each atom and each bond, and sort the predicted templates according to their probabilities. the top templates will be applied to the corresponding atoms or bonds via rdkit (landrum et al., 2016) to generate the reactants. chen & jung (2021) use mpnn (gilmer et al., 2017a) for prediction, and we replace the mpnn with we conduct experiments on the uspto-50k dataset (coley et al., 2017) that contains 50, 016 reactions. following chen & jung (2021), we partition the dataset as 45k training set, 5k validation set and 5k test set. the evaluation metric is the the top-k accuracy, where k = 1, 3, 5, 10, 50. the results are summarized in table 4. we can observe that -gnn can predict reactions more accurately than the baselines without ring information. especially, when the reaction type is known, we improve the top-1 accuracy for 1.8 points and the top-3 accuracy for 1.6 points. these results show the importance of modeling ring structure and the effectiveness of our method. LINEBREAK -gnn. LINEBREAK o LINEBREAK o LINEBREAK the performance for different number of rings. to study the prediction performance of molecules with different number of rings, we group the uspto-50k test set by the number of rings in the product molecules and compute the top-1 accuracy for each group. more specifically, we divide LINEBREAK method LINEBREAK top-1 top-3 LINEBREAK reaction type unknown LINEBREAK reaction type known top-1 top-3 top-5 top-10 top-50 LINEBREAK g2g gln graphretro localretro LINEBREAK o-gnn (ours) LINEBREAK table 4: results on uspto-50k datasets with reaction type known/unknown. LINEBREAK (a) accuracy w.r.t #rings. LINEBREAK (b) case study on molecule with complex rings. LINEBREAK figure 7: study of -gnn on retrosynthesis task. (a) the top-1 accuracy w.r.t. number of rings in product molecules. (b) the one-step retrosynthesis prediction of a product molecule with five rings. the first LINEBREAK -gnn output is the same as the ground truth (marked as green). LINEBREAK o LINEBREAK o LINEBREAK the test set into four groups with ring numbers [0, 2), [2, 4), [4, 6), [6, 12], and those groups have 808, 2347, 1617, 235 reactions, respectively. the results are in figure 7(a) where the blue bars represent the localretro baseline and the green bars represent o gnn has better accuracy on all groups, where the improvements are 0.99, 0.85, 1.30 and 5.96. overall speaking, the improvement is larger when there are more rings in a molecule. especially, -gnn increases the accuracy for when there are at least 6 rings in a group (i.e., the last column), 5.96 points, demonstrating that our method can better leverage ring structures. LINEBREAK -gnn. the results show that LINEBREAK o LINEBREAK o LINEBREAK case study. in figure 7(b), we show an example prediction of a product molecule with 5 rings. the reactions in the left panel are the top-3 predictions from localretro baseline and the ones on the right -gnn. our method successfully predicts the correct reactants in its first output (marked are from as green), but the baseline fails to give a correct prediction. more importantly, the baseline system even fails to identify the correct bond to change. these results suggest that modeling ring structures is crucial to predict reactions accurately, and LINEBREAK -gnn is an effective algorithm for retrosynthesis. LINEBREAK o LINEBREAK o LINEBREAK conclusions and future work
| 8
|
[
108.299,
200.8936768,
304.9533648,
212.8488768
] |
h0de3QWtGG.pdf
| 2,021
| 0
|
LINEBREAK learning "what-if" explanations for sequential decision-making LINEBREAK ioana bica university of oxford, oxford, uk the alan turing institute, london, uk [email protected] LINEBREAK alihan hüyük university of cambridge, cambridge, uk [email protected] LINEBREAK daniel jarrett university of cambridge, cambridge, uk [email protected] LINEBREAK mihaela van der schaar university of cambridge, cambridge, uk cambridge center for ai in medicine, uk university of california, los angeles, usa the alan turing institute, london, uk [email protected] LINEBREAK abstract LINEBREAK building interpretable parameterizations of real-world decision-making on the basis of demonstrated behavior—i.e. trajectories of observations and actions made by an expert maximizing some unknown reward function—is essential for introspecting and auditing policies in different institutions. in this paper, we propose learning explanations of expert decisions by modeling their reward function in terms of preferences with respect to “what if” outcomes: given the current history of observations, what would happen if we took a particular action? to learn these costbenefit tradeoffs associated with the expert’s actions, we integrate counterfactual reasoning into batch inverse reinforcement learning. this offers a principled way of defining reward functions and explaining expert behavior, and also satisfies the constraints of real-world decision-making—where active experimentation is often impossible (e.g. in healthcare). additionally, by estimating the effects of different actions, counterfactuals readily tackle the off-policy nature of policy evaluation in the batch setting, and can naturally accommodate settings where the expert policies depend on histories of observations rather than just current states. through illustrative experiments in both real and simulated medical environments, we highlight the effectiveness of our batch, counterfactual inverse reinforcement learning approach in recovering accurate and interpretable descriptions of behavior. LINEBREAK introduction LINEBREAK consider the problem of explaining sequential decision-making on the basis of demonstrated behavior. in healthcare, an important goal lies in being able to obtain an interpretable parameterization of the experts’ behavior (e.g in terms of how they assign treatments) such that we can quantify and inspect policies in different institutions and uncover the trade-offs and preferences associated with expert actions (james & hammond, 2000; westert et al., 2018; van parys & skinner, 2016; jarrett & van der schaar, 2020). moreover, modeling the reward function of different clinical practitioners can be revealing as to their tendencies to treat various diseases more/less aggressively (rysavy et al., 2015), which —in combination with patient outcomes—has the potential to inform and update clinical guidelines. LINEBREAK in many settings, such as medicine, decision-makers can be modeled as reasoning about "what-if" patient outcomes: given the available information about the patient, what would happen if we took a particular action? (djulbegovic et al., 2018; mcgrath, 2009). as treatments often affect several patient covariates, by having both benefits and side-effects, decision-makers often make choices based on their preferences over these counterfactual outcomes. thus, in our case, an interpretable explanation of a policy is one where the reward signal for (sequential) actions is parameterized on the basis of preferences over (sequential) counterfactuals (i.e. "what-if" patient outcomes). LINEBREAK figure 1: explaining decision-making behaviour in terms of preferences over "what if" outcomes. consider the evolution of tumour volume (u ) and side effects (z) under a binary action. e[ut+1[at] | ht] and e[zt+1[at] ht] are the counterfactuals for the patient features under action at given | history ht of prior actions and covariates. parameterizing the reward as the weighted sum of these counterfactuals: r(ht, at) = wue[ut+1[at] ht], naturally allows us to model ht] + wze[zt+1[at] | the preferences of experts: e.g. finding that indicates that the expert is treating more wz| wu| aggressively, by placing more weight on reducing tumour volume than on minimizing side effects. LINEBREAK given the observations and actions made by an expert, inverse reinforcement learning (irl) offers a principled way for modeling their behavior by recovering the (unknown) reward function being maximized (ng et al., 2000; abbeel & ng, 2004; choi & kim, 2011). standard solutions operate by iterating on candidate reward functions, solving the associated (forward) reinforcement learning problem at each step. in many real-world problems, however, we are specifically interested in the challenge of offline learning—that is, where further experimentation is not possible—such as in medicine. in this batch setting, we only have access to trajectories sampled from the expert policy in the form of an observational dataset—such as in electronic health records. LINEBREAK batch irl. by their nature, classic irl algorithms require interactive access to the environment, or full knowledge of the environment’s dynamics (ng et al., 2000; abbeel & ng, 2004; choi & kim, 2011). while batch irl solutions have been proposed by way of off-policy evaluation (klein et al., 2011; 2012; lee et al., 2019), they suffer from two disadvantages. first, they are limited by the assumption that state dynamics are fully-observable and markovian. this is hardly true in medicine: treatment assignments generally depend on how patient covariates have evolved over time (futoma et al., 2020). second, rewards are often parameterized as uninterpretable representations of neural network hidden states and consequently cannot be used to explain sequential decision making. LINEBREAK "what-if" explanations. to address these shortcomings and to obtain a parameterizable interpretation of the expert’s behavior, we propose explicitly incorporating counterfactual reasoning into batch irl. in particular, we focus on “what if” explanations for modeling decision-making, while simultaneously accounting for the partially-observable nature of patient histories. under the max-margin apprenticeship framework (abbeel & ng, 2004; klein et al., 2011; lee et al., 2019), we learn a parameterized reward function r(ht, at) that is defined as a weighted sum over potential outcomes (rubin, 2005) for taking action at given history ht. LINEBREAK ht] and e[zt+1[at] LINEBREAK as highlighted in figure 1, consider the decision making process of assigning a binary action given the tumour volume (u ) and side effects (z). let e[ut+1[at] ht] be the counterfactual outcomes for the two covariates when action at is taken given the history ht of covariates and previous actions. we define the reward as the weighted sum of these counterfactuals: ht], to take into account the effect of actions and r(ht, at) = wue[ut+1[at] | to directly model the preferences of the expert. the ideal scenario is when both the tumour volume and the side effects are zero, so the reward weights of a doctor aiming for this are both negative. however, recovering that , it means that the doctor is treating more aggressively, as wu| | they are focusing more on reducing the tumour volume rather than on the side effects of treatments. alternatively, indicates that the side effects are more important and the expert is treating less aggressively. our motivation for using counterfactuals to define the reward comes from the idea that rational decision making considers the potential effects of actions (djulbegovic et al., 2018). LINEBREAK ht] + wze[zt+1[at] LINEBREAK wu| | LINEBREAK wz| | LINEBREAK wz| | LINEBREAK contributions. exploring the synergy between counterfactual reasoning and batch irl for understanding sequential decision making confers multiple advantages. first, it offers a principled approach for parameterizing reward functions in terms of preferences over what-if patient outcomes, which enables us to explain the cost-benefit tradeoffs associated with an expert’s actions. second, by estimating the effects of different actions, counterfactuals readily tackle the off-policy nature of LINEBREAK method LINEBREAK environment batch LINEBREAK abbeel & ng (2004) model-based no choi & kim (2011) model-based no (cid:80) klein et al. (2011) model-free yes φ(xt) = basis functions for state xt π(at | xt) π(at | xt) lee et al. (2019) LINEBREAK φ(xt, at) = concat(φ(xt), at) LINEBREAK model-free yes LINEBREAK feature map for reward LINEBREAK policy feat. expectations φ(st) = basis functions for state st π(at | st) model roll-outs s bt(s)φ(s, at) = basis for belief bt π(at | bt) model roll-outs LINEBREAK lstd-q dsfn LINEBREAK ours LINEBREAK model-free yes LINEBREAK φ(ht, at) = e[yt+1[at]|ht] LINEBREAK π(at | ht) LINEBREAK counterfactual µ-learning LINEBREAK table 1: comparison of our proposed method (batch, counterfactual irl) with related works in irl. LINEBREAK policy evaluation in the batch setting. furthermore, we demonstrate that not only does this alleviate the cold-start problem typical of conventional batch irl solutions, but also accommodates settings where the usual assumption of full observability fails to hold. through experiments in both real and simulated medical environments, we illustrate the effectiveness of our batch, counterfactual inverse reinforcement learning approach in recovering accurate and interpretable descriptions of behavior. LINEBREAK 2 related works in our work, the aim is to explain decision-making by recovering the preferences of experts with respect to the effects of their actions, denoted by the counterfactual outcomes. this goal is fundamentally different from the goal of irl methods which generally aim to match the performance of experts. we operate under the standard max-margin apprenticeship framework (ng et al., 2000; abbeel & ng, 2004), which searches for a reward function that minimizes the margin between feature expectations of the expert and candidate policies. however, our approach to recovering and understanding decision policies is uniquely characterized by incorporating counterfactuals to obtain explainable reward functions. to tackle the challenges posed by real-world decision making, our method also operates in an offline and model-free manner, and accommodates partially-observable environments. LINEBREAK explainability. by using basis functions (klein et al., 2012) or hidden layers of a deep network (lee et al., 2019) to define the feature map, the learned rewards of either approach are inherently uninterpretable, and cannot be used to explain differences in expert behavior. an alternative approach for recovering the expert policy (without reward functions) is imitation learning (hussein et al., 2017; osa et al., 2018; torabi et al., 2019; jarrett et al., 2020). however, these methods do not allow us to fully model the decision-making process of experts and to uncover the trade-offs behind their actions. LINEBREAK batch learning. klein et al. (2011) propose an off-policy evaluation method based on least squares temporal difference (lstd-q) (lagoudakis & parr, 2003) for estimating feature expectations, and klein et al. (2012) use a linear score-based classifier to directly approximate the q-function offline. however, both methods require the constraining assumptions that rewards are direct, linear functions of fully-observable states—assumptions we cannot afford to make in realistic settings such as medicine. lee et al. (2019) propose a deep successor feature network (dsfn) based on q-learning to estimate feature expectations. but their approach similarly assumes fully-observable states, and additionally suffers from the “cold-start” problem where off- policy evaluations are heavily biased unless the initial candidate policy is (already) close to the expert. LINEBREAK partial observability. no existing batch irl method accommodates modeling expert policies that depend on patient histories. while choi & kim (2011) and makino & takeuchi (2012) extend the apprenticeship learning paradigm to partially observable environments by considering policies on beliefs over states, both need to interact with the environment (or a perfect simulator) during learning. LINEBREAK to the best of our knowledge, we are the first to propose explaining sequential decisions through counterfactual reasoning and to tackle the batch irl problem in partially-observable environments. our use of the estimated counterfactuals yields inherently interpretable rewards and simultaneously addresses the cold-start problem in lee et al. (2019). table 1 highlights the main differences between our method and the relevant related works. see appendix a for additional related works. LINEBREAK problem formulation LINEBREAK denote the action (e.g. treatment) taken, where LINEBREAK preliminaries. at timestep t, let random variable xt ∈ x at ∈ a a realizations of these random variables. let ht = (x0, a0, . . . , xt be a realization of the history ht ∈ h LINEBREAK denote the observed patient features and let is a finite set of actions. let xt and at denote LINEBREAK 1, xt) = (x0:t, a0:t − of patient observations and actions until timestep t. LINEBREAK ∈ h LINEBREAK ∈ a LINEBREAK and (cid:80) h × a → a LINEBREAK [0, 1], where π(a LINEBREAK h) indicates the a stationary stochastic policy represents a mapping: π : h) = 1. taking action at probability of choosing action a given history h under history ht results in observing xt+1 and obtaining ht+1. the reward function is r : r . the value function where r(h, a) represents the reward for taking action a π, h0 = h], where of a policy π, v : 0. the action-value function [0, 1) is the discount factor and at ∼ γ ≥ ∈ π, h0 = h, a0 = a] q : h × a → 0. a higher q-value indicates that action a will yield better long ht) for t where at ∼ term returns if taken for history h. we assume we know the discount factor γ which indicates the importance of future rewards for the current history and action pair. LINEBREAK r is defined as: v π(h) = e[(cid:80)∞t=0 γtr(ht, at) r of a policy is defined as qπ(h, a) = e[(cid:80)∞t=0 γtr(ht, at) · | π( · | LINEBREAK | ∈a given history h LINEBREAK ∈ a ht) for t LINEBREAK h×a → LINEBREAK ∈ h | LINEBREAK h → LINEBREAK ∈ h LINEBREAK π(a LINEBREAK a LINEBREAK ht). LINEBREAK πe( LINEBREAK h × LINEBREAK rd satisfy LINEBREAK d 0, . . . xi t i LINEBREAK rd also satisfies LINEBREAK are assigned according to some expert policy πe such that at ∼ LINEBREAK n ζ i i=1 be a batch observational dataset consisting of n patient trajectories: } { 1, ai 0, ai t i). the trajectory ζ i for patient i consists of covariates xi t and t i − t observed for t i timesteps. for simplicity, we drop the superscript i unless explicitly needed. LINEBREAK batch irl. let ζ i = (xi actions ai the actions at ∈ d we work in the apprenticeship learning set-up (abbeel & ng, 2004) and we consider a linear φ(ht, at), where the weights w reward function r(ht, at) = w 1. the 1 such that the reward is bounded. we feature map φ : ) φ( (cid:107)2 ≤ · (cid:107) assume that the expert policy πe is attempting to optimize, without necessarily succeeding, some φ(ht, at), where w∗ are the ‘true’ reward weights. given unknown reward function r∗(ht, at) = w∗ r(ht, at), the value of policy π can be re-written as: e[v π(h0)] = e[(cid:80)∞t=0 γtw π] = e[(cid:80)∞t=0 γtφ(ht, at) π], where the expectation is taken with respect to the sequence of histories w | 0 obtained by acting according to π. the feature expectation of policy and action pairs (ht, at)t π, defined as the expected discounted cumulative feature vector obtained when choosing actions according to policy π is µπ = e[(cid:80)∞t=0 γtφ(ht, at) our aim is to recover the expert weights w∗ as well as find a policy π that is close to the policy of the expert πe. we take the max-margin irl approach and we measure the similarity between the feature expectations of the expert’s policy and the feature expectations of a candidate policy using µπe (cid:107)2. in this batch irl setting, we do not have knowledge of transition dynamics and we (cid:107) cannot sample more trajectories from the environment. note that in this context, we are the first to model expert policies that depend on patient histories and not just current observations. LINEBREAK rd such that: e[v π(h0)] = w LINEBREAK φ(ht, at) LINEBREAK counterfactual reasoning. to explain the expert’s behaviour in terms of their trade-off associated with "what if" outcomes, we use counterfactual reasoning to define the feature map φ(ht, at) part of the reward r(ht, at) = w φ(ht, at). we adopt the potential outcomes framework (neyman, 1923; rubin, 1978; robins & hernán, 2008). let y [a] be the potential outcome, either factual or we learn feature map φ(ht, at) such that: counterfactual, for treatment a LINEBREAK . using the dataset LINEBREAK ∈ a LINEBREAK d LINEBREAK φ(ht, at) = e[yt+1[at] LINEBREAK ht], LINEBREAK where e[yt+1[at] ht] is the potential outcome for taking action at at time t given the history ht. for the factual action at, assigned under policy π( ht), the factual outcome is xt+1 and this is the same as the potential outcome e[yt+1[at] ht]. the potential outcomes for the other actions at ∈ a are the counterfactual ones and they allow us to understand what would happen to the patient if they receive a different treatment at. to identify the potential outcomes from the batch data we make the standard assumptions of consistency, positivity and no hidden confounders as described in appendix b. no hidden confounders means that we observe all variables affecting the action assignment and potential outcomes. overlap means that at each timestep, every action has a non-zero probability and can be satisfied in this setting by having a stochastic expert policy. these assumptions are standard across methods for estimating counterfactual outcome (robins et al., 2000; schulam & saria, 2017; bica et al., 2020a). note that these assumptions are needed to be able to reliably perform causal inference using observational data. however, they do not constrain the batch irl set-up. LINEBREAK estimating the potential outcomes from batch data poses additional challenges that need to be considered. the fact that the expert follows policies that consider the history of patient observations when deciding new actions, gives rise to time-dependent confounding bias. standard supervised learning methods for learning e[yt+1[at] will be biased by the expert policy used in the observational dataset and will not be able to correctly estimate the counterfactual outcomes under alternative policies (schulam & saria, 2017). methods for adjusting for the confounding bias involve LINEBREAK ht] from LINEBREAK d LINEBREAK using either inverse probability of treatment weighting (robins et al., 2000; lim et al., 2018) or building balancing representations (bica et al., 2020a). refer to appendix b for more details. LINEBREAK in the sequel, we consider the model for estimating counterfactuals as a black box such that the feature map φ(ht, at) represents the effect of taking action at for history ht. the reward is then: LINEBREAK r(ht, at) = w LINEBREAK φ(ht, at) = w LINEBREAK e[yt+1[at] LINEBREAK ht] LINEBREAK defining the reward function using counterfactuals gives an interpretable parameterization of doctor behavior: it allows us to interpret their behavior with respect to the importance weights implicitly assigned to the effects of their actions. this enables describing the relative trade-offs in treatment decisions. note that we are not assuming that the experts themselves actually compute these quantities (nor that they explicitly adopt the same causal inference assumptions); rather, we are simply providing a way to understand how decision-makers are effectively behaving (i.e. in terms of counterfactuals). LINEBREAK batch inverse reinforcement learning using counterfactuals LINEBREAK max-margin irl (abbeel & ng, 2004) starts with an initial random policy π and iteratively performs the following three steps to recover the expert policy and its reward weighs: (1) estimate feature expectations µπ of candidate policy π, (2) compute new reward weights w and (3) find new candidate φ(ht, at). this approach finds a policy policy π that is optimal for reward function r(ht, at) = w ˜π that satisfies (cid:107)2 < (cid:15) such that ˜π has an expected value function close the expert policy. LINEBREAK the expert feature expectations can be estimated empirically from the dataset LINEBREAK using: LINEBREAK d LINEBREAK µπe = LINEBREAK t i (cid:88) LINEBREAK γtφ(hi LINEBREAK t, ai LINEBREAK t). LINEBREAK (cid:80)t i LINEBREAK t=0 γtφ(hi LINEBREAK in the batch setting, we cannot estimate the feature expectations of candidate policies by taking the sample mean of on-policy roll-outs: µ˜π = 1 t, π(hi t)). to address this offn policy nature of estimating feature expectations, we introduce a new method that leverages the estimated counterfactuals. we also make use of the counterfactuals to learn optimal policies for different reward weights. figure 2 illustrates how we integrate "what if" reasoning into batch irl. LINEBREAK counterfactual µ LINEBREAK learning LINEBREAK figure 2: counterfactual inverse reinforcement learning (cirl). counterfactuals are used to define φ(h, a), to estimate feature expectations µπ of candidate policy π in batch setting and to learn optimal policy for reward weights w. LINEBREAK similar to the approach proposed by klein et al. (2012); lee et al. (2019), we consider a history-action feature expectation defined as follows µπ(h, a) = e[(cid:80)∞t=0 γtφ(ht, at) π, h0 = h, a0 = a], where | ht). this can be re-written as: the first action a can be chosen randomly and for t LINEBREAK µπ(h, a) = φ(h, a) + eh(cid:48),a(cid:48)∼π(·|h(cid:48))[ LINEBREAK 1, at ∼ γtφ(ht, at) | π, h1 = h(cid:48), a1 = a(cid:48)] LINEBREAK where h(cid:48) is the next history. notice the analogy between µπ(h, a) and the action-value function: LINEBREAK qπ(h, a) = r(h, a) + eh(cid:48),a(cid:48)∼π(·|h(cid:48))[ LINEBREAK γtr(ht, at) | π, h1 = h(cid:48), a1 = a(cid:48)] LINEBREAK = r(h, a) + γeh(cid:48),a(cid:48)∼π(·|h(cid:48))[qπ(h(cid:48), a(cid:48))], LINEBREAK that allows us to use temporal difference learning to estimate feature expectations (sutton et al., 1998). existing methods for estimating feature expectations fall into two extremes: (1) model-based (online) irl approaches learn a model of the world and then use the model as a simulator to obtain on-policy roll-outs (abbeel & ng, 2004) and (2) batch irl approaches use q-learning (or alternative methods) LINEBREAK algorithm 1 (batch, max-margin) cirl LINEBREAK 1: input: batch dataset LINEBREAK , max iterations n, convergence threshold (cid:15), LINEBREAK d LINEBREAK feature map φ(ht, at) = e[yt+1[at] ht] | LINEBREAK 2: µπe compute πe’s feature expectations (equation 3) ← random initial reward weights, π0 ← 3: w0 ← 4: µπ0 compute π0’s feature expectations ← , ¯µ0 = µπ0 µπ0 π0} 5: π = } { { 6: for k = 1 to n do wk = µπe 1, πk ← ¯µk 7: µπk compute πk’s feature expectations 8: ← 9: π = π 10: LINEBREAK orthogonally project µπe onto line through ¯µk LINEBREAK − πk} LINEBREAK } (µπk − ¯µk−1)t (µπe − ¯µk−1) (µπk − ¯µk−1)t (µπk − ¯µk−1) LINEBREAK ¯µk = LINEBREAK if t < (cid:15) then break LINEBREAK 11: 12: end for 13: k = arg mink:µπk 14: output: ˜r, ∆, π LINEBREAK µπe LINEBREAK µπk LINEBREAK ||2, ˜r(h, a) = wk · LINEBREAK φ(h, a) LINEBREAK compute optimal policy for r0 = w0 · LINEBREAK (counterfactual µ-learning) LINEBREAK compute optimal policy for rk = wk · µπk LINEBREAK φ (counterfacual µ-learning) LINEBREAK t = LINEBREAK µπe LINEBREAK for off-policy evaluation (lee et al., 2019), and can only be used to evaluate policies similar to the expert policy and require warm start. in our case, the counterfactual model allows us to compute and any arbitrary action a. thus, we propose counterfactual h(cid:48) = (h, a, e[y (a) µ-learning, a novel method for estimating feature expectations that uses these counterfactuals as part of temporal difference learning with 1-step bootstrapping. this approach falls in-between (1) and (2) and allows us to estimate feature expectations for any candidate policy π in the batch irl setting. LINEBREAK h]) for any h | LINEBREAK ∈ d LINEBREAK the counterfactual µ-learning algorithm learns the µ-values for policy π iteratively by updating the current estimates of the µ-values with the feature map plus the µ-values obtained by following policy π in the new counterfactual history h(cid:48) = (h, a, e[y [a] | ˆµπ(h, a) + α(φ(h, a) + γea(cid:48) LINEBREAK ˆµπ(h, a)), LINEBREAK ˆµπ(h, a) LINEBREAK h]): LINEBREAK where α is the learning rate. we use a recurrent network with parameters θ to approximate ˆµπ(h, a and we train it by minimizing the sequence of loss functions li(θi) = eh∼d[||yi − ˆµπ(h, a | θi)||2] LINEBREAK θ) | li which changes for every iteration i: θi+1 ← θi + α∇(li(θi)), (9) LINEBREAK where the action a can be chosen randomly from is the target for iteration i. the parameters for the previous iteration θi ing expectations for the policy π are given by ˆµπ = eh0,a0 empirically from the observational dataset LINEBREAK h(cid:48))[ˆµπ(h(cid:48), a(cid:48) 1)] ·| 1 are held fixed when optimizli(θi). refer to appendix c for full details of the counterfactual µ-learning algorithm. the feature h0)[ˆµπ(h0, a0)], which can be estimated ·| using ˆµπ = 1 n LINEBREAK and yi = φ(h, a)+γea(cid:48) LINEBREAK ˆµπ(hi LINEBREAK θi LINEBREAK a LINEBREAK a LINEBREAK ∈a LINEBREAK d LINEBREAK finding optimal policy for given reward weights LINEBREAK during each iteration of max-margin irl, we obtain a candidate policy to evaluate by finding the optimal policy for a given vector of reward weights. we use deep recurrent q-learning (hausknecht & stone, 2015), a model-free approach for learning q-values for reward function r(h, a) = w φ(h, a). the counterfactuals are used to compute φ(h, a), and to estimate the next history for the temporal difference updates. see appendix d for details. after estimating the q values, q(h, a) for history h) = 1 h and action a, a new candidate policy is obtained using: π(a LINEBREAK − a=arg maxa(cid:48) q(h,a(cid:48)). LINEBREAK counterfactual inverse reinforcement learning algorithm (cirl) LINEBREAK algorithm 1 describes our proposed counterfactual inverse reinforcement learning (cirl) method for the batch setting. cirl is based on the projection algorithm proposed by abbeel & ng (2004) and iteratively updates the reward weights to minimize the margin between the expert’s feature expectations and the feature expectations of intermediate policies. cirl uses our proposed counterfactual learning algorithm for estimating the feature expectations of intermediate policies in an off-policy µ manner that is suitable for the batch setting. compared to the algorithm for batch irl proposed by LINEBREAK lee et al. (2019) that requires the initial policy π0 to already be similar to the expert policy, cirl works for any initial policy π that is optimal for the randomly initialized reward weights w0. similarly to choi & kim (2011), the cirl algorithm returns the reward function ˜r(h, a) that results in a policy with feature expectations closest to the ones of the expert policy. we show experimentally that the reward that yields the closest feature expectations will be similar to the true underlying reward function of the expert. cirl returns the set of policies tried π and their feature expectations ∆, which allows us to compute a mixing policy that would yield similar performance to the expert policy (abbeel & ng, 2004). let ˜µ be the closest point to µπe in the convex closure of ∆ = LINEBREAK , which can be computed by solving the quadratic programming problem: LINEBREAK λiµπi , λi ≥ 0, LINEBREAK i from the termination criteria of algorithm 1, µπe is separated from the points µπi by a margin of µπe (cid:15). to obtain a policy that is close to at most (cid:15). thus, the solution ˜µ will satisfy (cid:107) the performance of the expert policy, we mix together the policies π = returned by π0, . . . πk} { algorithm 1, where the probability of selecting πi is λi. LINEBREAK i LINEBREAK experiments LINEBREAK we evaluate the ability of cirl to recover the preferences of experts over the "what if" outcomes of actions. these preferences are denoted by the magnitude of the recovered reward weights. since we do not have access to the underlying reward weights of experts in real data, we first validate the method in a simulated environment. to show the applicability of cirl in healthcare, we also perform a case study on an icu dataset from the mimic iii database (johnson et al., 2016). LINEBREAK benchmarks. for our proposed cirl method, we uses the counterfactual recurrent network, a state-of-the art model for estimating counterfactual outcomes in a temporal setting (bica et al., 2020a). note that other models for this task are also applicable (lim et al., 2018). refer to appendix f for details. we benchmark cirl against mb-irl: model-based irl—i.e. inverse reinforcement learning with model-based policy evaluation (e.g. yin et al. (2016); nagabandi et al. (2018); kaiser et al. (2019); buesing et al. (2018)). we consider two versions of this benchmark: mb(h)-irl which uses the patient history and mb(x)-irl which only uses the current observations to define the policy. for both mb(x)-irl and mb(h)-irl we define the reward as a weighted sum of counterfactual outcomes, but these methods use instead standard supervised methods to estimate the next history h(cid:48) needed for the counterfactual µ-learning algorithm. these benchmarks are aimed to highlight the need of handling the bias from the time-dependent confounders and using a suitable counterfactual model, but also the importance of handling the patient history. we also compare against the deep successor feature networks (dsfn) proposed by lee et al. (2019), which currently represents the state-of-the-art batch irl for the mdp setting. to show that their approach for estimating feature expectations in the batch setting is suboptimal, we extend their method to also incorporate histories in the dsfn(h) benchmark. implementation details of the benchmarks can be found in appendix g. LINEBREAK extracting different types of expert behaviour LINEBREAK simulated environment. we propose an environment that uses a general data simulation involving p-order auto-regressive processes. to analyze different types of expert behaviour (e.g. treating more/less aggressively) we simulate data for patient features representing disease progression (x), e.g. tumour volume and side effects (z) and action (a) indicating the binary application of treatment. for time t, we model the evolution of patient covariates according to the treatments as follows: LINEBREAK xt = LINEBREAK zt = LINEBREAK at−i − p + η LINEBREAK ∼ n LINEBREAK (0, 0.12) are noise terms. the initial values for the features where p = 5 and (cid:15) (2, 1). we set xmax = 50 and zmax = 15. the are sampled as follows: x0 ∼ n 20. the trajectory of the patient terminates when either xt = 0, xt ≥ tumour volume xt, denoting the disease progression, decreases when we give treatment and increases otherwise. conversely, the side effects zt, increase when we give treatment and decrease otherwise. we define a linear reward for taking action at given history ht = (x0:t, z0:t, a0:t LINEBREAK xmax, zt ≥ LINEBREAK 1) as follows: LINEBREAK zmax or t LINEBREAK ∼ n LINEBREAK r(ht, at) = w1 LINEBREAK xt+1 xmax − xmin LINEBREAK zt+1 zmax − zmin LINEBREAK w LINEBREAK where w = [w1, w2], 1 and xt+1 and zt+1 are simulated according to equations 11 to take into account the effect of action at for history ht. the features are normalized to [0, 1]. the best scenario for a patient is when both the side effects and tumour volume are zero and a doctor attempting to achieve this will have negative reward weights. however, different settings of the reward weights 0.3, the expert will result in different expert behaviours. for instance, for w1 = policy will focus more on the disease progression and will consequently treat more aggressively, while this behaviour will be reversed for reward weights set to w1 = 0.7. we − used deep recurrent q learning (hausknecht & stone, 2015) to find a stochastic expert policy that consists of optimizes the reward function for different settings of the weights. the batch dataset d 10000 trajectories sampled from the expert policy. refer to appendix e for more details. LINEBREAK recovering decision making preferences of experts. we first evaluate the benchmarks on their ability to recover the weights of the reward function optimized by the expert for the experimental setting with γ = 0.99, 0.7. note that dsfn does not w1 = provide interpretable reward weights, and thus cannot be used for understanding the trade-offs in the expert behavior. we train each benchmark 10 times and we plot in figure 3 the reward weights obtained for the different figure 3: reward weights recovered by iterations. we show that our proposed cirl method benchmarks over 10 runs. the weights of performs best at recovering the preferences of the expert, 0.7. the expert are w1 = which in this case is to treat less aggressively. while the mb(h)-irl method also recovers the correct trade-offs in the expert behavior, the computed weights have a much higher variance. conversely, the mb(x)-irl method, which does not consider the patient history fails to recover the underlying weights of the expert policy. LINEBREAK matching the expert policy. we evaluate the benchmarks’ ability to recover policies that match the . a lower γ performance on the expert policy for two settings of the discount factor γ } indicates that the expert is optimizing for the immediate effect of actions, while a higher γ means they considered the long term effect of actions. for each γ we learn expert policies for different reward weights and we use the expert policies to generate the batch datasets. we evaluate the policies learned by the benchmarks using two metrics: cumulative reward for running the policy in the simulated environment and accuracy on matching the expert policy (computed as described in appendix h). we report in tables 2 and 3 the average results and their standard error over 1000 sampled trajectories from the environment. cirl recovers a policy that has the closest cumulative reward to the expert policy and that can best match the treatments assigned by the expert. LINEBREAK table 2: mean cumulative reward and standard deviation for running learnt policy in the environment. LINEBREAK reward weights LINEBREAK expert LINEBREAK table 3: average accuracy and standard deviation for matching the actions in the expert policy. LINEBREAK reward weights LINEBREAK case study on real-world dataset: mimic iii LINEBREAK suppose we want to explain the decision-making process of doctors assigning antibiotics to patients in the icu. for this purpose, we consider a dataset with 6631 patients that have received antibiotics during their icu stay, extracted from the medical information mart for intensive care (mimic iii) database (johnson et al., 2016). LINEBREAK we used cirl, with γ = 0.99, to recover the policy and the reward weights of doctors administering antibiotics to understand their preferences over the effect of antibiotics on the patient features. the relative magnitude of the reward weights for the counterfactual outcomes of the patient features considered are illustrated in figure 4. cirl found that reducing temperature had the highest weight in the reward function of the expert, followed by wbc. this corresponds to known medical guidelines (marik, 2000; palmer et al., 2008). sepsis is a leading cause of morbidity and mortality in the icu, and several studies have shown that early administratio of antibiotics is crucial to decrease the risk of adverse outcomes (zahar et al., 2011). fever and elevated wbc are among a small subset of variables that indicate a systemic inflammatory response, concerning for the development of sepsis (neviere et al., 2017). while these findings are not specific to bacterial infection, the risk of failing to treat a potentially serious infection often outweighs the risk of inappropriate antibiotic administration, thereby driving clinicians to prescribe antibiotics in the setting of these abnormal findings. similarly, the decision to discontinue antibiotics is complex, but it is often supported by signs of a resolution of infection which included normalization of body temperature and a downtrending of the wbc. as such, our finding that the two highest reward weights for the administration of antibiotics in the icu is temperature and wbc is consistent with clinical practice. moreover, note that the model is simply identifying the factors that are driving the decision-making of the clinician represented in this dataset. LINEBREAK figure 4: radar plot of reward weights magnitude for assigning antibiotics. LINEBREAK table 4: accuracy on matching expert actions. LINEBREAK mb(x)-irl mb(h)-irl dsfn dsfn(h) cirl LINEBREAK accuracy LINEBREAK in table 4, to verify that explainability does not come at the cost of accuracy we also evaluate the benchmarks on matching the expert actions. LINEBREAK discussion LINEBREAK in this paper, we propose building interpretable parametrizations of sequential decision-making by explaining an expert’s behaviour in terms of their preferences over "what-if" outcomes. to achieve this, we introduce cirl, a new method that incorporates counterfactual reasoning into batch irl: counterfactuals are used to define the feature map part of the reward function, but also to tackle the off-policy nature of estimating feature expectations in the batch setting. the reward weights recovered by cirl indicate the relative preferences of the expert over the counterfactual outcomes of their actions. our aim is to provide a description of behavior, i.e. how the expert is effectively behaving under our interpretable parameterization of the reward based on counterfactuals. we are not assuming that the experts actually operate under this specific (linear, in our case) model or that they compute the exact counterfactuals. instead, our purpose is to show that we can explain an agent’s behavior on the basis of counterfactuals, which is useful in that it allows us to audit them, sanity-check their policies and find variation in practice. further discussion can be found in appendix i. LINEBREAK there are several limitations of your method and directions for future work. while our method considers reward functions that are linear in the features, one way of extending it to handle more complex reward functions is to use domain knowledge to define the feature map as a non-linear function over the counterfactual outcomes. nevertheless, these functions should be defined in a way that still allows us to obtain interpretable explanations of the expert’s behaviour. moreover, although time-invariant reward weights w are standard in the irl literature (abbeel & ng, 2004; choi & kim, 2011; lee et al., 2019), time-variant rewards/policies have been considered in the dynamic treatment regimes (reinforcement learning) literature (chakraborty, 2013; zhang & bareinboim, 2019). thus another direction for future work would be to extend our method to consider non-stationary policies and reward weights that can change over time. LINEBREAK acknowledgments LINEBREAK we would like to thank the reviewers for their valuable feedback. the research presented in this paper was supported by the alan turing institute, under the epsrc grant ep/n510129/1, by alzheimer’s research uk (aruk), by the us office of naval research (onr), and by the national science foundation (nsf) under grant numbers 1407712, 1462245, 1524417, 1533983, and 1722516. the authors are also grateful to brent ershoff for the insightful discussions and help with interpreting the medical results on mimic iii. LINEBREAK references LINEBREAK pieter abbeel and andrew y ng. apprenticeship learning via inverse reinforcement learning. in proceedings of the twenty-first international conference on machine learning, pp. 1. acm, 2004. LINEBREAK ioana bica, ahmed alaa, james jordon, and mihaela van der schaar. estimating counterfactual treatment outcomes over time through adversarially balanced representations. in international conference on learning representations, 2020a. LINEBREAK ioana bica, ahmed m alaa, craig lambert, and mihaela van der schaar. from real-world patient data to individualized treatment effects using machine learning: current and future methods to address underlying challenges. clinical pharmacology & therapeutics, 2020b. LINEBREAK abdeslam boularias, jens kober, and jan peters. relative entropy inverse reinforcement learning. in proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 182–189, 2011. LINEBREAK lars buesing, theophane weber, yori zwols, sebastien racaniere, arthur guez, jean-baptiste lespiau, and nicolas heess. woulda, coulda, shoulda: counterfactually-guided policy search. international conference on representation learning (iclr), 2018. LINEBREAK benjamin burchfiel, carlo tomasi, and ronald parr. distance minimization for reward learning from LINEBREAK scored trajectories. in thirtieth aaai conference on artificial intelligence, 2016. LINEBREAK bibhas chakraborty. statistical methods for dynamic treatment regimes. springer, 2013. LINEBREAK jaedeug choi and kee-eung kim. inverse reinforcement learning in partially observable environments. LINEBREAK journal of machine learning research, 12(mar):691–730, 2011. LINEBREAK benjamin djulbegovic, shira elqayam, and william dale. rational decision making in medicine: implications for overuse and underuse. journal of evaluation in clinical practice, 24(3):655–665, 2018. LINEBREAK chelsea finn, sergey levine, and pieter abbeel. guided cost learning: deep inverse optimal control via policy optimization. in international conference on machine learning, pp. 49–58, 2016. LINEBREAK justin fu, katie luo, and sergey levine. learning robust rewards with adversarial inverse reinforce LINEBREAK joseph futoma, michael c hughes, and finale doshi-velez. popcorn: partially observed prediction constrained reinforcement learning. international conference on artificial intelligence and statistics (aistats), 2020. LINEBREAK matthew hausknecht and peter stone. deep recurrent q-learning for partially observable mdps. in LINEBREAK 2015 aaai fall symposium series, 2015. LINEBREAK sepp hochreiter and jürgen schmidhuber. long short-term memory. neural computation, 9(8): LINEBREAK ahmed hussein, mohamed medhat gaber, eyad elyan, and chrisina jayne. imitation learning: a LINEBREAK survey of learning methods. acm computing surveys (csur), 50(2):1–35, 2017. LINEBREAK brent c james and m elizabeth h hammond. the challenge of variation in medical practice. archives LINEBREAK daniel jarrett and mihaela van der schaar. inverse active sensing: modeling and understanding LINEBREAK timely decision-making. international conference on machine learning (icml), 2020. LINEBREAK daniel jarrett, ioana bica, and mihaela van der schaar. strictly batch imitation learning by energy LINEBREAK based distribution matching. advances in neural information processing systems, 2020. LINEBREAK alistair ew johnson, tom j pollard, lu shen, h lehman li-wei, mengling feng, mohammad ghassemi, benjamin moody, peter szolovits, leo anthony celi, and roger g mark. mimic-iii, a freely accessible critical care database. scientific data, 3:160035, 2016. LINEBREAK lukasz kaiser, mohammad babaeizadeh, piotr milos, blazej osinski, roy h campbell, konrad czechowski, dumitru erhan, chelsea finn, piotr kozakowski, sergey levine, et al. model-based reinforcement learning for atari. arxiv preprint arxiv:1903.00374, 2019. LINEBREAK edouard klein, matthieu geist, and olivier pietquin. batch, off-policy and model-free apprenticeship LINEBREAK learning. in european workshop on reinforcement learning, pp. 285–296. springer, 2011. LINEBREAK edouard klein, matthieu geist, bilal piot, and olivier pietquin. inverse reinforcement learning in advances in neural information processing systems, pp. LINEBREAK through structured classification. 1007–1015, 2012. LINEBREAK michail g lagoudakis and ronald parr. least-squares policy iteration. journal of machine learning LINEBREAK donghun lee, srivatsan srinivasan, and finale doshi-velez. truly batch apprenticeship learning with deep successor features. in proceedings of the twenty-eighth international joint conference on artificial intelligence, ijcai-19, pp. 5909–5915. international joint conferences on artificial intelligence organization, 7 2019. doi: 10.24963/ijcai.2019/819. url https://doi.org/ 10.24963/ijcai.2019/819. LINEBREAK bryan lim, ahmed alaa, and mihaela van der schaar. forecasting treatment responses over time using recurrent marginal structural networks. in advances in neural information processing systems, pp. 7493–7503, 2018. LINEBREAK takaki makino and johane takeuchi. apprenticeship learning for model parameters of partially LINEBREAK observable environments. arxiv preprint arxiv:1206.6484, 2012. LINEBREAK mohammad ali mansournia, goodarz danaei, mohammad hossein forouzanfar, mahmood mahmoodi, mohsen jamali, nasrin mansournia, and kazem mohammad. effect of physical activity on functional performance and knee pain in patients with osteoarthritis: analysis with marginal structural models. epidemiology, pp. 631–640, 2012. LINEBREAK brent m mcgrath. how doctors think, 2009. LINEBREAK volodymyr mnih, koray kavukcuoglu, david silver, alex graves, ioannis antonoglou, daan wierstra, and martin riedmiller. playing atari with deep reinforcement learning. arxiv preprint arxiv:1312.5602, 2013. LINEBREAK anusha nagabandi, gregory kahn, ronald s fearing, and sergey levine. neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. in 2018 ieee international conference on robotics and automation (icra), pp. 7559–7566. ieee, 2018. LINEBREAK remi neviere, polly e parsons, and geraldine finlay. sepsis syndromes in adults: epidemiology, definitions, clinical presentation, diagnosis, and prognosis. monografía en internet]. wolters kluwer: uptodate, 2017. LINEBREAK jersey neyman. sur les applications de la théorie des probabilités aux experiences agricoles: essai LINEBREAK des principes. roczniki nauk rolniczych, 10:1–51, 1923. LINEBREAK andrew y ng, stuart j russell, et al. algorithms for inverse reinforcement learning. in icml, LINEBREAK takayuki osa, joni pajarinen, gerhard neumann, j andrew bagnell, pieter abbeel, jan peters, et al. in robotics, 7(1-2): LINEBREAK an algorithmic perspective on imitation learning. foundations and trends r (cid:13) 1–179, 2018. LINEBREAK lucy b palmer, gerald c smaldone, john j chen, daniel baram, tao duan, melinda monteforte, marie varela, ann k tempone, thomas o’riordan, feroza daroowalla, et al. aerosolized antibiotics and ventilator-associated tracheobronchitis in the intensive care unit. critical care medicine, 36(7), 2008. LINEBREAK robert w platt, enrique f schisterman, and stephen r cole. time-modified confounding. american LINEBREAK deepak ramachandran and eyal amir. bayesian inverse reinforcement learning. in ijcai, volume 7, LINEBREAK james m robins and miguel a hernán. estimation of the causal effects of time-varying exposures. LINEBREAK in longitudinal data analysis, pp. 547–593. chapman and hall/crc, 2008. LINEBREAK james m robins, miguel angel hernan, and babette brumback. marginal structural models and LINEBREAK causal inference in epidemiology, 2000. LINEBREAK paul r rosenbaum and donald b rubin. the central role of the propensity score in observational LINEBREAK studies for causal effects. biometrika, 70(1):41–55, 1983. LINEBREAK donald b rubin. bayesian inference for causal effects: the role of randomization. the annals of LINEBREAK donald b rubin. causal inference using potential outcomes: design, modeling, decisions. journal LINEBREAK matthew a rysavy, lei li, edward f bell, abhik das, susan r hintz, barbara j stoll, betty r vohr, waldemar a carlo, seetha shankaran, michele c walsh, et al. between-hospital variation in treatment and outcomes in extremely preterm infants. n engl j med, 372:1801–1811, 2015. LINEBREAK peter schulam and suchi saria. reliable decision support using counterfactual models. in advances LINEBREAK in neural information processing systems, pp. 1697–1708, 2017. LINEBREAK richard s sutton, andrew g barto, et al. introduction to reinforcement learning, volume 135. mit LINEBREAK press cambridge, 1998. LINEBREAK faraz torabi, garrett warnell, and peter stone. recent advances in imitation learning from observa LINEBREAK jessica van parys and jonathan skinner. physician practice style variation—implications for policy. LINEBREAK gert p westert, stef groenewoud, john e wennberg, catherine gerard, phil dasilva, femke atsma, and david c goodman. medical practice variation: public reporting a first necessary step to spark change. international journal for quality in health care, 30(9):731–735, 2018. LINEBREAK hang yin, patrícia alves-oliveira, francisco s melo, aude billard, and ana paiva. synthesizing robotic handwriting motion by learning from human demonstrations. in proceedings of the 25th international joint conference on artificial intelligence, number conf, 2016. LINEBREAK jean-ralph zahar, jean-francois timsit, maïte garrouste-orgeas, adrien francais, aurélien vesim, adrien descorps-declere, yohann dubois, bertrand souweine, hakim haouache, dany goldgrantoledano, et al. outcomes in severe sepsis and patients with septic shock: pathogen species and infection sites are not associated with mortality. critical care medicine, 39(8):1886–1895, 2011. LINEBREAK junzhe zhang and elias bareinboim. near-optimal reinforcement learning in dynamic treatment LINEBREAK regimes. in advances in neural information processing systems, pp. 13401–13411, 2019. LINEBREAK brian d ziebart, andrew maas, j andrew bagnell, and anind k dey. maximum entropy inverse LINEBREAK reinforcement learning. 2008. LINEBREAK a additional related works LINEBREAK alternative approaches for irl require a known mdp or pomdp model. in this context, several bayesian approaches to irl have also been proposed which make use of the know transition dynamics provided by the model of the environment (ziebart et al., 2008; ramachandran & amir, 2007). we do not assume access to a mdp or pomdp model. makino & takeuchi (2012) propose a method for estimating the unknown parameters of a pomdp model of the environment; however their method is only applicable to discrete observation spaces. we do not make any assumptions about the observation space. while several model-free irl methods have also been developed, these are also not applicable in the batch setting where we only have access to a fixed set of expert trajectories. relative entropy irl (boularias et al., 2011) requires non-expert trajectories following arbitrary policy; such experimentation to obtain non-expert trajectories is not possible in the healthcare setting. distance minimization irl (dm-irl) (burchfiel et al., 2016) learns reward functions from scores assigned by experts to sub-optimal demonstrations. moreover, guided cost learning proposed by finn et al. (2016) which performs model-free maximum entropy optimization also requires the ability to sample trajectories from the environment. similarly, adversarial irl, proposed by fu et al. (2017) builds upon the maximum entropy framework in ziebart et al. (2008), but also requires the ability to execute trajectories from candidate policies. LINEBREAK b counterfactual estimation and time-dependent confounding LINEBREAK observational patient data (e.g. electronic health records) contain information about how actions, such as treatments are performed by doctors and how they affect the patient’s trajectory. such data can be used by causal inference methods to estimate counterfactual outcomes–what would happen to the patient if the expert takes a particular action given a history of observations? LINEBREAK to identify the counterfactual outcomes from observational data we make the standard assumptions of consistency, positivity and no hidden confounders as described in assumption 1 (rosenbaum & rubin, 1983; robins et al., 2000). under assumption 1, e[yt+1[at] at, ht] and this can be estimated by training a regression model on the batch observational data. assumption 1 (consistency, ignorability and overlap). for any individual i, if action at is taken at time t, we observe xt+1 = yt+1[at]. moreover, we have sequential strong ignorabilt and sequential overlap pr(at = a ity ∀ LINEBREAK ht] = e[xt+1 | LINEBREAK yt+1[a] { LINEBREAK . ∈ a LINEBREAK ∈a ⊥⊥ LINEBREAK at | LINEBREAK ht, LINEBREAK }a LINEBREAK t, LINEBREAK a LINEBREAK the sequential strong ignorability assumption, also known as no hidden confounders, means that we observe all variables affecting the action assignment and potential outcomes. sequential overlap means that at each timestep, every action has a non-zero probability, which can be satisfied by having a stochastic expert policy. these assumptions are standard across causal inference methods (robins et al., 2000; schulam & saria, 2017; lim et al., 2018; bica et al., 2020a). we emphasize that these assumptions are needed to be able to reliably perform causal inference using observational data. nevertheless, they do not constrain the batch irl set-up. LINEBREAK using observational data to estimate the counterfactual outcomes poses additional challenges in this set-up that need to be considered. in particular, direct estimation of the treatment effects is biased by the presence of time-varying confounders (mansournia et al., 2012), which are patient covariates that influence the assignment of treatments and which, in turn, are affected by past actions. LINEBREAK for instance, consider that the doctor’s policy of assigning treatments takes into account whether the patients’ covariates denoting disease progression, such as tumor volume, has been increasing above normal thresholds for several timesteps. if these patients are also more likely to have severe side effects, without adjusting for the bias introduced by time-varying confounders, we may incorrectly conclude that the treatment is harmful to the patients (platt et al., 2009). using standard supervised learning methods to estimate the patients’ response to treatments in this setting will be biased by the doctor’s policy and will not be able to estimate the effect of treatments under different policies. this represents an issue for our batch irl setting where we need to be able to evaluate candidate policies that are different from the expert policy. thus, being able to correctly estimate counterfactual treatment outcomes is crucial for our method. methods for adjusting for the confounding bias use either inverse probability of treatment weighting (iptw) or balancing representations. the first approach, iptw, involves creating a pseudo-population where the probability of taking action at LINEBREAK does not depend on x0:t (robins et al., 2000; lim et al., 2018), while the second approach builds a balancing representation of the history that is invariant to the treatment (bica et al., 2020a). using either approach will result in an unbiased estimation of the counterfactual outcomes. see robins et al. (2000); lim et al. (2018); bica et al. (2020b) for more details about time-dependent confounding as well as for a more in-depth review of alternative methods for removing the bias from time-dependent confounders and estimating counterfactual outcomes. LINEBREAK c counterfactual µ-learning LINEBREAK our counterfactual µ-learning algorithm involves learning the µ-values for policy π iteratively by updating the current estimates of the µ-values with the feature map plus the µ-values obtained by h]): following policy π in the new counterfactual history h(cid:48) = (h, a, e[y [a] | LINEBREAK ˆµπ(h, a) LINEBREAK ˆµπ(h, a) + α(φ(h, a) + γea(cid:48) ∼ where α is the learning rate and γ is the discount factor. we approximate ˆµπ(h, a θf ) using an rnn with parameters θf . the rnn consists of an lstm unit with linear output. to stabilize training we use a target network ¯µπ with parameters θ−f that provide updates for the main network. note that using a target network is standard in q learning − (mnih et al., 2013; hausknecht & stone, 2015). the target network ¯µπ has the same architecture as the main network ˆµπ and its parameters θ−f are updated to match θf every m − iterations. the loss function for updating the µ network for estimating feature expectations at iteration i is: LINEBREAK ˆµπ(h, a)), LINEBREAK lf,i(θi) = eh θf,i+1 ← LINEBREAK ∼d LINEBREAK yf,i− [ || θf,i + α LINEBREAK | li(θf,i)) LINEBREAK ˆµπ(h, a LINEBREAK θf,i) LINEBREAK where α is the learning rate, (cid:26)φ(h, a), LINEBREAK is the batch observational dataset and LINEBREAK d LINEBREAK if patient trajectory terminates at history h LINEBREAK yf,i = LINEBREAK φ(h, a) + γea(cid:48) LINEBREAK θ−f )], otherwise LINEBREAK (16) is the target for iteration i obtained using the target network ¯µπ. the action a is chosen by following an ε-greedy policy by selecting action a ε and a random action with probability (cid:15). we perform m training iterations. algorithm 2 describes the full training procedure used. LINEBREAK h) with probability 1 LINEBREAK table 5 indicates the search ranges used for the various hyperparameters involved in the counterfactual µ-learning algorithm. the hyperparameters were selected to ensure stability of training and convergence of the algorithm. LINEBREAK hyperparameter LINEBREAK hyperparameter search range hyperparameter value LINEBREAK lstm size batch size learning rate target network update m − LINEBREAK min ε max ε ε decay number of training iterations m optimizer LINEBREAK table 5: hyperparameters for training µ-network for estimating feature expectations. LINEBREAK algorithm 2 counterfactual µ = LINEBREAK 1: input: batch dataset factual model φ(h, a) LINEBREAK d LINEBREAK learning (xi 0, ai LINEBREAK 0, . . . xi t i LINEBREAK 1, ai t i − LINEBREAK n i=1, policy to evaluate π, countert i) } LINEBREAK sample random minibatch for b = 1 to b do LINEBREAK 2: initialize feature expectations network ˆµπ with random weights θf 3: initialize target feature expectations network ¯µπ with random weights θ−f = θf 4: for i = 1 to m do 5: 6: 7: 8: LINEBREAK hb { with probability (cid:15) select random action ab, otherwise select ab compute counterfactual histories hb(cid:48) = (hb, ab, e[y [ab] model: e[y [ab] set targets: LINEBREAK b b=1 of histories h from } LINEBREAK hb] = φ(hb, ab). | LINEBREAK d LINEBREAK b LINEBREAK hb) LINEBREAK hb]) using the counterfactual | LINEBREAK yb f,i = LINEBREAK (cid:26)φ(hb, ab), LINEBREAK if trajectory terminates at history hb LINEBREAK φ(hb, ab) + γea(cid:48) LINEBREAK θ−f )], otherwise LINEBREAK yb f,i − LINEBREAK ˆµπ(hb, ab LINEBREAK θf,i) LINEBREAK ||2 with respect to parameters LINEBREAK end for perform gradient descent step on (cid:80)b θf if i mod m − = 0 then θ−f = θf,i LINEBREAK a LINEBREAK ∈a LINEBREAK ˆµπ(hi LINEBREAK d finding optimal policy for given reward weights LINEBREAK we use deep recurrent q-learning (hausknecht & stone, 2015) to find the optimal policy for each setting of the reward weights r(h, a) = w LINEBREAK φ(h, a). LINEBREAK for history h, let the next history for taking action a be h(cid:48) = (h, a, e[y (a) is estimated by the counterfactual model. using the batch dataset by updating the current estimate of the q over all possible actions in the new history h(cid:48): LINEBREAK h] values iteratively values towards the reward plus the maximum q-value LINEBREAK h]), where e[y (a) LINEBREAK , we learn the q LINEBREAK d LINEBREAK q(h, a) LINEBREAK q(h, a) + α(r(h, a) + γ max LINEBREAK ← where α is the learning rate and γ is the discount factor. LINEBREAK q(h, a)), LINEBREAK θq) using an rnn parameterized by θq. the rnn consists of an lstm we approximate q(h, a | networks (mnih et al., 2013; unit with linear output. we use the standard practices for training q hausknecht & stone, 2015) and we employ a target network ¯q with parameters θ−q to provide the updates for the main network and to stabilize training. the target network ¯q is the same architecture as the main network q and its parameters θ−q are updated to match θq every m − iterations. we use the following loss function for the q lq,i(θi) = eh θq,i+1 ← LINEBREAK learning update at iteration i: θq,i))2] q(h, a [(yq,i − | lq,i(θq,i)) ( ∇ LINEBREAK ∼d θq,i + α LINEBREAK where α is the learning rate and (cid:26)r(h, a), LINEBREAK yq,i = LINEBREAK if patient trajectory terminates at history h LINEBREAK r(h, a) + γ maxa(cid:48) ¯q(h(cid:48), a(cid:48) LINEBREAK θ−q ), otherwise is the stale update target obtained from the target network ¯q. the action a is chosen by following an ε-greedy policy by selecting action a = arg maxa(cid:48) q(h, a(cid:48) ε and a random action with probability (cid:15). we perform m training iterations. table 6 indicates the search ranges used for the various hyperparameters involved in the deep recurrent q learnign algorithm. the hyperparameters were selected to ensure stability of training and convergence of the algorithm. LINEBREAK θq) with probability 1 LINEBREAK hyperparameter LINEBREAK hyperparameter search range hyperparameter value LINEBREAK lstm size batch size learning rate target network update m − LINEBREAK min ε max ε ε decay number of training iterations m optimizer LINEBREAK table 6: hyperparameters used for training q-network to find optimal policy for a setting of the reward weights. LINEBREAK e data simulation LINEBREAK using the dynamics of the simulated environment described in equation 22, we trained a deep recurrent q-learning agent (hausknecht & stone, 2015) to find a stochastic optimal policy that optimizes the reward function for different settings of the reward weights w1 and w2 in equation 23. LINEBREAK let ht = (x0:t, z0:t, a0:t 1) contain the history of the simulated patient covariates representing disease progression x and side effects z. let ht+1 = (x0:t+1, z0:t+1, a0:t) be the new history after taking action at given ht and let rt = r(ht, at) be the corresponding reward. LINEBREAK we again learn the q values for history ht towards the reward plus the maximum q-value over all possible actions in the next history ht+1. (22) LINEBREAK values iteratively by updating the current estimate of the q LINEBREAK q(ht, at) + α(r(ht, at) + γ max
| 15
|
[
212.936,
401.58055,
349.40039486,
412.28995
] |
Qaw16njk6L.pdf
| 2,022
| 2
|
LINEBREAK nasvit: neural architecture search for efficient vision transformers with gradient conflict-aware supernet training LINEBREAK chengyue gong2∗, dilin wang1, meng li1, xinlei chen1, zhicheng yan1, yuandong tian1, qiang liu2, vikas chandra1 1 meta reality labs {wdilin, meng.li, xinleic, zyan3, yuandong, vchandra}@fb.com, {cygong, lqiang}@cs.utexas.edu LINEBREAK 2 university of texas at austin LINEBREAK abstract LINEBREAK designing accurate and efficient vision transformers (vits) is an important but challenging task. supernet-based one-shot neural architecture search (nas) enables fast architecture optimization and has achieved state-of-the-art results on convolutional neural networks (cnns). however, directly applying the supernetbased nas to optimize vits leads to poor performance - even worse compared to training single vits. in this work, we observe that the poor performance is due to a gradient conflict issue: the gradients of different sub-networks conflict with that of the supernet more severely in vits than cnns, which leads to early saturation in training and inferior convergence. to alleviate this issue, we propose a series of techniques, including a gradient projection algorithm, a switchable layer scaling design, and a simplified data augmentation and regularization training recipe. the proposed techniques significantly improve the convergence and the performance of all sub-networks. our discovered hybrid vit model family, dubbed nasvit, achieves top-1 accuracy from 78.2% to 81.8% on imagenet from 200m to 800m flops, and outperforms all the prior art cnns and vits, including alphanet and levit. when transferred to semantic segmentation tasks, nasvits also outperform previous backbones on both cityscape and ade20k datasets, achieving 73.2% and 37.9% miou with only 5g flops, respectively. code is available at https://github.com/facebookresearch/nasvit. LINEBREAK introduction LINEBREAK transformers have recently been applied to various vision tasks, including image classification (liu et al., 2021; dong et al., 2021), object detection (carion et al., 2020; zhu et al., 2020), semantic segmentation (xie et al., 2021; cheng et al., 2021), video understanding (bertasius et al., 2021; fan et al., 2021), etc. vision transformers (vits) benefit from high model capacity, large receptive field, and grouping effect, etc (dosovitskiy et al., 2020), and demonstrate superior performance compared to convolutional neural networks (cnns) especially with the scaling of the model size and training data size. for example, coatnet (dai et al., 2021) achieves 90.88% top-1 accuracy on imagenet by scaling the model to 2586g flops and pre-training the model on jft-3b dataset (sun et al., 2017). LINEBREAK though promising in the high computation budget regime, the performance of vits is still inferior to that of the cnn counterparts on small- or medium-sized architectures, especially compared to cnn architectures that are highly optimized by neural architecture search (nas), e.g., alphanet (wang et al., 2021a), fbnetv3 (dai et al., 2020), etc. for example, the initial deit-tiny (touvron et al., 2020) only achieves 72.2% top-1 accuracy with 1.2g flops. the recently proposed levit (graham et al., 2021) makes significant progress to achieve 76.6% top-1 accuracy with 305m flops with convolution/transformer hybrid architectures and a 3x longer training schedule. in contrast, alphanet (wang et al., 2021a) achieves 77.8% top-1 accuracy with only 203m flops. the large accuracy gap illustrated above raises a natural question: are transformer blocks that build large and dynamic receptive fields beneficial for small models? LINEBREAK ∗work done during an internship at meta reality labs LINEBREAK to answer the question above, in this work, we target at developing a family of efficient vits with flops ranging from 200m to 800m . a natural approach is to leverage nas, which has achieved state-of-the-art (sota) accuracy-efficiency trade-off for cnns (wang et al., 2021a; dai et al., 2020; cai et al., 2019). the recently proposed supernet-based nas, e.g., bignas (yu et al., 2020a) and alphanet (wang et al., 2021a), builds a weight-sharing graph including all the sub-networks in the architecture search space. a sandwich sampling rule with inplace knowledge distillation (kd) (yu et al., 2018) is leveraged to simultaneously optimize the supernet and sub-networks for each mini-batch, which stabilizes the training and improves the training convergence. LINEBREAK to leverage the supernet-based nas, we first modify the levit model to build the architecture search space for vits and then jointly optimize the model architectures and parameters following alphanet. however, we find that directly applying alphanet achieves poor performance on the vit search space, even worse compared to training single vits. to understand the root cause of the poor performance, we examine the supernet training procedure and observe that the gradients of the supernet and the different sub-networks conflict with each other during the sandwich sampling, which makes the training loss saturates much more quickly for vits, thus leading to slow convergence. LINEBREAK to alleviate the issue of conflicting gradients, we propose three different techniques to improve the supernet training. firstly, instead of directly adding the gradients from different sub-networks together, we find it beneficial to prioritize the training of the sub-networks over the supernet, as our main purpose is to build efficient sub-networks. we achieve this with a projection gradient algorithm which removes the component of the supernet gradient that is conflict with the sub-network gradient. secondly, to alleviate the gradient conflicts among different sub-networks, we propose to augment each transformer layer with switchable channel-wise scaling layers. the weights of different scaling layers are not shared among different transformer blocks to reduce gradient conflicts. thirdly, we propose to use a weak data augmentation scheme and reduce the regularization in training to decrease the optimization difficulty and hence reduce gradient conflicts. LINEBREAK our proposed techniques significantly alleviate the gradient conflict issue and empirically improve the convergence of supernet training. compared to the baseline supernet training algorithm in alphanet, we can improve the top-1 accuracy to 78.2% for the small model with 205m flops and achieve 81.8% for the large model with 757m flops. meanwhile, the resulting model family, nasvit, outperforms all the sota cnn and vit models across a wide range of computation constraints. nasvit also demonstrates good performance on downstream tasks. when transferring to semantic segmentation tasks, nasvit backbones outperform previous cnn and vit backbones on both cityscape and ade20k datasets, achieving 73.2% and 37.9% miou with 5g flops, respectively. LINEBREAK related works recently, researchers have used supernet-based nas to optimize the architecture for transformers. for example, hat (han et al., 2021) uses supernet for hardware-aware transformer optimization. hat mainly focuses on nlp tasks and features a design space with heterogeneous transformer layers. autoformer (chen et al., 2021a) and vitas (su et al., 2021) leverages supernetbased nas to optimize the vit architecture. by searching the width, depth, k/q/v dimension, mlp ratio, etc, better accuracy is achieved compared to the baseline deit models (chen et al., 2021a). however, these works focus on large vit models with more than 1g flops and their accuracy is still inferior to the cnn backbones with similar compute, e.g., efficientnet (tan & le, 2019). we refer readers to appendix for more discussions about related works. LINEBREAK nas for efficient transformers LINEBREAK our goal is to design efficient small- and medium-sized vits in the flops regime from 200m to 800m. we build our search space inspired by the recently proposed levit (graham et al., 2021). levit is a family of efficient models leveraging a hybrid architecture of convolutions and transformers. in levit, the convolutions are introduced to handle high resolution inputs thanks to their efficiency from local computation while the transformers are leveraged for lower resolution features to extract global information. we closely follow levit to build our search space; see figure 1 for an overview. LINEBREAK search space we summarize the detailed search dimensions of our search space in table 1. for each cnn block, we directly follow the design in alphanet (wang et al., 2021a;b) and search for the optimal channel widths, block depths, expansion ratios and kernel sizes; for each transformer LINEBREAK figure 1: an illustration of our vit search space. mbconv refers to inverted residual blocks (sandler et al., 2018). all cnn and transformer blocks contain a stack of dynamic layers with searchable architecture configurations. additionally, we also search for the input resolutions. LINEBREAK kernel size expansion ratio se stride number of windows n n y LINEBREAK table 1: an illustration of our search space. mbconv refers to the inverted residual block (sandler et al., 2018). mbpool denotes the efficient last stage (howard et al., 2019). se represents the squeeze and excite layer (hu et al., 2018). transformer stands for the transformer blocks (vaswani et al., 2017). for mbconv blocks, the expansion ratio refers to the expansion ratio of the depth-wise convolution layer. for transformer layers, it refers to the mlp expansion ratio. for each transformer block, we use 3 × 3 depth-wise convolution with stride 2 for down-sampling and the down-sampling layer is placed as the first layer for that block. LINEBREAK block, we search for the best number of windows, hidden feature dimensions (denoted as width in table 1)1, depths and mlp expansion ratios. compared to cnn blocks, one special search dimension for transformer blocks is the number of windows k. when the number of windows k is greater than 1, we follow swin transformer (liu et al., 2021) and partition the input tokens into k groups. we then compute the self-attention weights for each group separately to reduce computational cost. standard global self-attention is a special case of k = 1. in this work, we only search the number of windows for the first transformer block, as the input resolutions to the other transformer blocks are already small after 4 times of down-sampling. similar to the search range of alphanet, the smallest sub-network in our search space has 190m flops and the largest sub-network has flops of 1,881m. we refer the reader to appendix b for more description of our search space. LINEBREAK naive supernet-based nas fails to find accurate vits we first closely follow the previous best practices in alphanet (wang et al., 2021a) for the supernet training. we train the supernet for 360 epochs on imagenet (deng et al., 2009). at each training step, we adopt the sandwich sampling rule (yu et al., 2018) and sample four sub-networks: the smallest sub-network, the supernet (a.k.a. the largest sub-network), and two random sub-networks. all small sub-networks are supervised by the supernet with α-divergence-based kd; see algorithm 1 in appendix c.1 for an overview of the supernet training procedure. additionally, as our candidate networks contain transformer blocks, we further incorporate the best training recipe from levit (graham et al., 2021) by replacing the sgd optimizer with adam (kingma & ba, 2014) and leveraging an external pre-trained teacher model for the best accuracy. specifically, we use the pre-trained teacher to supervise the supernet and still constrain all other small sub-networks to learn from the supernet. in this work, we always use an efficientnet-b5 (tan & le, 2019) with 83.3% top-1 accuracy on imagenet as the teacher to train our vit supernet unless otherwise specified. LINEBREAK we plot the training curves of the smallest sub-network and the largest sub-network in figure 2. we find both the smallest sub-network and the largest sub-network from our search space converge poorly compared to the cnn baseline. specifically, the validation accuracy of both the smallest and the LINEBREAK 1hidden feature dimension equals the number of heads times the feature dimension of each head. in our LINEBREAK search space, we fix the head dimension to be 8, and only searching for the number of heads. LINEBREAK c c a LINEBREAK l a v 1 p o t LINEBREAK t e n e g a m LINEBREAK i LINEBREAK c c a LINEBREAK l a v 1 p o t LINEBREAK t e n e g a m LINEBREAK i LINEBREAK training epoch (a) the smallest sub-network LINEBREAK training epoch (b) the largest sub-network (the supernet) LINEBREAK figure 2: (a-b) show the training curves of the smallest sub-network and the largest sub-network (i.e., the supernet), respectively. note that alphanet is trained without external teacher models. LINEBREAK flops (m) scratch supernet LINEBREAK smallest largest LINEBREAK alphanet deit levit 76.8 82.2 LINEBREAK table 2: imagenet top-1 accuracy from subnetworks trained from scratch vs. results from sub-networks sampled from the supernet. LINEBREAK table 3: imagenet top-1 accuracy from the smallest and the largest sub-network by using different training recipes. LINEBREAK largest sub-network is saturated at around the 250-th epoch, and the final accuracy is much worse than the cnn baselines. to understand the inferior model performance, we investigate the potential issues of our vit supernet training from the following three directions. LINEBREAK investigation 1: is our search space designed badly? we seek to understand if the performance gap is caused by a bad search space design. to verify, we randomly pick four sub-networks from the search space with computation cost ranging from 190m to 591m flops. then, we train these networks from scratch with the same data augmentation and regularization. as we can see from table 2, the sub-networks trained from scratch outperform the sub-networks sampled from the supernet. note that from previous works (e.g. yu et al., 2020a), supernet often learns more accurate sub-networks compared to the training from scratch performance, by taking advantage of inplace knowledge kd and weight-sharing. our observations in table 2 indicate that the poor performance does not come from the search space but from the interference with the training of the supernet. LINEBREAK investigation 2: are the training settings suitable for vits? our default training settings from alphanet are originally optimized for cnns only. compared with alphanet, recent vit methods, e.g., deit and levit, suggest to use stronger data augmentation schemes (e.g., a combination of cutmix (yun et al., 2019), mixup (zhang et al., 2017), randaugment (cubuk et al., 2020), random erasing (zhong et al., 2020), and repeated augmentation) and stronger regularization (e.g., large weight decay, large drop path probability) for training. we evaluate the effectiveness of these vit specific training recipes and summarize our findings in table 3. as we can see from table 3, deit- or levit-based training recipe produces even worse accuracy compared to the results from alphanet-based training. LINEBREAK investigation 3: saturated supernet training due to gradient conflicts? compared to the standard single network training, a major difference of supernet training is that multiple networks are sampled and trained at each step. we hypothesize that the training loss from the supernet and that from the sub-networks may yield conflicting gradients due to the heterogeneous and complex structures of networks, and the conflict gradients may consequently lead to slow convergence and undesirable performance. LINEBREAK to verify this hypothesis, we compute the cosine similarity between the gradients from the supernet and the averaged gradients from the sub-networks. a negative cosine similarity indicates the supernet and sub-networks produce conflict gradients and tend to update model parameters in opposite directions. to quantitatively examine the gradient conflict issue, we go through the entire imagenet LINEBREAK epoch alphanet vit LINEBREAK table 4: an estimation of negative cosine similarity ratio (gradient conflict ratio) between the supernet gradient and the averaged gradient of the sub-networks. LINEBREAK training set and calculate the percentage of negative cosine similarity between the gradients of supernet and sub-networks among all training images at a per layer granularity. the gradients are computed under the same data augmentation and regularization as the supernet training stage. for alphanet, we train the model using its official code 2. as shown in table 4, our vit supernet suffers from more severe gradient conflicts compared to the cnn baseline. according to existing works in multi-task learning, large gradient conflict ratios may result in significant accuracy drop even for binary classification problems (see figure 3 in du et al. (2018) and figure 4(b) in yu et al. (2020b)). we hypothesize that the inferior performance of our vit supernet is mainly caused by the large percentage of disagreements between the supernet gradients and the subnetworks gradients. LINEBREAK gradient conflict aware supernet training LINEBREAK we propose to improve the vit supernet training by addressing the gradient conflict issue between the supernet and the sub-networks from three aspects: 1) manually resolving the gradient conflict by projecting the supernet gradients to the normal vector of the sub-networks gradients; 2) introducing switchable scaling layers to the search space to give more optimization freedom for sub-networks; 3) reducing data augmentation and regularization to provide easier training signals. LINEBREAK gradient projection to prioritize sub-networks update our first idea is to focus on training the sub-networks whenever gradients from the supernet and the gradients from the sub-networks conflicted with each other. as we are interested in the sub-networks from the 200m to 800m flops range, we propose to prioritize the optimization of the sub-networks over the supernet when gradient conflicts are observed. let ∇(cid:96)sup and ∇(cid:96)sub denote the gradients of the supernet and the sub-networks, respectively. to prioritize sub-networks training, we always project ∇(cid:96)sup to the normal vector of ∇(cid:96)sub to avoid gradient conflicts when the cosine similarity between ∇(cid:96)sup and ∇(cid:96)sub is negative. the overall accumulated gradient at each training iteration with projection can be written as follows, LINEBREAK figure 3: a basic transformer layer with scaling. activated components are the neurons selected in the forward path for one sub-network. ‘c1’ and ‘c2’ represent the number of channels activated in a selfattention layer and mlp, respectively. LINEBREAK g = ∇(cid:96)sub + proj(∇(cid:96)sup) with LINEBREAK if cos(∇(cid:96)sup, ∇(cid:96)sub) ≥ 0, LINEBREAK proj(∇(cid:96)sup) = LINEBREAK ∇(cid:96)sup − LINEBREAK ∇(cid:96)(cid:62) sup∇(cid:96)sub (cid:107)∇(cid:96)sub(cid:107)2 ∇(cid:96)sub note that cos(∇(cid:96)sub, proj(∇(cid:96)sup)) = 0 if cos(∇(cid:96)sup, ∇(cid:96)sub) < 0, which ensures the gradient cosine similarity is non-negative. in sandwich sampling, since several sub-networks are sampled in each iteration, (cid:96)sub is computed as the summation of the gradients from all sub-networks. note similar ideas of gradient projection have also been explored in multi-tasks learning, see e.g., yu et al. (2020b); du et al. (2018); real et al. (2019); dery et al. (2021). LINEBREAK otherwise. LINEBREAK while the gradient projection in eqn. (1) eliminates the gradient conflicts, it may lead to slow convergence as the resulting gradients are biased. hence, we also propose the follow two techniques to reduce the gradient conflicts from a search space design and training strategy refinement perspective. LINEBREAK 2https://github.com/facebookresearch/alphanet LINEBREAK switchable scaling layer motivated by slimmable nn (yu et al., 2018), we introduce additional switchable scaling layers to allow sub-networks with different layer widths and depths to re-scale their features in a privatized way. specifically, for each transformer layer, a switchable scaling layer is introduced at the output of the self-attention (sa) and the mlp, respectively, as shown in figure 3. assume x[c,d] ∈ rc is a input feature of a scaling layer, with c the feature dimension (i.e. the number of selected channels in the forward path) and d the index of this layer in a transformer search block. the scaling layer transforms x[c,d] as w[c,d] (cid:12) x[c,d]. here w[c,d] ∈ rc are learnable parameters and (cid:12) denotes element-wise multiplication. for each transformer block (see table 1), each different configuration of [c, d] will specify a set of independent switchable scaling layers. following cait (touvron et al., 2021), we initialize all scaling factors w to a small value (e.g. 10−4) for fast convergence and stable training. intuitively, the switchable scaling layers effectively increase the model capacity of sub-networks and give the sub-networks more optimization flexibility. LINEBREAK reduced data augmentation and regularization furthermore, we observe that the supernet and the sub-networks are more likely to conflict with each other in the presence of stronger data augmentations and stronger regularization, e.g., large weight decay, large dropconnect (wan et al., 2013). hence, we simplify the alphanet training recipe and use a weaker data augmentation scheme - randaugment (cubuk et al., 2019) with both the number of augmentation transformations and the magnitude set to 1, and remove the regularization, e.g. dropconnect (wan et al., 2013), dropout and weight decay, from the training; see table 5 for a comparison. LINEBREAK method alphanet ours LINEBREAK data augmentation autoaugment randaugment (n = 1, m = 1) LINEBREAK weight decay dropconnect dropout LINEBREAK table 5: an illustration of our simplified training settings, where n is the number of augmentation transformations and m the number of magnitudes in randaugment. a typical setting of randaugment is n=2 and m=9 for training a single network; see cubuk et al. (2020); liu et al. (2021). LINEBREAK experiments LINEBREAK y c a r u c c a LINEBREAK n o i t a d i l a v LINEBREAK 1 p o t LINEBREAK m flops LINEBREAK figure 4: comparison with prior-art cnns and vits on imagenet. here “+t” indicates methods that are trained with external teacher models. note that mobile-former (chen et al., 2021c) and mnasnet (tan et al., 2019) are trained without additional teacher models. LINEBREAK imagenet LINEBREAK we first retrain our vit supernet with our proposed gradient conflict reduction techniques on imagenet (deng et al., 2009); we then conduct an evolutionary search on a subset of the imagenet training dataset to search the accuracy vs. flops pareto following (wang et al., 2021b). we refer the reader to appendix c.1 for more details. note all the models are directly sampled from the supernet without retraining or finetuning. LINEBREAK we call our discovered as nasvit models and compare with state-of-the-art efficient cnns and vits, including fbnetv3 (dai et al., 2020), alphanet (wang et al., 2021a), levit (graham et al., 2021) and segformer (xie et al., 2021), on both image classification (e.g., imagenet) and semantic segmentation benchmarks (e.g., cityscapes and ade20k). LINEBREAK we compare our nasvit models with state-of-the-art nas-based cnns, including alphanet (wang et al., 2021a) and fbnetv3 (dai et al., 2020), and recently-proposed efficient vits, e.g., levits. LINEBREAK settings note that our vit supernet is trained with a pretrained efficient-b5 teacher model (83.3% top-1) model. for fair comparison, we retrain alphanet with the same teacher. for fbnet-v3 and LINEBREAK group LINEBREAK method alphanet-a0 nasvit-a0 (ours) levit (graham et al., 2021) nasvit-a1 (ours) alphanet-a2 fbnetv3 (dai et al., 2020) levit nasvit-a2 (ours) alphanet-a4 nasvit-a3 (ours) fbnetv3 nasvit-a4 (ours) alphanet levit nasvit-a5 (ours) fbnetv3 autoformer* (chen et al., 2021a) pit-xs (heo et al., 2021) vitas-d* (su et al., 2021) nasvit (supernet) (ours) cvt-13-nas* (wu et al., 2021) swin-tiny* (liu et al., 2021) cvt-13* (wu et al., 2021) t2t-vit-14* (yuan et al., 2021a) deepvit (zhou et al., 2021) LINEBREAK m flops top-1 accuracy (%) LINEBREAK table 6: comparison with prior art efficient cnns and vits on imagenet. the reported alphanet models are trained with an external teacher model. the “*” indicates that the vits are trained without external teacher models. LINEBREAK levit models, these models already use teachers with better performance than efficient-b5 for training, and therefore we directly report their results following their papers. specifically, fbnet-v3 use a regnety-32g with 84.5% top-1 and levit use a regnety-16g with 83.6% top-1 as the teacher model, respectively. LINEBREAK results we summarize our results in both table 6 and figure 4. our discovered nasvit models outperform all evaluated cnn and vit baselines. our models are the first models with transformers blocks that outperform state-of-the-art efficient cnns with similar flops on imagenet. for example, with < 600m flops, our nasvit-a4 achieves 81.4% top-1 accuracy on imagenet. as a reference point, a resnet-50 model (4g flops) achieves 81.5% top-1 accuracy by distilling from a bit (kolesnikov et al., 2020) teacher (87.5% top-1 accuracy) with 1200 epochs of training (beyer et al., 2021). LINEBREAK u o i m LINEBREAK u o i m LINEBREAK (a) g flops (cityscapes) LINEBREAK (b) g flops (ade20k) LINEBREAK figure 5: results of our method and baselines on semantic segmentation. (a-b) show the results on the cityscapes and ade20k validation set, respectively. LINEBREAK semantic segmentation
| 6
|
[
108.249,
114.4860784,
247.7570989,
124.4486784
] |
chDrutUTs0K.pdf
| 2,023
| 2
|
LINEBREAK popgym: benchmarking partially observable reinforcement learning LINEBREAK steven morad, ryan kortvelesy, matteo bettini, stephan liwicki, amanda prorok LINEBREAK abstract LINEBREAK real world applications of reinforcement learning (rl) are often partially observable, thus requiring memory. despite this, partial observability is still largely ignored by contemporary rl benchmarks and libraries. we introduce partially observable process gym (popgym), a two-part library containing (1) a diverse collection of 15 partially observable environments, each with multiple difficulties and (2) implementations of 13 memory model baselines – the most in a single rl library. existing partially observable benchmarks tend to fixate on 3d visual navigation, which is computationally expensive and only one type of pomdp. in contrast, popgym environments are diverse, produce smaller observations, use less memory, and often converge within two hours of training on a consumer-grade gpu. we implement our high-level memory api and memory baselines on top of the popular rllib framework, providing plug-andplay compatibility with various training algorithms, exploration strategies, and distributed training paradigms. using popgym, we execute the largest comparison across rl memory models to date. popgym is available at https: //github.com/proroklab/popgym. LINEBREAK introduction LINEBREAK datasets like mnist (lecun et al., 1998) have driven advances in machine learning (ml) as much as new architectural designs (levine et al., 2020). comprehensive datasets are paramount in assessing the progress of learning algorithms and highlighting shortcomings of current methodologies. this is evident in the context of rl, where the absence of fast and comprehensive benchmarks resulted in a reproducability crisis (henderson et al., 2018). large collections of diverse environments, like the arcade learning environment, openai gym, procgen, and dmlab provide a reliable measure of progress in deep rl. these fundamental benchmarks play a role in rl equivalent to that of mnist in supervised learning (sl). LINEBREAK the vast majority of today’s rl benchmarks are designed around markov decision processes in mdps, agents observe a markov state, which contains all necessary information to (mdps). solve the task at hand. when the observations are markov states, the markov property is satisfied, and traditional rl approaches guarantee convergence to an optimal policy (sutton & barto, 2018, chapter 3). but in many rl applications, observations are ambiguous, incomplete, or noisy – any of which makes the mdp partially observable (pomdp) (kaelbling et al., 1998), breaking the markov property and all convergence guarantees. furthermore, ghosh et al. (2021) find that policies trained under the ideal mdp framework cannot generalize to real-world conditions when deployed, with epistemic uncertainty turning real-world mdps into pomdps. by introducing memory (referred to as sequence to sequence models in sl), we can summarize the observations1 therefore restoring policy convergence guarantees for pomdps (sutton & barto, 2018, chapter 17.3). LINEBREAK despite the importance of memory in rl, most of today’s comprehensive benchmarks are fully observable or near-fully observable. existing partially observable benchmarks are often navigationbased – representing only spatial pomdps, and ignoring applications like policymaking, disease diagnosis, teaching, and ecology (cassandra, 1998). the state of memory-based models in rl libraries is even more dire – we are not aware of any rl libraries that implement more than three LINEBREAK 1strictly speaking, the agent actions are also required to guarantee convergence. we consider the previous LINEBREAK action as part of the current observation. LINEBREAK (a) stateless cartpole stateless pendulum LINEBREAK and LINEBREAK (b) battleship, concentration, higher lower and mine sweeper LINEBREAK (c) labyrinth escape and explore LINEBREAK figure 1: renders from select popgym environments. LINEBREAK or four distinct memory baselines. in nearly all cases, these memory models are limited to frame stacking and lstm. LINEBREAK to date, there are no popular rl libraries that provide a diverse selection of memory models. of the few existing pomdp benchmarks, even fewer are comprehensive and diverse. as a consequence, there are no large-scale studies comparing memory models in rl. we propose to fill these three gaps with our proposed popgym. LINEBREAK contributions LINEBREAK popgym is a collection of 15 partially observable gym environments (figure 1) and 13 memory baselines. all environments come with at least three difficulty settings and randomly generate levels to prevent overfitting. the popgym environments use low-dimensional observations, making them fast and memory efficient. many of our baseline models converge in under two hours of training on a single consumer-grade gpu ( table 1, figure 2). the popgym memory baselines utilize a simple api built on top of the popular rllib library (liang et al., 2018), seamlessly integrating memory models with an assortment of rl algorithms, sampling, exploration strategies, logging frameworks, and distributed training methodologies. utilizing popgym and its memory baselines, we execute a large-scale evaluation, analyzing the capabilities of memory models on a wide range of tasks. to summarize, we contribute: LINEBREAK 1. a comprehensive collection of diverse pomdp tasks. LINEBREAK 2. the largest collection of memory baseline implementations in an rl library. LINEBREAK 3. a large-scale, principled comparison across memory models. LINEBREAK related work LINEBREAK there are many existing rl benchmarks, which we categorize as fully (or near-fully) observable and partially observable. in near-fully observable environments, large portions of the the markov state are visible in an observation, though some information may be missing. we limit our literature review to comprehensive benchmarks (those that contain a wide set of tasks), as environment diversity is essential for the accurate evaluation of rl agents (cobbe et al., 2020). LINEBREAK fully and near-fully observable benchmarks LINEBREAK the arcade learning environment (ale) (bellemare et al., 2013) wraps atari 2600 roms in a python interface. most of the atari games, such as space invaders or missile command are fully observable (cobbe et al., 2020). some games like asteroids require velocity observations, but models can recover full observability by stacking four consecutive observations (mnih et al., 2015), an approach that does not scale for longer timespans. even seemingly partially-observable multi-room games like montezuma’s revenge are made near-fully observable by displaying the player’s score and inventory (burda et al., 2022). LINEBREAK openai gym (brockman et al., 2016) came after ale, implementing classic fully observable rl benchmarks like cartpole and mountaincar. their gym api found use in many other environments, including our proposed benchmark. LINEBREAK cobbe et al. (2020) find that randomly generated environments are critical to training general agents, showing policies will overfit to specific levels otherwise. they propose procgen: 16 procedurally generated environments with pixel-space observations. most environments are fully or near-fully observable, although a few environments provide a partially observable mode, effectively turning them into 2d area coverage (navigation) tasks. procgen motivates popgym’s use of random level generation. LINEBREAK partially observable benchmarks LINEBREAK when enumerating partially observable benchmarks, we find many are based on 3d first-person navigation. deepmind lab (beattie et al., 2016) (dmlab) is a 3d first-person view navigation simulator based on the quake 3 physics engine. it implements various tasks such as collecting fruits, maze exploration, and laser tag. vizdoom (kempka et al., 2016) is another 3d navigation simulator based on the pc game doom. it gives the agent weapons and adds computer-controlled characters that can shoot at the player. miniworld (chevalier-boisvert, 2018) is a third 3d first-person view navigation simulator that is easier to install than dmlab or vizdoom. minigrid (chevalier-boisvert et al., 2018) and gridverse (baisero & katt, 2021) are 2d navigation simulators with a first-person view. unlike the previously mentioned 3d simulators, agents converge on gridworld environments much faster due to the smaller observation space. this makes it a popular benchmark for memory models. LINEBREAK there are few pomdp libraries that provide tasks beyond navigation. behaviour suite (bsuite) evaluates agents on a variety of axes, one of which is memory (osband et al., 2020), but they only provide two pomdps. similar to our benchmark, (zheng & tellex, 2020) provide classic pomdps with low-dimensional observation spaces. but their tasks are solvable without neural networks and are not difficult enough for modern deep rl. ni et al. (2022) provide 21 environments, most of which are a special case of pomdp known as latent mdps (kwon et al., 2021), where a specific mdp is chosen from a set of possible mdps at the beginning of an episode. (morad et al., 2022) provides three pomdps, which is insufficient for a benchmark. LINEBREAK we briefly mention the starcraft (samvelyan et al., 2019) and vmas (bettini et al., 2022) benchmarks because multi-agent environments are intrinsically partially observable, but we focus specifically on single-agent pomdps. LINEBREAK shortcomings of current benchmarks LINEBREAK popular fully observable benchmarks use pixel-based observation spaces, adding a layer of complexity that takes an order of magnitude longer to train when compared against state-based observation counterparts (seita, 2020). in fully observable environments, visually pleasing results are worth a few extra hours training. this dogma persists into partial observability, where environments often take 10x longer to converge than their fully observable counterparts. popular benchmarks using 3d graphics take hundreds of billions of timesteps (parisotto et al., 2020) and multiple weeks (morad et al., 2021) on a gpu to train a single policy to convergence. until sample efficiency in partially observable rl improves, we must forgo pixel-based observations or continue to struggle with reproducibility. LINEBREAK many partially observable tasks with pixel-based observation spaces are based on some form of navigation (ramani, 2019). although navigation can be a partially observable task, wall following behavior in perfect mazes guarantees complete area coverage without the need for memory. when mazes are imperfect (i.e. contain cycles), deterministic wall following can get stuck in infinite loops. however, rl policies often have some amount of stochasticity that can break out of these loops. kadian et al. (2020) and morad et al. (2021) inadvertently show that memory-free navigation agents learn wall following strategies2 that are surprisingly effective in imperfect real-world mazes. we confirm these findings with our experiments, showing that memory-free agents are competitive with memory-endowed agents in certain navigation benchmarks. LINEBREAK all other (imperfect) mazes can be fully explored by storing no more than two past locations (observations) in memory (blum & kozen, 1978). navigation-based tasks like area coverage, moving to a coordinate, or searching for items can be reduced to the maze exploration task. we do not claim LINEBREAK 2https://en.wikipedia.org/wiki/maze-solving_algorithm#wall_follower LINEBREAK that navigation tasks are easy, but rather that it is important to have a variety of tasks to ensure we evaluate all facets of memory, such as memory capacity, that navigation tasks might miss. LINEBREAK existing memory baselines LINEBREAK the state of memory models in rl is even more bleak than the benchmarks. most libraries provide frame stacking and a single type of rnn. openai baselines (dhariwal et al., 2017), stablebaselines3 (raffin et al., 2021), and cleanrl (huang et al., 2021) provide implementations of ppo with frame stacking and an lstm. ray rllib (liang et al., 2018) currently implements frame stacking, lstm, and a transformer for some algorithms. ni et al. (2022) implement lstm, grus, and two model-based memory models. yang & nguyen (2021) provides recurrent versions of the ddpg, td3, and sac rl algorithms, which utilize grus and lstm. zheng & tellex (2020) implement multiple classical pomdp solvers, but these do not use neural networks, preventing their application to more complex tasks. there is currently no go-to library for users who want to compare or apply non-standard memory models. LINEBREAK a brief summary on memory
| 3
|
[
108.249,
510.1390784,
273.5025893,
520.1016784
] |
xYlJRpzZtsY.pdf
| 2,023
| 0
|
LINEBREAK roscoe: a suite of metrics for scoring step-bystep reasoning LINEBREAK olga golovneva, moya chen, spencer poff, martin corredor, luke zettlemoyer, maryam fazel-zarandi, asli celikyilmaz meta ai research {olggol, mpchen, spoff, mcorredor, lsz, maryamfazel, aslic}@meta.com LINEBREAK abstract LINEBREAK large language models show improved downstream task performance when prompted to generate step-by-step reasoning to justify their final answers (nye et al., 2021; wei et al., 2022). these reasoning steps greatly improve model interpretability and verification, but objectively studying their correctness (independent of the final answer) is difficult without reliable methods for automatic evaluation. we simply do not know how often the stated reasoning steps actually support the final end task predictions. in this work, we present roscoe, a suite of interpretable, unsupervised automatic scores that improve and extend previous text generation evaluation metrics. to evaluate roscoe against baseline metrics, we design a typology of reasoning errors and collect synthetic and human evaluation scores on commonly used reasoning datasets. in contrast with existing metrics, roscoe can measure semantic consistency, logicality, informativeness, fluency, and factuality — among other traits — by leveraging properties of step-by-step rationales. we empirically verify the strength of our metrics on five human annotated and six programmatically perturbed diagnostics datasets - covering a diverse set of tasks that require reasoning skills and show that roscoe can consistently outperform baseline metrics.1 LINEBREAK introduction LINEBREAK scaling language models has improved state-of-the-art performance on nearly every nlp benchmark (brown et al., 2020), with large language models (llms) performing impressively as few-shot learners (brown et al., 2020). despite these achievements, even the largest of these models still struggle with tasks including math word problems (hendrycks et al., 2021), symbolic manipulation (rytting & wingate, 2021), and commonsense reasoning (west et al., 2022). recent work has shown that prompting (wei et al., 2022; wang et al., 2022) or fine-tuning (lampinen et al., 2022) llms to generate step-by-step rationales can lead to improvements on reasoning tasks. some of these include small-scale analysis of specific error types within step-by-step rationales (lewkowycz et al., 2022; chowdhery et al., 2022), as shown in table 1. however, existing works primarily focus on end-task performance. although text generation evaluation metrics sometimes offer fine-grained quality evaluations (e.g., adequacy, fluency) against human scores (opitz & frank, 2021; leiter et al., 2022), these metrics generally treat the output as a whole, and many of these generative metrics operate on tasks such as summarization or machine-translation rather than reasoning. LINEBREAK 1code can be found at https://github.com/facebookresearch/parlai/tree/main/projects/ roscoe. annotated datasets can be downloaded from https://dl.fbaipublicfiles.com/parlai/ projects/roscoe/annotations.zip. LINEBREAK in this paper, we present roscoe, a suite of interpretable and fine-grained step-by-step generation evaluation metrics to address the above gaps. rather than providing one score that only evaluates the generated text on the overall, roscoe encapsulates fine-grained metrics under four perspectives: (1) semantic alignment defines to what extend the generated reasoning is coherent, and grounded with the source context; (2) logical inference evaluates if the generated reasoning steps are consistent within itself and checks for logical fallacies; (3) semantic similarity quantifies the degree of similarity between the generated reasoning and the context or between intermediate steps to capture hallucinations or repetitions; and (4) language coherence evaluates if the whole chain flows naturally. LINEBREAK table 1: step-by-step reasoning for logical inference task generated from 2-shot gpt-3 (text-davinci-002) (brown et al., 2020). error types are highlighted: logical or factual issues, partially correct, somewhat-relevant. full 2-shot exemplars are in appendix b. LINEBREAK context: shelley is from virginia, but is visiting that city with that famous market where they throw the fish. going home next tuesday! question: is it likely that shelly will be near the pacific ocean this weekend? gpt-3 step-by-step reasoning: LINEBREAK • no, it is not likely that shelley will be near the pacific LINEBREAK ocean this weekend. LINEBREAK • shelley is from virginia, which is on the east coast LINEBREAK of the united states. LINEBREAK • the pacific ocean is on the west coast. • shelley is visiting a city with a famous market, which LINEBREAK could be anywhere in the world. LINEBREAK to evaluate roscoe against existing metrics, we devise a taxonomy of reasoning errors for multi-step generations and use it to create synthetic data and collect human evaluations on commonly used reasoning datasets. our taxonomy and annotated datasets help us gain deeper insights into the causes of reasoning inconsistencies and weaknesses of llms. we evaluate roscoe with 18 fine-grained metrics under the above four perspectives. roscoe demonstrates performance gains against baseline evaluation metrics on all tasks that require reasoning over context. additional sensitivity analysis shows that roscoe is more robust when dealing with tasks that require logical and arithmetic reasoning. LINEBREAK • tuesday is her travel day, so she will likely not be LINEBREAK traveling this weekend. LINEBREAK contributions. (1) we propose a new taxonomy for reasoning errors, and use it for collecting human annotations and creating synthetic datasets. (2) using our taxonomy, we propose a new suite of metrics that focus on sequence and step level analysis of step-by-step reasoning. (3) we present extensive comparative analysis on 11 datasets of varied complex reasoning problems demonstrating the strengths of each metric, especially in terms of interpretability relative to baselines, and considerations for use. LINEBREAK related work LINEBREAK evaluating explanations. free-form natural language (nl) explanations of model decisions should enable accurate representation of the reasoning process and degree of plausibility (danilevsky et al., 2020; jacovi & goldberg, 2021; jacovi et al., 2021). a qualitative assessment of nl explanations with correctness labels collected from human judges was presented in (camburu et al., 2018). recent work has also investigated automatic metrics for natural language generation (nlg) evaluation including word overlap or embedding based similarly with human written explanations (clinciu et al., 2021). though fast and cost-effective, automatic metrics for nlg are not equipped to measure the logical inconsistencies or information gain with thinking steps (reiter, 2019; celikyilmaz et al., 2020). explanations have also been evaluated by collecting datasets, and running correlation analysis to investigate the degree to which an automatic metric correlates with human judgements of clarity, relevance and informativeness (leiter et al., 2022; welleck et al., 2022).although reliable, human evaluation is an expensive, domain specific, and time-consuming process. in comparison, roscoe provides generic automatic evaluation procedures that are domain and task specific. LINEBREAK automatic metrics. many nlg evaluation metrics exist in the literature including ones based on: n-gram match (lin, 2004), regression (sellam et al., 2020), embedding proximity (zhang et al., 2020), paraphrasing (thompson & post, 2020), generation as an evaluator (yuan et al., 2021); information alignment (deng et al., 2021); among others. although these metrics are easy to use, they evaluate the alignment of two texts as a whole and are not designed to assess individual reasoning steps. the closest metrics to ours are ctc (deng LINEBREAK table 2: taxonomy of step-by-step reasoning errors. full list of the error types with examples is illustrated in table 10. LINEBREAK error type LINEBREAK definition LINEBREAK grammar factuality hallucination redundancy repetition missing step coherency commonsense model lacks relations that should be known from general world (e.g., "all ducks are birds") arithmetic LINEBREAK faulty, unconventional, or controversial grammar usage information about an object (i.e. quantity, characteristics) or a named entity doesn’t match with the input context. information is not provided in the problem statement and is irrelevant or wrong explanation contains redundant information, which even though might be factual, is not required to answer the question step paraphrases information already mentioned in previous reasoning steps the content of the generated reasoning is incomplete and lacks required information to produce the correct answer. steps contradict each other or do not follow a cohesive story LINEBREAK error in math calculations LINEBREAK et al., 2021) and bartscore (yuan et al., 2021), as both introduce a set of interpretable metrics to evaluate the similarity between two texts. however, roscoe is unique in providing fine-grained interpretations of reasoning steps, determining contradictions, and identifying ordering issues in the reasoning narrative. LINEBREAK self-consistency with llms. recent work on improving llms performance on complex reasoning tasks uses an ensemble strategy called self-consistency (wang et al., 2022). this method samples a diverse set of reasoning paths from a language model via reasoning traces prompting and returns the most consistent final answer in the set. other work evaluates the diversity of a reasoning path (li et al., 2022), or the consistency of an inference step (creswell et al., 2022) or finetune llms (zelikman et al., 2022) to improve on difficult nlp tasks. in contrast to these works, we present a suit of metrics that focus on determining the type of the error (e.g., commonsense or logical inconsistency) in a reasoning path, if one exists. LINEBREAK reasoning error taxonomy and datasets construction LINEBREAK problem formulation. our goal is to score step-by-step rationales generated by a language model. we assume that the model is given a source context s = {s1, · · · , st } of t-sentences indicating a problem statement followed by a question and is prompted to generate step-by-step reasoning (nye et al., 2021). we refer to this as a hypothesis h = {h1, · · · , hn } of n-steps, including a final answer as the last step. we do not assume availability of gold step-by-step reasoning references r = {r1, · · · , rk} of k-steps. LINEBREAK taxonomy. we propose a new taxonomy of generic reasoning errors for language problem solving. we first conduct manual preliminary analysis on different types of llms reasoning errors using five human judged datasets described below. based on our analysis, we identified nine error types centered on the overall reasoning chain (i.e., the quality of the step-by-step thinking, including consistency with the context and commonsense reasoning). our taxonomy also includes fine-grained errors marking inconsistency of a reasoning step with the previous steps, whether each step contributes to the final decision, and overall logical inference or fluency issues. the definition of error types is in table 2, and table 10 provides examples. LINEBREAK datasets and annotations. to evaluate roscoe, we select datasets covering diverse set of tasks that require reasoning skills (e.g., logical, arithmetic, and commonsense reasoning tasks). we separate these datasets into two: (1) diagnostics datasets that contain gold standard step-wise reasoning chains, where we synthetically perturb some of the reasoning steps to introduce different generation errors (e.g., missing step, mathematical error, etc.); (2) human judged datasets with model generated step-by-step reasoning outputs where the reasoning error evaluations are solicited from expert judges. we investigate these in §5. LINEBREAK reasoning scorer: roscoe LINEBREAK we present our fine-grained metrics under four perspectives: semantic alignment, semantic similarity, logical inference and language coherence. each metric is bounded within [0, 1], where 1 indicates the perfect score LINEBREAK and 0 corresponds to failure. a metric is reference-free or unsupervised when it uses the source and hypothesis (h → s), while reference-based or supervised when evaluated between hypothesis and reference (h → r). LINEBREAK semantic alignment metrics (roscoe-sa) LINEBREAK at the core of the roscoe semantic alignment2 metrics is the reasoning alignment vector from the n -step hypothesis h to the source s of length t : r-align(h → s) = {α1, α2, · · · , αn }, where each alignment value αi = r-align(hi → s) = [1 + maxt j=1(cos(hi, sj)]/2 ∈ [0, 1] is the normalized cosine similarity between hypothesis step and most similar sentence in a context, and explicitly measures the grounding of the step-wise reasoning with respect to the source text (illustrated in app. d, fig. 3). we estimate the alignment vector r-align(h → s) by matching source text and the reasoning chains on the embeddings of tokens and individual reasoning steps. a similar information alignment score is introduced in ctc (deng et al., 2021) to measure the confidence that the information of the i-th source document token sj is grounded by a hypothesis token hi. our reasoning alignment is different in that we measure if a hypothesized reasoning step hi supports the source context s. our proposed metrics are summarized in table 3. LINEBREAK score LINEBREAK description LINEBREAK table 3: semantic alignment metrics (roscoe-sa). LINEBREAK faithfulness-step (h → s) LINEBREAK faithfulness-token (h → s) LINEBREAK informativeness-step (info-step) (h ↔ s) LINEBREAK repetition-token (hi → hj) LINEBREAK hallucination (h → (s, r)) LINEBREAK redundancy (h → r) LINEBREAK semantic coverage-step ((r, h) → s) LINEBREAK reasoning alignment (h → r) LINEBREAK commonsense (r → (h, s)) LINEBREAK missing step (r→h) LINEBREAK this step-level score is based on the alignment from the hypothesis steps to the source sentences, and is calculated as the mean reasoning alignment score over the steps of reasoning (see illustration in appendix d, figure 3): (1/n ) (cid:80)n i=1 r-align(hi → s). faithfulness measures if the model misinterpreted the problem statement, or the reasoning chain is too vague, irrelevant, or misuses information. LINEBREAK i=1[r-align(hi → s) + (cid:80)mi LINEBREAK we extend step-level embeddings of the faithfulness-step by measuring similarities between the token embeddings: (1/(n + m )) (cid:80)n j=1 r-aligntoken(hi,j → s)], as shown in app. d, fig. 3. mi is the number of tokens in step hi, m = (cid:80)n i=1 mi is the total number of tokens in the reasoning chain, hi,j is the jth token in ith step, and r-aligntoken is the alignment vector from tokens in step hi to all tokens in s. measures how well information present in the source is used in the reasoning steps: [(1/t ) (cid:80)t t=1 r-align(st → h) + (1/n ) (cid:80)n i=1 r-align(hi → s)]/2. info-step gives a higher score to reasoning steps that are well-grounded with respect to the source, and identifies the degree of information from source that is covered by the generated hypothesis. a lower info-step score corresponds to the reasoning steps that are not related to the source sentences or have missed information provided in the context. LINEBREAK to identify repeated, or paraphrased steps, we look at the token alignment scores between all steps in the hypothesis chain: 1 − maxi=2..n maxj=1···i−1[(1/mi) (cid:80)mi l=1 r-aligntoken(hi,l → hj)]. for each pair of sentences, we look at the mean token alignment, and find those sentences that maximize this alignment score. in other words, repetition-token will punish chains where there are at least two steps with high overlap in token embeddings. LINEBREAK to find irrelevant reasoning steps, we use alignment score to identify steps that are both not related to the context and not in the reference chain (to avoid punishing for possibly relevant commonsense knowledge): 1 − maxi=1..n ([1 − r-align(h → s)] · [1 − r-align(h → r)]). here, 1 is an all-ones vector, and (·) is the element-wise product. LINEBREAK to find chains that contain information that is not required to solve the problem (i.e., redundant steps), we identify those hypothesis steps that are least aligned with the the reference steps: mini=1..n r-align(hi → r). this score punishes chains with steps that are not required for the correct solution. LINEBREAK i=1 r-align(hi → s)|, where |·| indicates absolute value. LINEBREAK this score can be viewed as a measure of how easily a gold reference could be generated by the hypothesis. it compares step level grounding of the hypothesis with respect to the source, and the gold reference grounding: |(1/t ) (cid:80)k t=1 r-align(rt → s) − (1/n ) (cid:80)n the most straightforward way to evaluate the correctness of the hypothesis chain is to compare the degree of the overlap between the hypothesis and the reference. one way of doing that is to measure the reasoning alignment between them: (1/n ) (cid:80)n measures if hypothesis lacks steps that are not stated in the source, but are required to solve the problem such as general world knowledge (e.g., "velocity is distance divided by time", "1 foot is 12 inches", "all ducks are birds", etc.). we detect such information by extracting steps in the reference reasoning that are not grounded by the source text: 1 − maxi=1..k([1 − r-align(r → h)] · [1 − r-align(r → s)]). LINEBREAK i=1 r-align(hi → r). LINEBREAK to identify steps that are missing from the hypothesis but could be required to solve the problem, we look at the alignment between reference and the hypothesis, similar to redundancy. however, here we go through each step in the reference, and check if there is a similar step in the hypothesis: mini=1..k(r-align(ri→h)). LINEBREAK 2semantic alignment refers to determination of relations between concepts with the same or a similar intended LINEBREAK meaning (agirre et al., 2013). LINEBREAK semantic similarity metrics (roscoe-ss) LINEBREAK semantic similarity metrics quantify the degree of semantic equivalence between pieces of text. as opposed to the roscoe-sa metrics, roscoe-ss considers text as a whole, rather than relying on text units comparisons. we propose the following metrics summarized in table 4. LINEBREAK score LINEBREAK description LINEBREAK table 4: semantic similarity metrics (roscoe-ss). LINEBREAK informativeness-chain (info-chain) (h→s) LINEBREAK similar to info-step, this metric quantifies the degree of agreement between the hypothesis chain and the source and is calculated as [1 + cos(h, s)]/2. we embed reasoning chain and source context as a whole, as opposed to using step-wise embeddings in *-step types of metrics introduced in table 3. LINEBREAK repetition-step (hi↔hj) LINEBREAK measures repetition-related errors on the step level by checking if it paraphrases information already mentioned in the previous steps: (1 − maxi=2..n maxj=1···i−1[cos(hi, hj)])/2. unlike repetition-token, which is orderless and compares individual tokens in pairs of steps, repetition-step considers step embeddings similarity and is more robust to changing contexts. LINEBREAK semantic coveragechain (r ↔ h) LINEBREAK reflects the overall degree of similarity between the reference and hypothesis chains, comparing reference and hypothesis embeddings as a whole: [1 + cos(r, h)]/2. LINEBREAK logical inference metrics (roscoe-li) LINEBREAK logical inference metrics (table 5) measure logical errors between pieces of text. we use an nli model that was trained to classify hypothesis-context pairs into entailment, neutral, and contradiction classes (laurer et al., 2022) to infer the contradiction probability pcontr. LINEBREAK score LINEBREAK description LINEBREAK table 5: logical inference metrics (roscoe-li). LINEBREAK self-consistency (hi↔hj) source-consistency (h ↔ s) LINEBREAK measures logical entailment errors within the reasoning steps: 1 − maxi=2..n maxj<i pcontr(hi, hj). this metric will punish chains where there is a pair of steps that are likely to contradict each other. LINEBREAK measures logical entailment errors between any generated reasoning h and the source context s: 1 − maxi=1..n maxj=1..t pcontr(hi, sj). specifically, for each reasoning step we measure the probability that it contradicts any sentence in the context. we take the maximum probability of contradiction over all steps, following the logic that a contradiction anywhere in the reasoning chain signals a failure of the overall argument. LINEBREAK language coherence metrics (roscoe-lc) LINEBREAK to evaluate language coherence (table 6), we use perplexity ppl as scored by the gpt2-large model (radford et al., 2019), and english grammatical acceptability pgram as scored by the classifier model from krishna et al. (2020). both models were used as-is with no finetuning. LINEBREAK table 6: language coherence metrics (roscoe-lc). LINEBREAK score LINEBREAK description LINEBREAK perplexity-chain (h) LINEBREAK perplexity-step (hi) LINEBREAK grammar (hi) LINEBREAK average perplexity of all tokens in the generated reasoning steps: 1/ppl(h). the context used to score each token is the previous tokens in the current and all previous steps. steps are joined with a space character. to keep the range and orientation consistent with the other scores we invert the perplexity. LINEBREAK average perplexity of all tokens in the generated reasoning steps, where the context used to score each token is only the previous tokens within the current step: 1/[(1/n ) (cid:80)n i=0 ppl(hi)]. to keep the range and orientation consistent with the other scores we invert the perplexity. probability of grammatical acceptability of each step, averaged over all steps: (1/n ) (cid:80)n LINEBREAK i=0 pgram(hi). LINEBREAK experimental setup LINEBREAK diagnostics datasets. we construct our first category of labeled datasets by generating perturbations — i.e., deterministic modifications — on half of the reference reasoning steps and assign binary labels based on whether or not a chain has been perturbed. we select seven language understanding and entailment datasets LINEBREAK that require complex problem solving skills, and have reference step-by-step explanations: entailment-bank (deductive reasoning) (dalvi et al., 2021), proofwriter (logical reasoning) (tafjord et al., 2021); three arithmetic reasoning datasets math (hendrycks et al., 2021), asdiv (miao et al., 2020) and aqua (liang et al., 2018); eqasc (explanations for commonsense question answering) (aggarwal et al., 2021), and strategyqa (question answering with implicit reasoning strategies) (geva et al., 2021) (see dataset details in app. e.1). using our taxonomy, we introduce 12 error perturbation rules and apply on these datasets to construct our diagnostics datasets (see details in app. e.3). LINEBREAK human judged datasets. we select our second category of datasets from commonly used complex reasoning tasks: gsm8k (arithmetic reasoning) (cobbe et al., 2021), drop (discrete reasoning) (dua et al., 2019), esnli (deductive and commonsense reasoning) (camburu et al., 2018), cosmos-qa (commonsense reasoning) (huang et al., 2019) and semeval (ostermann et al., 2018) (commonsense reasoning). wei et al. (2022) provide model generated chain of thought reasoning steps for gsm8k. we used chains produced by the 175b_verification model to annotate for reasoning errors. for other datasets, we prompt gpt-3 llm (brown et al., 2020) with few-shot in-context examples to obtain step-by-step reasoning sequences (see examples in app. e.2). we use the error types in our taxonomy in table 2 as human evaluation perspectives of reasoning errors where we solicit five expert annotators3. the data collection interface provided judges with the source text (e.g., source and a question, or hypothesis, premise, and a question if they entail) and associated reasoning text clearly separated into individual steps. judges were asked to rate the chain as a whole (e.g., on overall quality) as well as each individual step (e.g., commonsense errors, contradicts with the previous steps). app. table 16 summarizes the distribution of error types annotated by the judges. see app. f for details. LINEBREAK roscoe training. to obtain reasoning step embeddings, we finetune simcse (gao et al., 2021), a supervised sentence similarity model extending the roberta word embedding model (liu et al., 2019) on multi-step reasoning datasets we listed in §5 (see details in table 11)4. simcse is a contrastive learning model that is trained on triplets of reference reasoning steps, positive and hard-negative hypothesis reasoning steps to minimize the cross-entropy objective with in-batch negatives. for contrastive learning, we use the context and reference reasoning steps as a positive sample (s, r), and context and perturbed reference steps (s, h) as hard-negative pairs. for finetuning, we embed source context and hypothesis chain as a whole, without splitting it into steps. with the finetuned model we embed each individual step, as well as a reasoning chain as a whole. we use the pretrained checkpoint of supervised simcse model sup-simcse-roberta-base to initialize our model, and further train it for five epochs on our synthetic train data (details in app. g). we also compare roscoe scores calculated against sup-simcse-roberta-base simcse model, and all-mpnet-base-v2 sentence embedding model (reimers & gurevych, 2019) to understand metrics sensitivity to the embedding method. LINEBREAK baseline metrics. we use text generation evaluation metrics as baseline metrics and comprehensively examine the ones outlined in §2, which are: n-gram match based metrics including rouge-1, rouge-2, and rouge-l (lin, 2004); pre-trained scores including bleurt (sellam et al., 2020), prism (thompson & post, 2020), bertscore (zhang et al., 2020), bartscore using the faithfulness (s → h) direction for factuality and relevance, and its finetuned variant bartscore+cnn+para bartscore+ (yuan et al., 2021); and information alignment metrics of ctc, ctc-relevancy and ctc-consistency. we also include bartscore-p, which we obtain by finetuneing bart (lewis et al., 2020) on the same reasoning datasets we use for finetuning our simcse embedding models. most of our roscoe metrics are constructed referencefree. we also have metrics that use reference reasoning steps which we examine against human judgements. we use the official code for each metric. LINEBREAK 3we chose expert annotators over crowd-sourcing, because our annotation task is cognitively challenging and requires LINEBREAK fine-grained annotation. LINEBREAK 4fine-tuned model is available at https://huggingface.co/facebook/roscoe-512-roberta-base LINEBREAK meta evaluation. we use somers’ d5 (somers, 1962), which measures the ordinal association between two measured quantities, to meta-evaluate each scorer against synthetic and human scores. we prefer somers’ d over more commonly used kendall’s τ or kendall’s τ -b, because it is better in handling the ties of a biased random variable (agresti, 2010, section 7.1.5), which imposes an upper bound on the possible values kendall’s τ (-b) can take. for each score y considered, our correlations are built against the biased random variable x ∈ [0, 1], represented by the perturbation or error presence indicator and evaluated using d(y |x) = τ (x, y )/τ (x, x). LINEBREAK experimental results LINEBREAK controlled experiments with diagnostics datasets. table 7 shows somers’ d correlation for metrics measured reference-free on six different datasets and compares baselines to roscoe-* aggregated categories calculated with finetuned embeddings: roscoe-sa, roscoe-ss, roscoe-li, roscoe-lc. results also include roscoe metrics with all-mpnet-base-v2 (roscoe-sa1, roscoe-ss1) and sup-simcse-robertabase (roscoe-sa2, roscoe-ss2) sentence embedding models. correlations for proofwriter are taken on its depth-5 subset. we report highest correlation scores across perturbations within each dataset. the breakdown of all roscoe metrics is in app. table 18. LINEBREAK entbank math aqua proofwr. eqasc asdiv LINEBREAK table 7: somers’ d correlation of different metrics on six diagnostics datasets. metrics are measured reference-free on (s, h). we take the maximum score over different perturbations. the two highest correlations for each dataset are bolded and underlined, respectively. correlations that are not significant (p-value ≥ 0.05) are omitted when aggregating, and "-" denotes an absence of any significant correlation. breakdown of all baseline and roscoe metrics is shown in app. h.1, table 18. LINEBREAK (1) roscoe can outwe observe that: perform all other reference-free methods on all six diagnostic datasets, (2) the gains for roscoe-ss are more pronounced in four out of six diagnostics datasets, which suggests that roscoe can capture hallucinations and repetitions in step-wise reasoning. on proofwriter, our scorers show lower correlations, because as shown in table e.1, the context is a list of facts and rules and the reasoning steps can include unordered fact and rule combinations, but still a correct answer can be deduced. this makes it challenging for roscoe to evaluate the steps in sequence. overall, the correlations of the baseline metrics are much lower than roscoe, because the baseline metrics are designed to capture the semantic or lexical overlap between a reference and hypothesis and it is harder to detect logical consistency without a golden reference text. roscoe is specifically focused on reference-free settings, and can gauge each individual step against the source and other generated steps. in fact, our metrics also work well against the baselines in the reference-based setting (comparing against reference reasoning steps). in app. table 19 we present correlations when metrics are measured as reference-based. we also observe that finetuning simcse gives highest improvements on the asdiv dataset. asdiv is a 1-step reasoning dataset (see app. table 12), where step is represented by an equation with one of the arithmetic perturbations added. we LINEBREAK rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc relev. ctc consist. LINEBREAK roscoe-sa roscoe-sa1 roscoe-sa2 LINEBREAK roscoe-ss roscoe-ss1 roscoe-ss2 LINEBREAK roscoe-li LINEBREAK roscoe-lc LINEBREAK 5we use scipy (virtanen et al., 2020) to calculate correlations and obtain p-values from a hypothesis test where the LINEBREAK null hypothesis is an absence of association. LINEBREAK hypothesize that including these patterns in finetuning helped the model to better learn relationships between context and equations, and resulted in higher scores. on eqasc dataset, repetition* scores are able to catch all duplicated steps in a chain, i.e., we can separate perturbed and non-perturbed chains based on the given threshold value for the repetition* scores, and achieve perfect correlation scores (app. table 20). to understand if finetuning actually helps to improve scoring, we compare non-aggregated metrics (see details in app. table 18). we observe, that finetuning indeed helps to improve roscoe: on average across datasets, all correlations except repetition_* scores improve (up to 0.556 on informativenesschain), with mean repetition-token not changing, and mean repetition-step degrading by 0.005. we speculate that since we finetune the model using reasoning chains and context as a whole, it helps to better capture step-by-step rationales, while possibly degrading on word and sentence-level semantics. LINEBREAK drop gsm8k esnli cosmos LINEBREAK table 8: somers’ d correlations of metrics with human judgement. we report the maximum over the error types in table 2. all metrics are measured reference-free on (s, h). the highest two correlations in each column are bolded and underlined, respectively. correlations that are not significant (p-value ≥ 0.05) are omitted when aggregating, and "-" denotes an absence of any significant correlation. breakdown of all baseline and roscoe metrics is shown in app. h.2. LINEBREAK meta-evaluations on human judgement datasets. table 8 reports a summary of meta-evaluation of roscoe metrics comparing against baselines on human judged datasets. the correlations are measured based on the presence of a particular error from table 2 and we report the highest correlation across all error types within each dataset. we observe that: (1) on all tasks, roscoe metrics outperform all other baselines when evaluated as reference-free; (2) overall, roscoe yields considerably better correlations, which indicates that step-by-step reasoning generations can be more effectively evaluated with roscoe. in general, most correlations with human judgements are moderate when compared to the synthetic correlation scores, indicating that step-by-step reasoning evaluation is among the cognitively hard tasks for neural models (deutsch et al., 2022). interpretable metrics such as roscoe can provide better information about a model’s reasoning skills, thus future work should improve such metrics on aligning with human judgments. in app. h.2, we show fine-grained experimental analysis per each human labeled dataset. specific examples showcasing roscoe scoring abilities are summarized in table 40. LINEBREAK rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency LINEBREAK roscoe-sa roscoe-sa1 roscoe-sa2 LINEBREAK roscoe-ss roscoe-ss1 roscoe-ss2 LINEBREAK roscoe-lc LINEBREAK roscoe-li LINEBREAK semeval LINEBREAK analysis LINEBREAK how sensitive are roscoe metrics against level of errors? to evaluate how well metric values match human assessment of reasoning, we measure sensitivity to the level of errors. we perturb sentences in the math (arithmetic) and entailmentbank (deductive reasoning) diagnostic datasets (similar to § 5) and inject different levels of errors into the reasoning text. using randomly selected perturbation types, we construct up to a maximum of 3 perturbations per instance. we measure the correlation (somers’ d) between the reasoning inconsistency level 1, 2, 3 of the reasoning steps (i.e., the number of injected errors) and the metric score. fig. 1 illustrates the results averaged over different perturbations. LINEBREAK we expect the metrics correlate with humans better when the level of errors is high. both semantic alignment of the reasoning roscoe-sa , and the semantic similarity metrics roscoe-ss show consistent behavior LINEBREAK on both datasets, while baseline metrics fluctuate with low correlations. baseline metrics perform better on entailmentbank. on math, roscoe-lc and the baseline metrics show minimal impact, which can be that some of the perturbations applied on the math dataset (e.g., randomoperation, or shufflenumbers) are harder to detect with language model based (bartscore) and nli model based (roscoe-lc) metrics. LINEBREAK what does roscoe illuminate about scores across errors and tasks? for an ideal scorer based on ease of use, it would be possible to pick a set of fixed thresholds that had error discrimination power across datasets. however, we show that this dataset-agnostic ideal is currently not possible and an issue endemic across scores, including baselines. we study which metrics correlate strongly with which perturbations, with a focus of consistency across datasets. from this, we plot the interquartile ranges for strongly correlated metric and perturbation pairs. we show a sample of these in fig. 2, though find that the trends generally hold across metrics and perturbations (see fig 6). we note that within a given dataset, scores are well separated: the perturbed version of a dataset for a given score and perturbation type shows little interquartile overlap with the original version. however, this does not hold across datasets – e.g., in (score: infochain, perturbation: repetition), if one were to set a detective threshold for the repetition perturbation based off entbank (around 0.95), it would mark almost all values of eqasc as perturbed, even non-perturbed samples. this shows the challenge of using metrics for classification without calibration for drifts in both mean and variance across datasets, even if a metric generally correlates well with detecting a given error. LINEBREAK figure 1: sensitivity of selected metrics on somers’ d by injecting levels of error into reasoning steps. LINEBREAK figure 2: box-and-whisker plots of interquartile ranges of scores, for perturbations and reference-free metrics with strong somers’ d values. scores are split by dataset and perturbation use. while interquartile ranges separate well by perturbation use within a single dataset, there is overlap across datasets. this shows the drift of neural scores across datasets and applies to both roscoe (left, center) and strong baselines (right). LINEBREAK conclusion LINEBREAK in this paper, we introduce roscoe, a new suite of interpretable, unsupervised metrics that enables evaluation of step-by-step reasoning generations of lms when no golden reference generation exists. we present a taxonomy of reasoning errors used to generate and evaluate our metrics. experimental results, from evaluating on both synthetic and human-labeled datasets exhibiting multiple types of reasoning (commonsense, arithmetic, and logical inference, etc.), demonstrate superior performance compared to prior semantic and lexical similarly based baseline metrics for text generation. our analysis shows improved capability in evaluation of reasoning exhibiting nuances, such as factual and logical errors in step-wise decisions. LINEBREAK ethics statement LINEBREAK explainability builds transparency and trust for users, eases bug-fixing and shortens improvement cycles for metric designers, and will be required by law/regulations for ai systems to be applied to large-scale, high-stakes domains. in this context, we hope our work will catalyze efforts on the topic of explainable evaluation metrics for language model rationale generations. we should mention that our evaluation metrics do not monitor the explanations from integrity or bias perspectives. our work also uses five human expert annotators and in the annotation process, annotators need to rate the model generated candidate rationals. while the model-generated explanations can produce potentially unsafe content, the datasets for annotations include domains related to logical and arithmetic concepts and general commonsense knowledge. the anecdotal consensus was that the generations were safe and didn’t include biased statements. LINEBREAK reproducibility statement LINEBREAK to ensure the reproducibility of our empirical results, we will open source our code to github, which will contain: instructions for installing the virtual environment, data preprocessing, all score generation and correlation scripts (both for roscoe and baselines), and trained embedding models. detailed explanation of all the finetuned models and metrics are given in the main paper as well as in the appendices. we will also release all the diagnostic and human judgment datasets used in our experiments. LINEBREAK references LINEBREAK shourya aggarwal, divyanshu mandowara, vishwajeet agrawal, dinesh khandelwal, parag singla, and LINEBREAK dinesh garg. explanations for commonsenseqa: new dataset and models. 2021. LINEBREAK eneko agirre, daniel cer, mona diab, aitor gonzalez-agirre, and weiwei guo. *sem 2013 shared task: semantic textual similarity. in second joint conference on lexical and computational semantics (*sem), volume 1: proceedings of the main conference and the shared task: semantic textual similarity, pp. 32–43, atlanta, georgia, usa, june 2013. association for computational linguistics. url https: //aclanthology.org/s13-1004. LINEBREAK alan agresti. analysis of ordinal categorical data, volume 656. john wiley & sons, 2010. LINEBREAK samuel r. bowman, gabor angeli, christopher potts, and christopher d. manning. a large annotated corpus for learning natural language inference. in proceedings of the 2015 conference on empirical methods in natural language processing, pp. 632–642, lisbon, portugal, september 2015. association for computational linguistics. doi: 10.18653/v1/d15-1075. url https://aclanthology.org/ d15-1075. LINEBREAK tom brown, benjamin mann, nick ryder, melanie subbiah, jared d kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, sandhini agarwal, ariel herbert-voss, gretchen krueger, tom henighan, rewon child, aditya ramesh, daniel ziegler, jeffrey wu, clemens winter, chris hesse, mark chen, eric sigler, mateusz litwin, scott gray, benjamin chess, jack clark, christopher berner, sam mccandlish, alec radford, ilya sutskever, and dario amodei. language models are few-shot learners. 33:1877–1901, 2020. url https://proceedings.neurips.cc/paper/ 2020/file/1457c0d6bfcb4967418bfb8ac142f64a-paper.pdf. LINEBREAK oana-maria camburu, tim rocktäschel, thomas lukasiewicz, and phil blunsom. e-snli: natural language inference with natural language explanations. in s. bengio, h. wallach, h. larochelle, k. grauman, n. cesa-bianchi, and r. garnett (eds.), advances in neural information processing systems 31, pp. 9539– 9549. curran associates, inc., 2018. url http://papers.nips.cc/paper/8163-e-snlinatural-language-inference-with-natural-language-explanations.pdf. LINEBREAK asli celikyilmaz, elizabeth clark, and jianfeng gao. evaluation of text generation: a survey. corr, LINEBREAK aakanksha chowdhery, sharan narang, jacob devlin, maarten bosma, gaurav mishra, adam roberts, paul barham, hyung won chung, charles sutton, sebastian gehrmann, et al. palm: scaling language modeling with pathways. arxiv preprint arxiv:2204.02311, 2022. LINEBREAK miruna-adriana clinciu, arash eshghi, and helen hastie. a study of automatic metrics for the evaluation in proceedings of the 16th conference of the european chapter of natural language explanations. of the association for computational linguistics: main volume, pp. 2376–2387, online, april 2021. association for computational linguistics. doi: 10.18653/v1/2021.eacl-main.202. url https:// aclanthology.org/2021.eacl-main.202. LINEBREAK karl cobbe, vineet kosaraju, mohammad bavarian, mark chen, heewoo jun, lukasz kaiser, matthias plappert, jerry tworek, jacob hilton, reiichiro nakano, christopher hesse, and john schulman. training verifiers to solve math word problems. arxiv preprint arxiv:2110.14168, 2021. LINEBREAK antonia creswell, murray shanahan, and irina higgins. selection-inference: exploiting large language models for interpretable logical reasoning. arxiv, 2022. url https://arxiv.org/abs/2205.09712. LINEBREAK bhavana dalvi, peter jansen, oyvind tafjord, zhengnan xie, hannah smith, leighanna pipatanangkura, and LINEBREAK peter clark. explaining answers with entailment trees. emnlp, 2021. LINEBREAK marina danilevsky, kun qian, ranit aharonov, yannis katsis, ban kawas, and prithviraj sen. a survey of the state of explainable ai for natural language processing. in proceedings of the 1st conference of the asia-pacific chapter of the association for computational linguistics and the 10th international joint conference on natural language processing, pp. 447–459, suzhou, china, december 2020. association for computational linguistics. url https://aclanthology.org/2020.aacl-main.46. LINEBREAK mingkai deng, bowen tan, zhengzhong liu, eric p. xing, and zhiting hu. compression, transduction, and creation: a unified framework for evaluating natural language generation. in emnlp, 2021. url https://aclanthology.org/2021.emnlp-main.599.pdf. LINEBREAK daniel deutsch, rotem dror, and dan roth. re-examining system-level correlations of automatic summa LINEBREAK rization evaluation metrics. arxiv preprint arxiv:2204.10216, 2022. LINEBREAK dheeru dua, yizhong wang, pradeep dasigi, gabriel stanovsky, sameer singh, and matt gardner. drop: a reading comprehension benchmark requiring discrete reasoning over paragraphs. in proceedings of the 2019 conference of the north american chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pp. 2368–2378, minneapolis, minnesota, june 2019. association for computational linguistics. doi: 10.18653/v1/n19-1246. url https: //aclanthology.org/n19-1246. LINEBREAK tianyu gao, xingcheng yao, and danqi chen. simcse: simple contrastive learning of sentence embeddings. LINEBREAK mor geva, daniel khashabi, elad segal, tushar khot, dan roth, and jonathan berant. did aristotle use a laptop? a question answering benchmark with implicit reasoning strategies. transactions of the association for computational linguistics, 9:346–361, 2021. LINEBREAK dan hendrycks, collin burns, saurav kadavath, akul arora, steven basart, eric tang, dawn song, and LINEBREAK jacob steinhardt. measuring mathematical problem solving with the math dataset. neurips, 2021. LINEBREAK lifu huang, ronan le bras, chandra bhagavatula, and yejin choi. cosmos qa: machine reading comprehension with contextual commonsense reasoning. in proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), pp. 2391–2401, hong kong, china, november 2019. association for computational linguistics. doi: 10.18653/v1/d19-1243. url https://aclanthology.org/d19-1243. LINEBREAK alon jacovi and yoav goldberg. aligning faithful interpretations with their social attribution. volume 9, pp. 294–310, cambridge, ma, 2021. mit press. doi: 10.1162/tacl_a_00367. url https: //aclanthology.org/2021.tacl-1.18. LINEBREAK alon jacovi, swabha swayamdipta, shauli ravfogel, yanai elazar, yejin choi, and yoav goldberg. contrastive explanations for model interpretability. in proceedings of the 2021 conference on empirical methods in natural language processing, pp. 1597–1611, online and punta cana, dominican republic, november 2021. association for computational linguistics. doi: 10.18653/v1/2021.emnlp-main.120. url https://aclanthology.org/2021.emnlp-main.120. LINEBREAK kalpesh krishna, john wieting, and mohit iyyer. reformulating unsupervised style transfer as paraphrase LINEBREAK generation. in empirical methods in natural language processing, 2020. LINEBREAK andrew k lampinen, nicholas roy, ishita dasgupta, stephanie cy chan, allison tam, james mcclelland, chen yan, adam santoro, neil c rabinowitz, jane wang, and felix hill. tell me why! explanations support learning relational and causal structure. in kamalika chaudhuri, stefanie jegelka, le song, csaba szepesvari, gang niu, and sivan sabato (eds.), proceedings of the 39th international conference on machine learning, volume 162 of proceedings of machine learning research, pp. 11868–11890. pmlr, 17–23 jul 2022. url https://proceedings.mlr.press/v162/lampinen22a.html. LINEBREAK moritz laurer, wouter van atteveldt, andreu casas, and kasper welbers. less annotating, more classifying– addressing the data scarcity issue of supervised machine learning with deep transfer learning and bert-nli. 2022. LINEBREAK christoph leiter, piyawat lertvittayakumjorn, marina fomicheva, wei zhao, yang gao, and steffen eger. towards explainable evaluation metrics for natural language generation. corr, abs/2203.11131, 2022. url https://doi.org/10.48550/arxiv.2203.11131. LINEBREAK mike lewis, yinhan liu, naman goyal, marjan ghazvininejad, abdelrahman mohamed, omer levy, veselin stoyanov, and luke zettlemoyer. bart: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. in proceedings of the 58th annual meeting of the association for computational linguistics, pp. 7871–7880, online, july 2020. association for computational linguistics. doi: 10.18653/v1/2020.acl-main.703. url https://aclanthology.org/2020.aclmain.703. LINEBREAK aitor lewkowycz, anders andreassen, david dohan, ethan dyer, henryk michalewski, vinay ramasesh, ambrose slone, cem anil, imanol schlag, theo gutman-solo, et al. solving quantitative reasoning problems with language models. arxiv preprint arxiv:2206.14858, 2022. LINEBREAK yifei li, zeqi lin, shizhuo zhang, qiang fu, bei chen, jian-guang lou, and weizhu chen. on the advance of making language models better reasoners. arxiv, 2022. url https://arxiv.org/abs/ 2206.02336. LINEBREAK chao-chun liang, yu-shiang wong, yi-chung lin, and keh-yih su. a meaning-based statistical english math word problem solver. pp. 652–662, june 2018. doi: 10.18653/v1/n18-1060. url https: //aclanthology.org/n18-1060. LINEBREAK chin-yew lin. rouge: a package for automatic evaluation of summaries. in text summarization branches out, pp. 74–81, barcelona, spain, july 2004. association for computational linguistics. url https: //aclanthology.org/w04-1013. LINEBREAK yinhan liu, myle ott, naman goyal, jingfei du, mandar joshi, danqi chen, omer levy, mike lewis, luke zettlemoyer, and veselin stoyanov. roberta: a robustly optimized bert pretraining approach. arxiv preprint arxiv:1907.11692, 2019. LINEBREAK shen-yun miao, chao-chun liang, and keh-yih su. a diverse corpus for evaluating and developing english LINEBREAK math word problem solvers. pp. 975–984, 2020. LINEBREAK maxwell nye, anders johan andreassen, guy gur-ari, henryk michalewski, jacob austin, david bieber, david dohan, aitor lewkowycz, maarten bosma, david luan, et al. show your work: scratchpads for intermediate computation with language models. arxiv preprint arxiv:2112.00114, 2021. LINEBREAK juri opitz and anette frank. towards a decomposable metric for explainable evaluation of text generation in proceedings of the 16th conference of the european chapter of the association for from amr. computational linguistics: main volume, pp. 1504–1518, online, april 2021. association for computational linguistics. doi: 10.18653/v1/2021.eacl-main.129. url https://aclanthology.org/ 2021.eacl-main.129. LINEBREAK simon ostermann, michael roth, ashutosh modi, stefan thater, and manfred pinkal. semeval-2018 task 11: machine comprehension using commonsense knowledge. in *semeval, 2018. url https: //aclanthology.org/s18-1119.pdf. LINEBREAK alec radford, jeffrey wu, rewon child, david luan, dario amodei, ilya sutskever, et al. language models LINEBREAK are unsupervised multitask learners. openai blog, 1(8):9, 2019. LINEBREAK nils reimers and iryna gurevych. sentence-bert: sentence embeddings using siamese bert-networks. in proceedings of the 2019 conference on empirical methods in natural language processing. association for computational linguistics, 11 2019. url https://arxiv.org/abs/1908.10084. LINEBREAK ehud reiter. natural language generation challenges for explainable ai. in proceedings of the 1st workshop on interactive natural language technology for explainable artificial intelligence (nl4xai 2019), pp. 3–7. association for computational linguistics, 2019. doi: 10.18653/v1/w19-8402. url https: //aclanthology.org/w19-8402. LINEBREAK christopher michael rytting and david wingate. leveraging the inductive bias of large language models for abstract textual reasoning. 2021. url https://openreview.net/forum?id=uruer03mkng. LINEBREAK thibault sellam, dipanjan das, and ankur parikh. bleurt: learning robust metrics for text generation. in proceedings of the 58th annual meeting of the association for computational linguistics, pp. 7881–7892, online, july 2020. association for computational linguistics. doi: 10.18653/v1/2020.acl-main.704. url https://aclanthology.org/2020.acl-main.704. LINEBREAK robert h somers. a new asymmetric measure of association for ordinal variables. american sociological LINEBREAK oyvind tafjord, bhavana dalvi, and peter clark. proofwriter: generating implications, proofs, and abductive statements over natural language. in findings of the association for computational linguistics: acl-ijcnlp 2021, pp. 3621–3634, online, august 2021. association for computational linguistics. doi: 10.18653/v1/2021.findings-acl.317. url https://aclanthology.org/2021.findingsacl.317. LINEBREAK brian thompson and matt post. automatic machine translation evaluation in many languages via zeroshot paraphrasing. in proceedings of the 2020 conference on empirical methods in natural language processing (emnlp), pp. 90–121, online, november 2020. association for computational linguistics. doi: 10.18653/v1/2020.emnlp-main.8. url https://aclanthology.org/2020.emnlp-main.8. LINEBREAK pauli virtanen, ralf gommers, travis e. oliphant, matt haberland, tyler reddy, david cournapeau, evgeni burovski, pearu peterson, warren weckesser, jonathan bright, stéfan j. van der walt, matthew brett, joshua wilson, k. jarrod millman, nikolay mayorov, andrew r. j. nelson, eric jones, robert kern, eric larson, c j carey, ˙ilhan polat, yu feng, eric w. moore, jake vanderplas, denis laxalde, josef perktold, robert cimrman, ian henriksen, e. a. quintero, charles r. harris, anne m. archibald, antônio h. ribeiro, fabian pedregosa, paul van mulbregt, and scipy 1.0 contributors. scipy 1.0: fundamental algorithms for scientific computing in python. nature methods, 17:261–272, 2020. doi: 10.1038/s41592-019-0686-2. LINEBREAK xuezhi wang, jason wei, dale schuurmans, quoc le, ed chi, and denny zhou. self-consistency improves LINEBREAK chain of thought reasoning in language models. arxiv preprint arxiv:2203.11171, 2022. LINEBREAK jason wei, xuezhi wang, dale schuurmans, maarten bosma, ed chi, quoc le, and denny zhou. chain of thought prompting elicits reasoning in large language models. arxiv preprint arxiv:2201.11903, 2022. LINEBREAK sean welleck, jiacheng liu, ximing lu, hannaneh hajishirzi, and yejin choi. naturalprover: grounded LINEBREAK mathematical proof generation with language models. 2022. LINEBREAK peter west, chandra bhagavatula, jack hessel, jena hwang, liwei jiang, ronan le bras, ximing lu, sean welleck, and yejin choi. symbolic knowledge distillation: from general language models to commonsense in proceedings of the 2022 conference of the north american chapter of the association models. for computational linguistics: human language technologies, pp. 4602–4625, seattle, united states, july 2022. association for computational linguistics. doi: 10.18653/v1/2022.naacl-main.341. url https://aclanthology.org/2022.naacl-main.341. LINEBREAK weizhe yuan, graham neubig, and pengfei liu. bartscore: evaluating generated text as text generation. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 27263–27277. curran associates, inc., 2021. url https://proceedings.neurips.cc/paper/2021/file/ e4d2b6e6fdeca3e60e0f1a62fee3d9dd-paper.pdf. LINEBREAK eric zelikman, yuhuai wu, jesse mu, and noah d. goodman. star: bootstrapping reasoning with reasoning. LINEBREAK tianyi zhang, varsha kishore, felix wu*, kilian q. weinberger, and yoav artzi. bertscore: evaluating text generation with bert. in international conference on learning representations, 2020. url https: //openreview.net/forum?id=skehucvfdr. LINEBREAK appendix LINEBREAK a limitations LINEBREAK our study is the first initial step that investigates the evaluation of the step-by-step reasoning produced by large language models. our taxonomy (in table 2) covers several reasoning errors and we designed our metrics to evaluate a spectrum of criteria including the ones in the taxonomy. even though we cannot say we cover all possible reasoning errors, our metrics are generic enough, work on natural language rationales, and consider the alignment with the input context and the generated explanation. nevertheless, we believe our study can spur others to investigate different reasoning errors and use our code and datasets as templates to extend further. LINEBREAK due to the extensive analysis needed to thoroughly test and communicate the ability of our proposed metrics to capture reasoning errors, we decided to leave some follow-up questions, such as the application of these metrics for improving downstream task performance, for future exploration. LINEBREAK b few-shot prompting examples (cont. from § 1) LINEBREAK below is the 2-shot example we used to generate the explanations from gpt-3 as we show in the fig. 1. LINEBREAK i will explain how to make logical inferences: LINEBREAK context: john wakes to the sound of his children giggling outside the door. they bust in and say "happy father’s day!" with a plate full of food. 2022 has been a great year. question: can we infer that john was born before the inauguration of barack obama? explanation: we can infer that john is a father because of "his children". we can infer that the current year is 2022. barack obama was inaugurated in 2009, so it has been about 13 years since obama was inaugurated. john’s children are old enough to speak, so if john were born after obama’s inauguration, he would have been younger than 10 when he had children. so, we can infer that john was born before obama’s inauguration. the answer is "yes". LINEBREAK context: sam sees a piano in the subway stations. laughing, his friends prod him to play, saying "remember how amazing your rendition of chopsticks was at the christmas party?" question: can we infer that john majored in piano at juilliard? explanation: juilliard is a top school for music, so someone who majored in piano at juilliard would be an expert pianist. "chopsticks" is a very simple song to play on the piano. his friends were therefore likely being sarcastic when they told him to play, which would imply that sam was not an expert piano player. so it is unlikely that sam majored in piano at juilliard. the answer is "no". LINEBREAK table 9 illustrates sample if in-context examples we used as prompts to obtain step-wise explanations. LINEBREAK table 9: example prompts used to generate step-by-step explanations using gpt-3. LINEBREAK (used for esnli dataset) explain if premise entails hypothesis. premise: tomato sauce (also known as neapolitan sauce, and referred to in italy as salsa di pomodoro) refers to any of a very large number of sauces made primarily from tomatoes, usually to be served as part of a dish (rather than as a condiment). tomato sauces are common for meat and vegetables, but they are perhaps best known as sauces for pasta dishes. hypothesis: tomato sauce is only rarely used to top pasta. explanation: salsa di pomodoro is made of peppers. the answer is no. LINEBREAK premise: kirk johnson (born 1960) is an american scientist, author, curator, and museum administrator, and is currently serving as director of smithsonian’s national museum of natural history. dr. johnson is the host of the pbs nova series, ¨making north america¨, which is a three-part series that describes the shaping of north america, which aired on november 4, 11 and 18, 2015. hypothesis: johnson hosted making north america when he turned 50. explanation: johnson was born in 1960 and hosted making north america in 2015, so he was 55, not 50. the answer is no. LINEBREAK premise: a person rides his bicycle in the sand beside the ocean. hypothesis: a person is on a beach. explanation: a person rides beside the ocean means is on a beach if there is sand beside the ocean. the answer is yes. LINEBREAK (used for semeval dataset) explain if premise entails hypothesis. premise: i went into my bedroom and flipped the light switch. oh, i see that the ceiling lamp is not turning on. it must be that the light bulb needs replacement. i go through my closet and find a new light bulb that will fit this lamp and i place it in my pocket. i also get my stepladder and i place it under the lamp. i make sure the light switch is in the off position. i climb up the ladder and unscrew the old light bulb. i place the old bulb in my pocket and take out the new one. i then screw in the new bulb. i climb down the stepladder and i place it back into the closet. i then throw out the old bulb into the recycling bin. i go back to my bedroom and turn on the light switch. i am happy to see that there is again light in my room. which room did the light go out in? hypothesis: bedroom label: correct explanation: the answer is bedroom, because the light went out in the bedroom. the person replaced the light bulb in the bedroom. LINEBREAK premise: the weather was so nice today that i decided to have a barbecue. i called up some of my friends to invite them over. i set up some chairs and tables outside for my friends to sit around. i then took out some hot dogs from my fridge and brought them over to my barbecue. my barbecue is a gas barbecue, so all i had to do was press the knob and turn it to ignite it. once i got a little fire going i put my hot dogs on the grill over it to cook. i closed the lid and left my hot dogs to cook for about ten minutes. after ten minutes i decided to check on them to see if they were done. they looked like they were cooked, so i put them all on a plate to serve to my friends. i went to my kitchen and got hot dog buns, ketchup, mustard, and relish to serve on top of the hot dogs. i laid out all of the food and condiments on the table so my friends could help themselves. we ate the hot dogs and relaxed around the table. why are we having the barbecue, to celebrate an occasion, or just because we want to? hypothesis: just because they want to. label: correct explanation: the answer is correct, because the weather was nice. they decided to have a barbecue. there is no mention of any special occasion. LINEBREAK premise: another nurse can in to look at me , took one look at my rash and said omg and ran out of the room . at that point i started crying , regretted coming to the hospital alone and started wheezing again . then the doctor came in , her eyes were all bugged out . what will i do after the doctor examines me ? hypothesis: i will talk with my friends . label: incorrect explanation: the premise is about the nurse’s reaction to the patient’s rash, and how the patient feels. the hypothesis does not follow up from this premise correctly. instead, it talks about talking with friends. LINEBREAK c taxonomy of reasoning errors (cont. from § 3) LINEBREAK to gain deeper insights into the types of reasoning errors introduced by llms while explaining their decisions, we propose a new taxonomy of generic reasoning errors for language problem solving. specifically, we sampled from the training portions of the logical inference and commonsense reasoning datasets, and prompted gpt-3 with reasoning explanations using prompts similar to app. b. we used task specific indomain examples for prompting. we also analyzed model generated explanations shared in wei et al. (2022). we then manually looked into each explanation and identified potential errors that are inconsistent with the source, question or the prompt and within the reasoning chain. some tasks require a model to classify the logical relationship between premise and a hypothesis, others are question and answering tasks. we adjusted our context and prompts according to the type of the task. LINEBREAK our reasoning error taxonomy is summarized in table 10. it contains types of errors concerning an overall chain or an individual step. specifically, the chain-level coarse-grained evaluations of the overall reasoning chain deals with overall quality of the step-by-step thinking, coherence, consistency of the explanation within itself, and consistency with the context, etc. on the other hand the step-level fine-grained evaluations focus on the consistency of a reasoning step with the previous steps, if a step conveys new and supporting information over the previous steps, factuality or logical inference issues. we use these error categories to construct diagnostics datasets with perturbed errors as well as human judged datasets of reasoning errors. in the taxonomy, we indicate *-step level errors to differentiate from the chain level error types. LINEBREAK table 10: taxonomy of step-by-step reasoning errors. errors used for perturbations in constructing the diagnostic datasets (diag.) and for human annotation (human) of the model generated reasoning chains are also marked. (cont. from table 2. LINEBREAK error type LINEBREAK description LINEBREAK example LINEBREAK grammar LINEBREAK faulty, unconventional, or controversial grammar usage LINEBREAK factuality LINEBREAK hallucination LINEBREAK information about object (i.e. quantity, characteristics) or a personal named entity does not match information provided in the question information is not provided in the problem statement and is irrelevant or wrong LINEBREAK redundancy LINEBREAK explanation contains redundant information, which even though might be factual, is not required to answer the question LINEBREAK repetition LINEBREAK step paraphrases information already mentioned in previous reasoning steps LINEBREAK missing step LINEBREAK the content of the generated reasoning is incomplete and lacks required information to produce the correct answer. if this missing steps are added, the model would produce the correct answer LINEBREAK coherency LINEBREAK steps contradict each other or do not follow a cohesive story LINEBREAK commonsense model lacks relations that should be known from general knowledge about the world (i.e. how to compute velocity, how many inches in one foot, all ducks are birds, etc.) LINEBREAK arithmetic LINEBREAK error in math calculations LINEBREAK reference: he chews 4 pieces of gum a day so over 30 days he will chew 4*30 = «4*30=120»120 pieces of gum. model expl: he eats 4 pieces of gum a day and lasts 30 days so he eats 4*30 = «4*30=120»120 pieces of gum. context: anakin caught 10 fish. model expl: locsin caught 10 fish. LINEBREAK context: the basketball team went to the steakhouse to eat dinner. the first player ate a 6-ounce steak. the second player ate beef tips, containing 8 beef tips, each an ounce in size. the third player ate a one-pound steak. and the fourth and fifth players ordered vegetarian meals. in total, how many ounces of meat were consumed by the team? model expl: the fourth and fifth players ordered vegetarian meals, for a total of 2 ounces of meat. context: bob is cold. if something is quiet then it is blue. all blue things are round. if something is round and smart then it is cold. question: bob is cold. model expl: if something is round and not smart then it is blue. all blue things are round. answer: true. context: parker chews 4 pieces of gum a day. a pack of gum has 15 pieces of chewing gum per pack. how many packs of gum will he need to last him 30 days? model expl.: he chews 4 pieces of gum a day and there are 30 days in a month so he chews 4*30 = 120 pieces of gum a month. parker chews 120 pieces of gum a month. he needs 120 pieces of gum a month and a pack of gum has 15 pieces of gum so he will need 120/15 = 8 packs of gum. context: a farm has 10 2-legged animals and 15 4-legged animals. if all animals are healthy, how many pairs of animal legs in total are on the farm? answer: 40 model expl.: 10 2-legged animals have 10*2=20 legs. 15 4-legged animals have 15*4=60 legs. in total on the farm, there are 20+60=80 legs.answer: 80 missing step: total number of pairs is 80/2=40 context: if the reactor is intact, then it is safe. if the reactor is safe, then no graphite is outside it. model expl.: the reactor is intact. all graphite is inside of it. there are some graphite outside of the the reactor. question: jordan has 2 children who wear diapers. each jordan’s wife child requires 5 diaper changes per day. changes half of the diapers. how many diapers does jordan change per day? model expl.: jordan has 2*5=10 diapers to change per day. jordan’s wife changes 10/2=5.0 diapers per day. for both children, jordan changes 10+5=15 diapers per day. reference: if a truck was carrying 20 tons of fertiliser packed in bags, the total number of bags in a truck is 20*20 = 400 bags model expl: if a truck was carrying 20 tons of fertiliser packed in bags, the total number of bags in a truck is 20*20 = 40 bags LINEBREAK diag. human LINEBREAK d roscoe metrics details (cont. from §4) LINEBREAK roscoe metrics are constructed under four categories: semantic alignment, semantic similarity, logical inference, and logical coherence. the details of each metric is explained in §4. at the core of roscoe semantic alignment metrics is the reasoning alignment score, which we designed to measure the grounding of step-by-step reasoning with respect to the source text. fig. 3 illustrates the reasoning alignment. LINEBREAK figure 3: reasoning alignment illustrating the measurement of the faithfulness-step and faithfulness-token semantic alignment scores. h = {h1, h2} is a hypothesis chain with tokens {h1,1, h1,2, h1,3, h2,1, h2,2}, and s = {s1, s2, s3} is a context with tokens {s1,1, s2,1, s2,2, s2,3, s3,1, s3,2, s3,3}. alignment scores from hypothesis to context are highlighted, and alignment scores from context to hypothesis are underscored. the reasoning alignment combines token and step level similarities where each alignment value (cell) is the cosine similarity and explicitly measures the grounding of the token and step-wise reasoning with respect to the source text. the variation of scorers of the roscoe shares some similarities, thus we explain them here: LINEBREAK bartscore (yuan et al., 2021) claims that more high level text can be generated using sequence to sequence model. it can support different evaluation perspectives such as factuality (by evaluating from source to hypothesis) or informativeness (by evaluating from both directions between reference and hypothesis). bartscore is used to measure the probability of generated text from a source text x to a target set y: LINEBREAK bart score = (cid:80)m LINEBREAK (1) bartscoreintroduce two variations: (1) finetuning, in which the bart model is finetuned on the task specific dataset to make the pre-training domain closer to the evaluation domain. (2) prompting, in which a task specific textual prompt is appended to the source x to get the y. in our experiments we compare the the bartscorebaseline and one with the prompting variant bartscore+to compare in the experiments. LINEBREAK t=1 wt log p(yt|y<t, x, θ) LINEBREAK ctc (compression, transduction, and creation) (deng et al., 2021), is a suite of metrics that unifies different perspectives of different tasks (e.g, summarization, style transfer, or text rewriting) into information alignment, which measures weather the information in one generation component is grounded in another. the information alignment is defined as follows: let x (e.g, dialog context) be the source input, c (e.g., external world knowledge) be some additional context, and y be the generated output text (e.g., generated response). the alignment is measured on token level and it is measured as the vector of scores: LINEBREAK align(a → b) = ⟨α1, · · · , αn ⟩ (2) where each score αi indicates confidence that the n-th token in a aligns with the whole sentence b. using the information alignment they define a list of metrics to evaluate text for different tasks. in our experiments we use two of these metrics that are closer to roscoe: the relevance (ctc relevance), which measures the consistency of the generated text with the source and its balanced between the reference, and the consistency (ctc consistency) which deals with the faithfullness of the generated text to the input context by the alignment between the two. LINEBREAK e experimental setup details (cont. from § 5) LINEBREAK e.1 diagnostic datasets LINEBREAK in the following we present details of each diagnostics dataset used in our work. table 11 illustrates how each dataset is used in our experiments. strategyqa dataset is only used to finetune the simcse embeddings model, because it contains reference reasoning chains in train and validation partitions, but not in the test partition. the rest of the six diagnostic datasets are used for sentence embedding model finetuning, and evaluating our models as presented in the experiments results. all datasets with examples are summarised in table 12. LINEBREAK table 11: summary of datasets used in our work. reasoning chain represent whether it contains human written golden step-wise reasoning explanation. type indicates whether it is used for constructing diagnostic or human judged datasets. train/val./test indicate whether the dataset is used for training, validation and/or testing. strategyqa dataset is only used for finetuning simcse embedding model. LINEBREAK dataset LINEBREAK reasoning chain LINEBREAK type LINEBREAK train val. LINEBREAK test annotated instances LINEBREAK entailmentbank (dalvi et al., 2021) proofwriter (tafjord et al., 2021) math (hendrycks et al., 2021) asdiv (miao et al., 2020) aqua (liang et al., 2018) eqasc (aggarwal et al., 2021) strategyqa (geva et al., 2021) drop (dua et al., 2019) gsm8k (cobbe et al., 2021) esnli (camburu et al., 2018) cosmosqa (huang et al., 2019) semeval (ostermann et al., 2018) LINEBREAK diagnostic, finetuning diagnostic, finetuning diagnostic, finetuning diagnostic, finetuning diagnostic, finetuning diagnostic, finetuning finetuning human judged human judged human judged human judged human judged LINEBREAK entailmentbank (entbank) (dalvi et al., 2021) is a complex question answering dataset which contains multi-step entailment trees, namely a tree of multi-premise entailment steps from facts that are known, through intermediate conclusions to hypothesis of interest (which in this case the question and answer). LINEBREAK proofwriter (tafjord et al., 2021) is a question answering dataset for logical reasoning. it contains 500k questions, answers and proofs over natural-language rulebases. this dataset is mostly used to emulate reasoning over rules expressed in language, including proof generation. the datasets proofs include intermediate conclusions. in our experiments, we used depth-0, depth-1, depth-2, depth-3, and depth-5 owa sets. LINEBREAK math (hendrycks et al., 2021) is a dataset of 12,500 problems from high school math competitions. given a math problem such as in table 12 models generate a sequence, such as 2 LINEBREAK 3 , that encodes the final answer. LINEBREAK asdiv (miao et al., 2020) (academia sinica diverse mwp dataset) is a dataset of 2,305 questions on diverse math word problem solving. it includes a diverse operations such as basic arithmetic or aggregative operations (e.g., comparisons, set-operations). LINEBREAK aqua (liang et al., 2018) is a dataset of 100,000 algebraic word problems with step-wise solutions as shown below. in the original dataset each question is decomposed in four parts, two inputs and two outputs: the description of the problem and a question, and the possible (multiple choice) answer options, one being the LINEBREAK table 12: we show instances from seven of the diagnostics datasets here. (continue from §5). LINEBREAK instance LINEBREAK reference step-by-step solution LINEBREAK dataset LINEBREAK entbank LINEBREAK earth is a kind of celestial object. stars appear to move relative to the horizon during the night. a star is a kind of celestial object celestial body. the earth rotating on its axis causes stars to appear to move across the sky at night. apparent motion is when an object appears move relative to another object ’s position. question: how does the appearance of a constellation change during the night? hypothesis: solve the following entailment problem: "earth is a kind of celestial object. during the night stars appear to move" LINEBREAK proofwriter facts: the cow is not big. the cow is not green. the lion eats the tiger. the lion sees the cow. the lion visits the cow. the lion does not visit the squirrel. the lion visits the tiger. the squirrel is big. the squirrel is round. the tiger is not green. the tiger does not see the cow. rules: if something sees the squirrel and the squirrel eats the cow then the cow is round. if something is green then it eats the tiger. if the squirrel is round then the squirrel visits the cow. if something eats the cow then it sees the squirrel. if something sees the tiger and the tiger visits the squirrel then it is nice. if something is round then it eats the cow. if something is kind then it eats the cow. if the tiger visits the cow then the cow sees the squirrel. if something sees the cow then the cow eats the tiger. question: the cow does not see the squirrel. LINEBREAK math LINEBREAK asdiv LINEBREAK aqua LINEBREAK context: tom has a red marble, a green marble, a blue marble, and three identical yellow marbles. question: how many different groups of two marbles can tom choose? LINEBREAK context: a sandwich is priced at $0.75. a cup of pudding is priced at $0.25. tim bought 2 sandwiches and 4 cups of pudding. question: how much money should tim pay? LINEBREAK context: the entrance fee for a fair is $5 for persons under the age of 18 and 20% more for persons older. each ride at the fair costs $0.50. if joe goes with her 6 years old twin brothers, and they each took 3 rides in total. question: how much money does joe end up spending at the fair? LINEBREAK eqasc LINEBREAK question: where is water likely to form beads? LINEBREAK strategyqa question: are more people today related to genghis khan LINEBREAK than julius caesar? LINEBREAK step1: earth is a kind of celestial object its position appears step2: a star is a kind of celestial object to shift relative / celestial body to the horizon. step3: apparent motion is when an object appears to move relative to another object ’s position step4 therefore apparent motion of stars is when stars appear to move relative to earth’s position step5: the earth rotating on its axis causes stars to appear to move across the sky at night step6: therefore the earth rotating on its axis causes apparent motion of stars step7: stars appear to move relative to the horizon during the night step8: therefore the earth rotating on its axis causes stars to move relative to the horizon during the night. LINEBREAK step1: the squirrel is round. step2: something is round then it eats the cow. step3: the squirrel eats the cow. step4: if something sees the squirrel and the squirrel eats the cow then the cow is round. step5: the cow is round. step6: if something is round then it eats the cow. step7: the cow eats the cow. step8: if something eats the cow then it sees the squirrel. step9: the cow sees the squirrel. answer: true LINEBREAK step1: there are two cases here: step2: either tom chooses two yellow marbles (1 result), or he chooses two marbles of different colors ((cid:0)4 step3: the total number of distinct pairs of marbles tom can choose is 1 + 6 = 7. answer: 7 LINEBREAK (cid:1)=6 results.). LINEBREAK step1: total entrance fee is (2*$5)+(1.20*5) = $16 step2: total rides fee is ( 0.50 * 3 ) * 3 = $4.50 step3: total money spent is $20.50 answer: 20.5 LINEBREAK step1: beads of water are formed by water vapor condensing step2: moisture builds up in condenses air and the wherever the surfaces are cold. answer: water beads form on cold surfaces. LINEBREAK step1: julius caesar had three children. step2: genghis khan had sixteen children. step3: modern geneticists have determined that out of every 200 men today has dna that can be traced to genghis khan. answer: true LINEBREAK correct one. in this work we only used the context and question, the step-wise solution and the correct answer to construct our diagnostic dataset. LINEBREAK eqasc (aggarwal et al., 2021) is a multi-hop question answering dataset with 98k explanation annotations for multi-step factual reasoning. each instance in the dataset comes with a question, multiple answer choices, LINEBREAK explanation of each answer choice and a free flow explanation of the whole context. in our experiments we used the correct answer’s explanation to construct our diagnostic datasets. LINEBREAK strategyqa (geva et al., 2021) is another multi-step question answering (qa) dataset, that covers a diverse set of reasoning skills. strategyqa consists of 2,780 questions, annotated with their decomposition and per-step evidence. LINEBREAK e.2 human judged dataset construction LINEBREAK in the following we present details of each human judged datasets used in our work. table 11 lists each dataset and illustrates how each dataset is used in our experiments. specifically, all six datasets are used for evaluations in the experiments results and model finetuning, and one dataset was used for finetuning only. the dataset details are explained below. LINEBREAK to construct these datasets, we first sample instances from each dataset (see the number of instances sampled in table 11). we use gpt-3 with few-shot in-context examples and a prompt to generate step-by-step reasoning (e.g., "explain step-by-step") for each sampled instance (see in-context examples and prompts in app. b). then, using our taxonomy we constructed a list of evaluation perspectives to label the model generated step-by-step reasoning step of each of these datasets. we explain the details of the perspectives used to label human judged datasets in § 5 and app. f. all datasets with examples are summarised in in table 13. in the following we present details of each human judged datasets. LINEBREAK drop (dua et al., 2019), discrete reasoning over the content of paragraphs, is a dataset of 96k of instances with context and a question. to solve the tasks, a system must resolve references in the context that match with the question, and perform discrete operations over them (such as addition, counting, or sorting). these operations require comprehensive understanding of the content of the input context. LINEBREAK gsm8k (cobbe et al., 2021) is a dataset of 8.5k linguistically diverse grade school math word problems. on this dataset, even the largest transformer models fail to achieve high test performance, despite the conceptual simplicity of this problem distribution. LINEBREAK cosmosqa (huang et al., 2019) is a dataset of 35k problems that require commonsense-based reading comprehension, formulated as multiple-choice questions. the questions focus on reading between the lines over a diverse collection of people’s everyday narratives, asking such questions as "what might be the possible reason of ...?", or "what would have happened if ...?". the dataset does not introduce step-by-step reasoning output, and contains multiple choice answers. LINEBREAK esnli (camburu et al., 2018) is the extended version of the stanford natural language inference corpus (bowman et al., 2015) of 570k labeled sentence pairs with entailment or contradiction labels. esnli includes human labeled explanations of the entailment decision. LINEBREAK semeval (ostermann et al., 2018) is a dataset on machine comprehension using commonsense knowledge. it contains questions that require commonsense knowledge for finding the correct answer. LINEBREAK e.3 synthetic diagnostics dataset generation with perturbation rules LINEBREAK to construct the diagnostics datasets we apply synthetic perturbations on half of the chains from six datasets (for details see app. e.1 and the summary table 11). also, in table 14 we illustrate these synthetic perturbations applied on reasoning steps {ri} of gold reference chains of all the datasets. in there, g∗ indicates a grammar error, which includes changing verb tense, dropping verb, or random word swap. s∗ represents change the semantics of one step in the chain by replacing named entities. to simulate extrinsic hallucinations, we use random steps from other chains within the same dataset. LINEBREAK table 13: we show instances from five of the human judged datasets used in our work. only gsm8k and esnli include human labeled explanations. LINEBREAK reference answer & reference step-by-step solution LINEBREAK answer: 11 step1: tine buys 3 12-packs of soda for 3*12=36 sodas step2: 6 people attend the party, so half of them is 6/2= 3 people step3: each of those people drinks 3 sodas, so they drink 3*3=9 sodas. step4: two people drink 4 sodas, which means they drink 2*4=8 sodas. step5: with 1 person drinking 5, that brings the total drank to 5+9+8+3=25 sodas step6: as tina started off with 36 sodas, that means there are 36-25=11 sodas left. LINEBREAK answer: the woman would have been stopped before she left to take the elevator to the top floor and she would have lived. LINEBREAK answer: john kasay LINEBREAK answer: neutral explanation: child does not imply daughter and woman does not imply mother. LINEBREAK answer: no LINEBREAK dataset LINEBREAK instance LINEBREAK gsm8k LINEBREAK question: tina buys 3 12-packs of soda for a party. including tina, 6 people are at the party. half of the people at the party have 3 sodas each, 2 of the people have 4, and 1 person has 5. how many sodas are left over when the party is over? LINEBREAK cosmosqa context: a woman had topped herself by jumping off the roof of the hospital she had just recently been admitted to. she was there because the first or perhaps latest suicide attempt was unsuccessful. she put her clothes on, folded the hospital gown and made the bed. she walked through the unit unimpeded and took the elevator to the top floor question: what would have happened to the woman if the staff at the hospital were doing their job properly? LINEBREAK drop LINEBREAK esnli LINEBREAK semeval LINEBREAK context: denver would retake the lead with kicker matt prater nailing a 43-yard field goal, yet carolina answered as kicker john kasay ties the game with a 39-yard field goal. . . . carolina closed out the half with kasay nailing a 44-yard field goal. . . . in the fourth quarter, carolina sealed the win with kasay’s 42-yard field goal. question: which kicker kicked the most field goals? premise: a child in a yellow plastic safety swing is laughing as a darkhaired woman in pink and coral pants stands behind her. hypothesis: a young mother is playing with her daughter in a swing. LINEBREAK context: now i am going to set the dining table up for dinner. first i put away all the stuff that is not supposed to be on the table. next i clean the table with a tissue paper. then i arrange some of the decorations on the table. after that i put down the plates and glasses.lastly in the remaining spaces on the table i put down what we are going to eat but i dont put down dessert yet. there is one more thing i do before i am finished setting up the dining table. i call my family down for dinner. i swept a drop of sweat of my chin and forehead. it was hard hard work but still it was so much fun. oh no my family is done with dinner and now i have to bring them dessert which is fruit i made myself. question: when did they clean the dining table? hypothesis: after it was set. LINEBREAK to construct diagnostic data from math datasets, we introduce four additional perturbations to simulate stepwise explanation errors that might arise in arithmetic reasoning task (arithmetic error), general knowledge about relationships and equation construction (common sense error), and misinformation about object/subject characteristics (factuality or hallucination): LINEBREAK • shuffle numbers: randomly shuffles all numbers in the chain, • shuffle operations: randomly shuffles all math operations in the chain, • random number: randomly replaces one number in the chain, • random operation: randomly replaces one math operation in the chain. LINEBREAK table 14: synthetic perturbations and corresponding error types of steps {ri} in reference chains used when constructing diagnostics datasets. g∗(·) represents grammar error, s∗(·) represents semantic change. LINEBREAK perturbation type error type LINEBREAK reference reasoning steps hypothesis reasoning steps LINEBREAK repeat a step remove a step shuffle steps swap a step negate a step hallucination grammar error semantic change LINEBREAK repetition missing step self-coherency self-coherency factuality hallucination grammatical factuality LINEBREAK f human annotations (cont. from § 5) LINEBREAK to construct human judged datasets, we perform human annotations on five datasets which we summarize in table 11 (type=’human judged’). these datasets do not include explanations (except gsm8k and esnli), so we construct model generated reasoning steps and label them with reasoning errors. we explain our generation process in §5 and app. e.2. we used five expert human annotators to collect reasoning error labels on five datasets. we asked human evaluators to directly rate the generated reasoning errors on overall chain level using a likert scale from 1 to 5. we also asked them to mark whether each error type proposed in our error taxonomy (§3) appeared in each step in step-level evaluations. in fig. 4 and fig. 5 we illustrate the ui used to collect the data. table 15 summarizes questions that experts were asked. table 16 reports the distribution of errors for each dataset. in general, we found that it was hard to get anonymous crowd workers to annotate our data accurately even when we paid averages of upwards of $30 an hour, hence relying on expert annotators. for the annotation sessions reported in the text of the paper, we find that it takes an average of 754 seconds for expert annotators to complete a session of at most 5 examples, or slightly over 2-and-a-half minutes per example. this highlights the difficulty of obtaining high-quality annotations on these cognitive challenging tasks. LINEBREAK figure 4: screenshot of expert annotation user interface, showing the context for the initial question as well as the questions regarding the generated response. LINEBREAK figure 5: screenshot of expert annotation user interface, showing questions asked for each step, using the question in fig 4. the questions are asked of every step generated by the model, with steps separated by sentence-ending periods. LINEBREAK table 15: evaluation perspectives used to human judged the datasets. the perspectives, which we used to ask humans to label, align with our taxonomy of reasoning errors. (continued from § 5) LINEBREAK level LINEBREAK evaluation perspective LINEBREAK overall qual LINEBREAK overall quality LINEBREAK overall coh LINEBREAK coherency LINEBREAK label details LINEBREAK does the generated response answer the question in a well-justified manner? (1=incomprehensible and wrong, 5=clear and correct) does the whole generated response make sense? (ie, does it sound understandable/non-contradictory/sensical, even if it fails to address the context?) - (1=sounds like nonsense, 5=easy to parse). LINEBREAK step LINEBREAK miss LINEBREAK missing step LINEBREAK y/n LINEBREAK step LINEBREAK gram LINEBREAK grammar LINEBREAK step LINEBREAK fact LINEBREAK factuality LINEBREAK y/n LINEBREAK y/n LINEBREAK step LINEBREAK logic LINEBREAK coherency and logic LINEBREAK y/n LINEBREAK step LINEBREAK hall LINEBREAK hallucination LINEBREAK step LINEBREAK red LINEBREAK redundancy LINEBREAK step LINEBREAK rep LINEBREAK repetition LINEBREAK y/n LINEBREAK y/n LINEBREAK y/n LINEBREAK step LINEBREAK common commonsense LINEBREAK y/n LINEBREAK step LINEBREAK math LINEBREAK arithmetic LINEBREAK y/n LINEBREAK is the reasoning in the generated response incomplete and lacking required information to produce the correct answer? specifically, does this response contains steps that, if added in, would make for a wellsupported chain? does this step contain faulty, unconventional, or controversial grammar usage? in other words, does the language in this step sounds unnatural? does this step contain information that contradicts the context while still largely talking about the same concepts? (ex. characteristics of named objects are wrong, named entities changed.) does this step any logical deduction errors (ie, makes a conclusion contradictory to previously stated clauses, including clauses within this step itself; makes a conclusion while not having enough support to make the conclusion) does this step contain information not provided in the problem statement that is irrelevant or wrong? does this step contain information not required to answer the question asked despite being factual and consistent with the context? does this step contain any information, possibly paraphrased, already mentioned in previous step (and thus could be dropped without impacting correctness)? does this step contain any errors in relation to general knowledge about the world (i.e. how to compute velocity, how many inches in one foot, etc) not explicitly provided in the context? does this step contain math equation errors? note that you should consider only current step in isolation, rather than issues propagated from prior steps. LINEBREAK table 16: statistics of types of errors in human judged datasets. each column reports the number of examples where the specified error type exists. (continue from § 5) LINEBREAK error type LINEBREAK drop gsm8k esnli cosmos semeval LINEBREAK grammar factuality hallucination redundancy repetition missing step coherency commonsense arithmetic LINEBREAK g sentence embedding model training (cont. from §6) LINEBREAK model training. we use the train portions of the perturbed diagnostics datasets to finetune the simcse embeddings model (explained in § 5) and validation portions to select the best embedding model. the test portions are used to evaluate our metrics against baseline metrics. we randomly select 500,000 samples with replacement from each dataset to create uniform representation and reduce bias. LINEBREAK the hyperparameters used to finetune simcse model are described in table 17. we use nvidia tesla v100 volta gpu instances with 32gb graphics card. we perform hyperparameter search, varying batch size in {32, 64, 256, 512, 1024, 2048}, learning rate in {5e-06, 1e-05, 5e-05, 1e-04}, and max sequence length in {64, 128, 512}. not all combinations of batch size and max sequence length were explored due to memory limitations. LINEBREAK table 17: hyperparameters used to fine-tune simcse model on perturbed datasets. LINEBREAK parameter LINEBREAK batch size max sequence length training epochs learning rate temperature LINEBREAK value LINEBREAK validation. we replace original validation procedure on semantic textual similarity tasks with similaritybased validation on perturbed reasoning chains. in particular, during training, we select best checkpoint that maximizes cosine similarity between positive and minimizes cosine similarity between hard-negative pairs within the batch of size b as the following: LINEBREAK i=1 [cos(si, ri) − cos(si, hi)] 2 ∗ b LINEBREAK model is evaluated every 100 steps on the development dataset and the best checkpoint is applied at the inference. other parameters not described in this section are kept as in the original simcse model used for initialization. LINEBREAK inference. we compare roscoe scores calculated against three embeddings: finetuned simcse model, sup-simcse-roberta-base simcse model, and all-mpnet-base-v2 sentence embedding model (reimers & gurevych, 2019). during inference, we set the random seed to 42. without this, the embedding-based scores naturally varied by about 0.01. LINEBREAK h additional experimental results (cont. from §6) LINEBREAK h.1 controlled experiments with diagnostics datasets LINEBREAK in this section, we presented somers’ d correlation of all metrics on all diagnostics datasets. table 18 summarizes the evaluations when investigated reference-free. one of the characteristics of our roscoe metrics is that, they can provide judgement of the model generated reasoning steps with and without the human reference reasoning chains. in the experiments section in §6, we discussed the results of our unsupervised scores in comparison to baseline scores when measured reference-free. in table 19, we summarize the correlation analysis on roscoe metrics in comparison to baselines on diagnostic datasets when reference is present for evaluation. specifically, each score is measured between the human provided reasoning steps (reference) and the model generated reasoning steps (hypothesis). we also display fine-grained meta-evaluations of all metrics on each diagnostics dataset in separate tables. specifically, tables 20, 26 for eqasc, tables 21, 27 for entailmentbank, tables 22, 28 for math, tables 23, 29 for proofwriter, tables 24, 30 for asdiv, and tables 25, 31 for aqua. LINEBREAK to understand if designed reference-free scores capture targeted error types we analyze perturbation-level correlations summarized in fig. 6. out of the all considered scores, info-chain is able to cover 10 out of 12 of errors, except remove step and semantic error perturbations. in general we can note that roscoe fails to consistently identify missing step error type represented by remove step perturbation across different datasets, while other synthesized error types are covered by at least one score type. LINEBREAK reference-based scores are covering all synthetic errors, with semantic coverage chain showing strong correlations with all types of perturbations (table 19). we also note that along with roscoe scores, the highest correlation among all reference-based scores belong to rouge and bert scores (tables 26-31). rouge scores consistently outperform on repetition, hallucination, remove step, shuffle steps, swap steps, negate step, and semantic perturbations, while under performing on random operation, and shuffle operations. we attribute this to the fact that rouge is an n-gram based score, so it is better in catching errors were wording has significantly changed, while failing to catch small changes within steps. LINEBREAK it is worth noting that some scores, especially those among reference-based evaluations, get the highest possible somers’ d correlation scores of 1.0. what it means is that in some scenarios, there is a perfect correlation between the metric and the error type. in other words, for this metric we can find a threshold such generated chains that have scores greater than the threshold do not have errors of the given type, and in all generated chains with scores less than the threshold have that error. it is especially evident on referenced-based metrics that directly compare the reference solution and hypothesis. in this scenario, we build correlation for two groups: 1) non-perturbed hypothesis: the score is calculated by comparing embedding similarities of the reference with itself, and we expect to get high scores, 2) perturbed hypothesis: comparing reference with its perturbed version, where the scores should be lower. in some cases, we are able to perfectly separate perturbed and non-perturbed chains based on the corresponding metric values by selecting a threshold, in other cases we cannot due to a number of false-negatives (i.e., a chain gets a high score, although the error is present). as an example, consider the semantic coverage-chain metric calculated on eqasc dataset using all-mpnet-base-v2 sentence embeddings, and hallucination perturbation (table 26). here the somers’ d correlation score is 1.0. semantic coverage-chain is calculated as a normalized cosine distance between the chain embedding of the reference solution r, and the chain embedding of the hypothesis h : [1 + cos(r, h)]/2. recall that in our setup, half of the hypothesis chains are perturbed reference chains, and another half is the same as the reference. while hallucination perturbation is an insertion of a random step from a dataset, it is hard to predict how if will affect the embedding of the chain as a whole, but on the unperturbed chains, where h == r, the semantic coverage-chain should be: [1 + cos(r, r)]/2 = 1.0. further review confirmed that in this dataset there are no false-positive instances, i.e., all chains with perturbations had semantic coverage-chain score less than 1.0. that means, we can always identify if the chain contains a hallucination LINEBREAK error or not, by comparing semantic coverage-chain value with 1.0 (threshold value), which is reflected in perfect somers’ d score. LINEBREAK highest correlations among reference-free scores belong to the repetition-* scores, that exhibit perfect correlation on eqasc dataset (tables 20-25). for other datasets, non-perfect correlations can be attributed to the small number of false-negatives, i.e. they give low repetition-* scores for chains with non-duplicated but similar steps, while all chains with duplicates got almost 0 scores (fig. 7). in eqasc explanations are created from a set of facts that are not directly related to each other, but are intended to give an answer when combined together. among all datasets considered, these steps are most dissimilar, and thus can be separated with similarity-based scores. LINEBREAK figure 6: relative presence of the strong score-perturbation correlation, measured as the number of datasets where for each score-perturbation pair somers’ d correlation value is in the 90th percentile, normalized by the total number of datasets where this type of perturbation occurs. statistics collected over roscoe referencefree scores with finetuned simcse embeddings. (continued from §7) LINEBREAK figure 7: box-and-whisker plots of interquartile ranges of scores, for repetition perturbations and repetition-* scores. while all perturbed subsets have 0 or near 0 scores, all datasets except eqasc have some chains that were also scored as low despite the absence of duplicates. LINEBREAK table 18: somers’ d correlation of all metrics on six diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlations that are not significant (p-value >= 0.05) are omitted when aggregating, and "-" denotes an absence of any significant correlations. note that asdiv is a 1-step equation dataset, so there are no repetition and self-consistency scores as there are no steps to compare. (continued from §6, more details in app. h.1.). LINEBREAK metric LINEBREAK entbank math aqua proofwriter eqasc asdiv LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc relevancy ctc consistency LINEBREAK roscoe metrics (reference-free metrics only) LINEBREAK roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.786 0.581 0.638 0.913 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.419 0.909 LINEBREAK info-chain repetition-step LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-sa with finetuned sup-simcse-roberta sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with finetuned sup-simcse-roberta sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK self-consistency source-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-step perplexity-chain grammar LINEBREAK table 19: somers’ d correlation of all reference-based metrics on six diagnostics datasets. metrics are measured using reference generations on (r, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. (continued from §6, more details in app. h.1.) LINEBREAK entbank math aqua proofwriter eqasc asdiv LINEBREAK metric LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc relevancy ctc consistency LINEBREAK roscoe metrics (reference-based metrics only) LINEBREAK roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step reasoning alignment commonsense missing step LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step reasoning alignment commonsense missing step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK hallucination redundancy semantic coverage-step reasoning alignment commonsense missing step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta sentence embeddings 1.000 LINEBREAK semantic coverage-chain LINEBREAK table 20: somers’ d correlations of all metrics per different perturbation applied on eqasc diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK perturbations → repet. halluc. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK grammar remove negate semantic LINEBREAK error LINEBREAK step LINEBREAK step LINEBREAK error LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings -0.006 -0.031 0.006 1.000† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.189† 1.000† LINEBREAK 0.220† -1.000† roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK info-chain repetition-step LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency -0.020 0.022 self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 21: somers’ d correlations of all metrics per different perturbation applied on entailment bank diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate semantic LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step LINEBREAK error LINEBREAK perturbations → repet. halluc. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.023 0.098 0.083 0.913† roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.023 0.098 0.083 0.913† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.039 0.909† LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK 0.071 -0.165† roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK -0.015 0.084 0.148† -0.216† roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK 0.515† 0.139† roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.392† 0.093 0.519† 0.055 0.364† 0.053 0.171† 0.137† roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.851† 0.133† LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency -0.044 -0.040 self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 22: somers’ d correlations of all metrics per different perturbation applied on math diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate random random shuffle LINEBREAK shuffle LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step number operation numbers operations LINEBREAK perturbations → repet. halluc. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK info-chain repetition-step LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.029 0.000 0.024 0.936† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.059† 0.932† LINEBREAK 0.172† -0.114† roscoe-sa with sup-simcse-roberta-base sentence embeddings 0.046† -0.004 0.092† -0.073† roscoe-ss with sup-simcse-roberta-base sentence embeddings 0.071† -0.094† LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK 0.114† 0.019 roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.223† 0.204† 0.133† 0.007 roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.588† 0.024 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 23: somers’ d correlations of all metrics per different perturbation applied on proofwriter diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK perturbations → repet. halluc. LINEBREAK grammar remove shuffle steps LINEBREAK error LINEBREAK step LINEBREAK swap negate semantic steps LINEBREAK error LINEBREAK step LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.002 0.004 -0.004 0.596† roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK -0.089† 0.116† roscoe-sa with sup-simcse-roberta-base sentence embeddings 0.154† 0.086† -0.063† 0.097† roscoe-ss with sup-simcse-roberta-base sentence embeddings -0.140† 0.115† LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK 0.004 0.028† roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.763† 0.499† 0.243† 0.036† roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.330† 0.248† 0.039† -0.007 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency -0.008 0.011 self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 24: somers’ d correlations of all metrics per different perturbation applied on asdiv diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK perturbations → LINEBREAK random random shuffle number operation numbers operations LINEBREAK shuffle LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.186† 0.182† 0.198† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.280† LINEBREAK faithfulness-step faithfulness-token info-step LINEBREAK info-chain LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 25: somers’ d correlations of all metrics per different perturbation applied on aqua diagnostics datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate random random shuffle LINEBREAK shuffle LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step number operation numbers operations LINEBREAK perturbations → repet. hallu. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.098 0.125 0.088 0.972† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.066 0.982† LINEBREAK 0.146† -0.169† roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK 0.135 0.117 0.162† -0.190† roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK 0.046 0.125 roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.165† 0.132 0.038 0.072 roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.465† 0.141† LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency -0.044 0.041 self-consistency LINEBREAK roscoe-lc LINEBREAK perplexity-chain perplexity-step grammar LINEBREAK table 26: somers’ d correlations of all metrics per different perturbation applied on eqasc diagnostics datasets. all metrics are measured reference-based on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove negate semantic LINEBREAK perturbations → LINEBREAK repet. hallu. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.999† 0.998† 0.998† 0.998† 0.998† 0.997† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.999† LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain 1.000† LINEBREAK step LINEBREAK step LINEBREAK error LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 1.000† LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 1.000† LINEBREAK table 27: somers’ d correlations of all metrics per different perturbation applied on entailment bank diagnostics datasets. all metrics are measured reference-based on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate semantic LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step LINEBREAK error LINEBREAK perturbations → LINEBREAK repet. hallu. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK semantic coverage-chain 1.000† 1.000† LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.927† 0.929† LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain 0.912† 0.934† LINEBREAK table 28: somers’ d correlations of all metrics per different perturbation applied on math diagnostics datasets. all metrics are measured reference-based on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate random random shuffle LINEBREAK shuffle LINEBREAK perturbations → LINEBREAK repet. hallu. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.835† 0.854† 0.853† 0.852† 0.850† 0.852† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.799† LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain 0.940† 0.946† LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step number operation numbers operations LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.674† 0.773† LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.674† 0.770† LINEBREAK table 29: somers’ d correlations of all metrics per different perturbation applied on proofwriter diagnostics datasets. all metrics are measured reference-based on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate semantic LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step LINEBREAK error LINEBREAK perturbations → LINEBREAK repet. hallu. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK semantic coverage-chain 1.000† 1.000† LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.995† 0.998† LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain 0.994† 0.998† LINEBREAK table 30: somers’ d correlations of all metrics per different perturbation applied on asdiv diagnostics datasets. all metrics are measured reference-based on (s, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK perturbations → LINEBREAK random random shuffle number operation numbers operations LINEBREAK shuffle LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK 1.000† roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 1.000† 1.000† 1.000† 1.000† 1.000† 1.000† roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 1.000† LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain LINEBREAK table 31: somers’ d correlations of all metrics per different perturbation applied on aqua diagnostics datasets. all metrics are measured reference-based on (r, h). the highest correlation overall for each dataset is in bold. the second best models are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from §6, more details in app. h.1.) LINEBREAK grammar remove shuffle swap negate random random shuffle LINEBREAK shuffle LINEBREAK perturbations → LINEBREAK repet. halluc. LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevancy ctc-consistency LINEBREAK error LINEBREAK roscoe metrics (reference-based on (s, h)) roscoe-sa with all-mpnet-base-v2 sentence embeddings 0.985† 0.992† 0.992† 0.992† 0.992† 0.987† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.995† LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK semantic coverage-chain 1.000† 1.000† LINEBREAK step LINEBREAK steps LINEBREAK steps LINEBREAK step LINEBREAK number operation numbers operations LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.965† 0.965† LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK reasoning alignment hallucination redundancy commonsense missing step semantic coverage-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain 0.957† 0.957† LINEBREAK h.2 experiments with human judgement datasets LINEBREAK in this section, we present somers’ d correlation of all metrics on all human judged datasets in separate tables. specifically, table 32 summarizes meta-evaluations for roscoe metrics in comparison to baselines on all human judged datasets. fine-grained evaluations are presented in table 33 for drop, table 34, 38 for gsm8k, table 35, 39 for esnli, table 36 for cosmosqa, and table 37 for semeval. human evaluation perspectives used in evaluations are described in app. table 15. LINEBREAK looking at how errors are captured by roscoe reference-free scores (fig. 8), we observe strongest correlations between redundancy error and repetition-*, self-consistency scores. repetition error is not present in this analysis as it has at most 3 occurrences per dataset. out of the all considered scores, self-consistency is able to cover 6 out of 7 evaluation perspectives, except missing step. LINEBREAK figure 8: relative presence of the strong score-error correlation, measured as the number of datasets where for each score and evaluation perspective pair somers’ d correlation value is in the 90th percentile, normalized by the total number of datasets where this type of perturbation occurs. statistics collected over roscoe reference-free scores with finetuned simcse embeddings, and evaluation perspectives where at least 10 errors are present in a dataset. LINEBREAK we further look at specific human annotated examples where our roscoe gives highest and lowest scores to understand strength and weaknesses of the proposed approach. results are summarized in table 40. similar analysis for diagnostic datasets is summarized in table 41. LINEBREAK table 32: somers’ d correlations of all metrics on five human judged datasets. all metrics are measured reference-free on (s, h). the highest correlation overall for each dataset is in bold and second best is underlined. correlations that are not significant (p-value ≥ 0.05) are omitted when aggregating, and "-" denotes an absence of any significant correlations. (continued from §6, more details in app. h.2.) LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency LINEBREAK drop gsm8k esnli cosmos semeval LINEBREAK roscoe metrics (reference-free on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.178 0.392 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.385 0.514 LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 33: somers’ d correlation of all metrics on drop human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-free on (s, h). the highest correlation overall for each aspect on each dataset is in bold, second best are underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK math LINEBREAK gram LINEBREAK miss LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency roscoe metrics (reference-free on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.143 -0.189 0.216 0.340 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings -0.393 0.165 LINEBREAK 0.108 0.036 roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.165† 0.052 LINEBREAK 0.240† -0.115 roscoe-ss with sup-simcse-roberta-base sentence embeddings 0.271† -0.085 LINEBREAK info-chain repetition-step LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 34: somers’ d correlation of all metrics on gsm8k human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-free on (s, h). the highest correlation overall for each aspect on each dataset is in bold, second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK math LINEBREAK gram LINEBREAK miss LINEBREAK 0.202† rouge-1 rouge-2 0.139 0.268† rouge-l 0.248† bleurt 0.220† bertscore bartscore 0.035 bartscore+ 0.132 bartscore-p 0.059 prism -0.075 -0.148† ctc-relevance -0.203† ctc-consistency roscoe metrics (reference-free on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings -0.138 -0.099 -0.025 0.224 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.035 0.254 LINEBREAK 0.097 0.199† roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.059 0.218† LINEBREAK 0.043 0.227† roscoe-ss with sup-simcse-roberta-base sentence embeddings 0.057 0.227† LINEBREAK info-chain repetition-step LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 35: somers’ d correlation of all metrics on esnli human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-free on (s, h). the highest correlation overall for each aspect on each dataset is in bold and second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK math LINEBREAK gram LINEBREAK miss LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency roscoe metrics (reference-free on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK 0.083 -0.021 roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.191† 0.007 LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 36: somers’ d correlation of all metrics on cosmos human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-free on (s, h). the highest correlation overall for each aspect on each dataset is in bold and second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK gram LINEBREAK miss LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency LINEBREAK roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK 0.013 0.011 roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.073 0.047 LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 37: somers’ d correlation of all metrics on semeval human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-free on (s, h). the highest correlation overall for each aspect on each dataset is in bold and second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK gram LINEBREAK miss LINEBREAK -0.208† rouge-1 rouge-2 0.060 -0.209† rouge-l -0.383† bleurt bertscore 0.064 bartscore -0.059 bartscore+ -0.098 bartscore-p -0.168 prism -0.040 -0.219† ctc-relevance -0.241† ctc-consistency roscoe metrics (reference-free on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings 0.694 0.714 0.835 -0.078 LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK faithfulness-step faithfulness-token info-step repetition-token LINEBREAK info-chain repetition-step LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings 0.539 -0.024 LINEBREAK -0.040 0.051 roscoe-ss with all-mpnet-base-v2 sentence embeddings 0.076 0.077 LINEBREAK 0.122 0.036 roscoe-ss with sup-simcse-roberta-base sentence embeddings 0.059 0.042 LINEBREAK info-chain repetition-step LINEBREAK info-chain repetition-step LINEBREAK roscoe-li LINEBREAK source-consistency self-consistency LINEBREAK roscoe-lc grammar perplexity-step perplexity-chain LINEBREAK table 38: somers’ d correlation of all metrics on gsm8k human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-based on (s, h). the highest correlation overall for each aspect on each dataset is in bold, second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK math LINEBREAK gram LINEBREAK miss LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency roscoe metrics (reference-based on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK roscoe-sa with all-mpnet-base-v2 sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK roscoe-ss with all-mpnet-base-v2 sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK table 39: somers’ d correlation of all metrics on esnli human judged dataset analyzing step-by-step reasoning on overall chain and step-level perspectives. all metrics are measured reference-based on (s, h). the highest correlation overall for each aspect on each dataset is in bold, second best is underlined. correlation scores with p-value < 0.05 are marked with †. (continued from § 6, more details in app. h.2) LINEBREAK qual LINEBREAK coh LINEBREAK common LINEBREAK fact LINEBREAK hall LINEBREAK red LINEBREAK rep LINEBREAK logic LINEBREAK math LINEBREAK gram LINEBREAK miss LINEBREAK rouge-1 rouge-2 rouge-l bleurt bertscore bartscore bartscore+ bartscore-p prism ctc-relevance ctc-consistency roscoe metrics (reference-based on (s, h)) roscoe-sa with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK roscoe-sa with sup-simcse-roberta-base sentence embeddings LINEBREAK hallucination redundancy semantic coverage-step missing step reasoning alignment commonsense LINEBREAK roscoe-ss with finetuned sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK -0.356 roscoe-ss with all-mpnet-base-v2 sentence embeddings -0.203 LINEBREAK semantic coverage-chain LINEBREAK roscoe-ss with sup-simcse-roberta-base sentence embeddings LINEBREAK semantic coverage-chain LINEBREAK table 40: roscoe performance analysis on examples from human judged datasets. errors are highlighted in red. (cont. from $ 6) LINEBREAK dataset context LINEBREAK reasoning chain LINEBREAK score type: score value; errors LINEBREAK info-step: 0.514; common, math LINEBREAK comment LINEBREAK common sense error: model should subtract smaller value (6,000) from bigger (20,000) to answer the question. arithmetic error: 6,000 minus 20,000 is -14,000. LINEBREAK drop LINEBREAK drop LINEBREAK over the next year, however, the polish forces were subject to attrition, as the sejm again refused to raise taxes and pay the army, resulting in mass desertions of unpaid soldiery. the polish problems were further aggravated by the incompetent leadership of hetman michał kazimierz pac, who obstructed sobieski’s leadership, while the ottomans continued to receive reinforcements. nonetheless in 1674 the commonwealth resumed the offensive, taking advantage of a new muscovy-ottoman conflict that year, and the polish-ottoman war remained undecided. sobieski’s force of 6,000 defeated 20,000 turks and tatars under ibrahim shyshman in the battle of lwow in august 1675. even after the battle of trembowla, the sejm still refused his pleas for more funds and a larger army. in 1676, after sobieski’s 16,000 withstood the twoweek siege of ˙zurawno, by 100,000 men under ibrahim pasha, a new peace treaty was signed, the treaty of ˙zurawno. the peace treaty partially reversing those from buczacz: the ottomans kept approximately two thirds of the territories they gained in 1672, and the commonwealth no longer was obliged to pay any kind of tribute to the empire; a large number of polish prisoners were released by the ottomans. how many was the difference beween sobieski’s force and the turks and tatars? claim: 14000. is the claim supported by the situation? the first azov campaign began in the spring of 1695. peter the great ordered his army to advance towards azov. the army comprised crack regiments and the don cossacks and was divided into three units under the command of franz lefort, patrick gordon and avtonom golovin. supplies were shipped down the don from voronezh.in 1693 the ottoman garrison of the fortress was 3,656, of whom 2,272 were janissaries.between june 27-july 5 the russians blocked azov from land but could not control the river and prevent resupply. after two unsuccessful attacks on august 5 and september 25, the siege was lifted on october 1. another russian army under the command of boris sheremetev set out for the lower reaches of the dnieper to take the ottoman forts there. the main fort at gazi-kerman was taken when its powder magazine blew up, as well as islam-kerman, tagan and tavan, but the russians were not able to hold the area and withdrew most of their forces. by the treaty of constantinople the remaining russians were withdrawn and the lower dnieper was declared a demilitarized zone. what happened first: russians blocked azov or treaty of constantinople? claim: russians blocked azov. is the claim supported by the situation? LINEBREAK info-step: 0.966, red LINEBREAK redundancy: repeats model sentences from context that are not directly relevant to the question and can be dropped. info-step score is however high, because it measures two-way similarity context between reasoning and thus being chain, not informative. LINEBREAK the first azov campaign began in the spring of 1695. peter the great ordered his army to advance towards azov. the army comprised crack regiments and the don cossacks and was divided into three units under the command of franz lefort, patrick gordon and avtonom golovin. supplies were shipped down the don from voronezh.in 1693 the ottoman garrison of the fortress was 3,656, of whom 2,272 were janissaries.between june 27-july 5 the russians blocked azov from land but could not control the river and prevent resupply. after two unsuccessful attacks on august 5 and september 25, the siege was lifted on october 1. another russian army under the command of boris sheremetev set out for the lower reaches of the dnieper to take the ottoman forts there. the main fort at gazi-kerman was taken when its powder magazine blew up, as well as islam-kerman. LINEBREAK dataset context LINEBREAK reasoning chain LINEBREAK gsm8k john has 3 boxes. each box is 5 inches by 6 inches by 4 inches. the walls are 1 inch thick. what is the total inner volume of all 3 boxes?
| 53
|
[
98.32136,
602.575120368,
264.7517933168,
635.560842368
] |
Cs3r5KLdoj.pdf
| 2,023
| 2
|
LINEBREAK learning mlps on graphs: a unified view of effectiveness, robustness, and efficiency LINEBREAK yijun tian1, chuxu zhang2, zhichun guo1, xiangliang zhang1, nitesh v. chawla1 1university of notre dame, 2brandeis university [email protected], [email protected], [email protected], [email protected], [email protected] LINEBREAK abstract LINEBREAK while graph neural networks (gnns) have demonstrated their efficacy in dealing with non-euclidean structural data, they are difficult to be deployed in real applications due to the scalability constraint imposed by the multi-hop data dependency. existing methods attempt to address this scalability issue by training student multi-layer perceptrons (mlps) exclusively on node content features using labels derived from the teacher gnns. however, the trained mlps are neither effective nor robust. in this paper, we ascribe the lack of effectiveness and robustness to three significant challenges: 1) the misalignment between content feature and label spaces, 2) the strict hard matching to teacher’s output, and 3) the sensitivity to node feature noises. to address the challenges, we propose nosmog, a novel method to learn noise-robust structure-aware mlps on graphs, with remarkable effectiveness, robustness, and efficiency. specifically, we first address the misalignment by complementing node content with position features to capture the graph structural information. we then design an innovative representational similarity distillation strategy to inject soft node similarities into mlps. finally, we introduce adversarial feature augmentation to ensure stable learning against feature noises. extensive experiments and theoretical analyses demonstrate the superiority of nosmog by comparing it to gnns and the state-of-the-art method in both transductive and inductive settings across seven datasets. codes are available at https://github.com/meettyj/nosmog. LINEBREAK introduction LINEBREAK graph neural networks (gnns) have shown exceptional effectiveness in handling non-euclidean structural data and have achieved state-of-the-art performance across a broad range of graph mining tasks (hamilton et al., 2017; kipf & welling, 2017; veliˇckovi´c et al., 2018). the success of modern gnns relies on the usage of message passing architecture, which aggregates and learns node representations based on their (multi-hop) neighborhood (wu et al., 2020; zhou et al., 2020). however, message passing is time-consuming and computation-intensive, making it challenging to apply gnns to real large-scale applications that are always constrained by latency and require the deployed model to infer fast (zhang et al., 2020; 2022a). to meet the latency requirement, multi-layer perceptrons (mlps) continue to be the first choice (zhang et al., 2022b), despite the fact that they perform poorly in non-euclidean data and focus exclusively on the node content information. LINEBREAK inspired by the performance advantage of gnns and the latency advantage of mlps, researchers have explored combining gnns and mlps together to enjoy the advantages of both (zhang et al., 2022b; zheng et al., 2022; chen et al., 2021). to combine them, one effective approach is to use knowledge distillation (kd) (hinton et al., 2015), where the learned knowledge is transferred from gnns to mlps through soft labels (phuong & lampert, 2019). then only mlps are deployed for inference, with node content features as input. in this way, mlps can perform well by mimicking the output of gnns without requiring explicit message passing, and thus obtaining a fast inference speed (hu et al., 2021). nevertheless, existing methods are neither effective nor robust, with three major drawbacks: (1) mlps cannot fully align the input content feature to the label space, especially when node labels are correlated with the graph structure; (2) mlps rely on the teacher’s output to learn a LINEBREAK strict hard matching, jeopardizing the soft structural representational similarity among nodes; and (3) mlps are sensitive to node feature noises that can easily destroy the performance. we thus ask: can we learn mlps that are graph structure-aware in both the feature and representation spaces, insensitive to node feature noises, and have superior performance as well as fast inference speed? LINEBREAK to address these issues and answer the question, we propose to learn noise-robust structure-aware mlps on graphs (nosmog), a novel method with remarkable performance, outstanding robustness and exceptional inference speed. specifically, we first extract node position features from the graph and combine them with node content features as the input of mlps. thus mlps can fully capture the graph structure as well as the node positional information. then, we design a novel representational similarity distillation strategy to transfer the node similarity information from gnns to mlps, so that mlps can encode the structural node affinity and learn more effectively from gnns through hidden layer representations. after that, we introduce the adversarial feature augmentation to make mlps noise-resistant and further improve the performance. to fully evaluate our model, we conduct extensive experiments on 7 public benchmark datasets in both transductive and inductive settings. experiments show that nosmog can outperform the state-of-the-art method and also the teacher gnns, with robustness to noises and fast inference speed. in particular, nosmog improves gnns by 2.05%, mlps by 25.22%, and existing state-of-the-art method by 6.63%, averaged across 7 datasets and 2 settings. in the meantime, nosmog achieves comparable efficiency to the state-of-the-art method and is 833× faster than gnns with the same number of layers. in addition, we provide theoretical analyses based on information theory and conduct consistency measurements between graph topology and model predictions to facilitate a better understanding of the model. to summarize, the contributions of this paper are as follows: LINEBREAK • we point out that existing works of learning mlps on graphs are neither effective nor robust. we identify three issues that undermine their capability: the misalignment between content feature and label spaces, the strict hard matching to teacher’s output, and the sensitivity to node feature noises. • to address the issues, we propose to learn noise-robust and structure-aware mlps on graphs, with remarkable effectiveness, robustness, and efficiency. the proposed model contains three key components: the incorporation of position features, representational similarity distillation, and adversarial feature augmentation. LINEBREAK • extensive experiments demonstrate that nosmog can easily outperform gnns and the state-ofthe-art method. in addition, we present theoretical analyses, robustness investigations, efficiency comparisons, and ablation studies to validate the superiority of the proposed model. LINEBREAK related work LINEBREAK graph neural networks. many graph neural networks (veliˇckovi´c et al., 2018; li et al., 2019; zhang et al., 2019; chen et al., 2020) have been proposed to encode the graph-structure data. they take advantage of the message passing paradigm by aggregating neighborhood information to learn node embeddings. for example, gcn (kipf & welling, 2017) introduces a layer-wise propagation rule to learn node features. gat (veliˇckovi´c et al., 2018) incorporates an attention mechanism to aggregate features. deepgcns (li et al., 2019) and gcnii (chen et al., 2020) utilize residual connections to aggregate neighbors from multi-hop and further address the over-smoothing problem. however, these message passing gnns only leverage local graph structure and have been demonstrated to be no more powerful than the wl graph isomorphism test (xu et al., 2019; morris et al., 2019). recent works propose to empower graph learning with positional encoding techniques such as laplacian eigenmap and deepwalk (you et al., 2019; wang et al., 2022; tian et al., 2023a), so that the node’s position within the broader context of the graph structure can be detected. inspired by these studies, we incorporate position features to fully capture the graph structure and node positional information. LINEBREAK knowledge distillation on graph. knowledge distillation (kd) has been applied widely in graphbased research and gnns (yang et al., 2020; yan et al., 2020; guo et al., 2023; tian et al., 2023b). previous works apply kd primarily to learn student gnns with fewer parameters but perform as well as the teacher gnns. however, time-consuming message passing is still required during the learning process. for example, lsp (yang et al., 2020) and tinygnn (yan et al., 2020) introduce the local structure-preserving and peer-aware modules that rely heavily on message passing. to overcome the latency issues, recent works start focusing on learning mlp-based student models that do not require message passing (hu et al., 2021; zhang et al., 2022b; zheng et al., 2022). specifically, mlp student LINEBREAK is trained with node content features as input and soft labels from gnn teacher as targets. although mlp can mimic gnn’s prediction, the graph structural information is explicitly overlooked from the input, resulting in incomplete learning, and the student is highly susceptible to noises that may be present in the feature. we address these concerns in our work. in addition, since adversarial learning has shown great performance in handling feature noises and enhancing model learning capability (jiang et al., 2020; xie et al., 2020; tian et al., 2022; kong et al., 2022), we introduce the adversarial feature augmentation to ensure stable learning against noises. LINEBREAK preliminary LINEBREAK notations. a graph is usually denoted as g = (v, e, c), where v represents the node set, e represents the edge set, c ∈ rn ×dc stands for the dc-dimensional node content attributes, and n is the total number of nodes. in the node classification task, the model tries to predict the category probability for each node v ∈ v, supervised by the ground truth node category y ∈ rk, where k is the number of categories. we use superscript l to mark the properties of labeled nodes (i.e., v l, cl, and y l), and superscript u to mark the properties of unlabeled nodes (i.e., v u , cu , and y u ). LINEBREAK graph neural networks. for a given node v ∈ v, gnns aggregate the messages from node neighbors n (v) to learn node embedding hv ∈ rdn with dimension dn. specifically, the node embedding in l-th layer h(l) v is learned by first aggregating (agg) the neighbor embeddings and then combining (com) it with the embedding from the previous layer. the whole learning process can be denoted as: h(l) LINEBREAK v = com(h(l−1) LINEBREAK , agg({h(l−1) LINEBREAK : u ∈ n (v)})). LINEBREAK u LINEBREAK v LINEBREAK proposed model LINEBREAK in this section, we present the details of nosmog. an overview of the proposed model is shown in figure 1. we develop nosmog by first introducing the background of training mlps with gnns distillation, and then illustrating three key components in nosmog, i.e., the incorporation of position features (figure 1 (b)), representational similarity distillation (figure 1 (c)), and adversarial feature augmentation (figure 1 (d)). LINEBREAK training mlps with gnns distillation. the key idea of training mlps with the knowledge distilled from gnns is simple. given a cumbersome pre-trained gnn, the ground truth label yv for any labeled node v ∈ v l, and the soft label zv learned by the teacher gnn for any node v ∈ v, the goal is to train a lightweight mlp using both ground truth labels and soft labels. the objective function can be formulated as: LINEBREAK l = LINEBREAK v∈v l LINEBREAK lgt ( ˆyv, yv) + λ LINEBREAK v∈v LINEBREAK lsl( ˆyv, zv), LINEBREAK where lgt is the cross-entropy loss between the student prediction ˆyv and the ground truth label yv, lsl is the kl-divergence loss between the student prediction ˆyv and the soft labels zv, and λ is a trade-off weight for balancing two losses. LINEBREAK incorporating node position features. to address the issue of misalignment between content feature and label spaces as well as assist mlp in capturing node positions on graph, we propose to enrich node content by positional encoding techniques such as deepwalk (perozzi et al., 2014). by simply concatenating the node content features with the learned position features, mlp is able to capture node positional information within a broad context of the graph structure and encode it in the feature space. the idea of incorporating position features is straightforward, yet as we will see, extremely effective. specifically, we first learn position feature pv for node v ∈ v by running deepwalk algorithm on g. noticed that there are no node content features involved in this step, so the position features are solely determined by the graph structure and the node positions in the graph. then, we concatenate (concat) the content feature cv and position feature pv to form the final node feature xv. after that, we send the concatenated node feature into mlp to obtain the category prediction ˆyv. the entire process is formulated as: LINEBREAK xv = concat(cv, pv), LINEBREAK ˆyv = mlp(xv). LINEBREAK later, ˆyv is leveraged to calculate lgt and lsl (equation 1). LINEBREAK figure 1: (a) the overall framework of nosmog: a gnn teacher is trained on the graph to obtain the representational node similarity and soft labels. then, an mlp student is trained on node content features and position features, guided by the learned representational node similarity and soft labels. we also introduce the adversarial feature augmentation to ensure stable learning against feature noises. (b) acquisition of node position features: capturing node positional information by positional encoding techniques. (c) representational similarity distillation: enforcing mlp to learn node similarity from gnn’s representation space. (d) adversarial feature augmentation: learning adversarial features by generating adversarial perturbation for input features. LINEBREAK representational similarity distillation. with the aim of mitigating the constraint of strict hard matching to teacher’s output, and facilitating mlp to capture the soft structural node similarity, we propose the representational similarity distillation (rsd) to encourage mlp to learn from gnn’s representation space. rsd preserves the similarity between node embeddings, and leverages mean squared error to measure the similarity discrepancy between gnn and mlp. compared to soft labels, the relative similarity between intermediate representations of different nodes serves as a more flexible and appropriate guidance from the teacher model (tung & mori, 2019). specifically, given the learned gnn representations hg ∈ rn ×dg and the mlp representations hm ∈ rn ×dm , where dg and dm indicate the representation dimension of gnn and mlp respectively, we define the intra-model representational similarity sgn n , sm lp for gnn and mlp as: LINEBREAK sgn n = hg · (hg)t LINEBREAK sm lp = h ′ (3) where wm ∈ rdm ×dm is the transformation matrix, σ is the activation function (we use relu in this work), and h ′ m is the transformed mlp representations. we then define the rsd loss lrsd to minimize the inter-model representation similarity using the frobenius norm || · ||f : LINEBREAK m = σ(wm · hm ), LINEBREAK m )t , h ′ LINEBREAK m · (h ′ LINEBREAK and LINEBREAK lrsd(sgn n , sm lp ) = ||sgn n − sm lp ||2 f , LINEBREAK adversarial feature augmentation. mlp is highly susceptible to feature noises (dey et al., 2017) if only considers the explicit feature information associated with each node. to enhance mlp’s robustness to noises, we introduce the adversarial feature augmentation to leverage the regularization power of adversarial features (kong et al., 2022; zhang et al., 2023). in other words, adversarial feature augmentation makes mlp invariant to small feature fluctuations and generalizes to out-ofdistribution samples, with the ability to further boost performance (wang et al., 2019). compared to the vanilla training that original node content features c are utilized to obtain the category prediction, adversarial training learns the perturbation δ and sends maliciously perturbed features x + δ as input for mlp to learn. this process can be formulated as the following min-max optimization problem: LINEBREAK min θ LINEBREAK max ∥δ∥p≤ϵ LINEBREAK (−y log(mlp(x + δ))) LINEBREAK where x represents the concatenation of node content and position features as shown in eq. 2, θ indicates the model parameters, δ is the perturbation, ∥ · ∥p is the ℓp-norm distance metric, and ϵ is the perturbation range. specifically, we choose projected gradient descent (madry et al., 2018) as LINEBREAK the default attacker to generate adversarial perturbation iteratively: LINEBREAK δt+1 = π∥δ∥∞≤ϵ [δt + s · sign (∇δ (−y log(mlp(x + δt))))] , where s is the perturbation step size and ∇δ is the calculated gradient given δ. for maximum robustness, the final perturbation δ = δt is learned by updating equation 6 for t times to generate the worst-case noises. finally, to accommodate kd, we perform adversarial training using both ground truth labels yv for labeled nodes (v ∈ v l), and soft labels zv for all nodes in graph (v ∈ v). therefore, we can reformulate the objective in equation 5 as follows: LINEBREAK x ′ LINEBREAK v = xv + δ, [− LINEBREAK ladv = max δ∈ϵ LINEBREAK ˆy′ v = mlp(x ′ (cid:88) yv log( ˆy′ v) − LINEBREAK v), zv log( ˆy′ LINEBREAK v)]. LINEBREAK v∈v l LINEBREAK v∈v LINEBREAK the final objective function l is defined as the weighted combination of ground truth cross-entropy loss lgt , soft label distillation loss lsl, representational similarity distillation loss lrsd and adversarial learning loss ladv : LINEBREAK l = lgt + λlsl + µlrsd + ηladv , LINEBREAK where λ, µ and η are trade-off weights for balancing lsl, lrsd and ladv , respectively. LINEBREAK experiments LINEBREAK in this section, we conduct extensive experiments to validate the effectiveness, robustness, and efficiency of the proposed model and answer the following questions: 1) can nosmog outperform gnns, mlps, and other gnns-mlps methods? 2) can nosmog work well under both inductive and transductive settings? 3) can nosmog work well with noisy features? 4) how does nosmog perform in terms of inference time? 5) how does nosmog perform with different model components? 6) how does nosmog perform with different teacher gnns? 7) how can we explain the superior performance of nosmog? LINEBREAK experiment settings LINEBREAK datasets. we use five widely used public benchmark datasets (i.e., cora, citeseer, pubmed, a-computer, and a-photo) (zhang et al., 2022b; yang et al., 2021), and two large ogb datasets (i.e., arxiv and products) (hu et al., 2020) to evaluate the proposed model. model architectures. for a fair comparison, we follow the paper (zhang et al., 2022b) to use graphsage (hamilton et al., 2017) with gcn aggregation as the teacher model. however, we also show the impact of other teacher models including gcn (kipf & welling, 2017), gat (veliˇckovi´c et al., 2018) and appnp (klicpera et al., 2019) in section 5.7. evaluation protocol. for experiments, we report the mean and standard deviation of ten separate runs with different random seeds. we adopt accuracy to measure the model performance, use validation data to select the optimal model, and report the results on test data. two settings: transductive vs. inductive. to fully evaluate the model, we conduct node classification in two settings: transductive (tran) and inductive (ind). for tran, we train models on g, x l, and y l, while evaluate them on x u and y u . we generate soft labels for every nodes in the graph (i.e., zv for v ∈ v). for ind, we randomly select out 20% test data for inductive evaluation. specifically, we separate the unlabeled nodes v u into two disjoint observed and inductive subsets (i.e., v u = v u obs ⊔ v u ind with no shared nodes. the edges between gl ⊔ gu ind are removed during training but are used during inference to transfer position features by average operator (hamilton et al., 2017). node features and labels are partitioned into three disjoint sets, i.e., x = x l ⊔ x u ind. we generate soft labels for nodes in the labeled and observed subsets (i.e., zv for v ∈ v l ⊔ v u LINEBREAK ind), which leads to three separate graphs g = gl ⊔ gu LINEBREAK ind and y = y l ⊔ y u LINEBREAK obs and gu LINEBREAK obs ⊔ x u LINEBREAK obs ⊔ y u obs). LINEBREAK obs ⊔ gu LINEBREAK can nosmog outperform gnns, mlps, and other gnns-mlps methods? LINEBREAK we compare nosmog to gnn, mlp, and the state-of-the-art method under the standard transductive setting and report the results in table 1, which can be directly comparable to those reported in previous literature (zhang et al., 2022b; hu et al., 2020; yang et al., 2021). as shown in table 1, LINEBREAK table 1: nosmog outperforms gnn, mlp, and the state-of-the-art method glnn on all datasets under the standard setting. ∆gn n , ∆m lp , ∆gln n represents the difference between the nosmog and gnn, mlp, glnn, respectively. results show accuracy (higher is better). LINEBREAK datasets LINEBREAK sage LINEBREAK mlp LINEBREAK glnn LINEBREAK nosmog LINEBREAK ∆gn n LINEBREAK ∆m lp LINEBREAK ∆gln n LINEBREAK cora citeseer pubmed a-computer a-photo arxiv products LINEBREAK nosmog outperforms both teacher model and baseline methods on all datasets. compared to the teacher gnn, nosmog improves the performance by 2.46% on average across different datasets, which demonstrates that nosmog can capture better structural information than gnn without explicit graph structure input. compared to mlp, nosmog improves the performance by 26.29% on average across datasets, while the state-of-the-art method glnn can only improve mlp by 18.55%, which shows the efficacy of kd and demonstrates that nosmog can capture additional information that glnn cannot. compared to glnn, nosmog improves the performance by 6.86% on average across datasets. specifically, glnn performs poorly in large ogb datasets (the last 2 rows) while nosmog learns well and shows an improvement of 12.39% and 23.14%, respectively. this further demonstrates the effectiveness of nosmog. the analyses of the capability of each model component and the expressiveness of nosmog are shown in sections 5.6 and 5.8, respectively. LINEBREAK can nosmog work well under both inductive and transductive settings? LINEBREAK to better understand the effectiveness of nosmog, we conduct experiments in a realistic production (prod) scenario that involves both inductive (ind) and transductive (tran) settings (see table 2). we find that nosmog can achieve superior or comparable performance to the teacher model and baseline methods across all datasets and settings. specifically, compared to gnn, nosmog achieves better performance in all datasets and settings, except for ind on arxiv and products where nosmog can only achieve comparable performance. considering these two datasets have a significant distribution shift between training data and test data (zhang et al., 2022b), this is understandable that nosmog cannot outperform gnn without explicit graph structure input. however, compared to glnn which can barely learn on these two datasets, nosmog improves the performance extensively, i.e., 18.72% and 11.01% on these two datasets, respectively. this demonstrates the capability of nosmog in capturing graph structural information on large-scale datasets, despite the significant distribution shift. in addition, nosmog outperforms mlp and glnn by great margins in all datasets and settings, with an average of 24.15% and 6.39% improvement, respectively. therefore, we conclude that nosmog can achieve exceptional performance in the production environment with both inductive and transductive settings. LINEBREAK can nosmog work well with noisy features? LINEBREAK considering that mlp and glnn are sensitive to feature noises and may not perform well when the labels are uncorrelated with the node content, we further evaluate the performance of nosmog with regards to noise levels in figure 2. experiment results are averaged across various datasets. specifically, we add different levels of gaussian noises to content features by replacing c with ˜c = (1 − α)c + αn, where n represents gaussian noises that independent from c, and α ∈ [0, 1] incates the noise level. we find that nosmog achieves better or comparable performance to gnns across different α, which demonstrates the superior efficacy of nosmog, especially when gnns can mitigate the impact of noises by leveraging information from neighbors and surrounding subgraphs, whereas nosmog only relies on content and position features. glnn and mlp, however, LINEBREAK figure 2: accuracy vs. feature noises. LINEBREAK table 2: nosmog outperforms gnn, mlp, and the state-of-the-art method glnn in a production scenario with both inductive and transductive settings. ind indicates the results on v u ind, tran indicates the results on v u LINEBREAK tran, and prod indicates the interpolated production results of both ind and tran. LINEBREAK datasets LINEBREAK cora LINEBREAK citeseer LINEBREAK pubmed LINEBREAK a-computer LINEBREAK a-photo LINEBREAK arxiv LINEBREAK products LINEBREAK eval LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK prod ind tran LINEBREAK sage LINEBREAK mlp LINEBREAK glnn LINEBREAK nosmog LINEBREAK drop their performance quickly as α increases. in the extreme case when α equals 1, the input features are completely noises and ˜c and c are independent. we observe that nosmog can still perform as good as gnns by considering the position features, while glnn and mlp perform poorly. LINEBREAK how does nosmog perform in terms of inference time? LINEBREAK to demonstrate the efficiency of nosmog, we analyze the capacity of nosmog by visualizing the trade-off between prediction accuracy and model inference time on products dataset in figure 3. we find that nosmog can achieve high accuracy (78%) while maintaining a fast inference time (1.35ms). specifically, compared to other models with similar inference time, nosmog performs significantly better, while glnn and mlps can only achieve 64% and 60% accuracy, respectively. for those models that have close or similar performance as nosmog, they need a considerable amount of time for inference, e.g., 2 layers graphsage (sage-l2) needs 144.47ms and 3 layers graphsage (sage-l3) needs 1125.43ms, which is not applicable in real applications. this makes nosmog 107× faster than sage-l2 and 833× faster than sage-l3. in addition, since increasing the hidden size of glnn may improve the performance, we compare nosmog with glnnw4 (4-times wider than glnn) and glnnw8 (8-times wider than glnn). results show that although glnnw4 and glnnw8 can improve glnn, they still perform worse than nosmog and even require more time for inference. we thus conclude that nosmog is superior to existing methods and gnns in terms of both accuracy and inference time. LINEBREAK figure 3: accuracy vs. inference time. LINEBREAK how does nosmog perform with different model components?
| 6
|
[
108.249,
124.5980784,
442.0473944,
134.5606784
] |
0IO5VdnSAaH.pdf
| 2,021
| 0
|
LINEBREAK on the universality of the double descent peak in ridgeless regression LINEBREAK david holzmüller university of stuttgart faculty of mathematics and physics institute for stochastics and applications [email protected] LINEBREAK abstract LINEBREAK we prove a non-asymptotic distribution-independent lower bound for the expected mean squared generalization error caused by label noise in ridgeless linear regression. our lower bound generalizes a similar known result to the overparameterized (interpolating) regime. in contrast to most previous works, our analysis applies to a broad class of input distributions with almost surely full-rank feature matrices, which allows us to cover various types of deterministic or random feature maps. our lower bound is asymptotically sharp and implies that in the presence of label noise, ridgeless linear regression does not perform well around the interpolation threshold for any of these feature maps. we analyze the imposed assumptions in detail and provide a theory for analytic (random) feature maps. using this theory, we can show that our assumptions are satisfied for input distributions with a (lebesgue) density and feature maps given by random deep neural networks with analytic activation functions like sigmoid, tanh, softplus or gelu. as further examples, we show that feature maps from random fourier features and polynomial kernels also satisfy our assumptions. we complement our theory with further experimental and analytic results. LINEBREAK introduction LINEBREAK seeking for a better understanding of the successes of deep learning, zhang et al. (2016) pointed out that deep neural networks can achieve very good performance despite being able to fit random noise, which sparked the interest of many researchers in studying the performance of interpolating learning methods. belkin et al. (2018) made a similar observation for kernel methods and showed that classical generalization bounds are unable to explain this phenomenon. belkin et al. (2019a) observed a “double descent” phenomenon in various learning models, where the test error first decreases with increasing model complexity, then increases towards the “interpolation threshold” where the model is first able to fit the training data perfectly, and then decreases again in the “overparameterized” regime where the model capacity is larger than the training set. this phenomenon has also been discovered in several other works (bös & opper, 1997; advani & saxe, 2017; neal et al., 2018; spigler et al., 2019). nakkiran et al. (2019) performed a large empirical study on deep neural networks and found that double descent can not only occur as a function of model capacity, but also as a function of the number of training epochs or as a function of the number of training samples. LINEBREAK theoretical investigations of the double descent phenomenon have mostly focused on specific unregularized (“ridgeless”) or weakly regularized linear regression models. these linear models can rd, where the covariates xi are mapped to be described via i.i.d. samples (x1, y1), . . . , (xn, yn) rp via a (potentially random) feature map φ, and (ridgeless) feature representations zi = φ(xi) linear regression is then performed on the transformed samples (zi, yi). while linear regression with random features can be understood as a simplified model of fully trained neural networks, it is also interesting in its own right: for example, random fourier features (rahimi & recht, 2008) and random neural network features (see e.g. cao et al., 2018; scardapane & wang, 2017) have gained a notable amount of attention. LINEBREAK unfortunately, existing theoretical investigations of double descent are usually limited in one or more of the following ways: LINEBREAK (1) they assume that the zi (or a linear transformation thereof) have (centered) i.i.d. components. this assumption is made by hastie et al. (2019), while advani & saxe (2017) and belkin et al. (2019b) even assume that the zi follow a gaussian distribution. while the assumption of i.i.d. components facilitates the application of some random matrix theory results, it excludes most feature maps: for feature maps φ with d < p, the zi will usually be concentrated on a d-dimensional submanifold of rp, and will therefore usually not have i.i.d. components. LINEBREAK (2) they assume a (shallow) random feature model with fixed distribution of the xi, e.g. an isotropic gaussian distribution or a uniform distribution on a sphere. examples for this are the single-layer random neural network feature models by hastie et al. (2019) in the unregularized case and by mei & montanari (2019); d’ascoli et al. (2020a) in the regularized case. a simple fourier model with d = 1 has been studied by belkin et al. (2019b). while these analyses provide insights for some practically relevant random feature models, the assumptions on the input distribution prevent them from applying to real-world data. and n/p LINEBREAK → where γ the model by belkin et al. (2019b) where the zi follow a standard gaussian distribution. LINEBREAK γ, ) is a constant. this applies to all works mentioned in (1) and (2) except LINEBREAK (3) their analysis only applies in a high-dimensional limit where n, p LINEBREAK in this paper, we provide an analysis under significantly weaker assumptions. we introduce the basic setting of our paper in section 2 and section 3. our main contributions are: LINEBREAK • in section 4, we show a non-asymptotic distribution-independent lower bound for the expected excess risk of ridgeless linear regression with (random) features. while the underparameterized bound is adapted from a minimax lower bound in mourtada (2019), the overparameterized bound is new and perfectly complements the underparameterized version. the obtained general lower bound relies on significantly weaker assumptions than most previous works and shows that there is only limited potential to reduce the sensitivity of unregularized linear models to label noise via engineering better feature maps. LINEBREAK • in section 5, we show that our lower bound applies to a large class of input distributions and feature maps including random deep neural networks, random fourier features and polynomial kernels. this analysis is also relevant for related work where similar assumptions are not investigated (e.g. mourtada, 2019; muthukumar et al., 2020). for random deep neural networks, our result requires weaker assumptions than a related result by nguyen & hein (2017). LINEBREAK • in section 6 and appendix c, we compare our lower bound to new theoretical and experimental results for specific examples, including random neural network feature maps as well as finite-width neural tangent kernels (jacot et al., 2018). we also show that our lower bound is asymptotically sharp in the limit n, p LINEBREAK similar to this paper, muthukumar et al. (2020) study the “fundamental price of interpolation” in the overparameterized regime, providing a probabilistic lower bound for the generalization error under the assumption of subgaussian features or (suitably) bounded features. we explain the difference to our lower bound in detail in appendix l, showing that our overparameterized lower bound for the expected generalization error requires significantly weaker assumptions, that it is uniform across feature maps and that it yields a more extreme interpolation peak. LINEBREAK our lower bound also applies to a large class of kernels if they can be represented using a feature map with finite-dimensional feature space, i.e. p < . for ridgeless regression with certain classes of ∞ kernels, lower or upper bounds have been derived (liang & rakhlin, 2020; rakhlin & zhai, 2019; liang et al., 2019). however, as explained in more detail in appendix k, these analyses impose restrictions on the kernels that allow them to ignore “double descent” type phenomena in the feature space dimension p. LINEBREAK beyond double descent, a series of papers have studied “multiple descent” phenomena theoretically and empirically, both with respect to the number of parameters p and the input dimension d. adlam & pennington (2020) and d’ascoli et al. (2020b) theoretically investigate triple descent phenomena. nakkiran et al. (2020) argue that double descent can be mitigated by optimal regularization. they also empirically observe a form of triple descent in an unregularized model. liang LINEBREAK et al. (2019) prove an upper bound exhibiting infinitely many peaks and empirically observe multiple descent. chen et al. (2020) show that in ridgeless linear regression, the feature distributions can be designed to control the locations of ascents and descents in the double descent curve for a “dimension-normalized” noise-induced generalization error. our lower bound provides a fundamental limit to this “designability” of the generalization curve for methods that can interpolate with probability one in the overparameterized regime. LINEBREAK proofs for our statements can be found in the appendix. we provide code to reproduce all of our experimental results at LINEBREAK https://github.com/dholzmueller/universal_double_descent LINEBREAK and we will provide the computed data at https://doi.org/10.18419/darus-1771. LINEBREAK basic setting and notation LINEBREAK following györfi et al. (2002), we consider the scenario where the samples (xi, yi) of a data set d = r)n are sampled independently from a probability distribution p ((x1, y1), . . . , (xn, yn)) on rd r, i.e. d LINEBREAK (rd p n.1 we define LINEBREAK x := LINEBREAK n LINEBREAK d, LINEBREAK r LINEBREAK y := LINEBREAK n . LINEBREAK r LINEBREAK y1 ... yn LINEBREAK we also consider random variables (x, y) of x by px . the (least squares) population risk of a function f : rd LINEBREAK p that are independent of d and denote the distribution LINEBREAK r is defined as LINEBREAK rp (f ) := ex,y(y LINEBREAK we assume ey2 < LINEBREAK . then, rp is minimized by the target function f ∗p given by LINEBREAK we have rp (f ∗p ) < LINEBREAK f ∗p (x) = e(y LINEBREAK x) , LINEBREAK | , and the excess risk (a.k.a. generalization error) of a function f is LINEBREAK rp (f ) LINEBREAK rp (f ∗p ) = ex(f (x) LINEBREAK f ∗p (x))2 . LINEBREAK b if a LINEBREAK b is positive definite. for a symmetric matrix s LINEBREAK b is positive semidefinite and a × LINEBREAK notation for two symmetric matrices, we write a (cid:31) b if a λn(s) ≥ ≥ be its eigenvalues in descending order. we denote the trace of a by tr(a) and the moore-penrose pseudoinverse of a by a+. for φ : rd p be the matrix rp and x rn × with φ applied to each of the rows of x individually. for a set , we denote its indicator function by 1 . for a random variable x, we say that x has a lebesgue density if px can be represented by a probability density function (w.r.t. the lebesgue measure). we say that x is nonatomic if for all possible values (cid:101)x, p (x = (cid:101)x) = 0. we denote the uniform distribution on a set , e.g. the unit sphere sp 1 ). we denote the normal (gaussian) distribution with mean µ and − covariance σ by LINEBREAK ∈ d, we let φ(x) LINEBREAK rp, by a (µ, σ). for n LINEBREAK n, we let λ1(s) LINEBREAK n, we define [n] := LINEBREAK − rn LINEBREAK rn LINEBREAK a LINEBREAK a LINEBREAK u LINEBREAK a LINEBREAK ⊆ n LINEBREAK we review relevant matrix facts, e.g. concerning the moore-penrose pseudoinverse, in appendix b. LINEBREAK linear regression with (random) features LINEBREAK the most general setting that we will consider in this paper is ridgeless linear regression in random features: given a random variable θ that is independent from the data set d and an associated random feature map φθ : rd LINEBREAK rp, we define the estimator fx,y,θ(x) := φθ(x)(cid:62)φθ(x)+y , LINEBREAK 1although many of our theorems apply to general domains xi ∈ x and not just x = r LINEBREAK d, we set x = r d d whenever we assume that the distribution of the xi has a LINEBREAK for notational simplicity. we require x = r lebesgue density or work with analytic feature maps. LINEBREAK which simply performs unregularized linear regression with random features. as a special case, the feature map φθ may be deterministic, in which case we drop the index θ. an even more specialized case is ordinary linear regression, where d = p and φθ = id, yielding fx,y(x) = x(cid:62)x +y. LINEBREAK as described in hastie et al. (2019), the ridgeless linear regression parameter (cid:98)β := φθ(x)+y 2 y 2, (cid:107) φθ(x)β (cid:107) LINEBREAK • has minimal euclidean norm among all parameters β minimizing • is the limit of gradient descent with sufficiently small step size on l(β) := LINEBREAK with initialization β(0) := 0, and LINEBREAK • is the limit of ridge regression with regularization λ > 0 for λ LINEBREAK y LINEBREAK for a fixed feature map φ, the kernel trick provides a correspondence between ridgeless linear regression with φ and ridgeless kernel regression with the kernel k(x, ˜x) := φ(x)(cid:62)φ(˜x) via LINEBREAK fx,y(x) = φ(x)(cid:62)φ(x)+y = φ(x)(cid:62)φ(x)(cid:62)(φ(x)φ(x)(cid:62))+y = k(x, x)k(x, x)+y , LINEBREAK where LINEBREAK k(x, x) := LINEBREAK k(x, x1) ... k(x, xn) LINEBREAK k(x, x) := LINEBREAK a lower bound LINEBREAK k(x1, xn) ... LINEBREAK . . . . . . . . . k(xn, xn) LINEBREAK in this section, we prove our main theorem, which provides a non-asymptotic distributionindependent lower bound on the expected excess risk. LINEBREAK rp (f ∗p ) can be decomposed into several different the expected excess risk ex,y,θrp (fx,y,θ) contributions (see e.g. d’ascoli et al., 2020a). in the following, we will focus on the contribution of label noise to the expected excess risk for the estimators fx,y,θ considered in section 3. using a bias-variance decomposition with respect to y, it is not hard to show that the label-noise-induced error provides a lower bound for the expected excess risk: x fx,y,θ(x)(cid:1)2 (cid:0)fx,y,θ(x) LINEBREAK x fx,y,θ(x)(cid:1)2 LINEBREAK + (cid:0) LINEBREAK ey LINEBREAK x fx,y,θ(x) | LINEBREAK enoise := ex,y,θ,x (cid:104) ey ex,θ,x ≤ = ex,y,θ,x (fx,y,θ(x) = ex,y,θ(rp (fx,y,θ) LINEBREAK x | LINEBREAK ey (cid:0)fx,y,θ(x) LINEBREAK ey − f ∗p (x))2 rp (f ∗p )) . LINEBREAK enoise does not depend on f ∗p and is LINEBREAK for linear models as considered here, it is not hard to see that equal to the expected excess risk in the special case f ∗p ≡ in the following, we first consider the setting where the feature map φ is deterministic. we will consider linear regression on z := φ(x) and z := φ(x) and formulate our assumptions directly w.r.t. the distribution pz of z, hiding the dependence on the feature map φ. while the distribution px of x is usually fixed and determined by the problem, the distribution pz can be actively influenced by choosing a suitable feature map φ. we will analyze in section 5 how the assumptions on pz can be translated back to assumptions on px and assumptions on φ. remark 1. for typical feature maps, we have p > d, pz is concentrated on a d-dimensional submanifold of rp and the components of z are not independent. a simple example (cf. proposition 8) 1). the imposed assumptions on is a polynomial feature map φ : r1 pz should hence allow for such distributions on submanifolds and not require independent compo(cid:74) nents. definition 2. assuming that e (cid:107) (positive semidefinite) second moment matrix LINEBREAK , i.e. (mom) in theorem 3 holds, we can define the LINEBREAK rp, x LINEBREAK z LINEBREAK (cid:2)zz(cid:62) if ez = 0, σ is also the covariance matrix of z. if σ is invertible, i.e. (cov) in theorem 3 holds, 1/2 satisfy ewiw(cid:62)i = i p. (cid:74) the rows wi := σ− LINEBREAK 1/2xi of the “whitened” data matrix w := zς− LINEBREAK σ := ez LINEBREAK p . LINEBREAK r LINEBREAK pz LINEBREAK (cid:3) LINEBREAK p LINEBREAK with these preparations, we can now state our main theorem. its assumptions and the obtained lower bound will be discussed in section 5 and section 6, respectively. theorem 3 (main result). let n, p LINEBREAK 1. assume that p and φ satisfy: LINEBREAK , ∞ σ2 almost surely over z, , i.e. σ exists and is finite, LINEBREAK (int) ey2 < ∞ (noi) var(y z) | 2 2 < (cid:107) rn LINEBREAK and hence rp (f ∗p ) < ≥ ∞ p almost surely has full rank, i.e. rank z = min { LINEBREAK (mom) e z (cid:107) (cov) σ is invertible, (frk) z then, for the ridgeless linear regression estimator fz,y(z) = z(cid:62)z+y, the following holds: LINEBREAK . n, p } LINEBREAK if p LINEBREAK if p LINEBREAK n, LINEBREAK n, LINEBREAK (i) LINEBREAK ≥ (i) LINEBREAK enoise LINEBREAK enoise LINEBREAK ez tr((z+)(cid:62)σz+) LINEBREAK (ii) LINEBREAK ez tr((w w (cid:62))− LINEBREAK ez tr((z+)(cid:62)σz+) LINEBREAK (iii) = σ2 LINEBREAK ez tr((w (cid:62)w )− LINEBREAK (iv) LINEBREAK ≥ (v) LINEBREAK here, the matrix inverses exist almost surely in the considered cases. moreover, we have: LINEBREAK n LINEBREAK p LINEBREAK • if (noi) holds with equality, then (i) holds with equality. • if n = p or σ = λi p for some λ > 0, then (ii) holds with equality. LINEBREAK for a discussion on how σ influences enoise, we refer to remark g.1. we can extend theorem 3 to random features if it holds for almost all of the random feature maps: rp is corollary 4 (random features). let θ a random feature map. consider the random features regression estimator fx,y,θ(x) = z(cid:62)θ z+ θ y with zθ := φθ(x) and zθ := φθ(x). if for pθ-almost all (cid:101)θ, the assumptions of theorem 3 are satisfied for z = z(cid:101)θ and z = z (cid:101)θ (with the corresponding matrix σ = σ LINEBREAK pθ be a random variable such that φθ : rd LINEBREAK enoise ≥ LINEBREAK n LINEBREAK p LINEBREAK if p if p LINEBREAK n, n. LINEBREAK n: the lower the main novelty in theorem 3 is the explicit uniform lower bound (iv) for p bound (v) for p n follows by adapting corollary 1 in mourtada (2019). statements similar to (i), (ii) and (iii) have also been proven, see e.g. hastie et al. (2019) and theorem 1 in muthukumar et al. (2020). however, as discussed in section 1, hastie et al. (2019) make sificiantly stronger assumptions for computing the expectation. in appendix l, we explain in more detail that the probabilistic overparameterized lower bound of muthukumar et al. (2020) is not distribution-independent and only applies to a smaller class of distributions than our lower bound. for a discussion on how theorem 3 applies to kernels with finite-dimensional feature space, we refer to appendix k. LINEBREAK when are the assumptions satisfied? LINEBREAK in this section, we want to discuss the assumptions of theorem 3 and provide different results helping to verify these assumptions for various input distributions and feature maps. the theory will be particularly nice for analytic feature maps, which we define now: definition 5 (analytic function). a function f : rd ∈ the taylor series of f around z converges to f in a neighborhood of z. a function f : rd rp, z LINEBREAK (f1(z), . . . , fp(z)) is called (real) analytic if f1, . . . , fp are analytic. LINEBREAK r is called (real) analytic if for all z LINEBREAK rd, → (cid:74) LINEBREAK sums, products and compositions of analytic functions are analytic, cf. e.g. section 2.2 in krantz & parks (2002). we will discuss examples of analytic functions later in this section. proposition 6 (characterization of (cov) and (frk)). consider the setting of theorem 3 and let frk(n) be the statement that (frk) holds for n. then, LINEBREAK 1. then, frk(n) iff p (z LINEBREAK u ) = 0 for all linear subspaces u LINEBREAK rp of dimension LINEBREAK (ii) let (mom) hold. then, (cov) holds iff p (z LINEBREAK u ) < 1 for all linear subspaces u LINEBREAK rp of LINEBREAK (i) let n ≥ n, p min } − { dimension p LINEBREAK assuming that (mom) holds such that (cov) is well-defined, consider the following statements: LINEBREAK (a) frk(p) holds. (b) frk(n) holds for all n (c) (cov) holds. (d) there exists a fixed deterministic matrix (cid:102)x (d). furthermore, if x LINEBREAK (b) LINEBREAK (c) LINEBREAK we have (a) ⇒ ⇔ then (a) – (d) are equivalent. LINEBREAK d such that det(φ((cid:102)x)) LINEBREAK rp ∈ rd has a lebesgue density and φ is analytic, LINEBREAK with this in mind, we can characterize the assumptions now: LINEBREAK • the assumption (int) is standard (see e.g. section 1.6 in györfi et al., 2002) and guarantees LINEBREAK rp (f ∗p ) < LINEBREAK , such that the excess risk is well-defined. LINEBREAK x) | LINEBREAK • the assumption (noi) is required to ensure the existence of sufficient label noise. imporσ2 almost surely over z, holds if z) ≥ | σ2 almost surely over x. all double descent papers from section 1 make the x) is independent of x or even a fixed e(y LINEBREAK tantly, lemma h.1 shows that (noi), i.e. var(y var(y stronger assumption that the distribution of y gaussian. LINEBREAK | z • the assumption (mom) can be reformulated as e (cid:107) LINEBREAK . ∞ for example, if k or equivalently φ are bounded, or if φ is continuous and x (cid:107)2 is bounded, then (mom) is satisfied. such assumptions are frequently imposed (see e.g. chapters 6, 7, 8, 10 in györfi et al., 2002). in this sense, (mom) is a standard assumption. LINEBREAK • the assumptions (cov) and frk(n) are implied by frk(p) and are even equivalent to frk(p) in the underparameterized case p n. in the following, we will therefore focus ≤ on proving frk(p) for various φ and px . in the case p = n, frk(p) ensures that fx,y almost surely interpolates the data, or equivalently that the kernel matrix k(x, x) almost surely has full rank. importantly, assuming frk(p) is weaker than assuming a strictly positive definite kernel, since strictly positive definite kernels require p = . example d.1 shows that the assumption (frk) in theorem 3 cannot be removed. LINEBREAK for the analytic function φ = id with d = p, proposition 6 yields a simple sufficient criterion: if z has a lebesgue density, then (frk) holds for all n. this assumption is already more realistic than assuming i.i.d. components. however, proposition 6 is also very useful for other analytic feature maps, as we will see in the remainder of this section. remark 7. suppose that φ 0 is analytic, x has a lebesgue density and (int), (mom) and (noi) are satisfied. if (d) in proposition 6 does not hold, there exists ˜p < p such that the lower bound from theorem 3 holds with p replaced by ˜p: let u := span 0, r ˜p ˜p := dim u and define the feature map ˜φ : rd ψ(φ(x)). then, ˜φ is analytic since ψ is linear, and ˜φ satisfies (d), hence theorem 3 can be applied to ˜φ. however, φ and ˜φ lead to the same kernel k enoise. (cid:74) since ψ is isometric, hence to the same estimator fx,y by eq. (2) and hence to the same rd, define the polynomial (cid:1), such rp, p := (cid:0)m+d LINEBREAK . since φ 1. moreover, (d) holds iff dim u = p. take any isometric isomorphism ψ : u LINEBREAK proposition 8 (polynomial kernel). let m, d ∈ kernel k(x, ˜x) := (x(cid:62) ˜x + c)m. then, there exists a feature map φ : rd that: LINEBREAK 1 and c > 0. for x, ˜x LINEBREAK φ(x) { LINEBREAK r ˜p, x LINEBREAK rd LINEBREAK x LINEBREAK m LINEBREAK (a) k(x, ˜x) = φ(x)(cid:62)φ(˜x) for all x, ˜x (b) if x LINEBREAK rd, and LINEBREAK rd has a lebesgue density and we use z = φ(x), then (frk) is satisfied for all n. LINEBREAK proposition 8 says that the lower bound from theorem 3 holds for ridgeless kernel regression with the polynomial kernel with p := (cid:0)m+d (cid:1) if x has a lebesgue density and e 2 2 = ek(x, x) = (cid:107) 2 + c)m < 2 . the proof of proposition 8 can be extended to the case c = 0, where one needs e( ∞ (cid:107) to choose p = (cid:0)m+d (cid:1). in general, we discuss in appendix k that theorem 3 can often be applied m to ridgeless kernel regression, where p needs to be chosen as the minimal feature space dimension for which k can still be represented. LINEBREAK z LINEBREAK m LINEBREAK we can also extend our theory to analytic random feature maps: proposition 9 (random feature maps). consider feature maps φθ : rd parameter θ LINEBREAK rp with (random) φθ(x) is analytic and that θ and x are independent LINEBREAK rq. suppose the map (θ, x) LINEBREAK and have lebesgue densities. if there exist fixed (cid:101)θ almost surely over θ, (frk) holds for all n for z = φθ(x). LINEBREAK rp LINEBREAK d with det(φ(cid:101)θ((cid:102)x)) LINEBREAK = 0, then LINEBREAK in appendix c, we demonstrate that proposition 9 can be used to computationally verify (frk) for analytic random feature maps. LINEBREAK up until now, we have assumed that x has a lebesgue density. it is desirable to weaken this assumption, such that x can, for example, be concentrated on a submanifold of rd. it is necessary for frk(p) with p 2 that x is nonatomic, such that the xi are distinct with probability one. in general, this is not sufficient: for example, if φ = id and x lives on a proper linear subspace of rd, frk(p) is not satisfied. perhaps surprisingly, we will show next that for random neural network feature maps, it is indeed sufficient that x is nonatomic.2 especially, our lower bound in corollary 4 thus applies to a large class of feedforward neural networks where only the last layer is trained (and initialized to zero, such that gradient descent converges to the moore-penrose pseudoinverse). theorem 10 (random neural networks). let d, p, l layer sizes be d0 = d, d1, . . . , dl be random variables and consider the two cases where LINEBREAK r be analytic and let the → dl for l rdl+1 1 × LINEBREAK 1 and dl = p. let w (l) LINEBREAK 1, let σ : r LINEBREAK (a) σ is not a polynomial with less than p nonzero coefficients, θ := (w (0), . . . , w (l LINEBREAK 1)) and LINEBREAK the random feature map φθ : rd LINEBREAK rp is recursively defined by LINEBREAK φ(x(0)) := x(l), x(l+1) := σ(w (l)x(l)) . LINEBREAK (b) σ is not a polynomial of degree < p LINEBREAK with random variables b(l) φθ : rd LINEBREAK − rdl+1 for l rp is recursively defined by LINEBREAK 1)) , and the random feature map } LINEBREAK φ(x(0)) := x(l), x(l+1) := σ(w (l)x(l) + b(l)) .
| 6
|
[
221.869,
410.13835,
425.99661028,
422.31535
] |
3k5CUGDLNdd.pdf
| 2,023
| 1
|
LINEBREAK benchmarking offline reinforcement learning on real-robot hardware LINEBREAK nico gürtler1, sebastian blaes1, pavel kolev1, felix widmaier1, manuel wüthrich2, stefan bauer3, bernhard schölkopf 1, and georg martius1 LINEBREAK 1max planck institute for intelligent systems∗ 2harvard university 3kth stockholm LINEBREAK abstract LINEBREAK learning policies from previously recorded data is a promising direction for realworld robotics tasks, as online learning is often infeasible. dexterous manipulation in particular remains an open problem in its general form. the combination of offline reinforcement learning with large diverse datasets, however, has the potential to lead to a breakthrough in this challenging domain analogously to the rapid progress made in supervised learning in recent years. to coordinate the efforts of the research community toward tackling this problem, we propose a benchmark including: i) a large collection of data for offline learning from a dexterous manipulation platform on two tasks, obtained with capable rl agents trained in simulation; ii) the option to execute learned policies on a real-world robotic system and a simulation for efficient debugging. we evaluate prominent open-sourced offline reinforcement learning algorithms on the datasets and provide a reproducible experimental setup for offline reinforcement learning on real systems. visit https://sites.google.com/view/ benchmarking-offline-rl-real for more details. LINEBREAK introduction LINEBREAK reinforcement learning (rl) (sutton et al., 1998) holds great potential for robotic manipulation and other real-world decision-making problems as it can solve tasks autonomously by learning from interactions with the environment. when data can be collected during learning, rl in combination with high-capacity function approximators can solve challenging high-dimensional problems (mnih et al., 2015; lillicrap et al., 2016; silver et al., 2017; berner et al., 2019). however, in many cases online learning is not feasible because collecting a large amount of experience with a partially trained policy is either prohibitively expensive or unsafe (dulac-arnold et al., 2020). examples include autonomous driving, where suboptimal policies can lead to accidents, robotic applications where the hardware is likely to get damaged without additional safety mechanisms, and collaborative robotic scenarios where humans are at risk of being harmed. LINEBREAK offline reinforcement learning (offline rl or batch rl) (lange et al., 2012) tackles this problem by learning a policy from prerecorded data generated by experts or handcrafted controllers respecting the system’s constraints. independently of how the data is collected, it is essential to make the best possible use of it and to design algorithms that improve performance with the increase of available data. this property has led to unexpected generalization in computer vision (krizhevsky et al., 2012; he et al., 2016; redmon et al., 2016) and natural language tasks (floridi & chiriatti, 2020; devlin et al., 2018) when massive datasets are employed. with the motivation to learn similarly capable decision-making systems from data, the field of offline rl has gained considerable attention. progress is currently measured by benchmarking algorithms on simulated domains, both in terms of data collection and evaluation. LINEBREAK ∗correspondence to [email protected] LINEBREAK figure 1: the trifinger manipulation platform (wüthrich et al., 2021; bauer et al., 2022). left: the robot has 3 arms with 3 dof each. the cube is constrained by a bowl-shaped arena, allowing for unattended data collection. right: a cluster of these robots for parallel data collection and evaluation. LINEBREAK yet, real-world data differs from simulated data qualitatively and quantitatively in several aspects (dulac-arnold et al., 2020). first, observations are noisy and sometimes faulty. second, real-world systems introduce delays in the sensor readings and often have different sampling rates for different modalities. third, the action execution can also be delayed and can get quantized by low-level hardware constraints. fourth, real-world environments are rarely stationary. for instance, in autonomous robotics, battery voltages might drop, leading to reduced motor torques for the same control command. similarly, thermal effects change sensor readings and motor responses. abrasion changes friction behavior and dust particles can change object appearances and sensing in general. fifth, contacts are crucial for robotic manipulation but are only insufficiently modeled in current physics simulations, in particular for soft materials. lastly, physical robots have individual variations. LINEBREAK since real-world data is different from simulated data, it is important to put offline rl algorithms to the test on real systems. we propose challenging robotic manipulation datasets recorded on real robots for two tasks: object pushing and object lifting with reorientation on the trifinger platform (wüthrich et al., 2021). to study the differences between real and simulated environments, we also provide datasets collected in simulation. our benchmark of state-of-the-art offline rl algorithms on these datasets reveals that they are able to solve the moderately difficult pushing task while their performance on the more challenging lifting task leaves room for improvement. in particular, there is a much larger gap between the performance of the expert policy and offline-learned policies on the real system compared to the simulated system. this underpins the importance of real-world benchmarks for offline rl. we furthermore study the impact of adding suboptimal trajectories to expert data and find that all algorithms are ‘distracted’ by them, i.e., their success rate drops significantly. this identifies an important open challenge for the offline rl community: robustness to suboptimal trajectories. LINEBREAK importantly, a cluster of trifinger robots is set up for evaluation of offline-learned policies for which remote access can be requested for research purposes. with our dataset and evaluation platform, we therefore aim to provide a breeding ground for future offline rl algorithms. LINEBREAK the trifinger platform
| 1
|
[
108.299,
220.0206768,
268.1118076,
231.9758768
] |
Ig53hpHxS4.pdf
| 2,021
| 2
|
LINEBREAK flowtron: an autoregressive flow-based generative network for text-to-speech synthesis LINEBREAK rafael valle, kevin j. shih, ryan prenger & bryan catanzaro nvidia [email protected] LINEBREAK abstract LINEBREAK in this paper we propose flowtron: an autoregressive flow-based generative network for text-to-speech synthesis with style transfer and speech variation. flowtron borrows insights from autoregressive flows and revamps tacotron 2 in order to provide high-quality and expressive mel-spectrogram synthesis. flowtron is optimized by maximizing the likelihood of the training data, which makes training simple and stable. flowtron learns an invertible mapping of data to a latent space that can be used to modulate many aspects of speech synthesis (timbre, expressivity, accent). our mean opinion scores (mos) show that flowtron matches state-ofthe-art tts models in terms of speech quality. we provide results on speech variation, interpolation over time between samples and style transfer between seen and unseen speakers. code and pre-trained models are publicly available at https://github.com/nvidia/flowtron. LINEBREAK introduction LINEBREAK current speech synthesis methods do not give the user enough control over how speech actually sounds. automatically converting text to audio that successfully communicates the text was achieved a long time ago (umeda et al., 1968; badham et al., 1983). however, communicating only the text information leaves out the acoustic properties of the voice that convey much of the meaning and human expressiveness. in spite of this, the typical speech synthesis problem is formulated as a text to speech (tts) problem in which the user inputs only text since the 1960s. this work proposes a normalizing flow model (kingma & dhariwal, 2018; huang et al., 2018) that learns an unsupervised mapping from non-textual information to manipulable latent gaussian distributions. LINEBREAK taming the non-textual information in speech is difficult because the non-textual is unlabeled. a voice actor may speak the same text with different emphasis or emotion based on context, but it is unclear how to label a particular reading. without labels for the non-textual information, recent approaches (shen et al., 2017; arik et al., 2017a;b; ping et al., 2017) have formulated speech synthesis as a tts problem wherein the non-textual information is implicitly learned. despite their success in recreating non-textual information in the training set, the user has limited insight and control over it. LINEBREAK it is possible to formulate an unsupervised learning problem in such a way that the user can exploit the unlabeled characteristics of a data set. one way is to formulate the problem such that the data is assumed to have a representation in some latent space, and have the model learn that representation. this latent space can then be investigated and manipulated to give the user more control over the generative model’s output. such approaches have been popular in image generation, allowing users to interpolate smoothly between images and to identify portions of the latent space that correlate with various features (radford et al., 2015; kingma & dhariwal, 2018; izmailov et al., 2019). LINEBREAK recent deep learning approaches to expressive speech synthesis have combined text and learned latent embeddings for non-textual information (wang et al., 2018; skerry-ryan et al., 2018; hsu et al., 2018; habib et al., 2019; sun et al., 2020). these approaches impose an undesirable paradox: they require making assumptions before hand about the dimensionality of the embeddings when the correct dimensionality can only be determined after the model is trained. even then, these embeddings are not guaranteed to contain all the non-textual information it takes to reconstruct speech, often LINEBREAK (a) time-averaged z-values from multiple samples from 3 speakers with different timbres. + is the centroid computed over samples from the same speaker. LINEBREAK (b) time-averaged z-values from multiple samples from 123 libritts speakers. + is male (lower f0, LINEBREAK each color represents a speaker. third quadrant). LINEBREAK is female (higher f0, first quadrant). LINEBREAK figure 1: t-sne plot showing flowtron partitioning the z-space according to acoustic characteristics. LINEBREAK resulting in models with dummy or uninterpretable latent dimensions and not enough capacity, as the appendices in wang et al. (2018); skerry-ryan et al. (2018); hsu et al. (2018) confirm. LINEBREAK furthermore, most models are not able to manipulate speech characteristics over time due to fixedlength embeddings. their assumption is that variable-length embeddings are not robust to text and speaker perturbations (skerry-ryan et al., 2018), which we show not to be the case. finally, although vaes and gans (sun et al., 2020; habib et al., 2019; hsu et al., 2018; bi´nkowski et al., 2019; akuzawa et al., 2018) provide a latent embedding that can be manipulated, they may be difficult to train, are limited to approximate latent variable prediction, and rely on an implicit generative model or elbo estimate to perform mle in the latent space (kingma & dhariwal, 2018; lucic et al., 2018; kingma et al., 2016). LINEBREAK in this paper we propose flowtron: an autoregressive flow-based generative network for melspectrogram synthesis with style transfer over time and speech variation. flowtron learns an invertible function that maps a distribution over mel-spectrograms to a latent z-space parameterized by a spherical gaussian. figure 1 shows that acoustic characteristics like timbre and f0 correlate with portions of the z-space of flowtron models trained without speaker embeddings. LINEBREAK with our formalization, we can generate samples containing specific speech characteristics manifested in mel-space by finding and sampling the corresponding region in z-space (gambardella et al., 2019). our formulation also allows us to impose a structure to the z-space and to parametrize it with a gaussian mixture, similar to hsu et al. (2018). in our simplest setup, we generate samples with a zero mean spherical gaussian prior and control the amount of variation by adjusting its variance. LINEBREAK compared to vaes and gans and their disadvantages enumerated in kingma & dhariwal (2018), manipulating a latent prior in flowtron comes at no cost in speech quality nor optimization challenges. flowtron is able to generalize and produce sharp mel-spectrograms, even at high σ2 values, by simply maximizing the likelihood of the data while not requiring any additional prenet or postnet layer (wang et al., 2017), nor compound loss functions required by most sota models (shen et al., 2017; ping et al., 2017; skerry-ryan et al., 2018; wang et al., 2018; bi´nkowski et al., 2019). LINEBREAK in summary, flowtron is optimized by maximizing the exact likelihood of the training data, which makes training simple and stable. using normalizing flows, it learns an invertible mapping from data to latent space that can be manipulated to modulate many aspects of speech synthesis. concurrent with this work are glow-tts (kim et al., 2020) and flow-tts (miao et al., 2020), both of which incorporate normalizing flows into the tts task. our work differs from these two in that flowtron is an autoregressive architecture where we explore the use of flow to modulate speech and style variation. in contrast, glow-tts and flow-tts are parallel architectures that focus on inference LINEBREAK speed. our mean opinion scores (mos) show that flowtron matches sota tts models in terms of speech quality. further, we provide results on speech variation, interpolation between samples and interpolation between styles over time, and style transfer between seen and unseen speakers with equal or different sentences. we hope this work, the first to show evidence that normalizing flows can be used for expressive text-to-speech synthesis and style transfer, will further stimulate developments in normalizing flows. LINEBREAK flowtron LINEBREAK flowtron is an autoregressive flow that generates a sequence of mel-spectrogram frames. a normalizing flow generates samples by first sampling a latent variable from a known distribution p(z), and applying a series of invertible transformations to produce a sample from the target distribution p(x). these invertible transformations f are known as steps of flow: LINEBREAK x = f 1 ◦ f 2 ◦ . . . f k(z) LINEBREAK because each transformation is invertible, we can directly evaluate the exact log-likelihood of the target distribution p(x) using the change of variables: LINEBREAK log pθ(x) = log pθ(z) + LINEBREAK log | det(j (f −1 LINEBREAK i LINEBREAK (x)))| LINEBREAK where j is the jacobian of the inverse transform f −1 p(z) and the invertible transformations, the exact log-likelihood becomes simple and tractable. LINEBREAK (x). by cleverly choosing the latent distribution LINEBREAK i LINEBREAK latent distributions LINEBREAK we consider two simple distributions for the latent distribution z: a zero-mean spherical gaussian and a mixture of spherical gaussians with fixed or learnable parameters. LINEBREAK z ∼ n (z; 0, i) or z ∼ LINEBREAK ˆφk n (z; ˆµk, ˆσk) LINEBREAK k LINEBREAK the zero-mean spherical gaussian has a simple log-likelihood. the mixture of the spherical gaussians, has inherent clusters that might result in interesting aspects of the audio information. LINEBREAK invertible transformations LINEBREAK normalizing flows are typically constructed using coupling layers (dinh et al., 2014; 2016; kingma & dhariwal, 2018). in our case, we use an autoregressive affine coupling layer (dinh et al., 2016). the latent variable z has the same number of dimensions and frames as the resulting mel-spectrogram sample. the previous frames z1:t−1 produce scale and bias terms, st and bt respectively, that affine-transform the succeeding time step zt: LINEBREAK (log st, bt) = n n (z1:t−1, text, speaker) f (zt) = (zt − bt) ÷ st f −1(zt) = st (cid:12) zt + bt LINEBREAK here, n n () can be any autoregressive causal transformation (shumway & stoffer, 2017). the affine coupling layer is a reversible transformation, even though n n () itself need not be invertible. we use a 0-vector for obtaining the scaling and bias terms what will affine transform z1. this 0-vector constant also guarantees that the first z is always known. LINEBREAK figure 2: mapping data (x) to the latent dimension (z) for k steps of flow. the right side shows a unrolled view of the n n () architecture. text and speaker embeddings are channel-wise concatenated to produce context matrix c. at every time step t, a recurrent attention mechanism computes a weighting distribution over the context matrix c to produce a weighted-sum reduction over c, which is then passed through an lstm-conv decoder architecture to generate affine parameters for transforming xt+1 → x(cid:48) t+1. as predicted parameters are always for the next time step, the first iteration is conditioned on a pre-defined 0-vector. LINEBREAK with an affine coupling layer, only the st term changes the volume of the mapping and adds a change of variables term to the loss. this term also penalizes the model for non-invertible affine mappings. LINEBREAK log | det(j (f −1 LINEBREAK coupling(x)))| = log |s| LINEBREAK to evaluate the likelihood, we take the mel-spectrograms and pass them through the inverse steps of flow conditioned on the text and optional speaker ids, adding the corresponding log |s| penalties, and evaluate the result based on the gaussian likelihoods. LINEBREAK with this setup, it is also possible to reverse the ordering of the mel-spectrogram frames in time without loss of generality. we reverse the order of frames on even steps of flow, defining a step of flow as a full pass over the input sequence. this allows the model to learn dependencies both forward and backwards in time while remaining causal and invertible. LINEBREAK model architecture LINEBREAK our text encoder modifies the text encoder in tacotron 2 by replacing batch-norm with instance-norm. our decoder and n n architecture, depicted in figure 2, removes the prenet and postnet layers from tacotron previously thought to be essential (shen et al., 2017). please compare figure 2 describing our architecture and figure 8 in a.4.4 describing tacotron’s architecture. we also provide model summary views in a.6 LINEBREAK we use the content-based tanh attention described in vinyals et al. (2015), which can be easily modified to become also location sensitive. we use the mel encoder described in hsu et al. (2018) to predict the parameters of the gaussian mixture. following (valle et al., 2019b), we use speakerembeddings channel-wise concatenated with the encoder outputs at every token. we use a single shared embedding for models not conditioned on speaker id. LINEBREAK the step of flow closest to the latent variable z has a gating mechanism that prunes extra frames from the z-values provided to the model during inference. the length of z-values remains fixed on the next steps of flow. LINEBREAK inference LINEBREAK inference, given a trained model, is simply a matter of sampling z values from a spherical gaussian, or gaussian mixture, and running them through the network in the forward direction f , e.g. eq. 1. the parameters of the gaussian mixture are either fixed or predicted by flowtron. training was conducted with σ2 = 1, but we explore the effects of different values for σ2 in section 3.3. in general, we found that sampling z from a gaussian with lower standard deviation than used during training resulted in better sounding mel-spectrograms, as similarly concluded in kingma & dhariwal (2018) and (parmar et al., 2018). our inference results use σ2 = 0.5 while sampling the prior and the posterior variance while sampling the posterior. LINEBREAK posterior inference LINEBREAK figure 1 shows that several speech characteristics present in mel-spectrograms are clustered into regions of the z-space. knowing this, we can treat the latent distribution as a prior q(z) = n (0, i) and obtain a posterior over the latent space of the flow model q(z|ζ1:m) conditioned on the evidence ζ1:m, which are m data observations xi mapped to the latent space using ζi = f −1(xi). we can use a gaussian likelihood function with covariance matrix σ to compute the posterior above analytically, q(z|ζ1:m) = n (µp, σp). following the approach in gambardella et al. (2019), defining ¯ζ as the mean of ζi and using λ as a hyperparameter, we define the parameters of the posterior below. please see a.2, algorithm 1 and gambardella et al. (2019) for implementation details and a full derivation. LINEBREAK µp = LINEBREAK σp = LINEBREAK i LINEBREAK experiments LINEBREAK this section describes our training setup and provides quantitative and qualitative results. our quantitative results show that flowtron has mean opinion scores that are comparable to the state of the art. our qualitative results demonstrate many features that are either impossible or inefficient to achieve using tacotron, tacotron 2 gst and tacotron gm-vae. these features include variation control in speech, interpolation between samples, and style transfer over time. LINEBREAK we decode all mel-spectrograms into waveforms with a waveglow (prenger et al., 2019) model available on github (valle et al., 2019a). this suggests that waveglow can be used as an universal decoder. in addition to our illustrated and quantitative results, we ask that the readers listen to flowtron samples in our supplementary materials corresponding to our qualitative experiments. LINEBREAK training setup LINEBREAK we train flowtron, tacotron 2 and tacotron 2 gst models using a dataset (lsh) that combines the ljspeech dataset (ito et al., 2017) with two proprietary single speaker datasets with 20 and 10 hours each (sally and helen). we also train a flowtron model on the train-clean-100 subset of libritts (zen et al., 2019) with 123 speakers and 25 minutes on average per speaker. speakers with less than 5 minutes of data and files that are larger than 10 seconds are filtered out. for each dataset, we use at least 180 samples for the validation set, and the remainder for the training set. LINEBREAK the models are trained on uniformly sampled normalized text and arpabet encodings obtained from the cmu pronouncing dictionary (weide, 1998). we do not perform any data augmentation. we adapt public tacotron 2 and tacotron 2 gst repos to include speaker embeddings as described in section 2. we use the same mel-spectrogram representation used in waveglow (prenger et al., 2019). we train flowtron with a pre-trained text encoder, progressively adding steps of flow once the last step of flow has learned to attend to text. flowtron models used in our experiments have 2 steps of flow. we forward readers to a.3 and a.4 for details on our training setup and ablation studies. LINEBREAK mean opinion score (mos) comparison LINEBREAK we use the ljs voice as a reference and compare mos between real samples, samples from flowtron with 2 steps of flow, and samples from tacotron 2. following guidelines in (prenger et al., 2019), we crowd-sourced mos tests on amazon mechanical turk using 30 volume normalized utterances disjoint from the training set for evaluation, and randomly chose the utterances for each subject. the scores provided in (prenger et al., 2019) are used for real samples. LINEBREAK the mean opinion scores are shown in table 1 with 95% confidence intervals computed over approximately 250 scores per source. the results roughly match our subjective qualitative assessment. the larger advantage of flowtron is in the control over the amount of speech variation and the manipulation of the latent space. LINEBREAK source LINEBREAK flows mos LINEBREAK real flowtron tacotron 2 LINEBREAK table 1: mean opinion scores LINEBREAK sampling the prior LINEBREAK the simplest approach to generating samples with flowtron is to sample from a prior distribution z ∼ n (0, σ2) and adjust σ2 to control the amount of variation. whereas σ2 = 0 completely removes variation and produces outputs based on the model bias, increasing σ2 will increase the amount of variation in speech. LINEBREAK 3.3.1 speech variation LINEBREAK we illustrate the relationship between σ2 and control over variability by synthesizing flowtron samples with σ2 ∈ {0.0, 0.5, 1.0}. all samples are generated conditioned on the speaker sally and the text “how much variation is there?". despite the variability added by increasing σ2, all flowtron-synthesized samples produce high quality speech. LINEBREAK figure 3 shows that contrary to commonly held wisdom (shen et al., 2017; arik et al., 2017a;b; ping et al., 2017; skerry-ryan et al., 2018; wang et al., 2018; bi´nkowski et al., 2019), flowtron generates sharp harmonics and well resolved formants without a compound loss nor prenet or postnet layers. LINEBREAK (b) σ2 = 0.5 figure 3: flowtron mel-spectrograms illustrate increasing variability by using different σ2 and that flowtron is able to produce sharp harmonics with high σ2 and without prenet or postnet layers. LINEBREAK now we show that adjusting σ2 is a simple and valuable approach that provides more variation and control thereof than tacotron, without sacrificing speech quality and despite of having a similar but simpler architecture. for this, we synthesize 10 samples with tacotron 2 using different values for the prenet dropout probability p ∈ {0.45, 0.5, 0.55}, scaling outputs accordingly. samples computed on values of p ∈ [0.3, 0.8] are not included because they sound unintelligible. LINEBREAK figure 4 provides plots of f0 contours extracted with the yin algorithm (de cheveigné & kawahara, 2002), with minimum f0, maximum f0, and harmonicity threshold equal to 80 hz, 400 hz and 0.3 respectively. our results are similar to the previous sample duration analysis. as expected, σ2 = 0 provides no variation in f0 contour1, while increasing σ2 will increase variation in f0 contours. LINEBREAK our results in figure 4 also show that flowtron samples are considerably less monotonous than the samples produced with tacotron 2 at no cost and with a similar but simpler architecture. whereas increasing σ2 considerably increases variation in f0, modifying p barely produces any variation. this is valuable because expressive speech is associated with non-monotonic f0 contours. in a.1 we show similar results with respect to sentence duration. LINEBREAK interpolation between samples LINEBREAK with flowtron, we can perform interpolation in z-space to achieve interpolation in mel-spectrogram space. this experiment evaluates flowtron models with and without speaker embeddings. for the experiment with speaker embeddings, we choose the speaker sally and the phrase “it is well known that deep generative models have a rich latent space.". we generate mel-spectrograms by sampling z ∼ n (0, 0.8) twice and interpolating between them over 100 timesteps. for the experiment without speaker embeddings we interpolate between sally and helen using the phrase “we are testing this model.". LINEBREAK first, we perform inference by sampling z ∼ n (0, 0.5) until we find z values, zh and zs, that produce mel-spectrograms with helen’s and sally’s voice respectively. we then generate samples by LINEBREAK 1variations in σ2 = 0 are due to different z for waveglow. LINEBREAK (a) flowtron σ2 = 0 LINEBREAK (b) flowtron σ2 = 0.5 LINEBREAK (c) flowtron σ2 = 1 LINEBREAK figure 4: f0 contours obtained from samples generated by flowtron and tacotron 2 with different values for σ2 and p. flowtron provides more variability and expressivity than tacotron 2. LINEBREAK performing inference while linearly interpolating between zh and zs. our same speaker interpolation samples show that flowtron is able to interpolate between multiple samples while producing correct alignment maps. our different speaker interpolation samples show that flowtron is able to gradually and smoothly morph one voice into another. LINEBREAK sampling the posterior (style transfer) LINEBREAK we generate samples with flowtron by sampling a posterior distribution conditioned on the evidence containing speech characteristics of interest, as described in 2.5 and gambardella et al. (2019). tacotron 2 gst wang et al. (2018) has an equivalent posterior sampling approach. during inference, the model is conditioned on a weighted sum of global style tokens (posterior) queried through an embedding of existing audio samples (evidence). we evaluate tacotron 2 gst using a single sample to query a style token, or multiple samples to compute an average style token. for complete results, please refer to audio samples in the supplemental material corresponding to the following sections. LINEBREAK 3.4.1 seen speaker LINEBREAK in this section we run two style transfer experiments: the first one (expressive) uses samples with high variance in pitch, which we use as a proxy for comparing expressivity in speech; the second (high pitch), uses samples with high average pitch. in these experiments, we provide comparisons between pitch mean and pitch standard deviation from the reference samples providing the style, a flowtron baseline and after style transfer using flowtron posterior and tacotron 2 gst. LINEBREAK our experiments show that by sampling from the posterior or interpolating between the posterior and the gaussian prior over time, flowtron makes a monotonic speaker gradually sound more expressive. architectures similar to tacotron 2 gst with fixed-latent embeddings are not able to perform gradual changes in style over time. table 2 provides pitch summary statistics computed over 5 phrases and 10 takes each and shows that flowtron is overall closer to the reference providing the style than tacotron 2 gst. our supplemental materials also show that tacotron 2 gst sentences are repetitive and contain vocal-fry like distortions. LINEBREAK style LINEBREAK model LINEBREAK reference fta posterior fta baseline tacotron 2 gst LINEBREAK pitch mean LINEBREAK pitch standard deviation LINEBREAK expressive high pitch LINEBREAK surprised LINEBREAK expressive high pitch LINEBREAK surprised LINEBREAK table 2: values closer to the reference are better. comparison between pitch (midi number) summary statistics from reference providing the style, flowtron with standard gaussian prior (fta baseline) and samples after style transfer with flowtron (fta posterior) and tacotron 2 gst. our results show that fta posterior is overall more effective than tacotron 2 gst in emulating the reference by better matching its pitch summary statistics. LINEBREAK 3.4.2 seen speaker with unseen style LINEBREAK we compare samples generated with flowtron and tacotron 2 gst to evaluate their ability to emulate a speaking style unseen during training of a speaker seen during training. while sally’s data used during training consists of news article readings, the evaluation samples contain sally’s interpretation of the somber and vampiresque novel, born of darkness (bod). LINEBREAK our samples show that while tacotron 2 gst fails to emulate the somber timbre in born of darkness, flowtron succeeds in transferring not only the somber timbre, but also the low f0 and the long pauses associated with the narrative style. LINEBREAK 3.4.3 unseen speaker LINEBREAK in this experiment we compare flowtron and tacotron 2 gst samples to evaluate their ability to emulate the speaking style of a speaker not seen during training. the styles comes from speaker id 24 and her “surprised" samples in ravdess (livingstone & russo, 2018), a dataset with emotion labels. table 2 shows that while the samples generated with tacotron 2 gst are not able to emulate the high-pitched style from ravdess, flowtron is able to make sally sound high-pitched as in the “surprised" style. LINEBREAK interpolation between styles (prior and posterior) LINEBREAK in this experiment we illustrate how to control the speaking style at inference time by adjusting the parameter λ in equation 9 to interpolate between a baseline style (prior) and a target style (posterior). we use a model trained on libritts and use a single sample from sally’s (unseen speaker) born of darkness dataset as evidence providing the target style. we synthesize posterior samples generated with flowtron with λ ∈ {0.1, 0.666, 1.0, 2.0}. figure 5 reflects the interpolation in style as interpolation in spectral profiles. our supplemental materials aurally reflect a similar interpolation in other non-textual characteristics. LINEBREAK (a) flowtron baseline LINEBREAK (b) flowtron posterior λ = 1 LINEBREAK (c) flowtron posterior λ = 0.1 LINEBREAK (d) flowtron posterior λ = 2 LINEBREAK (e) flowtron posterior λ = 0.666 LINEBREAK (f) target style LINEBREAK figure 5: spectral profiles from the target style, from the flowtron baseline generated using the prior, and from flowtron samples generated using the posterior with different values for λ. these images show that by decreasing the value of λ we gradually move the spectral profile from the baseline style (prior) to the target style (posterior). LINEBREAK sampling the gaussian mixture
| 7
|
[
108.249,
141.4330784,
288.6511475,
151.3956784
] |
kEnBH98BGs5.pdf
| 2,021
| 1
|
LINEBREAK estimating informativeness of samples with smooth unique information LINEBREAK hrayr harutyunyan1,2∗, alessandro achille1, giovanni paolini1, orchid majumder1, avinash ravichandran1, rahul bhotika1, stefano soatto1 1 amazon web services, 2 usc information sciences institute [email protected], {aachille, paoling, orchid}@amazon.com, {ravinash, bhotikar, soattos}@amazon.com LINEBREAK abstract LINEBREAK we define a notion of information that an individual sample provides to the training of a neural network, and we specialize it to measure both how much a sample informs the final weights and how much it informs the function computed by the weights. though related, we show that these quantities have a qualitatively different behavior. we give efficient approximations of these quantities using a linearized network and demonstrate empirically that the approximation is accurate for real-world architectures, such as pre-trained resnets. we apply these measures to several problems, such as dataset summarization, analysis of under-sampled classes, comparison of informativeness of different data sources, and detection of adversarial and corrupted examples. our work generalizes existing frameworks but enjoys better computational properties for heavily overparametrized models, which makes it possible to apply it to real-world networks. LINEBREAK introduction LINEBREAK training a deep neural network (dnn) entails extracting information from samples in a dataset and storing it in the weights of the network, so that it may be used in future inference or prediction. but how much information does a particular sample contribute to the trained model? the answer can be used to provide strong generalization bounds (if no information is used, the network is not memorizing the sample), privacy bounds (how much information the network can leak about a particular sample), and enable better interpretation of the training process and its outcome. to determine the information content of samples, we need to define and compute information. in the classical sense, information is a property of random variables, which may be degenerate for the deterministic process of computing the output of a trained dnn in response to a given input (inference). so, even posing the problem presents some technical challenges. but beyond technicalities, how can we know whether a given sample is memorized by the network and, if it is, whether it is used for inference? LINEBREAK we propose a notion of unique sample information that, while rooted in information theory, captures some aspects of stability theory and influence functions. unlike most information-theoretic measures, ours can be approximated efficiently for large networks, especially in the case of transfer learning, which encompasses many real-world applications of deep learning. our definition can be applied to either “weight space” or “function space.” this allows us to study the non-trivial difference between information the weights possess (weight space) and the information the network actually uses to make predictions on new samples (function space). LINEBREAK our method yields a valid notion of information without relying on the randomness of the training algorithm (e.g., stochastic gradient descent, sgd), and works even for deterministic training algorithms. our main work-horse is a first-order approximation of the network. this approximation is accurate when the network is pre-trained (mu et al., 2020) — as is common in practical applications — or is randomly initialized but very wide (lee et al., 2019), and can be used to obtain a closed-form expression of the per-sample information. in addition, our method has better scaling with respect to the number of parameters than most other information measures, which makes it applicable to mas LINEBREAK ∗work conducted at amazon web services. LINEBREAK sively over-parametrized models such as dnns. our information measure can be computed without actually training the network, making it amenable to use in problems like dataset summarization. LINEBREAK we apply our method to remove a large portion of uninformative examples from a training set with minimum impact on the accuracy of the resulting model (dataset summarization). we also apply our method to detect mislabeled samples, which we show carry more unique information. LINEBREAK to summarize, our contributions are (1) we introduce a notion of unique information that a sample contributes to the training of a dnn, both in weight space and in function space, and relate it with the stability of the training algorithm; (2) we provide an efficient method to compute unique information even for large networks using a linear approximation of the dnn, and without having to train a network; (3) we show applications to dataset summarization and analysis. the implementation of the proposed method and the code for reproducing the experiments is available at https:// github.com/awslabs/aws-cv-unique-information. prerequisites and notation. consider a dataset of n labeled examples s = {zi}n i=1, where zi = (xi, yi), xi ∈ x and yi ∈ rk and a neural network model fw : x (cid:55)→ rk with parameters w ∈ rd. throughout the paper s−i = {z1, . . . , zi−1, zi+1, . . . , zn} denotes the set excluding the ith sample; fwt is often shortened to ft; the concatenation of all training examples is denoted by x; the concatenation of all training labels by y ∈ rnk; and the concatenation of all outputs by fw(x) ∈ rnk. the loss on the i-th example is denoted by li(w) and is equal to 1 2 (cid:107)fw(xi) − yi(cid:107)2 2, unless specified otherwise. this choice is useful when dealing with linearized models and is justified by hui & belkin (2020), who showed that the mean-squared error (mse) loss is as effective as crossentropy for classification tasks. the total loss is l(w) = (cid:80)n 2, where λ ≥ 0 is a weight decay regularization coefficient and w0 is the weight initialization point. note that the regularization term differs from standard weight decay (cid:107)w(cid:107)2 2 and is more appropriate for linearized neural networks, as it allows us to derive the dynamics analytically (see sec. f of the appendix). finally, a (possibly stochastic) training algorithm is denoted with a mapping a : s → w, which maps a training dataset s to classifier weights w = a(s). since the training algorithm can be stochastic, w is a random variable. the distribution of possible weights w after training with the algorithm a on the dataset s is denoted with pa(w | s). we use several information-theoretic quantities, such as entropy: h(x) = −e(cid:2) log p(x)(cid:3), mutual information: i(x; y ) = h(x) + h(y ) − h(x, y ), kullback–leibler divergence: kl(p(x)||q(x)) = ex∼p(x) [log(p(x)/q(x))] and their conditional variants (cover & thomas, 2006). if y ∈ rm and x ∈ rn, then the jacobian ∂y ∂x is an m × n matrix. the gradient ∇xy denotes transpose of the jacobian ∂y LINEBREAK i=1 li(w) + λ LINEBREAK ∂x , an n × m matrix. LINEBREAK related work LINEBREAK our work is related to information-theoretic stability notions (bassily et al., 2016; raginsky et al., 2016; feldman & steinke, 2018) that seek to measure the influence of a sample on the output, and to measure generalization. raginsky et al. (2016) define information stability as i=1 i(w ; zi | s−i)(cid:3), the expected average amount of unique (shannon) information that es weights have about an example. this, without the expectation over s, is also our starting point (eq. 1). bassily et al. (2016) define kl-stability sups,s(cid:48) kl(pa(w | s) (cid:107) pa(w | s(cid:48))), where s and s(cid:48) are datasets that differ by one example, while feldman & steinke (2018) define average leaveone-out kl stability as sups i=1 kl(pa(w | s) (cid:107) pa(w | s−i)). the latter closely resembles our definition (eq. 4). unfortunately, while the weights are continuous, the optimization algorithm (such as sgd) is usually discrete. this generally makes the resulting quantities degenerate (infinite). most works address this issue by replacing the discrete optimization algorithm with a continuous one, such as stochastic gradient langevin dynamics (welling & teh, 2011) or continuous stochastic differential equations that approximate sgd (li et al., 2017) in the limit. we aim to avoid such assumptions and give a definition that is directly applicable to real networks trained with standard algorithms. to do this, we apply a smoothing procedure to a standard discrete algorithm. the final result can still be interpreted as a valid bound on shannon mutual information, but for a slightly modified optimization algorithm. our definitions relate informativeness of a sample to the notion of algorithmic stability (bousquet & elisseeff, 2002; hardt et al., 2015), where a training algorithm a is called stable if a(s) is close to a(s(cid:48)) when the datasets s and s(cid:48) differ by only one sample. LINEBREAK to ensure our quantities are well-defined, we apply a smoothing technique which is reminiscent of a soft discretization of weight space. in section 4, we show that a canonical discretization is obtained using the fisher information matrix, which relates to classical results of rissanen (1996) on optimal coding length. it also relates to the use of a post-distribution in achille et al. (2019), who however use it to estimate the total amount of information in the weights of a network. LINEBREAK we use a first-order approximation (linearization) inspired by the neural tangent kernel (ntk) (jacot et al., 2018; lee et al., 2019) to efficiently estimate informativeness of a sample. while ntk predicts that, in the limit of an infinitely wide network, the linearized model is an accurate approximation, we do not observe this on more realistic architectures and datasets. however, we show that, when using pre-trained networks as common in practice, linearization yields an accurate approximation, similarly to what is observed by mu et al. (2020). shwartz-ziv & alemi (2020) study the total information contained by an ensemble of randomly initialized linearized networks. they notice that, while considering ensembles makes the mutual information finite, it still diverges to infinity as training time goes to infinity. on the other hand, we consider the unique information about a single example, without the neeed for ensembles, by considering smoothed information, which remains bounded for any time. other complementary works study how information about an input sample propagates through the network (shwartz-ziv & tishby, 2017; achille & soatto, 2018; saxe et al., 2019) or total amount of information (complexity) of a classification dataset (lorena et al., 2019), rather than how much information the sample itself contains. LINEBREAK in terms of applications, our work is related to works that estimate influence of an example (koh & liang, 2017; toneva et al., 2019; katharopoulos & fleuret, 2018; ghorbani & zou, 2019; yoon et al., 2019). this can be done by estimating the change in weights if a sample is removed from the training set, which is addressed by several works (koh & liang, 2017; golatkar et al., 2020; wu et al., 2020). influence functions (cook, 1977; koh & liang, 2017) model removal of a sample as reducing its weight infinitesimally in the loss function, and show an efficient first-order approximation of its effect on other measures (such as test time predictions). we found influence functions to be prohibitively slow for the networks and data regimes we consider. basu et al. (2020) found that influence functions are not accurate for large dnns. additionally, influence functions assume that the training has converged, which is not usually the case in practice. we instead use linearization of neural networks to estimate the effect of removing an example efficiently. we find that this approximation is accurate in realistic settings, and that the computational cost scales better with network size, making it applicable to very large neural networks. LINEBREAK our work is orthogonal to that of feature selection: while we aim to evaluate the informativeness for the final weights of a subset of training samples, feature selection aims to quantify the informativeness for the task variable of a subset of features. however, they share some high-level similarities. in particular, kohavi et al. (1997) propose the notion of strongly-relevant feature as one that changes the discriminative distribution when it is excluded. this notion is similar to the notion of unique sample information in eq. (1). LINEBREAK unique information of a sample in the weights LINEBREAK consider a (possibly stochastic) training algorithm a that, given a training dataset s, returns the weights w of a classifier fw. from an information-theoretic point of view, the amount of unique information a sample zi = (xi, yi) provides about the weights is given by the conditional point-wise mutual information: LINEBREAK i(w ; zi = zi | s−i = s−i) = kl(pa(w | s = s) (cid:107) r(w | s−i = s−i)), (1) where s denotes the random variable whose sample is the particular dataset s, and r(w | s−i = s−i) = (cid:82) pa(w | s = s−i, z(cid:48) i)] denotes the marginal distribution of the weights over all possible sampling of zi.1 computing the distribution r(w | s−i) is challenging because of the high-dimensionality and the cost of training algorithm a for multiple samples. one can address this problem by using the following upper bound (lemma b.1): kl(pa(w | s) (cid:107) r(w | s−i)) = kl(pa(w | s) (cid:107) q(w | s−i)) − kl(r(w | s−i) (cid:107) q(w | s−i)) ≤ kl(pa(w | s) (cid:107) q(w | s−i)), LINEBREAK i∼p(z)[pa(w | s = s−i, z(cid:48) LINEBREAK i) = ez(cid:48) LINEBREAK i)dp (z(cid:48) LINEBREAK 1hereafter, to avoid notational clutter, we will shorten “s−i = s−i” to s−i and “zi = zi” to just zi in all LINEBREAK conditionals and information-theoretic functionals. LINEBREAK which is valid for any distribution q(w | s−i). choosing q(w | s−i) = pa(w | s−i), the distribution of the weights after training on s−i, gives a reasonable upper bound (see sec. a.1 for details): LINEBREAK i(w ; zi | s−i) ≤ kl(pa(w | s) (cid:107) pa(w | s−i)). (3) we call si(zi, a) (cid:44) kl(pa(w | s) (cid:107) pa(w | s−i)) the sample information of zi w.r.t. algorithm a. smoothed sample information. the formulation above is valid in theory but, in practice, even sgd is used in a deterministic fashion by fixing the random seed and, in the end, we obtain just one set of weights rather than a distribution of them. under these circumstances, all the above kl divergences are degenerate, as they evaluate to infinity. it is common to address the problem by assuming that a is a continuous stochastic optimization algorithm, such as stochastic gradient langevin dynamics (sgld) or a continuous approximation of sgd which adds gaussian noise to the gradients. however, this creates a disconnect with the practice, where such approaches do not perform at the state-of-the-art. our definitions below aim to overcome this disconnect. definition 3.1 (smooth sample information). let a be a possibly stochastic algorithm. following eq. (3), we define the smooth sample information with smoothing σ: LINEBREAK siς(zi, a) = kl(paς (w | s) (cid:107) paς (w | s−i)). LINEBREAK where we define smoothed weights aς(s) (cid:44) a(s) + ξ, with ξ ∼ n (0, σ). LINEBREAK note that if the algorithm a is continuous, we can pick σ → 0, which will make siς(zi, a) → si(zi, a). the following proposition shows how to compute the value of siς in practice. proposition 3.2. let a be a deterministic training algorithm. then, we have: LINEBREAK siς(zi, a) = LINEBREAK (w − w−i)t σ−1(w − w−i), LINEBREAK where w = a(s) and w−i = a(s−i) are the weights obtained by training respectively with and without the training sample zi. that is, the value of siς(zi) depends on the distance between the solutions obtained training with and without the sample zi, rescaled by σ. LINEBREAK the smoothing of the weights by a matrix σ can be seen as a form of soft-discretization. rather than simply using an isotropic discretization σ = σ2i – since different filters have different norms and/or importance for the final output of the network – it makes sense to discretize them differently. in sections 4 and 5 we show two canonical choices for σ. one is the inverse of the fisher information matrix, which discounts weights not used for classification, and the other is the covariance of the steady-state distribution of sgd, which respects the level of sgd noise and flatness of the loss. LINEBREAK unique information in the predictions LINEBREAK siς(zi, a) measures how much information an example zi provides to the weights. alternatively, instead of working in weight-space, we can approach the problem in function-space, and measure the informativeness of a training example for the network outputs or activations. the unique information that zi provides to the predictions on a test example x is: LINEBREAK i(zi; (cid:98)y | x, s−i) = es kl(q((cid:98)y | x, s) (cid:107) r((cid:98)y | x, s−i)), where x ∼ p(x) is a previously unseen test sample, (cid:98)y ∼ q(· | x, s) is the network output on input x after training on s, and r((cid:98)y | x, s−i) = (cid:82) q((cid:98)y | x, s−i, z(cid:48) q((cid:98)y | x, s−i, z(cid:48) i). following the reasoning in the previous section, we arrive at LINEBREAK i) = ez(cid:48) LINEBREAK i)dp (z(cid:48) LINEBREAK i LINEBREAK i(zi; (cid:98)y | x, s−i) ≤ kl(q((cid:98)y | x, s) (cid:107) q((cid:98)y | x, s−i)). again, when training with a discrete algorithm and/or when the output of the network is deterministic, the above quantity may be infinite. similar to smooth sample information, we define: definition 4.1 (smooth functional sample information). let a be a possibly stochastic training algorithm and let (cid:98)y be the prediction on a test example x after training on s. we define the smooth functional sample information (f-si) as: LINEBREAK f-siσ(zi, a) = e(x,y)[kl(qσ((cid:98)yσ | x, s) (cid:107) qσ((cid:98)yσ | x, s−i))] , LINEBREAK where (cid:98)yσ = (cid:98)y(x, s) + n, with n ∼ n (0, σ2i) and qσ((cid:98)yσ | x, s) being the distribution of (cid:98)yσ. LINEBREAK we now describe a first-order approximation of the value of f-siς for deterministic algorithms. proposition 4.2. let a be a deterministic algorithm, w = a(s) and w−i = a(s−i) be the weights obtained training respectively with and without sample zi. then, LINEBREAK f-siσ(zi, a) = LINEBREAK 1 2σ2 1 2σ2 (w − w−i)t f (w)(w − w−i), (cid:2)∇wfw(x)∇wfw(x)t (cid:3) being the fisher information matrix of qσ=1((cid:98)y | x, s). LINEBREAK with f (w) = ex LINEBREAK by comparing eq. (5) and eq. (9), we see that the functional sample information is approximated by using the inverse of the fisher information matrix to smooth the weight space. however, this smoothing is not isotropic as it depends on the point w. LINEBREAK exact solution for linearized networks LINEBREAK in this section, we derive a close-form expression for siς and f-siς using a linear approximation of the network around the initial weights. we show that this approximation can be computed efficiently and, as we validate empirically in sec. 6, correlates well with the actual informativeness values. we also show that the covariance matrix of sgd’s steady-state distribution is a canonical choice for the smoothing matrix σ of siς. LINEBREAK linearized network. linearized neural networks are a class of neural networks obtained by taking the first-order taylor expansion of a dnn around the initial weights (lee et al., 2019): LINEBREAK w (x) (cid:44) fw0(x) + ∇wfw(x)t |w=w0 (w − w0). f lin these networks are linear with respect to their parameters w, but can be highly non-linear with respect to their input x. one of the advantages of linearized neural networks is that the dynamics of continuous-time or discrete-time gradient descent can be written analytically if the loss function is the mean squared error (mse). in particular, for continuous-time gradient descent with constant learning rate η > 0, we have (lee et al., 2019): LINEBREAK (cid:0)i − e−ηθ0t(cid:1) (f0(x) − y ), LINEBREAK t (x) = f0(x) + θ0(x, x)θ−1 f lin 0 where θ0 = ∇wf0(x)t ∇wf0(x) ∈ rnk×nk is the neural tangent kernel (ntk) (jacot et al., 2018; lee et al., 2019) and θ0(x, x) = ∇wf0(x)t ∇wf0(x). the expressions for networks trained with weight decay is essentially the same (see sec. f). to keep the notation simple, we will use fw(x) to indicate f lin LINEBREAK (cid:0)i − e−ηθ0t(cid:1) (y − f0(x)), LINEBREAK w (x) from now on. LINEBREAK stochastic gradient descent. as mentioned in sec. 3, a popular alternative approach to make information quantities well-defined is to use continuous-time sgd, which is defined by (li et al., 2017; mandt et al., 2017): LINEBREAK dwt = −η∇wlw(wt)dt + η LINEBREAK λ(wt)dn(t), LINEBREAK where η is the learning rate, b is the batch size, n(t) is a brownian motion, and λ(wt) is the covariance matrix of the per-sample gradients (see sec. c for details). let asgd be the algorithm that returns a random sample from the steady-state distribution of (12), and let aerm be the deterministic algorithm that returns the global minimum w∗ of the loss l(w) (for a regularized linearized network l(w) is strictly convex). we now show that the non-smooth sample information si(zi, asgd) is the same as the smooth sample information using sgd’s steady-state covariance as the smoothing matrix and aerm as the training algorithm. proposition 5.1. let the loss function be regularized mse, w∗ be the global minimum of it, and algorithms asgd and aerm be defined as above. assuming λ(w) is approximately constant around w∗ and sgd’s steady-state covariance remains constant after removing an example, we have LINEBREAK si(zi, asgd) = siς(zi, aerm) = LINEBREAK (w∗ − w∗ LINEBREAK −i)t σ−1(w∗ − w∗ LINEBREAK −i), LINEBREAK where σ is the solution of LINEBREAK with h = (∇wf0(x)∇wf0(x)t + λi) being the hessian of the loss function. LINEBREAK hς + σh t = LINEBREAK η b LINEBREAK λ(w∗), LINEBREAK this proposition motivates the use of sgd’s steady-state covariance as a smoothing matrix. from equations (13) and (14) we see that sgd’s steady-state covariance is proportional to the flatness of the loss at the minimum, the learning rate, and to sgd’s noise, while inversely proportional to the batch size. when h is positive definite, as in our case when using weight decay, the continuous lyapunov equation (14) has a unique solution, which can be found in o(d3) time using the bartelsstewart algorithm (bartels & stewart, 1972). one particular case when the solution can be found analytically is when λ(w∗) and h commute, in which case σ = η 2b λh −1. for example, this is the case for langevin dynamics, for which λ(w) = σ2i in equation (12). in this case, we have LINEBREAK si(zi, asgd) = siς(zi, aerm) = LINEBREAK b ησ2 (w∗ − w∗ LINEBREAK −i)t h(w∗ − w∗ LINEBREAK −i), LINEBREAK which was already suggested by cook (1977) as a way to measure the importance of a datum in linear regression. LINEBREAK functional sample information. the definition in section 4 simplifies for linearized neural networks: the step from eq. (8) to eq. (9) becomes exact, and the fisher information matrix becomes (cid:2)∇wf0(x)∇wf0(x)t (cid:3). this shows that functional samindependent of w and equal to f = ex∼p(x) ple information can be seen as weight sample information with discretization σ equal to f −1. the functional sample information depends on the training data distribution, which is usually unknown. we can estimate it using a validation set: LINEBREAK f-siσ(zi, a) ≈ LINEBREAK nval(cid:88) LINEBREAK (cid:13) (cid:13)fw(xval LINEBREAK j ) − fw−i(xval LINEBREAK (w − w−i)t (hval − λi)(w − w−i). LINEBREAK it is instructive to compare the sample weight information of (15) and functional sample information of (17). besides the constants, the former uses the hessian of the training loss, while the latter uses the hessian of the validation loss (without the (cid:96)2 regularization term). one advantage of the latter is computational cost: as demonstrated in the next section, we can use equation (16) to compute the prediction information, entirely in the function space, without any costly operation on weights. for this reason, we focus on the linearized f-si approximation in our experiments. since σ−2 is just a multiplicative factor in (17) we set σ = 1. we also focus on the case where the training algorithm a is discrete gradient descent running for t epochs (equations 10 and 11). LINEBREAK efficient implementation. to compute the proposed sample information measures for linearized neural networks, we need to compute the change in weights w − w−i (or change in predictions fw(x) − fwi(x)) after excluding an example from the training set. this can be done without retraining using the analytical expressions of weight and prediction dynamics of linearized neural networks eq. (10) and eq. (11), which also work when the algorithm has not yet converged (t < ∞). we now describe a series of measures to make the problem tractable. first, to compute the ntk matrix we would need to store the jacobian ∇f0(xi) of all training points and compute ∇wf0(x)t ∇wf0(x). this is prohibitively slow and memory consuming for large dnns. instead, similarly to zancato et al. (2020), we use low-dimensional random projections of per-example jacobians to obtain provably good approximations of dot products (achlioptas, 2003; li et al., 2006). we found that just taking 2000 random weights coordinates per layer provides a good enough approximation of the ntk matrix. importantly, we consider each layer separately, as different layers may have different gradient magnitudes. with this method, computing the ntk matrix takes o(nkd + n2k2d0) time, where d0 ≈ 104 is the number of sub-sampled weight indices (d0 (cid:28) d). we also need to recompute θ−1 after removing an example from the training set. this can be done in quadratic time by using rank-one updates of the inverse (see sec. e). finally, when t (cid:54)= ∞ we need to recompute e−ηθ0t after removing an example. this can be done in o(n2k2) time by downdating the eigendecomposition of θ0 (gu & eisenstat, 1995). overall, the complexity of computing w − wi for all training examples is o(n2k2d0 + n(n2k2 + c)), c is the complexity of a single pass over the LINEBREAK reg. LINEBREAK method LINEBREAK mnist mlp LINEBREAK mnist cnn LINEBREAK cats and dogs LINEBREAK scratch LINEBREAK scratch LINEBREAK pretrained LINEBREAK pr. resnet-18 LINEBREAK pr. resnet-50 LINEBREAK t h g i e w LINEBREAK s n o i t c i d e r p LINEBREAK linearization infl. functions LINEBREAK linearization infl. functions LINEBREAK linearization infl. functions LINEBREAK linearization infl. functions LINEBREAK table 1: pearson correlations of weight change (cid:107)w − w−i(cid:107)2 (cid:107)fw(xval) − fw−i(xval)(cid:107)2 with their corresponding measures computed for standard neural networks with retraining. LINEBREAK 2 and validation prediction change 2 norms computed with influence functions and linearized neural networks LINEBREAK figure 1: functional sample information of samples in the icassava classification task with 1000 samples, where the network is a pretrained resnet-18. a: histogram of sample informations, b: 10 least informative samples, c: 10 most informative samples. LINEBREAK training dataset. the complexity of computing functional sample information for m test samples is o(c + nmk2d0 + n(mnk2 + n2k2)). this depends on the network size lightly, only through c. LINEBREAK experiments
| 6
|
[
108.299,
358.3096768,
200.0834953,
370.2648768
] |
dPs6BGO2QT0.pdf
| 2,023
| 0
|
LINEBREAK learning locality and isotropy in dialogue modeling LINEBREAK han wu1,2, haochen tan1,2, mingjie zhan3, gangming zhao3, shaoqing lu3, ding liang3, linqi song1,2,∗ 1department of computer science, city university of hong kong 2city university of hong kong shenzhen research institute 3sensetime research {hanwu32-c,haochetan-2}@my.cityu.edu.hk [email protected] LINEBREAK abstract LINEBREAK existing dialogue modeling methods have achieved promising performance on various dialogue tasks with the aid of transformer and the large-scale pre-trained language models. however, some recent studies revealed that the context representations produced by these methods suffer the problem of anisotropy. in this paper, we find that the generated representations are also not conversational, losing the conversation structure information during the context modeling stage. to this end, we identify two properties in dialogue modeling, i.e., locality and isotropy, and present a simple method for dialogue representation calibration, namely simdrc, to build isotropic and conversational feature spaces. experimental results show that our approach significantly outperforms current state-of-the-art models on three open-domain dialogue tasks with eight benchmarks. more in-depth analyses further confirm the effectiveness of our proposed approach. we release the code at https://github.com/hahahawu/simdrc. LINEBREAK introduction LINEBREAK dialogue modeling (serban et al., 2016; mehri et al., 2019; liu et al., 2021) is to encode the raw text of the input dialogue to the contextual representations. although the transformer-based dialogue modeling methods (hosseini-asl et al., 2020; liu et al., 2021) have achieved great success on various dialogue tasks, there are still some impediments in these methods that are not well explored nowadays. specifically, recent studies (ethayarajh, 2019; su et al., 2022) have revealed that on dialogue generation tasks, the representations produced by existing dialogue modeling methods are anisotropic, i.e. features occupy a narrow cone in the vector space, thus leading to the problem of degeneration. to alleviate this problem, previous solutions (e.g. simctg) (su et al., 2021; 2022) encourage the model to learn isotropic token embeddings by pushing away the representations of distinct tokens. while building the more discriminative and isotropic feature space, these methods still ignore learning dialogue-specific features, such as inter-speaker correlations and conversational structure information, in the dialogue modeling stage. therefore, a question is naturally raised - are the representations produced by existing dialogue modeling methods really conversational? LINEBREAK to answer this question, in figure 1(a), we showcase the cosine similarity matrix of token representations produced by bart (lewis et al., 2020) that is well trained on response generation task. first, we can easily observe the phenomenon of anisotropy from the heatmap where the similarities of distinct tokens are relatively high, over 0.5 for most token pairs. then, figure 1(b) illustrates the similarity heatmap of token representations produced by simctg where the color is faded on the whole, suggesting the problem of anisotropy is relaxed. however, another critical problem still remains, is that the representations of tokens in different utterances are nearby to each other, making the utterance indistinguishable on the token representations. it is undesirable that no conversational features can be captured from the token similarity matrix while the matrix is produced by a “dialogue modeling” method trained on the dialogue task using dialogue data. ideally, we expect that the LINEBREAK ∗ corresponding author. LINEBREAK figure 1: illustrations of the token cosine similarity matrix produced by bart (a), simctg (su et al., 2022) (b) and our proposed simdrc (c). LINEBREAK representations of tokens within an utterance are close to voice a concentrated idea of the utterance, and the representations of different utterances are discriminative and isotropic to convey the maximal information of the dialogue. accordingly, the ideal similarity matrix of token representations should be similar to figure 1(c), where tokens within an utterance are intensive and different utterances are easily distinguishable on representations. our motivation is that humans pay more attention to the central idea of the utterance rather than how the utterance is organized by words when humans utter, and humans also prefer to express more information with fewer utterances (woolnough et al., 2021). LINEBREAK based on the above observation and motivation, we identify two properties, i.e., locality and isotropy in dialogue modeling, and then present simdrc, a simple dialogue representation calibration method, which encourages the model to aggregate the representations of tokens within an utterance and push away the representations of distinct utterances. we evaluate our approach on three open-domain dialogue tasks, including multi-turn dialogue response generation (li et al., 2017), conversational response retrieval (lowe et al., 2015) and conversational semantic role labeling (xu et al., 2021). the experimental results show that our approach achieves comparable or better performance against the current state-of-the-art methods across the three dialogue tasks on both automatic and human evaluations. in-depth analyses towards the effects of the hyper-parameters and the measurements of locality and isotropy further verify the effectiveness of our proposed approach. LINEBREAK related work LINEBREAK dialogue modeling LINEBREAK dialogue modeling is to transform the raw text of the dialogue to machine-readable representations, which is an indispensable step to most dialogue tasks (li et al., 2017; liu et al., 2021). to achieve this goal, conventional approaches (serban et al., 2016; 2017; xing et al., 2018) with recurrent neural networks (rnn) (hochreiter & schmidhuber, 1997; mikolov et al., 2010) prefer to hierarchically learn the representations due to the long distance dependency problems in rnns. with the remarkable success of transformer (vaswani et al., 2017) and pre-trained language models (devlin et al., 2019; raffel et al., 2020) on various nlp tasks, transformer-based dialogue modeling methods (hosseiniasl et al., 2020; gu et al., 2020; liu et al., 2021; wu et al., 2021) are widely used, and significantly outperform the traditional methods on many dialogue tasks, such as response generation (li et al., 2017) and response retrieval (lowe et al., 2015). in this work, we concentrate on the standard transformer-based dialogue modeling method, which directly encodes the flattened dialogue context with the pre-trained language models. by studying the geometry of the representation space of the model, we find that the contextual representations produced by existing dialogue modeling methods are not isotropic and conversational. LINEBREAK representation calibration LINEBREAK outside dialogue modeling, many other representation learning approaches also attempt to normalize their feature distributions from different perspectives. a bunch of studies theoretically verify that LINEBREAK uniformly distributing points on unit hypersphere can provide good representations (bojanowski & joulin, 2017; wang & isola, 2020). specifically, wang & isola (2020) directly uses the alignment and uniformity properties to guide the representation learning, finally achieving comparable or even better performance on downstream tasks than the original contrastive learning framework. with the rapid spread of transformer, a set of works (dong et al., 2021; su et al., 2022) also empirically explore the intrinsic properties of representations produced by the models, and find that the contextual words representations from most models are anisotropy, occupying a narrow cone in the feature space (ethayarajh, 2019). this observation strongly agrees with our intuition that refining dialogue feature space is a desirable step. to this problem, simctg (su et al., 2022) presents a token-level contrastive learning framework to calibrate the model’s representation space regarding the anisotropy problem. however, the essential difference with our work is that we normalize the feature space on multi-granularity levels instead of just the token level, which matches better with the structural characteristics of the dialogue and produces more isotropic and conversational representations. LINEBREAK methodology LINEBREAK dialogue modeling LINEBREAK given a dialogue d = {u1, u2, ..., un } consisting of n utterances, where ui = {wi,1, wi,2, ..., wi,|ui|} is a sequence of words, the goal of dialogue modeling is to learn the contextual representation h = {h1,1, ..., hi,j, ..., hn,|un |} over the dialogue context. typically, the transformer-based dialogue modeling method obtain the dialogue contextual representations by taking the utterances as a consecutive sequence with special separate tokens, which is presented as: LINEBREAK h = prlm(u1 [eou] u2 [eou] ... un [eou] [context]), LINEBREAK where [eou] and [context] are special tokens which would further be used to represent the whole utterance or dialogue. [eou] and [context] are respectively inserted as the last token of each utterance and the last token of the whole dialogue. LINEBREAK locality and isotropy distance LINEBREAK conventional wisdom says that a good dialogue contextual representation should be informative, discriminative and structurally sensitive (gu et al., 2020; wu et al., 2021; su et al., 2022). therefore, we identify two properties for good dialogue representations as following: LINEBREAK • locality: tokens within an utterance are mapped to nearby features, thus concentrating on LINEBREAK expressing a core idea of the utterance. LINEBREAK • isotropy: utterance representations are roughly uniformly distributed in the feature space, thus preserving as much information of the whole dialogue as possible and enabling the utterance discriminative to each other. LINEBREAK for locality, it encourages the learned feature representations of the tokens within an utterance to be similar. in practice, the special token (i.e., [eou]) is often served as the representative token of the utterance to speak for the utterance (zhu et al., 2020; liu et al., 2021). therefore, we model locality by bridging the gap between each token and the representative token of the utterance it belongs. the benefits of this design are 1) the representations of the tokens within an utterance are pushed close to the representation of the utterance representative token for better expressing the utterance’s concentrated idea; 2) the representative token are encouraged to combine the information from all tokens within the utterance, thus becoming more informative and representative. formally, given a dialogue d = {w1,1, ..., wi,j, ..., wn,|un |}, for each token wi,j(j(cid:54)=|ui|) in the context, we obtain the locality value by calculating the cosine similarity between the token and the corresponding utterance representative token wi,|ui|, LINEBREAK locality_value(i,j) = LINEBREAK where hi,j is the representation of token wi,j. the value will be larger when the two vectors are closer. then, we compute the overall locality distance for the whole dialogue context as: LINEBREAK locality_distance(d) = LINEBREAK locality_value(i,j). LINEBREAK for isotropy, it encourages the model to push away the features of distinct utterances, thus preserving the maximal information of the dialogue and enabling the utterance discriminative and isotropic. similar to locality, we model isotropy by enlarging the gap between distinct representative tokens. formally, given two distinct utterances ui and uj, we obtain the isotropy value by computing the cosine similarity between two utterance representative tokens, LINEBREAK isotropy_value(i,j) = LINEBREAK ht i,|ui|hj,|uj | (cid:107)hi,|ui|(cid:107) · (cid:107)hj,|uj |(cid:107) LINEBREAK similarly, the overall isotropy distance of the whole dialogue context is formulated as: LINEBREAK isotropy_distance(d) = LINEBREAK isotropy_value(i,j). LINEBREAK adjusting feature space LINEBREAK based on the locality distance and isotropy distance, we present locality loss, isotropy loss and simdrc loss to adjust the feature space for modeling better representations. LINEBREAK locality loss attempts to close the representations of the tokens within an utterance to the representations of the corresponding utterance representative token. therefore, we introduce locality loss, aiming at maximizing the locality distance defined in equation 3, LINEBREAK llocality = LINEBREAK max(0, δ1 − locality_value(i,j)) LINEBREAK where δ1 ∈ [0, 1] is the margin value. when δ1 equals to 0, the loss degrades to 0. LINEBREAK isotropy loss isotropy loss to minimize the isotropy distance defined in equation 5, LINEBREAK tries to push away the representations of distinct utterances. to this end, we introduce LINEBREAK lisotropy = LINEBREAK max(0, δ2 + isotropy_value(i,j)) LINEBREAK where δ2 ∈ [−1, 1] is the margin value. when δ2 equals to -1, the loss degrades to 0. LINEBREAK simdrc loss formally, we present the simdrc loss as, LINEBREAK combines the locality loss and isotropy loss to calibrate the representation space. LINEBREAK lsimdrc = αllocality(δ) + (1 − α)lisotropy(δ) LINEBREAK where δ ∈ [−1, 1] is the margin value, shared between the locality loss and isotropy loss. α is the hyper-parameter of loss weight. the simdrc loss degenerates to locality loss when α = 1, and to isotropy loss when −1 < δ ≤ 0 or α = 0, and to 0 when δ = −1. it is worth noting that, the isotropy loss is more sparse because it only works on a few utterance representative tokens while the locality loss computes on all tokens within the utterances. therefore, the model would be biased to modeling LINEBREAK dailydialog LINEBREAK model LINEBREAK method LINEBREAK bart LINEBREAK simctg (ρ=0.5) LINEBREAK greedy beam nucleus contrastive LINEBREAK greedy beam nucleus contrastive LINEBREAK greedy beam nucleus contrastive LINEBREAK bas↑ LINEBREAK bt↑ LINEBREAK lccc LINEBREAK bas↑ LINEBREAK bt↑ LINEBREAK table 1: results of automatic evaluation on the dailydialog and lccc datasets. bas means the bartscore (yuan et al., 2021). bt means the bleurt score (sellam et al., 2020). LINEBREAK more local features if we give moderate values of δ and α (e.g. δ=0, α=0.5). to this problem, we empirically scale up the isotropy loss by applying the large value of δ and the small value of α. LINEBREAK experiments LINEBREAK we evaluate our method on three kinds of dialogue tasks, i.e., multi-turn dialogue response generation (li et al., 2017), conversational response retrieval (lowe et al., 2015) and conversational semantic role labeling (xu et al., 2021). note that we just focus on open-domain dialogue tasks in this work since previous studies (jakobovits et al., 2022) revealed that most task-oriented datasets, like multiwoz (budzianowski et al., 2018) are essentially not conversational and contextualized while our method aims to learn these features in dialogue modeling stage. LINEBREAK multi-turn dialogue response generation LINEBREAK task & data multi-turn dialogue response generation is to automatically produce the human-like response given the dialogue context. hopefully, we expect the generated responses are diverse, fluent, coherent and informative. we evaluate our approach on dailydialog (li et al., 2017) and lccc (wang et al., 2020), wherein dailydialog is a multi-turn open-domain english dialogue dataset and lccc is a open-domain chinese short-text conversation dataset. LINEBREAK models & decoding we compare the vanilla bart and dialogpt models to their fine-tuned versions with simctg and simdrc. for each model, we conduct the inference using four decoding strategies, including 1) greedy search; 2) beam search (beam size = 5); 3) nucleus sampling (p = 0.95) (holtzman et al., 2019); 4) contrastive decoding (k = 5, α = 0.6) (su et al., 2022). LINEBREAK evaluation it is a long-standing problem to accurately and comprehensively evaluate the quality of the generated texts (celikyilmaz et al., 2020). the traditional n-gram overlap and text matching metrics, such as bleu (papineni et al., 2002) and rouge (lin, 2004), are not good choices to open-domain dialogue systems which permit significant diversity and allow multiple plausible outputs for a given input. therefore, we choose to measure the generation quality over following automatic evaluation metrics, including bertscore (zhang et al., 2019), bartscore (yuan et al., 2021), bleurt (sellam et al., 2020), distinct2/4 (li et al., 2016). LINEBREAK we also conduct the human evaluation with the help of proficient english/chinese speakers recruited from the crowdsourcing platform. we randomly sample 200 dialogue contexts from dailydialog and lccc test sets, respectively. for each dialogue context, we generate responses using different models (vanilla bart, bart+simctg and bart+simdrc) with different decoding strategies (greedy, beam search, nucleus sampling and contrastive decoding). five annotators are employed to independently evaluate these 2,400 samples by giving a score ranging from 1 to 5 over following aspects, including fluency, informativeness, coherence, and semantic coverage1. LINEBREAK 1more details of human evaluation in appendix a. LINEBREAK model LINEBREAK method
| 5
|
[
157.1970696,
695.3298112,
176.4130944,
701.5066112
] |
JjCAdMUlu9v.pdf
| 2,023
| 1
|
LINEBREAK auto-encoding goodness of fit LINEBREAK aaron palmer1, zhiyi chi2, derek aguiar1, jinbo bi1 1department of computer science, 2department of statistics {aaron.palmer,zhiyi.chi,derek.aguiar,jinbo.bi}@uconn.edu university of connecticut, storrs, ct, usa LINEBREAK abstract LINEBREAK we develop a new type of generative autoencoder called the goodness-of-fit autoencoder (gofae), which incorporates gof tests at two levels. at the minibatch level, it uses gof test statistics as regularization objectives. at a more global level, it selects a regularization coefficient based on higher criticism, i.e., a test on the uniformity of the local gof p-values. we justify the use of gof tests by providing a relaxed l2-wasserstein bound on the distance between the latent distribution and a distribution class. we prove that optimization based on these tests can be done with stochastic gradient descent on a compact riemannian manifold. empirically, we show that our higher criticism parameter selection procedure balances reconstruction and generation using mutual information and uniformity of p-values respectively. finally, we show that gofae achieves comparable fid scores and mean squared errors with competing deep generative models while retaining statistical indistinguishability from gaussian in the latent space based on a variety of hypothesis tests. LINEBREAK introduction
| 0
|
[
126.82956,
390.8736768,
205.9888518,
402.8288768
] |
GQjaI9mLet.pdf
| 2,022
| 0
|
LINEBREAK independent se(3)-equivariant models for end-to-end rigid protein docking LINEBREAK octavian-eugen ganea†∗ mit LINEBREAK xinyuan huang§∗ eth zurich LINEBREAK charlotte bunne eth zurich LINEBREAK yatao bian† tencent ai lab LINEBREAK regina barzilay mit LINEBREAK tommi jaakkola mit LINEBREAK andreas krause eth zurich LINEBREAK abstract LINEBREAK protein complex formation is a central problem in biology, being involved in most of the cell’s processes, and essential for applications, e.g. drug design or protein engineering. we tackle rigid body protein-protein docking, i.e., computationally predicting the 3d structure of a protein-protein complex from the individual unbound structures, assuming no conformational change within the proteins happens during binding. we design a novel pairwise-independent se(3)-equivariant graph matching network to predict the rotation and translation to place one of the proteins at the right docked position relative to the second protein. we mathematically guarantee a basic principle: the predicted complex is always identical regardless of the initial locations and orientations of the two structures. our model, named equidock, approximates the binding pockets and predicts the docking poses using keypoint matching and alignment, achieved through optimal transport and a differentiable kabsch algorithm. empirically, we achieve significant running time improvements and often outperform existing docking software despite not relying on heavy candidate sampling, structure refinement, or templates. 1 LINEBREAK introduction LINEBREAK in a recent breakthrough, alphafold 2 (jumper et al., 2021; senior et al., 2020) provides a solution to a grand challenge in biology—inferring a protein’s three-dimensional structure from its amino acid sequence (baek et al., 2021), following the dogma sequence determines structure. LINEBREAK besides their complex three-dimensional nature, proteins dynamically alter their function and structure in response to cellular signals, changes in the environment, or upon molecular docking. in particular, protein interactions are involved in various biological processes including signal transduction, protein synthesis, dna replication and repair. molecular docking is key to understanding protein interactions’ mechanisms and effects, and, subsequently, to developing therapeutic interventions. LINEBREAK figure 1: different views of the 3d structure of a protein complex. a. surface and b. cartoon view of protein z and its inhibitor. LINEBREAK we here address the problem of rigid body protein-protein docking which refers to computationally predicting the 3d structure of a protein-protein complex given the 3d structures of the two proteins in unbound state. rigid body means no deformations occur within any protein during binding, which is a realistic assumption in many biological settings. LINEBREAK popular docking software (chen et al., 2003; venkatraman et al., 2009; de vries et al., 2010; torchala et al., 2013; schindler et al., 2017; sunny and jayaraj, 2021) are typically computationally expensive, LINEBREAK †correspondence to: octavian ganea ([email protected]) and yatao bian ([email protected]). ∗equal contribution. §work done during an internship at tencent ai lab. 1our code is publicly available: https://github.com/octavian-ganea/equidock_public. LINEBREAK figure 2: same output guarantee of equidock. we predict a rigid transformation to place the ligand in the binding location w.r.t the receptor. we mathematically guarantee to output the same complex structure — up to an se(3) transformation — independently of the initial unbound positions, rotations, or roles of both constituents. (rmsd = root-mean-square deviation of atomic positions) LINEBREAK taking between minutes and hours to solve a single example pair, while not being guaranteed to find accurate complex structures. these methods largely follow the steps: i.) randomly sample a large number (e.g., millions) of candidate initial complex structures, ii.) employ a scoring function to rank the candidates, iii.) adjust and refine the top complex structures based on an energy model (e.g., force field). we here take a first step towards tackling these issues by using deep learning models for direct prediction of protein complex structures. LINEBREAK contributions. we design equidock, a fast, end-to-end method for rigid body docking that directly predicts the se(3) transformation to place one of the proteins (ligand) at the right location and orientation with respect to the second protein (receptor). our method is based on the principle that the exact same complex structure should be predicted irrespectively of the initial 3d placements and roles of both constituents (see fig. 2). we achieve this desideratum by incorporating the inductive biases of pairwise se(3)–equivariance and commutativity, and deriving novel theoretical results for necessary and sufficient model constraints (see section 3). next, we create equidock to satisfy these properties by design, being a combination of: i) a novel type of pairwise independent se(3)-equivariant graph matching networks, ii) an attention-based keypoint selection algorithm that discovers representative points and aligns them with the binding pocket residues using optimal transport, and iii) a differentiable superimposition model to recover the optimal global rigid transformation. unlike prior work, our method does not use heavy candidate sampling or ranking, templates, task-specific geometric or chemical hand-crafted features, or pre-computed meshes. this enables us to achieve plausible structures with a speed-up of 80-500x compared to popular docking software, offering a promising competitive alternative to current solutions for this problem. LINEBREAK related work LINEBREAK geometric deep learning. graph neural networks (gnns) are becoming the de facto choice for learning with graph data (bruna et al., 2013; defferrard et al., 2016; kipf and welling, 2016; gilmer et al., 2017; xu et al., 2018; li et al., 2019). motivated by symmetries naturally occurring in different data types, architectures are tailored to explicitly incorporate such properties (cohen and welling, 2016a;b; thomas et al., 2018; fuchs et al., 2020; finzi et al., 2020; eismann et al., 2020; satorras et al., 2021). gnns are validated in a variety of tasks such as particle system dynamics or conformation-based energy estimation (weiler and cesa, 2019; rezende et al., 2019).
| 1
|
[
107.532,
142.6760784,
504.830482452,
218.4624166
] |
zq1iJkNk3uN.pdf
| 2,022
| 2
|
LINEBREAK supervision exists everywhere: a data efficient contrastive language-image pre-training paradigm LINEBREAK yangguang li ∗ 1,, feng liang∗ 2, lichen zhao∗ 1, yufeng cui1, wanli ouyang3, jing shao1, fengwei yu1, junjie yan1 1sensetime research 2the university of texas at austin 3university of sydney {liyangguang,zhaolichen,cuiyufeng}@sensetime.com [email protected] LINEBREAK abstract LINEBREAK recently, large-scale contrastive language-image pre-training (clip) (radford et al., 2021) has attracted unprecedented attention for its impressive zero-shot recognition ability and excellent transferability to downstream tasks. however, clip is quite data-hungry and requires 400m image-text pairs for pre-training, thereby restricting its adoption. this work proposes a novel training paradigm, data efficient clip (declip), to alleviate this limitation. we demonstrate that by carefully utilizing the widespread supervision among the image-text pairs, our declip can learn generic visual features more efficiently. instead of using the single image-text contrastive supervision, we fully exploit data potential through the use of (1) self-supervision within each modality; (2) multi-view supervision across modalities; (3) nearest-neighbor supervision from other similar pairs. benefiting from these intrinsic supervision, our declip-resnet50 can achieve 60.4% zeroshot top1 accuracy on imagenet, which is 0.8% above the clip-resnet50 while using 7.1× fewer data. our declip-resnet50 outperforms its counterpart in 8 out of 11 visual datasets when transferred to downstream tasks. moreover, scaling up the model and computing also works well in our framework. our code, dataset and models are released at: https://github.com/sense-gvt/declip LINEBREAK introduction LINEBREAK over the last few years, pre-trained models have greatly revolutionized computer vision (cv) and natural language processing (nlp). the first wave of exploring pre-trained models took place in the field of cv. deep convolutional neural nets (krizhevsky et al., 2012; simonyan & zisserman, 2014; he et al., 2016) are pre-trained on well-labeled imagenet (deng et al., 2009) and then transferred to downstream cv tasks (girshick et al., 2014; long et al., 2015; vinyals et al., 2015). standardly, cv models are pre-trained to predict a fixed set of pre-defined object categories, e.g., 1000 classes in imagenet. however, this supervised pre-training is hard to scale since we need arduous human labeling to specify new visual concepts. LINEBREAK when pre-training meets nlp, the intrinsic supervision within the natural language makes the pretraining more scalable (devlin et al., 2018; radford et al., 2019; brown et al., 2020). witnessing the progress in nlp, researchers use natural language supervision to learn visual features. the language-image pre-training can scale up to a very large size, benefiting from abundant image-text pairs on the internet. for instance, clip (radford et al., 2021) and align (jia et al., 2021) adopt the contrastive loss to push the embedding of matched image-text pairs together while pushing those of non-matched pairs apart. they achieve prestigious performance by learning from an enormous dataset that contains 400m/1b image-text pairs. however, these methods also require huge storage and computing resources, which is not affordable for most laboratories and companies. we argue LINEBREAK ∗the first three authors contribute equally. the order is determined by dice rolling. LINEBREAK data LINEBREAK clip declip 41.9 49.3 60.4 62.5 # † our reimplementation. LINEBREAK figure 1: zero-shot performance of clipresnet50 and our declip-resnet50 when using different amounts of data. (88m, 62.5%) denotes the use of 88m data with top-1 accuracy 62.5% on the imagenet-1k validation dataset. our model has much better data efficiency. LINEBREAK figure 2: transfer the declip-resnet50 (abbr. as dec) and clip-resnet50 (abbr. as c) to 11 downstream visual datasets using linear probe verification. our declip achieves better results in 8 out of 11 datasets. LINEBREAK that these prior arts only use the single image-text contrastive supervision while overlooking the widespread supervision within the pairs, thus is inefficient. LINEBREAK firstly, there underlies rich structural information within each modality itself (lecun & misra, 2021). we can tweak some words/pixels in a sentence/image while retaining a similar semantic meaning. this sort of self-supervision can be exploited to learn a more common-sense representation for each modality (devlin et al., 2018; he et al., 2020; chen et al., 2020a). moreover, inspired by contrasting multi-crops in an image (caron et al., 2020), we further extend the multi-view 1 supervision into our multi-modality setting. specifically, each image is paired with multiple textual descriptions obtained via stochastic augmentations, vice versa. the benefit is intuitive: this auxiliary multi-view supervision brings more invariant and robust information. LINEBREAK besides these overlooked supervision, we propose a novel nearest-neighbor (nn) supervision from other similar pairs. this nn supervision is mainly based on the intuition that one image is likely to have other similar text deas shown in right figscriptions among the dataset. ure, the image with the text ’going to see a lot of vintage tractors this week’ can also be described by ’vintage at tractors a gathering’. for this reason, we sample the nn in the embedding space and utilize them as additional supervisory signals. aggregating these supervision leads to our novel training paradigm declip, which stands for data efficient contrastive language-image pretraining. LINEBREAK figure 3: examples of nearest neighbor from conceptual captions dataset. LINEBREAK extensive experiments show the effectiveness and efficiency of our declip. as shown in fig. 1, with a resnet50 image encoder and a transformer text encoder, our model can achieve 60.4% zero-shot top1 accuracy on imagenet, which is 0.8% above the clipresnet50 while using 7.1× fewer data. using only 88m image-text pairs, our best resnet50/vitb32 models boost the zero-shot performance to 62.5% and 66.2%, nearly 3.0% higher than the best number reported for these two architectures. we further verify the transferability of our models on downstream tasks. as indicated in fig. 2, our declip-resnet50 outperforms its counterpart in 8 out of 11 visual datasets. moreover, scaling up the model and computing also works well in our framework. using 4.5× fewer data, our declip-regnety-64gf achieves 73.7% zero-shot imagenet top1 accuracy, which is on-pair with clip-r50×64. pre-trained models, code, and datasets shall be released to the community. the contributions are summarized as follows: LINEBREAK 1view is originally a visual concept. for simplicity, we use the same term for language. LINEBREAK • to the best of our knowledge, this is the first work to study self-supervision and cross-modal multi-view supervision in the million-scale image-text pre-training task. our work opens a new direction to fully exploit the intrinsic supervision within the multi-modal data instead of scaling up data naively. LINEBREAK • we propose novel cross-modal nearest-neighbor supervision (nns) to harness information from LINEBREAK other similar pairs. the nns can also be regarded as a semantic-level augmentation. LINEBREAK related work LINEBREAK pre-trained models
| 2
|
[
108.249,
585.5230784,
231.0813068,
595.4856784
] |
E01k9048soZ.pdf
| 2,023
| 2
|
LINEBREAK unified-io: a unified model for vision, language, and multi-modal tasks LINEBREAK jiasen lu†∗, christopher clark†∗, rowan zellers†⋄, LINEBREAK roozbeh mottaghi†⋄, aniruddha kembhavi†⋄ LINEBREAK †allen institute for ai, ⋄university of washington, seattle LINEBREAK abstract LINEBREAK we propose unified-io, a model that performs a large variety of ai tasks spanning classical computer vision tasks, including pose estimation, object detection, depth estimation and image generation, vision-and-language tasks such as region captioning and referring expression, to natural language processing tasks such as question answering and paraphrasing. developing a single unified model for such a large variety of tasks poses unique challenges due to the heterogeneous inputs and outputs pertaining to each task, including rgb images, per-pixel maps, binary masks, bounding boxes, and language. we achieve this unification by homogenizing every supported input and output into a sequence of discrete vocabulary tokens. this common representation across all tasks allows us to train a single transformer-based architecture, jointly on over 90 diverse datasets in the vision and language fields. unified-io is the first model capable of performing all 7 tasks on the grit benchmark and produces strong results across 16 diverse benchmarks like nyuv2-depth, imagenet, vqa2.0, ok-vqa, swig, vizwizground, boolq, and scitail, with no task-specific fine-tuning. code and demos for unified-io are available at: unified-io.allenai.org LINEBREAK introduction LINEBREAK we present unified-io, the first neural model to jointly perform a large and diverse set of ai tasks spanning classical computer vision (such as object detection, segmentation, and depth estimation), image synthesis (such as image generation and image in-painting), vision-and-language (like visual question answering, image captioning, and referring expression) and nlp (such as question answering and paraphrasing). unified general-purpose models avoid the need for task-specific design, learn and perform a wide range of tasks with a single architecture, can utilize large, diverse data corpora, can effectively transfer concept knowledge across tasks, and even perform tasks unknown and unobserved at design and training time. LINEBREAK building unified models for computer vision has proven to be quite challenging since vision tasks have incredibly diverse input and output representations. for instance, object detection produces bounding boxes around objects in an image, segmentation produces binary masks outlining regions in an image, visual question answering produces an answer as text, and depth estimation produces a map detailing the distance of each pixel from the camera. this heterogeneity makes it very challenging to architect a single model for all these tasks. in contrast, while the landscape of natural language processing (nlp) tasks, datasets, and benchmarks is large and diverse, their inputs and desired outputs can often be uniformly represented as sequences of tokens. sequence to sequence (seq2seq) architectures (raffel et al., 2020; brown et al., 2020), specifically designed to accept and produce such sequences of tokens, are thus widely applicable to many tasks. unified models employing such architectures have been central to much recent progress in nlp. LINEBREAK unified models for computer vision typically use a shared visual backbone to produce visual embeddings but then employ individual branches for each of the desired tasks. these include models LINEBREAK ∗equal contribution. correspondence to [email protected] LINEBREAK figure 1: unified-io is a single sequence-to-sequence model that performs a variety of tasks in computer vision and nlp using a unified architecture without a need for either task or modalityspecific branches. this broad unification is achieved by homogenizing every task’s input and output into a sequence of discrete vocabulary tokens. unified-io supports modalities as diverse as images, masks, keypoints, boxes, and text, and tasks as varied as depth estimation, inpainting, semantic segmentation, captioning, and reading comprehension. LINEBREAK like mask r-cnn (he et al., 2017) for classical visual tasks that use an imagenet pre-trained encoder followed by branches for detection and segmentation, trained in a fully supervised manner. in the vision and language (v&l) domain, cnn backbones feed visual features to transformer architectures that also combine language, followed by task-specific heads for visual question answering, referring expression, visual commonsense reasoning, etc. (lu et al., 2019; li et al., 2019; tan & bansal, 2019). a more recent trend has seen the emergence of unified architectures that do away with task-specific heads and instead introduce modality-specific heads (hu & singh, 2021; cho et al., 2021; gupta et al., 2022a; wang et al., 2022b) – for instance, a single language decoder that serves multiple tasks requiring language output like captioning and classification. however, most progress in unified models continues to be centered around v&l tasks, owing to the simplicity of building shared language decoders and is often limited to supporting just a handful of tasks. LINEBREAK unified-io is a seq2seq model capable of performing a variety of tasks using a unified architecture without a need for either task or even modality-specific branches. this broad unification is achieved by homogenizing every task’s output into a sequence of discrete tokens. dense structured outputs such as images, segmentation masks and depth maps are converted to sequences using a vector quantization variational auto-encoder (vq-gan) (esser et al., 2021), sparse structured outputs such as bounding boxes, and human joint locations are transcribed into sequences of coordinate tokens, and language outputs are converted to sequences using byte-pair encoding. this unification enables unified-io to jointly train on over 90 datasets spanning computer vision, v&l, and nlp tasks with a single streamlined transformer encoder-decoder architecture (raffel et al., 2020). LINEBREAK our jointly trained unified-io is the first model to support all 7 tasks in the general robust image task (grit) benchmark (gupta et al., 2022b) and obtains the top overall score of 64.3 when averaging across all tasks, handily beating the second best model by 32.0. we further evaluate unified-io on 16 diverse benchmarks across computer vision and nlp, without any fine-tuning towards any individual benchmark, and find that it performs remarkably well compared to specialized (or fine-tuned) state-of-the-art models. LINEBREAK vision, language and multi-modal tasks LINEBREAK unified-io is designed to handle a wide range of language, vision and language, and classic vision tasks in a unified way. to fully test this capability, we gather 95 vision, language, and multi-modal LINEBREAK example source LINEBREAK size LINEBREAK input modalities LINEBREAK output modalities LINEBREAK datasets size percent rate text LINEBREAK image sparse dense text LINEBREAK image sparse dense LINEBREAK image synthesis LINEBREAK image synthesis from text image inpainting image synthesis from seg. LINEBREAK redcaps vg lvis LINEBREAK sparse labelling object detection object localization keypoint estimation referring expression LINEBREAK dense labelling LINEBREAK depth estimation surface normal estimation object segmentation image classification image classification object categorization LINEBREAK image captioning LINEBREAK open images vg coco refcoco LINEBREAK nyu depth framenet lvis LINEBREAK imagenet coco LINEBREAK webly supervised captioning cc12m supervised captioning region captioning vision & language LINEBREAK vizwiz vg LINEBREAK visual question answering relationship detection grounded vqa LINEBREAK vqa 2.0 vg vizwiz LINEBREAK nlp LINEBREAK text classification question answering text summarization language modelling LINEBREAK mnli squad gigaword LINEBREAK masked language modelling c4 LINEBREAK all tasks LINEBREAK table 1: tasks unified-io learns to complete. from left to right, columns show an example of one of the sources used for the task, the number of datasets, total number and percent of examples relative to the entire training corpus, and sample rate during multi-task training. subsequent columns show what modalities are required for the tasks, and highlighted rows show aggregated statistics for groups of similar tasks. LINEBREAK datasets from 62 publicly available data sources as targets for our model to learn during multi-task training. these datasets cover a wide range of tasks, skills, and modalities. LINEBREAK we categorize the input and output modalities of each task into 4 different types: text – natural language tokens; image – rgb images; sparse – a small number of location coordinates within the image; dense – per-pixel labels such as depth maps, surface normal maps, etc. we group related datasets into 8 groups and 22 tasks to facilitate our training and analysis: LINEBREAK image synthesis. given a text description, partially occluded image and inpainting target, or segmentation map containing a semantic class for some pixels, generate a matching image. data sources with image and text pairs (desai et al., 2021), bounding boxes (krishna et al., 2017) or semantic segmentation (gupta et al., 2019) can be used to build these tasks. LINEBREAK sparse labelling. given an image and a natural language query, identify the target regions or keypoint locations that are being referred to. tasks include object detection (kuznetsova et al., 2020), object localization (rhodes et al., 2017), human pose estimation (lin et al., 2014), and referring expression (kazemzadeh et al., 2014). LINEBREAK dense labelling. given an image, produce per-pixel labels for that image. labels include the distance of that pixel to the camera (nathan silberman & fergus, 2012), surface orientation (bae et al., 2021) or semantic class (lin et al., 2014). LINEBREAK image classification. given an image and optionally a target bounding box, generate a class name or tag of that image or target region. this group includes image classification (deng et al., 2009) and object categorization (pinz et al., 2006) datasets. LINEBREAK image captioning. given an image and optionally a bounding box, generate a natural language description of that image or target region. we include both crowd-sourced (chen et al., 2015) and webly supervised (changpinyo et al., 2021) captions. LINEBREAK figure 2: unified-io. a schematic of the model with four demonstrative tasks: object segmentation, visual question answering, depth estimation and object localization. LINEBREAK vision & language. a broad category for other tasks that require joint reason over image content and a natural language query. there are many popular vision and language datasets, and we categories these datasets into 3 tasks – visual question answering (antol et al., 2015); relationship detection (lu et al., 2016) and grounded vqa (chen et al., 2022a). LINEBREAK nlp. tasks with text as the only input and output modalities, including text classification (williams et al., 2018), question answering (rajpurkar et al., 2016) and text summarization (graff et al., 2003). LINEBREAK language modeling. the masking language modeling pre-training task (see section 3.3) using text from c4 (raffel et al., 2020) and wikipedia (foundation), which we include to ensure the knowledge gained from language pre-training is not lost during multi-task training. other pre-training tasks are not included because the relevant datasets are already used in other supervised tasks (e.g., for captioning or classification). LINEBREAK table 1 shows the details of tasks and groups. we list an example dataset source, number of datasets, number of examples, percent of the total number of examples, and sampling rate during training (section 3.3) for each group and task. subsequent columns show what modalities are required for the inputs and outputs. we defer additional task details, inference details, the complete list of datasets and visualizations to the appendix a.1. LINEBREAK unified-io LINEBREAK our goal is to build a single unified model that can support a diverse set of tasks across computer vision and language with little to no need for task-specific customizations and parameters. such unified architectures can be applied to new tasks with little to no knowledge of the underlying machinery, enable general pre-training to benefit many diverse downstream applications, be jointly trained on a large number of tasks, and better allows knowledge to be shared between tasks. LINEBREAK unified task representations LINEBREAK supporting a variety of modalities such as images, language, boxes, binary masks, segmentation masks, etc. without task-specific heads requires representing these modalities in a shared and unified space. to do this, we discretize the text, images, and other structured outputs in our tasks and represent them with tokens drawn from a unified and finite vocabulary. LINEBREAK text representation. following raffel et al. (2020), text inputs and outputs are tokenized using sentencepiece (kudo & richardson, 2018). following past works such as mccann et al. (2018); raffel et al. (2020); gupta et al. (2022a); wang et al. (2022b) we also specify each task with a natural language prompt (excluding some tasks like vqa, which are fully specified by their text inputs) in order to indicate what task should be performed. for example, “what is the depth map of the image?” for depth estimation or “what region does “cat” describe?” for object localization. LINEBREAK images and dense structures representation. a variety of tasks in computer vision requires the model to produce high-dimensional outputs such as images (e.g., image in-painting) or per-pixel labels (e.g., depth estimation). to handle these modalities, we first convert per-pixel labels into rgb images. for depth, we construct a grayscale image by normalizing the depth map. for surface normal estimation, we convert the x/y/z orientations into r/g/b values. for segmentation, we map each instance present in the image to a unique color. we randomly select colors for each instance and specify the color-to-class mapping in the text instead of using universal color-to-class mapping. this avoids requiring a fixed list of classes and avoids having colors that may only be marginally different due to the presence of a large number of classes. LINEBREAK then we encode these images as discrete tokens using a vq-gan. in particular, we use the imagenet-pretrained vq-gan from esser et al. (2021) with 256 × 256 resolution, a compression ratio of 16, and 16384 codebook size. the vq-gan codebook is added to the vocabulary as additional tokens that can be generated by the decoder. during training, the tokens for the target image are used as targets. during inference, the vq-gan decoder is used to convert the generated image tokens into an output image. LINEBREAK sparse structures representation. we encode sparse structures such as bounding boxes or human joints by adding 1000 special tokens to the vocabulary to represent discretized image coordinates (chen et al., 2022b). points are then encoded with a sequence of two such tokens, one for the x and one for the y coordinates, and boxes are encoded using a sequence of four tokens, two for the upper right corner and two for the lower left corner. labeled boxes are encoded as a box followed by a text class label, and joints are encoded as a sequence of points followed by a text visibility label. this allows us to handle a wide variety of tasks that use these elements in their inputs or output (see appendix a.1 for examples). LINEBREAK unified architecture
| 4
|
[
108.249,
347.5130784,
238.4285706,
357.4756784
] |
elDEe8LYW7-.pdf
| 2,023
| 0
|
LINEBREAK nansy++: unified voice synthesis with neural analysis and synthesis LINEBREAK hyeong-seok choi1,2, *jinhyeok yang2, *juheon lee1,2, *hyeongju kim2 1seoul national university 2supertone, inc., {kekepa15,yangyangii,juheon2,hyeongju}@supertone.ai LINEBREAK abstract LINEBREAK various applications of voice synthesis have been developed independently despite the fact that they generate “voice” as output in common. in addition, most of the voice synthesis models still require a large number of audio data paired with annotated labels (e.g., text transcription and music score) for training. to this end, we propose a unified framework of synthesizing and manipulating voice signals from analysis features, dubbed nansy++. the backbone network of nansy++ is trained in a self-supervised manner that does not require any annotations paired with audio. after training the backbone network, we efficiently tackle four voice applications - i.e. voice conversion, text-to-speech, singing voice synthesis, and voice designing - by partially modeling the analysis features required for each task. extensive experiments show that the proposed framework offers competitive advantages such as controllability, data efficiency, and fast training convergence, while providing high quality synthesis. audio samples: tinyurl.com/8tnsy3uc. LINEBREAK introduction LINEBREAK most deep learning-based voice synthesis models consist of two parts: generating a mel spectrogram from an acoustic model that takes labeled annotations as input (e.g., text, music score, etc.), and converting the mel spectrogram into a waveform using a vocoder (wang et al., 2017; kim et al., 2020; jeong et al., 2021; lee et al., 2019; liu et al., 2022). however, this usually suffers from poor synthesis quality due to the training/inference mismatch of the acoustic model and vocoder. end-toend training methods has been recently proposed to tackle such issues (bi´nkowski et al., 2020; weiss et al., 2021; donahue et al., 2021; kim et al., 2021). despite the high quality, however, the training process of end-to-end models is often costly, as the waveform synthesis part needs to be trained again when training each different model. furthermore, regardless of the training strategies of previous studies (end-to-end or not), most of the standard voice synthesis models are not modular enough in that most of the desirable control features are entangled in a single mid-level representation, or so-called latent space. this limits the controllability of such features and restrains the possibility of models being used as co-creation tools between creators and machines. lastly, although many voice synthesis tasks are analogous in that they are meant to synthesize or control certain attributes of voice, the methodologies developed for each application remain scattered in research fields. these problems call for the need of developing a unified voice synthesis framework. LINEBREAK we stick to three objectives for designing the unified synthesis framework, that is, 1. data-scalable: the training procedure should be done via a minimum amount of labeled dataset while exploiting abundant audio recordings without labels, 2. modular: the training for each application should be done in a modularized way by sharing a universal parameterized synthesizer, 3. high quality: the synthesis quality must persist high standard even by abiding by the modularized training procedure. to this end, we make a core assumption that most of the voice synthesis tasks can be defined by synthesizing and controlling four aspects of voice, that is, pitch, amplitude, linguistic, and timbre. this motivates us to develop a backbone network that can analyze voice into the four properties and then synthesize them back into an waveform. on that account, we propose nansy++, which LINEBREAK *equal contribution
| 0
|
[
124.139,
60.2012576,
195.4398128,
69.1676576
] |
RQLLzMCefQu.pdf
| 2,022
| 0
|
LINEBREAK provable rl with exogenous distractors via multistep inverse dynamics LINEBREAK yonathan efroni1, dipendra misra1, akshay krishnamurthy1, alekh agarwal2 1microsoft research, new york, ny 2google LINEBREAK †, john langford1 LINEBREAK abstract LINEBREAK many real-world applications of reinforcement learning (rl) require the agent to deal with high-dimensional observations such as those generated from a megapixel camera. prior work has addressed such problems with representation learning, through which the agent can provably extract endogenous, latent state information from raw observations and subsequently plan efficiently. however, such approaches can fail in the presence of temporally correlated noise in the observations, a phenomenon that is common in practice. we initiate the formal study of latent state discovery in the presence of such exogenous noise sources by proposing a new model, the exogenous block mdp (ex-bmdp), for rich observation rl. we start by establishing several negative results, by highlighting failure cases of prior representation learning based approaches. then, we introduce the predictive path elimination (ppe) algorithm, that learns a generalization of inverse dynamics and is provably sample and computationally efficient in ex-bmdps when the endogenous state dynamics are near deterministic. the sample complexity of ppe depends polynomially on the size of the latent endogenous state space while not directly depending on the size of the observation space, nor the exogenous state space. we provide experiments on challenging exploration problems which show that our approach works empirically. LINEBREAK introduction LINEBREAK in many real-world applications such as robotics there can be large disparities in the size of agent’s observation space (for example, the image generated by agent’s camera), and a much smaller latent state space (for example, the agent’s location and orientation) governing the rewards and dynamics. this size disparity offers an opportunity: how can we construct reinforcement learning (rl) algorithms which can learn an optimal policy using samples that scale with the size of the latent state space rather than the size of the observation space? several families of approaches have been proposed based on solving various ancillary prediction problems including autoencoding (tang et al., 2017; hafner et al., 2019), inverse modeling (pathak et al., 2017; burda et al., 2018), and contrastive learning (laskin et al., 2020) based approaches. these works have generated some significant empirical successes, but are there provable (and hence more reliable) foundations for their success? more generally, what are the right principles for learning with latent state spaces? LINEBREAK in real-world applications, a key issue is robustness to noise in the observation space. when noise comes from the observation process itself, such as due to measurement error, several approaches have been recently developed to either explicitly identify (du et al., 2019; misra et al., 2020; agarwal et al., 2020a) or implicitly leverage (jiang et al., 2017) the presence of latent state structure for provably sample-efficient rl. however, in many real-world scenarios, the observations consist of many elements (e.g. weather, lighting conditions, etc.) with temporally correlated dynamics (see e.g. figure 1 and the example below) that are entirely independent of the agent’s actions and rewards. the temporal dynamics of these elements precludes us from treating them as uncorrelated noise, and as such, most previous approaches resort to modeling their dynamics. however, this is clearly wasteful as these elements have no bearing on the rl problem being solved. LINEBREAK †work was done while the author was at microsoft research. {yefroni, dimisra, akshaykr, jcl}@microsoft.com, [email protected] LINEBREAK figure 1: left: an agent is walking next to a pond in a park and observes the world as an image. the world consists of a latent endogenous state, containing variable such as agent’s position, and a much larger latent exogenous state containing variables such as motion of ducks, ripples in the water, etc. center: graphical model of the ex-bmdp. right: ppe learns a generalized form of inverse dynamics that recovers the endogenous state. LINEBREAK as an example, consider the setting in figure 1. an agent is walking in a park on a lonely sidewalk next to a pond. the agent’s observation space is the image generated by its camera, the latent endogenous state is its position on the sidewalk, and the exogenous noise is provided by motion of ducks, swaying of trees and changes in lighting conditions, typically unaffected by the agent’s actions. while there is a line of recent empirical work that aims to remove causally irrelevant aspects of the observation (gelada et al., 2019; zhang et al., 2020), theoretical treatment is quite limited (dietterich et al., 2018) and no prior works address sample-efficient learning with provable guarantees. given this, the key question here is: LINEBREAK how can we learn using an amount of data scaling with just the size of the endogenous latent state, while ignoring the temporally correlated exogenous observation noise? LINEBREAK we initiate a formal treatment of rl settings where the learner’s observations are jointly generated by a latent endogenous state and an uncontrolled exogenous state, which is unaffected by the agent’s actions and does not affect the agent’s task. we study a subset of such problems called exogenous block mdps (ex-bmdps), where the endogenous state is discrete and decodable from the observations. we first highlight the challenges in solving ex-bmdps by illustrating the failures of many prior representation learning approaches (pathak et al., 2017; misra et al., 2020; jiang et al., 2017; agarwal et al., 2020a; zhang et al., 2020). these failure happen either due to creating too many latent states, such as one for each combination of ducks and passers-by in the example above leading to sample inefficiency in exploration, or due to lack of exhaustive exploration. LINEBREAK we identify one recent approach developed by du et al. (2019) with favorable properties for exbmdps with near-deterministic latent state dynamics. in section 4 and section 5, we develop a variation of their algorithm and analyze its performance. the algorithm, called path prediction and elimination (ppe), learns a form of multi-step inverse dynamics by predicting the identity of the path that generates an observation. for near-deterministic ex-bmdps, we prove that ppe successfully explores the environment using o((sa)2h log( /δ)) samples where s is the size of the latent endogenous state space, a is the number of actions, h is the horizon and is a function class employed to solve a maximum likelihood problem. several prior works (gregor et al., 2016; paster et al., 2020) have also considered a multi-step inverse dynamics approach to learn a near optimal policy. yet, these works do not consider the ex-bmdp model. further, it is unknown whether these algorithms have provable guarantees, as ppe. theoretical analysis of the performance of these algorithms in the presence of exogenous noise is an interesting future work direction. LINEBREAK |f| LINEBREAK f LINEBREAK empirically, in section 6, we demonstrate the performance of ppe and various prior baselines in a challenging exploration problem with exogenous noise. we show that baselines fail to decode the endogenous state as well as learning a good policy. we further, show that ppe is able to recover the latent endogenous model in a visually complex navigation problem, in accordance with the theory. LINEBREAK exogenous block mdp setting LINEBREAK we introduce a novel exogenous block markov decision process (ex-bmdp) setting to model systems with exogenous noise. we describe notations before formalizing the ex-bmdp model. LINEBREAK notations. for a given set u for a given natural number n for a probability distribution p LINEBREAK , we use ∆( LINEBREAK ) to denote the set of all probability distributions over LINEBREAK u LINEBREAK n, we use the notation [n ] to denote the set ), we define its support as supp(p) = ∆( LINEBREAK . u . lastly, } . p(u) > 0, u LINEBREAK , n LINEBREAK u LINEBREAK x LINEBREAK z LINEBREAK q( LINEBREAK x ∆( LINEBREAK z × a → LINEBREAK x × a → LINEBREAK , a set of latent states LINEBREAK ), a reward function r : LINEBREAK with cardinality a, a transition function t : LINEBREAK z z [0, 1], a horizon h LINEBREAK · · · , zh ), instead receiving only the observations (x1, LINEBREAK , zh , xh , ah , rh ) where z1 ∼ µ( zh), rh = r(xh, ah), and if h < h, then zh+1 ∼ LINEBREAK ∈ u} we start with describing the block markov decision process (bmdp) du et al. (2019). this process with cardinality z, a finite set consists of a finite set of observations ), an emission function of actions a n, and a start state q : z × a → ). the agent interacts with the environment by repeatedly generating h-step distribution µ trajectories (z1, x1, a1, r1, [h] we have ∈ zh, ah). the agent does not xh ∼ · | observe the states (z1, , xh ) and rewards · · · , rh ). we assume that the emission distributions of any two latent states are disjoint, usually (r1, referred as the block assumption: supp(q( = z2. the agent when z1 (cid:54) z1)) ∅ ∩ ). we also define the set of non-stationary policies chooses actions using a policy π : πns = πh as a h-length tuple, with (π1, πns denoting that the action at time step h , πh ) is taken as ah ∼ xh). the value v (π) of a policy π is the expected episodic sum of rewards πh( v (π) := eπ[(cid:80)h h=1 r(xh, ah)]. the optimal policy is given by π(cid:63) = arg maxπ πns v (π). we denote by ph(x π) the probability distribution over observations x at time step h when following | h sequences of actions. a policy π. lastly, we refer to an open loop policy as an element in all an open loop policy follows a pre-determined sequence of actions for h time steps, unaffected by state information. LINEBREAK ) and for every h · t ( LINEBREAK a a1, .., ah } { LINEBREAK a · · · LINEBREAK supp(q( LINEBREAK x → LINEBREAK given the aforementioned definitions, we define an ex-bmdp as follows: definition 1 (exogenous block markov decision processes). an ex-bmdp is a bmdp such that the latent state can be decoupled into two parts z = (s, ξ) where s is the endogenous state ∈ s and ξ the initial distribution and transition functions are ξ is the exogenous state. for z ∈ z decoupled, that is: µ(z) = µ(s)µξ(ξ), and t (z(cid:48) s, a)tξ(ξ(cid:48) LINEBREAK | the observation space can be arbitrarily large to model which could be a high-dimensional real vector denoting an image, sound, or haptic data in an ex-bmdp. the endogenous state s captures the information that can be manipulated by the agent. figure 1, center, visualizes the transition dynamics is finite with cardinality s. the factorization. we assume that the set of all endogenous states exogenous state ξ captures all the other information that the agent cannot control and does not affect the information it can manipulate. again, we make no assumptions on the exogenous dynamics which may be arbitrarily large. we note that the block assumption of the nor on its cardinality ξ | ex-bmdp implies the existence of two inverse mappings: φ(cid:63) : to map an observation to its endogenous state, and φ(cid:63) ξ : LINEBREAK ξ to map it to its exogenous state. LINEBREAK z, a) = t (s(cid:48) LINEBREAK x → s LINEBREAK x LINEBREAK s LINEBREAK x → LINEBREAK justification of assumptions. the block assumption has been made by prior work (e.g., du et al. (2019), zhang et al. (2020)) to model many real-world settings where the observation is rich, i.e., it contains enough information to decode the latent state. the decoupled dynamics assumption made in the ex-bmdp setting is a natural way to characterize exogenous noise; the type of noise that is not affected by our actions nor affects the endogenous state but may have non-trivial dynamic. this decoupling captures the movement of ducks, captured in the visual field of the agent in figure 1, and many additional exogenous processes (e.g., movement of clouds in a navigation task). LINEBREAK goal. our formal objective is reward-free learning. we wish to find a set of policies, we call a policy cover, that can be used to explore the entire state space. given a policy cover, and for any reward function, we can find a near optimal policy by applying dynamic programming (e.g., bagnell et al. (2004)), policy optimization (e.g., kakade and langford (2002); agarwal et al. (2020b); shani et al. (2020)) or value (e.g., antos et al. (2008)) based methods. definition 2 (α-policy cover). let ψh be a finite set of non-stationary policies. we say ψh is an α-policy cover for the hth time step if it holds that maxπ πn s LINEBREAK ∈ z α. if α = 0 we call ψh a policy cover. LINEBREAK for all z LINEBREAK ph(z LINEBREAK ph(z LINEBREAK maxπ LINEBREAK ψh LINEBREAK for standard bmdps the policy cover is simply the set of policies that reaches each latent state of the bmdp (du et al., 2019; misra et al., 2020; agarwal et al., 2020a). thus, for a bmdp, the cardinality . the structure of ex-bmdps allows to reduce the size of the of the policy cover scales with LINEBREAK |z| LINEBREAK policy cover significantly to when the size of the exogenous state space is large. specifically, we show that the set of policies that reach each endogenous state, and do not depend on the exogenous part of the state is also a policy cover (see appendix b, proposition 4). LINEBREAK |s| (cid:28) |z| LINEBREAK |s| | LINEBREAK failures of prior approaches LINEBREAK we now describe the limitation of prior rl approaches in the presence of exogenous noise. we provide an intuitive analysis over here, and defer a formal statement and proof to appendix a. LINEBREAK limitation of noise-contrastive learning. noise-contrastive learning has been used in rl to learn a state abstraction by exploiting temporal information. specifically, the homer algorithm (misra et al., 2020) trains a model to distinguish between real and imposter transitions. this is done by collecting a dataset of quads (x, a, x(cid:48), y) where y = 1 means the transition was (x, a, x(cid:48)) was observed and y = 0 means that (x, a, x(cid:48)) was not observed. homer then trains a model pθ(y x, a, φθ(x(cid:48))) with parameters θ, on the dataset, by predicting whether a given pair of transition was observed n for exploring the environment. homer or not. this provides a state abstraction φθ : can provably solve block mdps. unfortunately, in the presence of exogenous noise, homer distinguishes between two transitions that represent transition between the same latent endogenous states but different exogenous states. in our walk in the park example, even if the agent moves between same points in two transitions, the model maybe able to tell these transitions apart by looking at the position of ducks which may have different behaviour in the two transitions. this results in the homer creating LINEBREAK ) many abstract states. we call this the under-abstraction problem. LINEBREAK x → LINEBREAK ( |z| LINEBREAK o LINEBREAK limitation of inverse dynamics. another common approach in empirical works is based on modeling the inverse dynamics of the system, such as the icm module of pathak et al. (2017). in such approaches, we learn a representation by using consecutive observations to predict the action that was taken between them. such a representation can ignore all information that is not relevant for action prediction, which includes all exogenous/uncontrollable information. however, it can also ignore controllable information. this may result in a failure to sufficiently explore the environment. in this sense, inverse dynamics approaches result in an over-abstraction problem where observations from different endogenous states can be mapped to the same abstract state. the over-abstraction problem was described at misra et al. (2020), when the starting state is random. in appendix a.3 we show inverse dynamics may over-abstract when the initial starting state is deterministic. LINEBREAK limitation of bisimulation. zhang et al. (2020) proposed learning a bisimulation metric to learn a representation which is invariant to exogenous noise. unfortunately, it is known that bisimulation metric cannot be learned in a sample-efficient manner (modi et al. (2020), proposition b.1). intuitively, when the reward is same everywhere, then bisimulation merges all states into a single abstract state. this creates an over-abstraction problem in sparse reward settings, since the agent can falsely merge all states into a single abstract state until it receives a non-trivial reward. LINEBREAK bellman rank might depend on . the bellman rank was introduced in jiang et al. (2017) as a ξ | | complexity measure for the learnability of an rl problem with function approximations. to date, most of the learnable rl problems have a small bellman rank. however, we show in appendix a that bellman rank for ex-bmdp can scale as ). this shows that ex-bmdp is a highly non-trivial ξ | | setting as we don’t even have sample-efficient algorithms regardless of computationally-efficient. LINEBREAK o LINEBREAK in appendix a we also describe the failures of flambe (agarwal et al., 2020a)) and autoencoding based approaches (tang et al., 2017). LINEBREAK reinforcement learning for ex-bmdps LINEBREAK in this section, we present an algorithm predictive path elimination (ppe) that we later show can provably solve any ex-bmdp with nearly deterministic dynamics and start state distribution of the endogenous state, while making no assumptions on the dynamics or start state distribution of the exogenous state (algorithm 1). before describing ppe, we highlight that ppe can be thought of as LINEBREAK , stochasticity level η LINEBREAK algorithm 1 ppe(δ, η): predictive path elimination 1: set ψ1 = 2: for h = 2, . . . , h do set n = 16 ( ψh 3: | collect a dataset solve multi-class classification problem: ˆfh = arg maxf for 1 LINEBREAK |f || 1 ◦ of n i.i.d. tuples (x, υ) where υ LINEBREAK )2 log LINEBREAK i < j LINEBREAK do LINEBREAK ah LINEBREAK d LINEBREAK a LINEBREAK ψh LINEBREAK 1 ◦ a| calculate the path prediction gap: (cid:98)∆(i, j) = 1 n if (cid:98)∆(i, j) LINEBREAK ◦a| LINEBREAK denotes an empty path LINEBREAK unf(ψh 1 ◦ a − (cid:80) (x,υ) LINEBREAK ∈f LINEBREAK ∈d LINEBREAK ) and x LINEBREAK ln f (idx(υ) LINEBREAK p(xh | x). | LINEBREAK (x,υ) LINEBREAK ∈d LINEBREAK ˆfh(i | LINEBREAK x) LINEBREAK ˆfh(j LINEBREAK , then eliminate path υ with idx(υ) = j. //υi and υj visit same state LINEBREAK ψh is defined as the set of all paths in ψh LINEBREAK that have not been eliminated in line 8. LINEBREAK a computationally-efficient and simpler alternative to algorithm 4 of du et al. (2019) who studied rich-observation setting without exogenous noise.1 LINEBREAK , h LINEBREAK ∈ a} LINEBREAK where π LINEBREAK a is an open-loop policy that follows π till time step h LINEBREAK . in the hth iteration, it learns a policy ppe performs iterations over the time steps h 2, } cover ψh for time step h containing open-loop policies. this is done by first augmenting the policy cover for previous time step by one step. formally, we define υh = ψh = a ∈ ◦ 1 and then takes ψh action a. since we assume the transition dynamics to be near-deterministic, therefore, we know that there exists a policy cover for time step h that is a subset of υh and whose size is equal to the number of reachable states at time step h. further, as the transitions are near-deterministic, we refer to an open-loop policy as a path, as we can view the policy as tracing a path in the latent transition model. ppe works by eliminating paths in υh so that we are left with just a single path for each reachable of tuples (x, υ) where υ is a uniformly sampled from state. this is done by collecting a dataset υh and x by predicting the index idx(υ) of the path υ from the observation x (line 5). index of paths in υh are computed with respect to υh and remain fixed throughout training. intuitively, if ˆfh(i x) is sufficiently large, then we can hope that the path υi visits the state φ(cid:63)(x). further, we can view this prediction problem as learning a multistep inverse dynamics model since the open-loop policy contains information about all previous actions and not just the last action. for every pair of paths in υh, we first compute a path prediction gap (cid:98)∆(line 7). if the gap is too small, we show it implies that these paths reach the same endogenous state, hence we can eliminate a single redundant path from this pair (line 8). finally, ψh is defined as the set of all paths in υh which were not eliminated. ppe reduces rl to performing h standard classification problems. further, the algorithm is very simple and in practice requires just a single hyperparameter (n ). we believe these properties will make it well-suited for many problems. LINEBREAK υ) (line 4). we train a classifier ˆfh using LINEBREAK ph(x LINEBREAK d LINEBREAK d LINEBREAK recovering an endogenous state decoder. we can recover a endogenous state decoder ˆφh for directly from ˆfh as shown below: each time step h LINEBREAK , h LINEBREAK ∈ { · · · ˆφh(x) = min LINEBREAK } ˆfh(i LINEBREAK i LINEBREAK x) LINEBREAK max j LINEBREAK ˆfh(j LINEBREAK x) LINEBREAK ), i | LINEBREAK ] υh| LINEBREAK − o LINEBREAK intuitively, this assigns the observation to the path with smallest index that has the highest chance of visiting x, and therefore, φ(cid:63)(x). we are implicitly using the decoder for exploring, since we rely on using ˆfh for making planning decisions. we will evaluate the accuracy of this decoder in section 6. LINEBREAK recovering the latent transition dynamics. ppe can also be used to recover a latent endogenous transition dynamics. the direct way is to use the learned decoder ˆφh along with episodes collected by ppe during the course of training and do count-based estimation. however, for most problems, recovering an approximate deterministic transition dynamics suffices, which can be directly read LINEBREAK 1alg. 4 has time complexity of o(s4a4h) compared to o(s3a3h) for ppe. furthermore, alg. 4 requires an upper bound on s, whereas ppe is adaptive to it. lastly, du et al. (2019) assumed deterministic setting while we provide a generalization to near-determinism. LINEBREAK from the path elimination data. we accomplish this by recovering a partition of paths in ψh 1 × a where two paths in the same partition set are said to be merged with each other. in the beginning, each path is only merged with itself. when we eliminate a path υj on comparison with υi in line 8, then all paths currently merged with υj get merged with υi. we then define an abstract state space ψh. further, we recover a sh for time step h that contains an abstract state j for each path υj ∈ (cid:98) latent deterministic transition dynamics for time step h sh where we set 1 : (cid:98) (cid:98) 1 × a → sh − ˆth ψh where υ(cid:48)i ∈ ψh − LINEBREAK 1 as ˆth − ψh gets merged with path υ(cid:48)i ◦ a ∈ LINEBREAK 1(i, a) = j if the path υj ∈ LINEBREAK learning a near optimal policy given a policy cover. ppe runs in a reward-free setting. however, the recovered policy cover and dynamics can be directly used to optimize any given reward function with existing methods. if the reward function depends on the exogenous state then we can use the psdp algorithm (bagnell et al., 2004) to learn a near-optimal policy. psdp is a model-free dynamic programming method that only requires policy cover as input (see appendix d.1 for details). if the reward function only depends on the endogenous state, we can use a computationally cheaper value-iteration vi that uses the recovered transition dynamics. vi is a model-based algorithm that estimates the reward for each state and action, and performs dynamic programming on the model (see appendix d.2 for details). in each case, the sample complexity of learning a near-optimal policy, given the output of ppe, scales with the size of endogenous and not the exogenous state space. LINEBREAK theoretical analysis and discussion LINEBREAK we provide the main sample complexity guarantee for ppe as well as additional intuition for why it works. we analyze the algorithm in near-deterministic mdps defined as follows: two transition functions t1 and t2 are η-close if for all h [h], a · | η. s, a) we emphasize that near-deterministic dynamics are common in real-world applications like robotics. assumption 1 (near deterministic endogenous dynamics). we assume the endogenous dynamics is η-close to a deterministic model (µd,η, td,η) where η LINEBREAK ∈ sh it holds that ∈ η. analogously, two starting distribution µ1 and µ2 are η-close if || LINEBREAK ∈ a LINEBREAK , s LINEBREAK f LINEBREAK we make a realizability assumption for the regression problem solved by ppe (line 5). we assume is expressive enough to represent the bayes optimal classifier of the regression problems that created by ppe. assumption 2 (realizability). for any h where LINEBREAK [h], and any set of paths υ LINEBREAK h denotes the set of all paths of length h, there exists f (cid:63) ph(φ(cid:63)(x)) LINEBREAK h with sa and υ ⊆ a | ≤ such that: f (cid:63) υ,h(idx(υ) υ(cid:48)) > 0. LINEBREAK υ,h ∈ f ph(φ(cid:63)(x)) LINEBREAK with (cid:80) LINEBREAK υ and x LINEBREAK x) = LINEBREAK υ) | ph(φ(cid:63)(x)) LINEBREAK υ(cid:48)) , for all υ | LINEBREAK ∈ x LINEBREAK realizability assumptions are common in theoretical analysis (e.g., misra et al. (2020), agarwal et al. (2020a)). in practice, we use expressive neural networks to solve the regression problem, so we expect the realizability assumption to hold. note that there are at most as(h+1) bayes classifiers for different prediction problems. however, this is acceptable since our guarantees will scale as ln and, therefore, the function class LINEBREAK can be exponentially large to accommodate all of them. LINEBREAK |f| LINEBREAK f we now state the formal sample complexity guarantees for ppe below. theorem 1 (sample complexity). fix δ returns a policy cover LINEBREAK h h=1 such that for any h LINEBREAK (0, 1). then, with probability greater than 1 LINEBREAK δ, ppe [h], ψh is a ηh-policy cover for time step h LINEBREAK ψh} LINEBREAK s, which gives the total number of episodes used by ppe as LINEBREAK o LINEBREAK s2a2h ln |f | LINEBREAK sah δ LINEBREAK and LINEBREAK ψh| ≤ | LINEBREAK we defer the proof to appendix c. our sample complexity guarantees do not depend directly on the size of observation space or the exogenous space. further, since our analysis only uses standard uniform convergence arguments, it extends straightforwardly to infinitely large function classes by replacing ln LINEBREAK with other suitable complexity measures such as rademacher complexity. LINEBREAK |f| LINEBREAK why does ppe work? we provide an asymptotic analysis to explain why ppe works. consider a deterministic setting and the hth iteration of ppe. assume by induction that ψh 1 is an exact policy cover for time step h is also a policy cover for time step h. however, 1 ◦ a it may contain redundancies; it may contain several paths that reach the same endogenous state. we now show how a generalized inverse dynamics objective can eliminate such redundant paths. LINEBREAK 1. therefore, υh = ψh LINEBREAK (a) combination lock (h = 2). LINEBREAK (b) regret plot LINEBREAK (c) decoding accuracy LINEBREAK figure 2: results on combination lock. left: we show the latent transition dynamics of combination lock. observations are not shown for brevity. center: shows minimal number of episodes needed to achieve a mean regret of at most v (π(cid:63))/2. right: state decoding accuracy (in percent) of decoders learned by different methods. solid lines implies no exogenous dimension while dashed lines imply an exogenous dimension of 100. LINEBREAK let ph(ξ) denote the distribution over exogenous states at time step h which is independent of agent’s policy. the bayes optimal classifier (f (cid:63) LINEBREAK h := fυh,h) of the prediction problem can be derived as: ph(x | υ) LINEBREAK ph(x | υ)p(υ) LINEBREAK ph(φ(cid:63)(x)) | υ) LINEBREAK ph(x | υ(cid:48))p(υ(cid:48)) LINEBREAK ph(x | υ(cid:48)) LINEBREAK (a) = LINEBREAK (b) = LINEBREAK f (cid:63) h (idx(υ) | x) := ph(υ | x) = LINEBREAK where (a) holds since all paths in υh are chosen uniformly, and (b) critically uses the fact that for any open-loop policy υ we have a factorization property, LINEBREAK ph(x LINEBREAK υ) = q (cid:0)x LINEBREAK ξ(x)(cid:1) ph(φ(cid:63)(x) LINEBREAK υ)ph(φ(cid:63) LINEBREAK ξ(x)). LINEBREAK xh) LINEBREAK xh) LINEBREAK f (cid:63) h(i LINEBREAK υh be two paths with indices i and j respectively. we define their exact path prediction let υ1, υ2 ∈ gap as ∆(i, j) := exh [ f (cid:63) ]. assume that υ1 visits an endogenous state s at h(j | | − time step h and denote ω(s) as the number of paths in υh that reaches s. then f (cid:63) xh) = 1/ω(s) if φ(cid:63)(xh) = s, and 0 otherwise. if υ2 also visits s at time step h, then f (cid:63) xh) for h(j all xh. this implies ∆(i, j) = 0 and ppe will filter out the path with higher index since it detected both paths reach to the same endogenous state. conversely, let υ2 visit a different state at time step h. if x is an observation that maps to s, then f (cid:63) x) = 0. this gives h(i f (cid:63) and, consequently, ∆(i, j) > 0. in fact, we can show h(i x) | | | ). thus, ppe will not eliminate these paths upon comparison. our complete ∆(i, j) | analysis in the appendix generalizes the above reasoning to finite sample setting where we can only approximate f (cid:63) h and ∆, as well as to ex-bmdps with near-deterministic dynamics. as evident, the analysis critically relies on the factorization property that holds for open-loop policies but not for arbitrary ones. this is the reason why we build a policy cover with open-loop policies. LINEBREAK x) = 1/ω(s) and f (cid:63) LINEBREAK h(i | xh) = f (cid:63) LINEBREAK − ≥ o LINEBREAK h(j LINEBREAK h(i LINEBREAK x) LINEBREAK υh LINEBREAK experiments LINEBREAK we evaluate ppe on two domains: a challenging exploration problem called combination lock to test whether ppe can learn an optimal policy and an accurate state decoder, and a visual-grid world with complex visual representations to test whether ppe is able to recover the latent dynamics. LINEBREAK s LINEBREAK a LINEBREAK sh,a, sh,b, sh,c} LINEBREAK h , an action space 0, 1 }
| 6
|
[
132.907,
152.472904,
226.37719792,
170.88235
] |
FLA55mBee6Q.pdf
| 2,022
| 1
|
LINEBREAK coptidice: offline constrained reinforcement learning via stationary distribution correction estimation LINEBREAK jongmin lee1∗, cosmin paduraru2, daniel j. mankowitz2, nicolas heess2, doina precup2, kee-eung kim1, arthur guez2 1kaist, 2deepmind LINEBREAK abstract LINEBREAK we consider the offline constrained reinforcement learning (rl) problem, in which the agent aims to compute a policy that maximizes expected return while satisfying given cost constraints, learning only from a pre-collected dataset. this problem setting is appealing in many real-world scenarios, where direct interaction with the environment is costly or risky, and where the resulting policy should comply with safety constraints. however, it is challenging to compute a policy that guarantees satisfying the cost constraints in the offline rl setting, since the offpolicy evaluation inherently has an estimation error. in this paper, we present an offline constrained rl algorithm that optimizes the policy in the space of the stationary distribution. our algorithm, coptidice, directly estimates the stationary distribution corrections of the optimal policy with respect to returns, while constraining the cost upper bound, with the goal of yielding a cost-conservative policy for actual constraint satisfaction. experimental results show that coptidice attains better policies in terms of constraint satisfaction and return-maximization, outperforming baseline algorithms. LINEBREAK introduction LINEBREAK reinforcement learning (rl) has shown great promise in a wide range of domains, such as complex games (mnih et al., 2015; silver et al., 2017) and robotic control (lillicrap et al., 2016; haarnoja et al., 2018). however, the need to interact with the environment during learning hinders its widespread application to many real-world problems for which executing exploratory behavior in the environment is costly or dangerous. offline rl (also known as batch rl) (lange et al., 2012; levine et al., 2020) algorithms sidestep this problem and perform policy optimization solely from a set of pre-collected data. the use of existing (offline) data can make offline reinforcement learning applicable to real world systems and and has led to a sharp increase in interest in this paradigm. LINEBREAK recent works on offline rl, however, mostly assume that the environment is modeled as a markov decision process (mdp), and standard offline rl algorithms focus on reward-maximization only (fujimoto et al., 2019; wu et al., 2019; kumar et al., 2019; siegel et al., 2020; wang et al., 2020; kumar et al., 2020). in contrast, in real-world domains it is common that the behavior of the agent is subject to additional constraints beyond the reward. consider, for example, autonomous driving or an industrial robot in a factory. some behaviors may damage the agent itself or its surroundings, and safety constraints should thus be considered as part of the objective of a suitable reinforcement learning system. one of the ways to mathematically characterize a constrained rl problem is through the formalism of constrained markov decision processes (cmdp) (altman, 1999). in cmdps taking an action incurs a cost as well as a reward, and the goal is to maximize the expected long-term reward while satisfying a bound on the expected long-term cost. in this work, we aim to solve the constrained decision making problem in the offline rl setting, to enable deployment in various safety-critical domains where direct learning interactions are infeasible. LINEBREAK offline constrained rl inherits the difficulties of offline unconstrained rl, while introducing additional challenges. first, since the target policy being optimized deviates from the data-collection LINEBREAK ∗work done during an internship at deepmind. LINEBREAK policy with no further data collection, distribution shift becomes the central difficulty. to mitigate the distributional shift, existing offline rl methods frequently adopt the pessimism principle: either by explicit policy (and critic) regularization that penalizes deviation from the data-collection policy (jaques et al., 2019; wu et al., 2019; kumar et al., 2019; siegel et al., 2020; wang et al., 2020; lee et al., 2020; kostrikov et al., 2021) or by reward penalty to the uncertain state-action regions (kumar et al., 2020; kidambi et al., 2020; yu et al., 2020). second, in offline constrained rl, the computed policy should satisfy the given cost constraints when it is deployed to the real environment. unfortunately off-policy policy evaluation inherently has estimation errors, and it is therefore difficult to ensure that a policy estimated from a finite dataset will satisfy the constraint when executed in the environment. in addition, constrained policy optimization usually involves an additional optimization for the lagrange multiplier associated with the cost constraints. actor-critic-based constrained rl algorithms thus have to solve triple (i.e. critic, actor, lagrange multiplier) intertwined optimization problems (borkar, 2005; tessler et al., 2019), which can be very unstable in practice. LINEBREAK in this paper, we present an offline constrained rl algorithm that optimizes the state-action stationary distribution directly, rather than the q-function or the policy. we show that such treatment obviates the need for multiple estimators for the value and the policy, yielding a single optimization objective that is practically solvable. still, naively constraining the cost value may result in severe constraint violation in the real environment, as we demonstrate empirically. we thus propose a method to constrain the upper bound of the cost value, aiming to compute a policy more robust in constraint violation, where the upper bound is computed in a way motivated by a recent advance in off-policy confidence interval estimation (dai et al., 2020). our algorithm, offline constrained policy optimization via stationary distribution correction estimation (coptidice), estimates the stationary distribution corrections of the optimal policy that maximizes rewards while constraining the cost upper bound, with the goal of yielding a cost-conservative policy for better actual constraint satisfaction. coptidice computes the upper bound of the cost efficiently by solving an additional minimization problem. experimental results show that coptidice attains a better policy in terms of constraint satisfaction and reward-maximization, outperforming several baseline algorithms. LINEBREAK background LINEBREAK a constrained markov decision process (cmdp) (altman, 1999) is an extension of an mdp, formally defined by a tuple m = (cid:104)s, a, t, r, c = {ck}1..k, ˆc = {ˆck}1..k, p0, γ(cid:105), where s is the set of states, a is the set of actions, t : s × a → ∆(s) is a transition probability, r : s × a → r is the reward function, ck : s × a → r is the k-th cost function with its corresponding threshold ˆck ∈ r, p0 ∈ ∆(s) is the initial state distribution, and γ ∈ (0, 1] is the discount factor. a policy π : s → ∆(a) is a mapping from state to distribution over actions. we will express solving cmdps in terms of stationary distribution. for a given policy π, the stationary distribution dπ is defined by: LINEBREAK dπ(s, a) = LINEBREAK lim t →∞ LINEBREAK γt pr(st = s, at = a) LINEBREAK pr(st = s, at = a) LINEBREAK where s0 ∼ p0, at ∼ π(st), st+1 ∼ t (st, at) for all timesteps t ≥ 0. we define the value of the policy as vr(π) := e(s,a)∼dπ [r(s, a)] ∈ r and vc(π) := e(s,a)∼dπ [c(s, a)] ∈ rk. constrained rl aims to learn an optimal policy that maximizes the reward while bounding the costs up to the thresholds by interactions with the environment: LINEBREAK max π LINEBREAK vr(π) s.t. vck (π) ≤ ˆck ∀k = 1, . . . , k LINEBREAK lagrangian relaxation is typically employed to solve eq. (2), leading to the unconstrained problem: LINEBREAK min λ≥0 LINEBREAK max π LINEBREAK vr(π) − λ(cid:62)(vc(π) − ˆc) LINEBREAK where λ ∈ rk is the lagrange multiplier and ˆc ∈ rk is the vector-valued cost threshold. the inner maximization in eq. (3) corresponds to computing an optimal policy that maximizes scalarized rewards r(s, a) − λ(cid:62)c(s, a), due to the linearity of the value function with respect to the reward function. the outer minimization corresponds to balancing the cost penalty in the scalarized reward LINEBREAK function: if the current policy is violating the k-th cost constraint, λk increases so that the cost is penalized more in the scalarized reward, and vice versa. LINEBREAK in the offline rl setting, online interaction with the environment is not allowed, and the policy is optimized using the fixed offline dataset d = {(s0, s, a, r, c, s(cid:48))i}n i=1 collected with one or more (unknown) data-collection policies. the empirical distribution of the dataset is denoted as dd, and we will abuse the notation dd for s ∼ dd, (s, a) ∼ dd, (s, a, s(cid:48)) ∼ dd. we abuse (s0, s, a, s(cid:48)) ∼ dd for s0 ∼ p0, (s, a, s(cid:48)) ∼ dd. we denote the space of data samples (s0, s, a, s(cid:48)) as x. LINEBREAK a naive way to solve (3) in an offline manner is to adopt an actor-critic based offline rl algorithm for maxπ vr−λ(cid:62)c(π) while jointly optimizing λ. however, the intertwined training procedure of offpolicy actor-critic algorithms often suffers from instability due to the compounding error incurred by bootstrapping out-of-distribution action values in an offline rl setting (kumar et al., 2019). the instability would be exacerbated when the nested optimization for λ is added. LINEBREAK offline constrained rl via stationary distribution LINEBREAK correction estimation LINEBREAK in this section, we present our offline constrained rl algorithm, constrained policy optimization via stationary distribution correction estimation (coptidice). the derivation of our algorithm starts by augmenting the standard linear program for cmdp (altman, 1999) with an additional f -divergence regularization: LINEBREAK max d LINEBREAK e(s,a)∼d[r(s, a)] − αdf (d||dd) LINEBREAK s.t. e(s,a)∼d[ck(s, a)] ≤ ˆck LINEBREAK d(s, a)t (s(cid:48)|s, a) LINEBREAK s,a LINEBREAK ∀s, a, LINEBREAK (cid:2)f (cid:0) d(s,a) dd(s,a) LINEBREAK (7) (cid:1)(cid:3) is the f -divergence between the distribution d and the where df (d||dd) := e(s,a)∼dd dataset distribution dd, and α > 0 is the hyperparameter that controls the degree of pessimism, i.e. how much we penalize the distribution shift, a commonly adopted principle for offline rl (nachum et al., 2019b; kidambi et al., 2020; yu et al., 2020; lee et al., 2021). we assume that dd > 0 and f is a strictly convex and continuously differentiable function with f (1) = 0. note that when α = 0, the optimization (4-7) reduces to the standard linear program for cmdps. the bellman-flow constraints (6-7) ensure that d is the stationary distribution of a some policy, where d(s, a) can be interpreted as a normalized discounted occupancy measure of (s, a). thus, we seek the stationary distribution of an optimal policy that maximizes the reward value (4) while bounding the cost values (5). once the optimal solution d∗ has been estimated, its corresponding optimal policy is obtained by π∗(a|s) = d∗(s,a) LINEBREAK a(cid:48) d∗(s,a(cid:48)) . LINEBREAK now, consider the lagrangian for the constrained optimization problem (4-7): LINEBREAK min λ≥0,ν LINEBREAK max d≥0 LINEBREAK e(s,a)∼d[r(s, a)] − αdf (d||dd) − LINEBREAK (cid:0)e(s,a)∼d[ck(s, a)] − ˆck LINEBREAK (cid:1) LINEBREAK λk LINEBREAK (cid:105) d(s, a)t (s(cid:48)|s, a) LINEBREAK s,a LINEBREAK where λ ∈ rk + is the lagrange multiplier for the cost constraints (5), and ν(s) ∈ r is the lagrange multiplier for the bellman flow constraints (6). solving (8) in its current form requires evaluation of t (s(cid:48)|s, a) for (s, a) ∼ d, which is not accessible in the offline rl setting. to make the optimization tractable, we rearrange the terms so that the direct dependence on d is eliminated, while introducing new optimization variables w that represent stationary distribution corrections: LINEBREAK min λ≥0,ν LINEBREAK max d≥0 LINEBREAK e (s,a)∼d s(cid:48)∼t (s,a) LINEBREAK (cid:2)r(s, a) − λ(cid:62)c(s, a) + γν(s(cid:48)) − ν(s)(cid:3) − αe(s,a)∼dd LINEBREAK (cid:16) d(s,a) dd(s,a) LINEBREAK (s,a)∼dd LINEBREAK = min λ≥0,ν LINEBREAK max w≥0 LINEBREAK (cid:2)w(s, a)eλ,ν(s, a) − αf (w(s, a))(cid:3) + (1 − γ)es0∼p0[ν(s0)] + λ(cid:62)ˆc LINEBREAK where eλ,ν(s, a) := r(s, a) − λ(cid:62)c(s, a) + γes(cid:48)∼t (s,a)[ν(s(cid:48))] − ν(s) is the advantage function by regarding ν as a state value function, and w(s, a) := d(s,a) dd(s,a) is the stationary distribution correction. every term in eq. (9) can be estimated from samples in the offline dataset d: LINEBREAK min ν,λ≥0 LINEBREAK max w≥0 LINEBREAK e LINEBREAK (s0,s,a,s(cid:48))∼dd LINEBREAK (cid:2)w(s, a)ˆeλ,ν(s, a, s(cid:48)) − αf (w(s, a)) + (1 − γ)ν(s0)(cid:3) + λ(cid:62)ˆc LINEBREAK where ˆeλ,ν(s, a, s(cid:48)) := r(s, a)−λ(cid:62)c(s, a)+γν(s(cid:48))−ν(s) is the advantage estimate using a single sample. as a consequence, (10) can be optimized in a fully offline manner. moreover, exploiting the strict convexity of f , we can further derive a closed-form solution for the inner maximization in (9) as follows. all the proofs can be found in appendix b. proposition 1. for any ν and λ, the closed-form solution of the inner maximization problem in (9) is given by: LINEBREAK α eλ,ν(s, a) LINEBREAK where x+ = max(0, x) LINEBREAK finally, by plugging the closed-form solution (11) into (9), we obtain the following convex minimization problem: LINEBREAK min λ≥0,ν LINEBREAK l(λ, ν) = e(s,a)∼dd LINEBREAK (cid:2)w∗ LINEBREAK λ,ν(s, a)eλ,ν(s, a) − αf (w∗ LINEBREAK to sum up, by operating in the space of stationary distributions, constrained (offline) rl can in principle be solved by solving a single convex minimization (12) problem. this is in contrast to existing constrained rl algorithms that manipulate both q-function and policy, and thus require solving triple optimization problems for the actor, the critic, and the cost lagrange multiplier with three different objective functions. note also that when λ is fixed and treated as a constant, (12) reduces to optidice (lee et al., 2021) for unconstrained rl with the scalarized rewards r(s, a) − λ(cid:62)c(s, a), without considering the cost constraints. in order to meet the constraints, λ should also be optimized, and the procedure of (12) can be understood as joint optimization of: LINEBREAK ν ← arg min LINEBREAK l(λ, ν) LINEBREAK (optidice for r − λ(cid:62)c) LINEBREAK λ ← arg min LINEBREAK λ(cid:62)(cid:0)ˆc − e(s,a)∼dd [w∗ LINEBREAK (cid:1) LINEBREAK (cost lagrange multiplier) LINEBREAK once the optimal solution of (12), (λ∗, ν∗), is computed, w∗ dd(s,a) is also derived by (11), which is the stationary distribution correction between the stationary distribution of the optimal policy for the cmdp and the dataset distribution. LINEBREAK λ∗,ν∗ (s, a) = dπ∗ LINEBREAK (s,a) LINEBREAK cost-conservative constrained policy optimization LINEBREAK our first method based on (12) relies on off-policy evaluation (ope) using dice to ensure cost constraint satisfaction, i.e. e(s,a)∼dd [wλ,ν(s, a)c(s, a)] ≈ e(s,a)∼dπ [c(s, a)] ≤ ˆc. however, as we will see later, constraining the cost value estimate naively can result in constraint violation when deployed to the real environment. this is due to the fact that an off-policy value estimate based on a finite dataset inevitably has estimation error. reward estimation error may be tolerated as long as the value estimates are useful as policy improvement signals: it may be sufficient to maintain the relative order of action values, while the absolute values matter less. for the cost value constraint, we instead rely on the estimated value directly. LINEBREAK to make a policy robust against cost constraint violation in an offline setting, we consider the constrained policy optimization scheme that exploits the upper bound of the cost value estimate: LINEBREAK max π LINEBREAK ˆvr(π) s.t. upperbound( ˆvck (π)) ≤ ˆck ∀k LINEBREAK then, the key question is how to estimate the upper bound of the policy value. one natural way is to exploit bootstrap confidence interval (efron & tibshirani, 1993; hanna et al., 2017). we can LINEBREAK construct bootstrap datasets di by resampling from d and run an ope algorithm on each di, which yields population statistics for confidence interval estimation { ˆvc(π)i}m i=1. however, this procedure is computationally very expensive since it requires solving m ope tasks. instead, we take a different approach in a more computationally efficient way motivated by coindice (dai et al., 2020), a recently proposed dice-family algorithm for off-policy confidence interval estimation. specifically, given that our method estimates the stationary distribution corrections w(s, a) ≈ dπ(s,a) dd(s,a) of the target policy π, we consider the following optimization problem for each cost function ck: LINEBREAK e(s0,s,a,s(cid:48))∼ ˜p[w(s, a)ck(s, a)] LINEBREAK max ˜p∈∆(x) s.t. dkl(˜p(s0, s, a, s(cid:48))||dd(s0, s, a, s(cid:48))) ≤ (cid:15) LINEBREAK ˜p(s, a)w(s, a)˜p(s(cid:48)|s, a) ∀s(cid:48) LINEBREAK s,a LINEBREAK where ˜p(s0, s, a, s(cid:48)) = ˜p0(s0)˜p(s, a)˜p(s(cid:48)|s, a) is the distribution over data samples (s0, s, a, s(cid:48)) ∈ x which lies in the simplex ∆(x), and (cid:15) > 0 is the hyperparameter. in essence, we want to adversarially optimize the distribution over data samples ˜p so that it overestimates the cost value by (15). at the same time, we enforce that the distribution ˜p should not be perturbed too much from the empirical data distribution dd by the kl constraint (16). lastly, the perturbation of distribution should be done in a way that maintains compatibility with the bellman flow constraint. the constraint (17) is analogous to the bellman flow constraint (6) by noting that ˜p(s, a)w(s, a) = ˜p(s, a) dπ(s,a) dd(s,a) ≈ dπ(s, a). in this optimization, when (cid:15) = 0, the optimal solution is simply given by ˜p∗ = dd, which yields the vanilla ope result via dice, i.e. e(s,a)∼dd [w(s, a)ck(s, a)]. for (cid:15) > 0, the cost value will be overestimated more as (cid:15) increases. through a derivation similar to that for obtaining (12), we can simplify the constrained optimization into a single unconstrained minimization problem as follows. we denote (s0, s, a, s(cid:48)) as x for notational brevity. proposition 2. the constrained optimization problem (15-17) can be reduced to solving the following unconstrained minimization problem: LINEBREAK min τ ≥0,χ LINEBREAK (cid:96)k(τ, χ; w) = τ log e LINEBREAK x∼dd LINEBREAK exp LINEBREAK (18) where τ ∈ r+ corresponds to the lagrange multiplier for the constraint (16), and χ(s) ∈ r corresponds to the lagrange multiplier for the constraint (17). in other words, minτ ≥0,χ (cid:96)(τ, χ) = e(s,a)∼ ˜p∗ [w(s, a)ck(s, a)] where ˜p∗ is the optimal perturbed distribution of the problem (15-17). also, for the optimal solution (τ ∗, χ∗), ˜p∗ is given by: (cid:16) 1 τ ∗ LINEBREAK ˜p∗(x) ∝ dd(x) exp LINEBREAK (cid:123)(cid:122) =: ω∗(x) (unnormalized weight for x = (s0, s, a, s(cid:48))) LINEBREAK note that every term in (18) can be estimated only using samples of the offline dataset d, thus it can be optimized in a fully offline manner. this procedure can be understood as computing the weights for each sample while adopting reweighting in the dice-based ope, i.e. upperbound( ˆvc(π)) = ex∼dd [˜ω∗(x)w(s, a)c(s, a)] where ˜ω∗(x) = (normalized ω∗(x) of (19)). the weights are given non-uniformly so that the cost value is overestimated to the extent controlled by (cid:15). remark. coindice (dai et al., 2020) solves the similar optimization problem to estimate an upper cost value of the target policy π as follows: LINEBREAK max w≥0 LINEBREAK min τ ≥0,ν LINEBREAK τ log e LINEBREAK exp LINEBREAK it is proven that (20) provides an asymptotic (1 − α)-upper-confidence-interval of the policy value if (cid:15) := ξα n where ξα is the (1 − α)-quantile of the χ2-distribution with 1 degree of freedom (dai et al., 2020). compared to our optimization problem (18), coindice’s (20) involves the additional outer ˜dπ(s,a) ˜p(s,a) , the stationary distribution corrections maximization, which is for estimating w(s, a) = of the target policy π. in contrast, we consider the case when w is given, thus solving the inner minimization alone is enough. LINEBREAK finally, we are ready to present our final algorithm coptidice, an offline constrained rl algorithm that maximizes rewards while bounding the upper cost value, with the goal of computing a policy robust against cost violation. coptidice addresses (14) by solving the following joint optimization. (21) LINEBREAK (optidice for r − λ(cid:62)c) LINEBREAK ν ← arg min LINEBREAK l(λ, ν) LINEBREAK τ, χ ← arg min LINEBREAK λ ← arg min LINEBREAK k=1 (cid:96)k(τk, χk; w∗ LINEBREAK (upper cost value estimation) LINEBREAK (cid:123)(cid:122) ≈upperbound( ˆvc (π)) LINEBREAK (cid:1) LINEBREAK (cost lagrange multiplier) LINEBREAK compared to (13), the additional minimization for (τ, χ) is introduced to estimate the upper bound of cost value. LINEBREAK policy extraction LINEBREAK our algorithm estimates the stationary distribution corrections of the optimal policy, rather than directly obtaining the policy itself. since the stationary distribution corrections do not provide a direct way to sample an action, we need to extract the optimal policy π∗ from w∗(s, a) = dπ∗ (s,a) dd(s,a) , in order to select actions when deployed. for finite cmdps, it is straightforward to obtain π∗ by π∗(a|s) = dπ∗ a(cid:48) dd(s,a)w∗(s,a) . however, the same method cannot directly be applied to continuous cmdps due to the intractability of computing the normalization constant. for continuous cmdps, we instead extract the policy using importance-weighted behavioral cloning: LINEBREAK a(cid:48) dπ∗ (s,a(cid:48)) = dd(s,a)w∗(s,a) LINEBREAK (s,a) LINEBREAK max π LINEBREAK (s,a)∼dπ∗ [log π(a|s)] = e(s,a)∼dd [w∗(s, a) log π(a|s)] e LINEBREAK which maximizes the log-likelihood of actions to be selected by the optimal policy π∗. LINEBREAK practical algorithm with function approximation LINEBREAK for continuous or large cmdps, we represent our optimization variables using neural networks. the lagrange multipliers ν and χ are networks parameterized by θ and φ respectively: νθ : s → r is a feedforward neural network that takes a state as an input and outputs a scalar value, and χφ : s → rk is defined similarly. λ ∈ rk + are represented by k-dimensional vectors. for the policy πψ, we use a mixture density network (bishop, 1994) where the parameters of a gaussian mixture model are output by the neural network. the parameters of the νθ network are trained by minimizing the loss: LINEBREAK + and τ ∈ rk LINEBREAK jν(θ) =ex∼dd LINEBREAK min θ LINEBREAK (cid:2) ˆw(s, a, s(cid:48))(r(s, a) − λ(cid:62)c(s, a) + γνθ(s(cid:48)) − νθ(s)) − αf ( ˆw(s, a, s(cid:48))) + (1 − γ)νθ(s0)(cid:3) + λ(cid:62)ˆc LINEBREAK α (r(s, a) − λ(cid:62)c(s, a) + γνθ(s(cid:48)) − νθ(s))(cid:1) LINEBREAK where ˆw(s, a, s(cid:48)) := (f (cid:48))−1(cid:0) 1 ν can be a biased estimate of l(λ, ν) in (12) in general due to (f (cid:48))−1(e[·]) (cid:54)= e[(f (cid:48))−1(·)], we can show that j λ ν is an upper bound of l(ν, λ) (i.e. we minimize the upper bound), and j λ ν = l(ν, λ) holds if transition dynamics are deterministic (e.g. mujoco control tasks) (lee et al., 2021). the parameters of the χφ network and τ can be trained by: exp (cid:0) 1 LINEBREAK +. while j λ LINEBREAK τ log ex∼dd LINEBREAK min τ ≥0,φ LINEBREAK (cid:0) ˆw(s, a, s(cid:48))(ck(s, a) + γχφ,k(s(cid:48)) − χφ,k(s)) + (1 − γ)χφ,k(s0)(cid:1)(cid:1)(cid:105) LINEBREAK this involves a logarithm outside of the expectation, which implies that mini-batch approximations would introduce a bias. still, we adopt the simple mini-batch approximation for computational efficiency, with a moderately large batch size (e.g. 1024), which worked well in practice. the empirical form of the loss we use is given by: LINEBREAK min τ ≥0,φ LINEBREAK jτ,χ(τ, φ) =ebatch(d)∼d LINEBREAK τ log ex∼batch(d) LINEBREAK (cid:2) exp (cid:0) 1 LINEBREAK (cid:0) ˆw(s, a, s(cid:48))· LINEBREAK (ck(s, a) + γχφ,k(s(cid:48)) − χφ,k(s)) + (1 − γ)χφ,k(s0)(cid:1)(cid:1)(cid:3) + τk(cid:15) LINEBREAK lastly, λ and the policy parameter ψ are optimized by: LINEBREAK jλ(λ) = λ(cid:62)(ˆc − jτ,χ(τ, φ)) LINEBREAK jπ(ψ) = −ex∼dd [ ˆw(s, a, s(cid:48)) log πψ(a|s)] LINEBREAK min λ≥0 min ψ LINEBREAK the complete pseudo-code is described in appendix c, where every parameter is optimized jointly. LINEBREAK experiments
| 6
|
[
108.299,
610.9236768,
200.0834953,
622.8788768
] |
TUBpc5rqGA.pdf
| 2,023
| 2
|
LINEBREAK neural design for genetic perturbation experiments LINEBREAK aldo pacchiano microsoft research nyc [email protected] LINEBREAK drausin wulsin & robert a. barton & luis voloch immunai {drausin,robert.barton,luis}@immunai.com LINEBREAK abstract LINEBREAK the problem of how to genetically modify cells in order to maximize a certain cellular phenotype has taken center stage in drug development over the last few years (with, for example, genetically edited car-t, car-nk, and car-nkt cells entering cancer clinical trials). exhausting the search space for all possible genetic edits (perturbations) or combinations thereof is infeasible due to cost and experimental limitations. this work provides a theoretically sound framework for iteratively exploring the space of perturbations in pooled batches in order to maximize a target phenotype under an experimental budget. inspired by this application domain, we study the problem of batch query bandit optimization and introduce the optimistic arm elimination (oae) principle designed to find an almost optimal arm under different functional relationships between the queries (arms) and the outputs (rewards). we analyze the convergence properties of oae by relating it to the eluder dimension of the algorithm’s function class and validate that oae outperforms other strategies in finding optimal actions in experiments on simulated problems, public datasets well-studied in bandit contexts, and in genetic perturbation datasets when the regression model is a deep neural network. oae also outperforms the benchmark algorithms in 3 of 4 datasets in the genedisco experimental planning challenge. LINEBREAK introduction LINEBREAK we are inspired by the problem of finding the genetic perturbations that maximize a given function of a cell (a particular biological pathway or mechanism, for example the proliferation or exhaustion of particular immune cells) while performing the least number of perturbations required. in particular, we are interested in prioritizing the set of genetic knockouts (via shrna or crispr) to perform on cells that would optimize a particular scalar cellular phenotype. since the space of possible perturbations is very large (with roughly 20k human protein-coding genes) and each knockout is expensive, we would like to order the perturbations strategically so that we find one that optimizes the particular phenotype of interest in fewer total perturbations than, say, just brute-force applying all possible knockouts. in this work we consider only single-gene knockout perturbations since they are the most common, but multi-gene perturbations are also possible (though considerably more technically complex to perform at scale). while a multi-gene perturbation may be trivially represented as a distinct (combined) perturbation in our framework, we leave for future work the more interesting extension of embedding, predicting, and planning these multi-gene perturbations using previously observed single-gene perturbations. LINEBREAK with this objective in mind we propose a simple method for improving a cellular phenotype under a limited budget of genetic perturbation experiments. although this work is inspired by this concrete biological problem, our results and algorithms are applicable in much more generality to the setting of experimental design with neural network models. we develop and evaluate a family of algorithms for the zero noise batch query bandit problem based on the optimistic arm elimination principle (oae). we focus on developing tractable versions of these algorithms compatible with neural network function approximation. LINEBREAK during each time-step oae fits a reward model on the observed responses seen so far while at the same time maximizing the reward on all the arms yet to be pulled. the algorithm then queries the batch of arms whose predicted reward is maximal among the arms that have not been tried out. LINEBREAK we conduct a series of experiments on synthetic and public data from the uci dua & graff (2017) database and show that oae is able to find the optimal “arm" using fewer batch queries than other algorithms such as greedy and random sampling. our experimental evaluation covers both neurally realizable and not neurally realizable function landscapes. the performance of oae against benchmarks is comparable in both settings, demonstrating that although our presentation of the oae algorithm assumes realizability for the sake of clarity, it is an assumption that is not required in practice. in the setting where the function class is realizable i.e. the function class f used by oae contains the function generating the rewards, and the evaluation is noiseless we show two query lower bounds for the class of linear and 1−lipshitz functions. LINEBREAK we validate oae on the public cmap dataset subramanian et al. (2017), which contains tens of thousands of genetic shrna knockout perturbations, and show that it always outperforms a baseline and almost always outperforms a simpler greedy algorithm in both convergence speed to an optimal perturbation and the associated phenotypic rewards. these results illustrate how perturbational embeddings learned from one biological context can still be quite useful in a different biological context, even when the reward functions of these two contexts are different. finally we also benchmark our methods in the genedisco dataset and algorithm suite (see mehrjou et al. (2021)) and show oae to be competitive against benchmark algorithms in the task of maximizing hitratios. LINEBREAK related work LINEBREAK bayesian optimization the field of bayesian optimization has long studied the problem of optimizing functions severely limited by time or cost jones et al. (1998). for example, srinivas et al. (2009) introduce the gp-ucb algorithm for optimizing unknown functions. other approaches based on adaptive basis function regression have also been used to model the payoff function as in snoek et al. (2015). these algorithms have been used in the drug discovery context. mueller et al. (2017) applied bayesian optimization to the problem of optimizing biological phenotypes. very recently, genedisco was released as a benchmark suite for evaluating active learning algorithms for experiment design in drug discovery mehrjou et al. (2021). perhaps the most relevant to our setting are the many works that study the batch acquisition setting in bayesian active learning and optimization such as kirsch et al. (2019); kathuria et al. (2016) and the gp − bucb algorithm of desautels et al. (2014). in this work we move beyond the typical parametric and bayesian assumptions from these works towards algorithms that work in conjunction with neural network models. we provide guarantees for the no noise setting we study based on the eluder dimension russo & van roy (2013). LINEBREAK parallel bandits despite its wide applicability in many scientific applications, batch learning has been studied relatively seldom in the bandit literature. despite this, recent work (chan et al., 2021) show that in the setting of contextual linear bandits (abbasi-yadkori et al., 2011), the finite sample complexity of parallel learning matches that of sequential learning irrespective of the batch size provided the number of batches is large enough. unfortunately, this is rarely the regime that matters in many practical applications such as drug development where the size of the experiment batch may be large but each experiment may be very time consuming, thus limiting their number. in this work we specifically address this setting in our experimental evaluation in section e. LINEBREAK structure learning prior work in experiment design tries to identify causal structures with a fixed budget of experiments ghassami et al. (2018). scherrer et al scherrer et al. (2021) proposes a mechanism to select intervention targets to enable more efficient causal structure learning. sussex et al. (2021) extend the amount of information contained in each experiment by simultaneously intervening on multiple variables. causal matching, where an experimenter can perform a set of interventions aimed to transform the system to a desired state, is studied in zhang et al. (2021). LINEBREAK neural bandits methods such as neural ucb and shallow neural ucb zhou et al. (2020); xu et al. (2020) are designed to add an optimistic bonus to model predictions of a nature that can be analytically computed as is extremely reminiscent of the one used in linear bandits (auer, 2002; dani et al., 2008), thus their theoretical validity depends on the ‘linearizing’ conditions to hold. more LINEBREAK recently (pacchiano et al., 2021b) have proposed the use of pseudo-label optimisim for the bank loan problem where they propose an algorithm that adds optimism to neural network predictions through the addition of fake data and is only analyzed in the classification setting. our algorithms instead add optimism to their predictions. the later is achieved via two methods, either by explicitly encouraging it to fit a model whose predictions are large in unseen data, or by computing uncertainties. LINEBREAK active learning active learning is relatively well studied problem settles (2009); dasgupta (2011); hanneke et al. (2014) particularly in the context of supervised learning. see for example balcan et al. (2009), dasgupta et al. (2007), settles (2009), hanneke et al. (2014). there is a vast amount of research on active learning for classification (see for example agarwal (2013), dekel et al. (2010) and cesa-bianchi et al. (2009) where the objective is to learn a linearly parameterized response model p(y|x). broadly speaking there are two main sample construction approaches, diversity sener & savarese (2017); geifman & el-yaniv (2017); gissin & shalev-shwartz (2019) and uncertainty sampling tong & koller (2001); schohn & cohn (2000); balcan et al. (2009); settles et al. (2007), successful in the large guo & schuurmans (2007); wang & ye (2015); chen & krause (2013); wei et al. (2015); kirsch et al. (2019) and small batch sizes regimes respectively. diversity sampling methods produce spread out samples to better cover the space while uncertainty-based methods estimate model uncertainty to select what points to label. hybrid approaches are common as well. a common objective in the active learning literature is to collect enough samples to produce a model that minimizes the population loss over the data distribution. this is in contrast with the objective we study in this work, which is to find a point in the dataset with a large response. there is a rich literature dedicated to the development of active learning algorithms for deep learning applications both in the batch and single sample settings settles et al. (2007); ducoffe & precioso (2018); beluch et al. (2018); ash et al. (2021). LINEBREAK problem definition LINEBREAK let y⋆ : a → r be a response function over a ⊂ rd. we assume access to a function class f ⊂ fun(a, r) where fun(a, r) denotes the set of functions from a to r. following the typical online learning terminology we call a the set of arms. in this work we allow a to be infinite, although we only consider finite a in practice. LINEBREAK in our setting the experiment designer (henceforth called the learner) interacts with y⋆ and a in a sequential manner. during the t−th round of this interaction, aided by f and historical query and response information the learner is required to query a batch of b ∈ n arms {at,i}b i=1 ⊂ a and observe noiseless responses {yt,i = y⋆(at,i)}b i=1 after which these response values are added to the historical dataset dt+1 = dt ∪ {(at,i, yt,i)}b i=1. LINEBREAK in this work we do not assume that y⋆ ∈ f. instead we allow the learner access to a function class f to aid her in producing informative queries. this is a common situation in the setting of neural experiment design, where we may want to use a dnn model to fit the historical responses and generate new query points without prior knowledge of whether it accurately captures y⋆. our objective is to develop a procedure that can recover an ‘almost optimal’ arm a ∈ a in the least number of arm pulls possible. we consider the following objective, LINEBREAK τ −quantile optimality. find an arm aτ ∈ a belonging to the top τ −quantile1 of {y⋆(a)}a∈a. LINEBREAK although ϵ−optimality (find an arm aϵ ∈ a such that y⋆(aϵ) + ϵ ≥ maxa∈a y⋆(a) for ϵ ≥ 0) is the most common criterion considered in the optimization literature, for it to be meaningful it requires knowledge of the scale of maxa∈a y⋆(a). in some scenarios this may be hard to know in advance. thus in our experiments we focus on the setting of τ −quantile optimality as a more relevant practical performance measure. this type of objective has been considered by many works in the bandit literature (see for example szorenyi et al. (2015); zhang & ong (2021)). moreover, it is a measure of optimality better related to practical objectives used in experiment design evaluation, such as hit ratio in the genedisco benchmark library mehrjou et al. (2021). we show in section e that our algorithms are successful at producing almost optimal arms under this criterion after a small number of queries. the main challenge we are required to overcome in this problem is designing a smart choice of batch LINEBREAK 1in the case of an infinite set a quantile optimality is defined with respect to a measure over a. LINEBREAK queries {at,i}b and zooming into others that have shown promising rewards. LINEBREAK i=1 that balances the competing objectives of exploring new regions of the arm space LINEBREAK in this work we focus on the case where the observed response values y⋆(a) of any arm a ∈ a are noiseless. in the setting of neural perturbation experiments the responses are the average of many expression values across a population of cells, and thus it is safe to assume the observed response is almost noiseless. in contrast with the noisy setting, when the response is noiseless, querying the same arm twice is never necessary. we leave the question on how to design algorithms for noisy responses in the function approximation regime for future work. although note it can be reduced to our setting if we set the exploitation round per data point sufficiently large. LINEBREAK evaluation. after the queries ∪t i=1 the learner will output a candidate approximate optimal arm ˆat among all the arms whose labels she has queried (all arms in dt+1) by considering (ˆat, ˆyt) = arg max(a,y)∈dt+1 y, the point with the maximal observed reward so far. given a quantile value τ we measure the performance of our algorithms by considering the first timestep tτ first where a τ −quantile optimal point ˆat was proposed. LINEBREAK ℓ=1{aℓ,i}b LINEBREAK optimistic arm elimination LINEBREAK with these objectives in mind, we introduce a family of algorithms based on the optimistic arm elimination algorithm (oae) principle. we call ut to the subset of arms yet to be queried by our algorithm. at time t any oae algorithm produces a batch of query points of size b from2 ut. our algorithms start round t by fitting an appropriate response predictor (cid:101)ft : ut → r based on the historical query points dt and their observed responses so far. instead of only fitting the historical responses with a square loss and produce a prediction function (cid:101)ft, we encourage the predictions of (cid:101)ft to be optimistic on the yet-to-be-queried points of ut. LINEBREAK we propose two tractable ways of achieving this. first by fitting a model (or an ensemble of models) t to the data in dt and explicitly computing a measure of uncertainty ˜ut : ut → r of its predictions (cid:101)f o on ut. we define the optimistic response predictor (cid:101)ft(a) = (cid:101)f o t (a) + ˜ut(a). second, we achieve this by defining (cid:101)ft to be the approximate solution of a constrained objective, LINEBREAK (cid:101)ft ∈ arg max f ∈f LINEBREAK a(f, ut) LINEBREAK s.t. LINEBREAK (a,y)∈dt LINEBREAK (f (a) − y)2 ≤ γt. LINEBREAK where γt a possibly time-dependent parameter satisfying γt ≥ 0 and a(f, u) is an acquisition objective tailored to produce an informative arm (or batch of arms) from ut. we consider a couple a∈u (max(0, f (a)))p of acquisition objectives aavg(f, u) = 1 |u | for some p > 0 and asoftmax(f, u) = log (cid:0)(cid:80) a∈u f (a). an important acquisition functions of theoretical interest, although hard to optimize in practice are amax(f, u) = maxa∈u f (a) and its batch version amax,b(f, u) = maxb⊂u ,|b|=b a∈b f (a). regardless of whether (cid:101)ft was computed via equation 1 or it is an uncertainty aware objective of the form (cid:101)ft(a) = (cid:101)f o t (a) + (cid:101)ut(a), our algorithm then produces a query batch bt by solving LINEBREAK a∈u exp(f (a))(cid:1) and asum(f, u) = (cid:80) (cid:80) LINEBREAK a∈u f (a), ahinge(f, u) = 1 LINEBREAK |u | LINEBREAK bt ∈ arg max b⊂ut,|b|=b LINEBREAK aavg( (cid:101)ft, b). LINEBREAK the principle of optimism in the face of uncertainty (ofu) allows oae algorithms to efficiently explore new regions of the space by acting greedily with respect to a model that fits the rewards of the arms in dt as accurately as possible but induces large responses from the arms she has not tried. if y⋆ ∈ f, and (cid:101)ft is computed by solving equation 1, it can be shown the optimistic model overestimates the true response values i.e. (cid:80) y⋆(a) where b⋆,t = arg maxb⊂ut,|b|=b a∈b y⋆(a). consult appendix d.2 for a proof and an explanation of the relevance of this observation. LINEBREAK a∈bt (cid:101)ft(a) ≥ (cid:80) LINEBREAK a∈b⋆,t LINEBREAK acting greedily based on an optimistic model means the learner tries out the arms that may achieve the highest reward according to the current model plausibility set. after pulling these arms, the learner can successfully update the model plausibility set and repeat this procedure. LINEBREAK 2the batch equals ut when |ut| ≤ b. LINEBREAK algorithm 1 optimistic arm elimination principle (oae) input action set a ⊂ rd, num batches n , batch size b initialize unpulled arms u1 = a. observed points and labels dataset d1 = ∅ for t = 1, · · · , n do if t = 1 then: · sample uniformly a size b batch bt ∼ u1. else: · solve for (cid:101)ft and compute bt ∈ arg maxb⊂ut||b|=b observe batch rewards yt = {y∗(a) for a ∈ bt} update dt+1 = dt ∪ {(bt, yt)} and ut+1 = ut\bt . LINEBREAK tractable implementations of oae
| 4
|
[
108.249,
556.5580784,
305.92945304,
566.7398556
] |
9r30XCjf5Dt.pdf
| 2,021
| 2
|
LINEBREAK vulnerability-aware poisoning mechanism for online rl with unknown dynamics LINEBREAK da huo2 LINEBREAK yanchao sun1 1,3 department of computer science, university of maryland, college park, md 20742, usa 2 shanghai jiao tong university, china [email protected], [email protected], [email protected] LINEBREAK furong huang3 LINEBREAK abstract LINEBREAK poisoning attacks on reinforcement learning (rl) systems could take advantage of rl algorithm’s vulnerabilities and cause failure of the learning. however, prior works on poisoning rl usually either unrealistically assume the attacker knows the underlying markov decision process (mdp), or directly apply the poisoning methods in supervised learning to rl. in this work, we build a generic poisoning framework for online rl via a comprehensive investigation of heterogeneous poisoning models in rl. without any prior knowledge of the mdp, we propose a strategic poisoning algorithm called vulnerability-aware adversarial critic poison (va2c-p), which works for on-policy deep rl agents, closing the gap that no poisoning method exists for policy-based rl agents. va2c-p uses a novel metric, stability radius in rl, that measures the vulnerability of rl algorithms. experiments on multiple deep rl agents and multiple environments show that our poisoning algorithm successfully prevents agents from learning a good policy or teaches the agents to converge to a target policy, with a limited attacking budget. LINEBREAK introduction LINEBREAK although reinforcement learning (rl), especially deep rl, has been successfully applied in various fields, the security of rl techniques against adversarial attacks is not yet well understood. in realworld scenarios, including high-stakes ones such as autonomous driving vehicles and healthcare systems, a bad decision may lead to a tragic outcome. should we trust the decision made by an rl agent? how easy is it for an adversary to mislead the agent? these questions are crucial to ask before deploying rl techniques in many applications. LINEBREAK in this paper, we focus on poisoning attacks, which occur during the training and influence the learned policy. since training rl is known to be very sample-consuming, one might have to constantly interact with the environment to collect data, which opens up a lot of opportunities for an attacker to poison the training samples collected. therefore, understanding poisoning mechanisms and studying the vulnerabilities in rl are crucial to provide guidance for defense methods. however, existing works on adversarial attacks in rl mainly study the test-time evasion attacks (chen et al., 2019) where the attacker crafts adversarial inputs to fool a well-trained policy, but does not cause any change to the policy itself. motivated by the importance of understanding rl security in the training process and the scarcity of relevant literature, in this paper, we investigate how to poison rl agents and how to characterize the vulnerability of deep rl algorithms. LINEBREAK in general, rl is an “online” process: an agent rolls out experience from the environment with its current policy, and uses the experience to improve its policy, then uses the new policy to roll out new experience, etc. poisoning in online rl is significantly different from poisoning in classic supervised learning (sl), even online sl, and is more difficult due to the following challenges. LINEBREAK challenge i – future data unavailable in online rl. poisoning approaches in sl (mu˜noz-gonz´alez et al., 2017; wang & chaudhuri, 2018) usually require the access to the whole training dataset, so the attacker can decide the optimal poisoning strategy before the learning starts. however, in online rl, the training data (trajectories) are generated by the agent while it is learning. although the optimal poison should work in the long run, the attacker can only access and change the data in the current iteration, since the future data is not yet generated. LINEBREAK challenge ii – data samples no longer i.i.d.. it is well-known that in rl, data samples (state-action transitions) are no longer i.i.d., which makes learning challenging, since we should consider the longterm reward rather than the immediate result. however, we notice that data samples being not i.i.d. also makes poisoning attacks challenging. for example, an attacker wants to reduce the agent’s total reward in a task shown as figure 1; at state s1, the attacker finds that a1 is less rewarding than a0; if the attacker only looks at the immediate reward, he will lure the agent into choosing a1. however, following a1 finally leads the agent to s10 which has a much higher reward. LINEBREAK figure 1: an example of difficult poisoning. LINEBREAK challenge iii – unknown dynamics of environment. although challenge i and ii can be partially addressed by predicting the future trajectories or steps, it requires prior knowledge on the dynamics of the underlying mdp. many existing poisoning rl works (rakhsha et al., 2020; ma et al., 2019) assume the attacker has perfect knowledge of the mdp, then compute the optimal poisoning. however, in many real-world environments, knowing the dynamics of the mdp is difficult. although the attacker could potentially interact with the environment to build an estimate of the environment model, the cost of interacting with the environment could be unrealistically high, market making (spooner et al., 2018) for instance. in this paper, we study a more realistic scenario where the attacker does not know the underlying dynamics of mdp, and can not directly interact with the environment, either. thus, the attacker learns the environment only based on the agent’s experience. LINEBREAK in this paper, we systematically investigate poisoning in rl by considering all the aforementioned rl-specific challenges. previous works either do not address any of the challenges or only address some of them. behzadan & munir (2017) achieve policy induction attacks for deep q networks (dqn). however, they treat output actions of dqn similarly to labels in sl, and do not consider challenge ii that the current action will influence future interactions. ma et al. (2019) propose a poisoning attack for model-based rl, but they suppose the agent learns from a batch of given data, not considering challenge i. rakhsha et al. (2020) study poisoning for online rl, but they require perfect knowledge of the mdp dynamics, which is unrealistic as stated in challenge iii. LINEBREAK summary of contributions. (1) we propose a practical poisoning algorithm called vulnerabilityaware adversarial critic poison (va2c-p) that works for deep policy gradient learners without any prior knowledge of the environment. to the best of our knowledge, va2c-p is the first practical algorithm that poisons policy-based deep rl methods. (2) we introduce a novel metric, called stability radius, to characterize the stability of rl algorithms, measuring and comparing the vulnerabilities of rl algorithms in different scenarios. (3) we conduct a series of experiments for various environments and state-of-the-art deep policy-based rl algorithms, which demonstrates rl agents’ vulnerabilities to even weaker attackers with limited knowledge and attack budget. LINEBREAK related work LINEBREAK the main focus of this paper is on poisoning rl, an emerging area in the past few years. we survey related works of adversarial attacks in sl and evasion attacks in rl in appendix a, as they are out of the scope of this paper. LINEBREAK targeted poisoning attacks for rl. most rl poisoning researches work on targeted poisoning, also called policy teaching, where the attacker leads the agent to learn a pre-defined target policy. policy teaching can be achieved by manipulating the rewards (zhang & parkes, 2008; zhang et al., 2009) or dynamics (rakhsha et al., 2020) of the mdp. however, they require the attackers to not only have prior knowledge of the environments (e.g., the dynamics of the mdp), but also have the ability to alter the environment (e.g. change the transition probabilities), which are often unrealistic or difficult in practice. LINEBREAK poisoning rl with omniscient attackers. most guaranteed poisoning rl literature (rakhsha et al., 2020; ma et al., 2019) assume omniscient attackers, who not only know the learner’s model, but also know the underlying mdp. however, as motivated in the introduction, the underlying mdp is usually either unknown or too complex in practice. some works poison rl learners by changing the reward signals sent from the environment to the agent. for example, ma et al. (2019) introduce a policy teaching framework for batch-learning model-based agents; huang & zhu (2019) propose a reward-poisoning attack model, and provide convergence analysis for q-learning; zhang et al. LINEBREAK (2020b) present an adaptive reward poisoning method for q-learning (while it also extends to dqn) and analyze the safety thresholds of rl; these papers all assume the attacker knows not only the models of the agent, but also the parameters of the underlying mdp, which could be possible in a tabular mdp, but hard to realize in large environments and modern deep rl systems. LINEBREAK on the contrary, we consider non-omniscient attackers who do not know the underlying mdp or environment in this paper. the non-omniscient attackers can be further divided into two categories: white-box attackers, who know the learner’s model/parameters, and black-box attackers, who do not know the learner’s model/parameters. they both tap the interactions between the learner and the environment. LINEBREAK black-box poisoning for value-based learners. although there are many successful black-box evasion approaches (xinghua et al., 2020; inkawhich et al., 2020), black-box poisoning in rl is rare. there is a black-box attacking method for a value-based learner (dqn) proposed by behzadan & munir (2017), which does not require the attacker to know the learner’s model or the underlying mdp. in this work, the attacker induces the dqn agent to output the target action by perturbing the state with fast gradient sign method (fgsm) (goodfellow et al., 2015) in every step. however, the data-correlation problem of rl (challenge ii) is not considered, and fgsm attack does not work for policy-based methods due to their high stochasticity, as we show in experiments. LINEBREAK in this paper, we propose a new poisoning algorithm for policy-based deep rl agents, which can achieve both non-targeted and targeted attacks. we do not require any prior knowledge of the environment. and our algorithm works not only when the attacker knows the learner’s model (whitebox), but also when the leaner’s model is hidden (black-box). LINEBREAK problem formulation for poisoning online rl LINEBREAK notations and preliminaries LINEBREAK in rl, an agent interacts with the environment by taking actions, observing states and receiving rewards. the environment is modeled by a markov decision process (mdp), which is denoted by a tuple m = (cid:104)s, a, p, r, γ, µ(cid:105), where s is the state space, a is the action space, p is the transition kernel, r is the reward function, γ ∈ (0, 1) is the discount factor, and µ is the initial state distribution. a trajectory τ ∼ π generated by policy π is a sequence s1, a1, r1, s2, a2, · · · , where s1 ∼ µ, at ∼ π(a|st), st+1 ∼ p (s|st, at) and rt = r(st, at). the goal of an rl agent is to find an optimal policy π∗ that maximizes the expected total rewards η, which is defined as η(π) = eτ ∼π[r(τ )] = es1,a1,···∼µ,π,p,r[(cid:80)∞ t=1 γt−1rt]. we use an overhead check signˇon a variable to denote that the variable is poisoned. for example, if the attacker perturbs a reward rt, then the poisoned reward is denoted as ˇrt. if a policy π is updated with poisoned observation, then it is denoted as ˇπ. LINEBREAK the procedure of online learning and poisoning LINEBREAK procedure of online learning. we consider a classical online policy-based rl setting, where the learner iteratively updates its policy π parametrized by θ, through k iterations with the environment. for notation simplicity, we omit θ and use πk to denote πθk , the learner’s policy at iteration k. the online learning process is described as below. LINEBREAK figure 2: online poisoning-learning process. LINEBREAK k = [s1, s2, · · · ], oa LINEBREAK at iteration k = 1, · · · , k, (1) the agent uses the current policy πk to roll out observation ok = (os ronment mk, where os k = [a1, a2, · · · ], or sequence of states, actions and rewards generated at iteration k. (2) the agent updates its policy parameters θ with its algorithm f . most policy-based algorithms perform on-policy updating, i.e., update policy only by the current observation ok. the on-policy update can be then formalized as πk+1 = f (πk, ok) ≈ argmaxπj(π, πk, ok), where j is an objective function defined by algorithm f , e.g., the expected total reward η(π). LINEBREAK k, oa k ) from envik = [r1, r2, · · · ] are respectively the LINEBREAK k , or LINEBREAK procedure of online poisoning. a poisoning attacker influences the learner in the training process by perturbing the training data. in sl, the training data consists of features and labels, and the attacker poisons the training data before the learning starts. however, the training data in rl is the trajectories a learner rolls out from the environment, i.e., observation o = (os, oa, or). at iteration k, the attacker eavesdrops on the interaction between the learner and the environment, obtains the observation ok, and may poison it into ˇok, then send ˇok to the learner before policy updating. 1 procedure 2 in appendix b illustrates how the online game goes between the learner and the attacker. figure 2 visualizes this online learning-poisoning procedure, where we can see that learning and poisoning are convoluted and inter-dependent. LINEBREAK a unified formulation for poisoning online policy-based rl. LINEBREAK 3.3.1 attacker’s poison aim LINEBREAK as defined in section 3.1, the observation is a collection of trajectories, consisting of the observed states os, the executed actions oa or the received rewards or. when poisoning the observation, the attacker may only focus on the states, or on the actions, or on the rewards. we call the quantity being altered as the poison aim of the attacker, denoted by d ∈ {os, oa, or}. for example, d = os means the attacker chooses to attack the states. LINEBREAK distinguishing different poison aims is important, since in real-world applications different poison aims correspond to different behaviors of the attacker. for example, in an rl-based recommender system, the rl agent recommends an item (i.e., an action) for a user (i.e., a state), and the user may or may not choose to click on the recommended item (i.e., a reward). an adversary might manipulate the reward (poisoning d = or), e.g., blocking the user’s click from the rl agent or creating a fake click. an adversary might also alter the state (poisoning d = os), e.g., raising a teenager user’s age which could result in inappropriate recommendations. an adversary might also change the action (poisoning d = oa), e.g., inserting a fake recommendation into the agent’s list of recommendations. under different scenarios, the feasibility of poisoning different aims may vary. LINEBREAK most existing works on poisoning rl only solve one type of poison aim. zhang et al. (2020b); huang & zhu (2019) propose to poison rewards, and behzadan & munir (2017) assume the attacker poison the states. however, in our paper, we provide a general solution for any of the poison aims to satisfy the needs in different scenarios. our proposed method also supports a ”hybrid” poison aim, where the attacker could switch aims at different iterations, as discussed in section 5. LINEBREAK 3.3.2 a poisoning framework for rl LINEBREAK we focus on proposing a poisoning mechanism for the above challenging online learning scenario. we first formalize the poisoning attacking at iteration k as a sequential bilevel optimization problem in problem (q), and explain the details of the problem in the remaining of this section. LINEBREAK argmin ˇdk,··· , ˇdk LINEBREAK s.t. LINEBREAK j=k LINEBREAK λjla(ˇπj+1) LINEBREAK ((a) attacker’s weighted loss) LINEBREAK (q) LINEBREAK ˇπj+1 = argmaxπj(π, ˜πj, ˇoj| ˇdj), ∀k ≤ j ≤ k (cid:88)k LINEBREAK 1{ ˇdj (cid:54)= dj} ≤ c LINEBREAK u (dj, ˇdj) ≤ (cid:15), ∀1 ≤ j ≤ k LINEBREAK ((b) imitate the learner) LINEBREAK ((c) limited-budget) LINEBREAK ((d) limited-power) LINEBREAK (a) attacker’s weighted loss. la(ˇπ) measures the attacker’s loss w.r.t. a poisoned policy π. as the definition of poisoning implies, the attacker influences or misleads the learner’s policy. λk:k are the weights of future attacker losses, controlling how much the attacker value the poisoning results in different iterations. the goal of the attacker is either (1) non-targeted poisoning, which minimizes the expected total rewards of the learner, i.e., la = η(ˇπ), or (2) targeted poisoning, which induces the learner to learn a pre-defined target policy, i.e., la = distance(ˇπ, π†), where distance(ˇπ, π†) can be any distance measure between a learned policy ˇπ and a target policy π†. note that the targeted LINEBREAK 1in this paper, we assume the attacker poisons the observation(trajectories), which is the most universal setting in practice. appendix b extends our problem formulation to a more general case where the attacker can change the underlying mdp. LINEBREAK poisoning objective can usually be directly computed with a prior target policy, while non-targeted poisoning has a “reward-minimizing” objective, which is the reverse of the learner’s objective. without any prior knowledge of the environment, non-targeted poisoning is usually more difficult, as the attacker needs to first learn “what is the worst way” (which is as difficult as a learning problem by a rl agent) and then lead the learner to that way (which is as difficult as a targeted poisoning problem, assuming leading an agent to different policies is roughly equally challenging). however, most existing poisoning work focus on targeted poisoning, which requires the attacker to know a pre-defined target policy. thus in this paper, we make more efforts to solve the reward-minimizing poisoning problem, which may deprave the policy without any prior knowledge. LINEBREAK (b) imitate the policy-based learner. to confidently mislead a learner, the attacker needs to predict how the learner will behave under the poison, which can be achieved by imitating the learner using the learner’s observation. more specifically, at the j-th iteration, the attacker estimates the learner’s policy to be ˜πj, called imitating policy. then, the attacker predicts the next-policy ˇπj+1 under poisoned observation, based on the learner’s update rule argmaxπj(π, ˜πj, ˇoj| ˇdj), where d ∈ {os, oa, or} stands for the poison aim of the poisoning, ˇo| ˇd denotes that o is poisoned into ˇo given that poison aim d is poisoned into ˇd. however, the imitating policy ˜π may or may not be the same as the actual learner’s policy, depending on the attacker’s knowledge. as introduced in section 2, we deal with both white-box and black-box attackers, and both of them do not know the environment m. a white-box attacker knows the current and past observations o1:k, the learner’s algorithm f and policy π, so it can directly copy the policy ˜πj = πj, ∀j. a black-box attacker knows the current and past observations o1:k, but does not know the learner’s policy π. in this case, the attacker has to estimate π at every iteration. section 4.3 states how to guess π. LINEBREAK (c,d) limited-budget and limited-power. in practice, the ability of an attacker is usually restricted by some constraints. for the online poisoning problem, we consider attacker’s constraints in two forms: (1) (attack budget c) the total number of iterations that the attacker could poison does not exceed c; (2) (attack power (cid:15)) in one iteration, the total change2 u (dk, ˇdk) between dk and ˇdk can not be larger than (cid:15). attack power controls the amount of perturbation, as commonly used in the adversarial learning literature. attack budget considers the frequency of attack, which is similar to the constraint studied by wang & chaudhuri (2018). LINEBREAK problem (q) is a generic formulation, covering a variety of poisoning models, and specifies the best poison an attacker can execute. however, directly solving problem (q) is prohibitive, as (1) the future observations ok+1:k are unknown when poisoning the k-th iteration, as the attacker has no knowledge of the underlying mdp. (2) the limited-budget constraint is analogous to (cid:96)0-norm regularization, which is generally np-hard (nguyen et al., 2019); and (3) minimizing attacker’s loss while maximizing learner’s gain is non-convex minimax optimization, which is a complex problem (perolat et al., 2015). LINEBREAK in spite of the above difficulties, we introduce a practical method to approximately and effectively solve problem (q) in section 4. LINEBREAK va2c-p: poison policy gradient learners LINEBREAK in this section, we propose a practical and efficient poisoning algorithm called vulnerability-aware adversarial critic poison (va2c-p) for policy gradient learners. without loss of generality, we assume the loss weights λj = 1 for all j = 1, · · · , k. LINEBREAK main idea. as discussed in section 3.3, problem (q) is difficult mainly because of the unknown future observations and the limited budget constraint. in other words, it is hard to exactly determine (1) what kind of attack benefits the future the most, and (2) which iterations are worth attacking the most. thus, we propose to break problem (q) into two decisions: when to attack, and how to attack. the “when to attack” decision allocates the limited budget to iterations which are more likely to be influenced by the attacker, and the “how to attack” decision utilizes limited power to minimize the attacker’s loss. we introduce two mechanisms of va2c-p, vulnerability-awareness and adversarial critic, to make these two decisions respectively. LINEBREAK 2there are many choices of u (·, ·). for example, the total effort w.r.t. os-poisoning can be the average LINEBREAK (cid:96)p-distance between any poisoned and unpoisoned state in os and ˇos. LINEBREAK decision 1: when to attack – vulnerability-aware
| 5
|
[
108.249,
698.0240784,
384.1130309,
707.9866784
] |
ECuvULjFQia.pdf
| 2,021
| 2
|
LINEBREAK a teacher-student framework to distill future trajectories LINEBREAK alexander neitz1, * giambattista parascandolo1, 2, * bernhard schölkopf1, 2 1mpi for intelligent systems, tübingen, ∗equal contribution LINEBREAK 2eth, zürich, LINEBREAK abstract LINEBREAK by learning to predict trajectories of dynamical systems, model-based methods can make extensive use of all observations from past experience. however, due to partial observability, stochasticity, compounding errors, and irrelevant dynamics, training to predict observations explicitly often results in poor models. model-free techniques try to side-step the problem by learning to predict values directly. while breaking the explicit dependency on future observations can result in strong performance, this usually comes at the cost of low sample efficiency, as the abundant information about the dynamics contained in future observations goes unused. here we take a step back from both approaches: instead of hand-designing how trajectories should be incorporated, a teacher network learns to extract relevant information from the trajectories and to distill it into target activations which guide a student model that can only observe the present. the teacher is trained with meta-gradients to maximize the student’s performance on a validation set. our approach performs well on tasks that are difficult for model-free and model-based methods, and we study the role of every component through ablation studies. LINEBREAK introduction LINEBREAK the ability to learn models of the world has long been argued to be an important ability of intelligent agents. an open and actively researched question is how to learn world models at the right level of abstraction. this paper argues, as others have before, that model-based and model-free methods lie on a spectrum in which advantages and disadvantages of either approach can be traded off against each other, and that there is an optimal compromise for every task. predicting future observations allows extensive use of all observations from previous experiences during training, and to swiftly transfer to a new reward if the learned model is accurate. however, due to partial observability, stochasticity, irrelevant dynamics and compounding errors in planning, model-based methods tend to be outperformed asymptotically (pong et al., 2018; chua et al., 2018). on the other end of the spectrum, purely model-free methods use the scalar reward as the only source of learning signal. by avoiding the potentially impossible task of explicitly modeling the environment, model-free methods can often achieve substantially better performance in complex environments (vinyals et al., 2019; openai et al., 2019). however, this comes at the cost of extreme sample inefficiency, as only predicting rewards throws away useful information contained in the sequences of future observations. LINEBREAK what is the right way to incorporate information from trajectories that are associated with the inputs? in this paper we take a step back: instead of trying to answer this question ourselves by handdesigning what information should be taken into consideration and how, we let a model learn how to make use of the data. depending on what works well within the setting, the model should learn if and how to learn from the trajectories available at training time. we will adopt a teacher-student setting: a teacher network learns to extract relevant information from the trajectories, and distills it into target activations to guide a student network.1 a sketch of our approach can be found in figure 1, next to prototypical computational graphs used to integrate trajectory information in most model-free and model-based methods. future trajectories can be seen as being a form of privileged information vapnik and vashist (2009), i.e. data available at training time which provides additional information but is not available at test time. LINEBREAK 1note that the term distillation is often used in the context of “distilling a large model into a smaller one” (hinton et al., 2015), but in this context we talk about distilling a trajectory into vectors used as target activations. LINEBREAK contributions the main contribution of this paper is the proposal of a generic method to extract relevant signal from privileged information, specifically trajectories of future observations. we present an instantiation of this approach called learning to distill trajectories (ldt) and an empirical analysis of it. LINEBREAK y LINEBREAK ˆy LINEBREAK ˆy LINEBREAK y LINEBREAK ˆy LINEBREAK ˆx∗ LINEBREAK x∗ LINEBREAK x LINEBREAK x∗ n LINEBREAK x∗ LINEBREAK ˆyn LINEBREAK yt LINEBREAK r LINEBREAK r LINEBREAK r LINEBREAK r LINEBREAK ˆxn LINEBREAK f LINEBREAK ˆxn−1 f LINEBREAK f LINEBREAK f LINEBREAK x LINEBREAK faux LINEBREAK x LINEBREAK ˆy LINEBREAK y LINEBREAK t LINEBREAK x LINEBREAK x∗ LINEBREAK (a) model-free LINEBREAK (b) vanilla model-based LINEBREAK (c) auxiliary task LINEBREAK (d) teacher LINEBREAK figure 1: comparison of architectures. the data generator is a markov reward process (no actions) with an episode length of n. x denotes the initial observation. y = (cid:80) i yi is the n-step return (no bootstrapping). x∗ = (x∗ n) is the trajectory of observations (privileged data). model activations and predictions are displayed boxed. losses are displayed as red lines. solid edges denote learned functions. dotted edges denote fixed functions. LINEBREAK related work LINEBREAK efficiently making use of signal from trajectories is an actively researched topic. the technique of bootstrapping in td-learning (sutton, 1988) uses future observations to reduce the variance of value function approximations. however, in its basic form, bootstrapping provides learning signal only through a scalar bottleneck, potentially missing out on rich additional sources of learning signal. another approach to extract additional training signal from observations is the framework of generalized value functions (sutton et al., 2011), which has been argued to be able to bridge the gap between model-free and model-based methods as well. a similar interpretation can be given to the technique of successor representations (dayan, 1993). LINEBREAK a number of methods have been proposed that try to leverage the strengths of both model-free and model-based methods, among them racanière et al. (2017), who learn generative models of the environment and fuse predicted rollouts with a model-free network path. in a different line of research, silver et al. (2017) and oh et al. (2017) show that value prediction can be improved by incorporating dynamical structure and planning computation into the function approximators. guez et al. (2019) investigate to what extent agents can learn implicit dynamics models which allow them to solve planning tasks effectively, using only model-free methods. similarly to ldt, those models can learn their own utility-based state abstractions and can even be temporally abstract to some extent. one difference of these approaches to ldt is that they use reward as their only learning signal without making direct use of future observations when training the predictor. LINEBREAK the meta-gradient approach presented in this paper can be used more generally for problems in the framework of learning using privileged information (lupi, (vapnik and vashist, 2009; lopez-paz et al., 2016)), where privileged information is additional context about the data that is available at training time but not at test time. hindsight information such as the trajectories in a value-prediction task falls into this category. LINEBREAK there are a variety of representation learning approaches which can learn to extract learning signal from trajectories. jaderberg et al. (2016) demonstrate that the performance of rl agents can be LINEBREAK improved significantly by training the agent on additional prediction and control tasks in addition to the original task. du et al. (2018) use gradient similarity as a means to determine whether an auxiliary loss is helpful or detrimental for the downstream task. oord et al. (2018) introduce a method based on contrastive learning. they, as well as multiple follow-up studies, show that the representations learned in this way are helpful for downstream tasks in a variety of settings. LINEBREAK buesing et al. (2018) present ways to learn efficient dynamical models which do not need to predict future observations at inference time. recently, schrittwieser et al. (2019) introduced an rl agent that learns an abstract model of the environment and uses it to achieve strong performance on several challenging tasks. similarly to our motivation, their model is not required to produce future observations. meta-learning approaches have recently been shown to be successful as a technique to achieve fast task adaptation (finn et al., 2017), strong unsupervised learning (metz et al., 2019), and to improve rl (xu et al., 2018). similar to this paper in motivation is the recent work by guez et al. (2020) which also investigates how privileged hindsight information can be leveraged for value estimation. the difference to ldt is how the trajectory information is incorporated. their approach has the advantage of not needing second-order gradients. at the same time, ldt naturally avoids the problem of the label being easily predictable from the hindsight data — the teacher is trained to present it to the student in such a way that it empirically improves the student’s performance on held-out data. veeriah et al. (2019) use meta-gradients to derive useful auxiliary tasks in the form of generalized value functions. in contrast, we use a teacher network that learns to provide target activations for a student neural network based on privileged information. LINEBREAK meta-learning a dynamics teacher LINEBREAK here we describe our approach of jointly learning a teacher and a student.2 while our approach applies to the generic setting of learning using privileged information (vapnik and vashist, 2009), here we will focus on the special case of a prediction task with an underlying dynamical system. LINEBREAK learning task LINEBREAK we are considering learning problems in which we have to make a prediction about some property of the future state of a dynamical system, given observations up to the current state. our method particularly applies to systems in which both the function that relates the current observation to the label as well as the function that predicts the next observation from the current one are hard to learn, making it difficult for both model-free and model-based methods respectively. LINEBREAK to make the explanation more concrete, we will use the practical problem of medical decision-making as a running example to which we can relate the definitions we used, similar to a motivating example from vapnik and vashist (2009): given the history of measurements (biopsies, blood-pressure, etc.) on a given patient and the treatment assignment, we want to predict whether the patient will recover or not. LINEBREAK the input x ∈ x of our learning task is some observation of the system state st ∈ s before and including time step3 t ∈ z. in our running example, st can be considered the detailed physical state of the patient, which is not directly observable. the observations x include potentially multi-modal data such as x-ray images, vital sign measurements, oncologist reports, etc. the system is governed by an unknown dynamical law f : s → s — in our example, the dynamics are physical equations that determine the evolution of all cells in the body. the prediction target y ∈ y is some function of a future state st = f t −t(st), separated from t by t − t time steps: y = g(st ). in our running example, a prediction target could be the binary indicator of whether the patient will recover within some time frame. note that t could vary from one example to the next. in addition to the initial observation, we have access to the trajectory x∗ = (xτ )τ =t+1..t at training (but not test) time. in our running example, the trajectory includes all measurements from the patient after the treatment decision has been made. this information is available in a dataset of past patients (in hindsight), but not in any novel situation. LINEBREAK 2note that unlike in some related work, the teacher in our task is not a copy of the student network, but can LINEBREAK have a completely different architecture. LINEBREAK 3for simplicity, our dynamical system is time-discrete, but this assumption is not important for what follows. LINEBREAK y LINEBREAK ˆy LINEBREAK ly LINEBREAK lh LINEBREAK s LINEBREAK h LINEBREAK h∗ LINEBREAK sgd LINEBREAK validation LINEBREAK s LINEBREAK xv LINEBREAK yv LINEBREAK ˆyv LINEBREAK lv LINEBREAK meta-gradient LINEBREAK x LINEBREAK x∗ LINEBREAK t LINEBREAK figure 2: visualization of the ldt framework for the special case of n = 1. circled nodes are part of the dataset. x denotes the input, x∗ is the privileged data, y is the label. s is the student network with parameters θ, t is the teacher network with parameters φ. LINEBREAK supervision of internal activations LINEBREAK a straightforward approach to solve the learning task which takes into account the trajectory information, would be to train a state-space-model (ssm) ˆf , consisting of a dynamical model and a decoder. the ssm is trained to maximize the likelihood of the observed trajectories in the training set, conditioned on the observed initial observation. ideally, the induced ˆf closely resembles f , such that at test time, we can use it to generate an estimate of the rollout and infer the label from it. a potential drawback of this approach is that learning a full ssm could be more difficult than necessary. there may be many details of the dynamics that are both difficult to model and unimportant for the classification tasks. one example for this is the precise timing of events. as argued by neitz et al. (2018); jayaraman et al. (2019), there are situations in which it is easy to predict a sequence of events where each event follows a previous one, but hard to predict the exact timing of those events. moreover, an ssm typically requires rendering observations at training time, which may be difficult to learn and computationally expensive to execute. LINEBREAK in the running example from section 3.1, it seems challenging and wasteful to predict all future observations in detail, as it would require modeling a complicated distribution over data such as x-ray images or doctor reports written in natural language. ideally, we would like a model to learn how to extract the relevant information from these data efficiently. LINEBREAK we propose to relax the requirement of fitting the dynamics precisely. the teacher can decide to omit properties of the observations that are not needed and omit time steps that can be skipped. it could also change the order of computation and let the student compute independently evolving sub-mechanisms sequentially, even if they evolved in parallel in the actual data generating process. in addition to potentially simplifying the learning problem, this could have the additional benefit of gaining computational efficiency. for example, modeling detailed pixel observations may be computationally wasteful, as argued by buesing et al. (2018) and oord et al. (2018). LINEBREAK student-teacher setup LINEBREAK we propose a student-teacher setup with two neural networks, as shown in figure 2. the student network s, parameterized by weights θ, is the network that attempts to predict the quantity of interest y (for instance a cumulative reward or value). its input is x ∈ x , and its output is s(x) = ˆy ∈ y. in computing ˆy, it produces a sequence of internal activations (h1, ..., hn ), one for each of its n hidden layers. each hk is a vector whose size is the number of neurons of the corresponding hidden layer. the student’s goal is to minimize the generalization loss ex,y∼ptest [ly(s(x), y)] for some loss function ly : y × y → r. the teacher network t , parametrized by weights φ, is only used at training time, not at test time. it reads the observations of the rollout x∗ = (xτ )τ =t+1..t corresponding to the current training example, and outputs supervision signals (h∗ LINEBREAK n ). LINEBREAK the target activations produced by the teacher’s supervision result in another loss for the student, the teaching loss, defined as lh = (cid:80) k). lh denotes the teaching loss function which, given LINEBREAK k lh(hk, h∗ LINEBREAK a pre-activation and a supervision signal, produces a scalar value. it can be chosen to be any common loss function. note however that in general, lh could combine its inputs in an arbitrary way, as long as it is differentiable and produces a scalar. in particular, hk and h∗ k are not required to have the same dimensionality. for example, in our specific instantiation described in section 4, h∗ contains masking weights to gate the teaching signal. the total student training loss is ltrain = αlh + ly, where ly is the label loss, e.g. the cross-entropy error between predictions and true labels. α ∈ r+ is the teaching coefficient, a coefficient weighting the losses against each other. LINEBREAK training the teacher using meta-gradients LINEBREAK we train the teacher’s weights φ using the the technique of meta-gradient optimization. this is done as follows: at the beginning of training, we split the dataset into a training and a validation set4. this split is kept during the entire duration of training. the split ratio is a hyperparameter. LINEBREAK the student’s weights θ are updated n times using stochastic gradient descent on randomly sampled training batches, resulting in updated weights θn. the student s is then evaluated on a validation set, producing a validation loss lval. this validation loss is optimized by the teacher. this validation loss does not contain a term for the internal activation loss, but consists only of the label-loss l (s(xval), yval). the teacher is optimized via the meta-gradient LINEBREAK dlval dφ LINEBREAK ∂l ∂ ˆy LINEBREAK (s(xval; θn), yval) LINEBREAK ∂s ∂θ LINEBREAK (xval; θn) LINEBREAK dθn dφ LINEBREAK where xval and yval are the inputs and targets from the validation set. LINEBREAK we omit the summation over individual loss components to avoid cluttering the notation. the crucial quantity dθn dφ describes how the final student’s weights θn depend on the teachers weights φ. it can be computed in linear computation time and space in the number of steps in the inner optimization loop using automatic differentiation5. the meta-gradient is then used for one step of stochastic gradient descent of the teacher’s weights φ. the student’s weights are reset to what they were at the beginning of the step, since θn was only a hypothetical parameterization used to determine the meta-gradient. then, the student is actually trained using the newly updated teacher for a certain number of steps. in our experiments, every step of metatraining is followed by n steps of training the student’s weights where n is a hyperparameter. alg. 1 describes the teacher update formally. LINEBREAK experiments LINEBREAK (cid:46) θ is unchanged in teacher update LINEBREAK algorithm 1 teacher update LINEBREAK require: θ : student parameters require: φ : teacher parameters require: η : inner-loop learning rate require: α : teaching coefficient require: n : number of inner-loop steps LINEBREAK x, x∗, y ← next training batch ˆy, h ← s(x; θi) h∗ ← t (x∗; φ) lh ← lh(h, h∗) ly ← ly(ˆy, y) ltrain ← ly + αlh θi ← sgd(θi−1, ltrain, η) LINEBREAK 1: θ0 ← θ 2: for i in {1..n} do 3: 4: 5: 6: 7: 8: 9: 10: xval, yval ← validation data 11: lval ← ly(s((xval; θn), yval) 12: update φ to reduce lval LINEBREAK we implemented ldt in pytorch (paszke et al., 2019) using higher by grefenstette et al. (2019). note that in all experiments, we distinguish between a validation set and a test set. the validation set is used to train the teacher’s parameters. therefore, in order to allow for fair comparison with non-meta-learning baselines, we train baselines with the full training set and for ldt we split this set into a training and a validation portion. the test set is separate from the validation set and is used only passively to track generalization metrics. LINEBREAK 4note that the validation set is separate from the test set, which is an independently sampled dataset used LINEBREAK only to evaluate the generalization performance of all methods. LINEBREAK 5see baydin et al. (2018) for a survey of automatic differentiation in machine learning. LINEBREAK x ∼ n (0, i) LINEBREAK linear LINEBREAK h LINEBREAK y LINEBREAK xor LINEBREAK si ∼ LINEBREAK x∗ (a) LINEBREAK x ∼ n (0, i) LINEBREAK h LINEBREAK y LINEBREAK linear LINEBREAK sample LINEBREAK linear LINEBREAK x∗ LINEBREAK (b) LINEBREAK (c) LINEBREAK (d) LINEBREAK figure 3: (a) data generation diagram of task a. (b) test accuracies on task a. for every combination, we report the maximum test accuracy achieved, averaged over 5 random seeds. (c) data generation diagram of task b. (d) test losses on task b achieved by ldt and the no-teacher baselines with different entropy regularization coefficients β. LINEBREAK toy examples LINEBREAK before moving on to datasets of dynamical systems, we study two toy tasks in order to give a better intuition for situations where privileged data can improve learning even though it is unavailable at test time, and at the same time to examine whether ldt can make use of the privileged data. LINEBREAK task a this task demonstrates a situation where the privileged information x∗ predicts the label y perfectly and is lower-dimensional than the input x. at the same time, x∗ is not deterministically predictable from x. formally, we construct the distribution over x, x∗, and y such that the conditional expectation e [x∗|x] = 0 for all x, and the conditional entropies h(y|x) = h(y|x∗) = 0. this is intended to correspond to a real-world setting where we observe training-time privileged data which gives us a low-dimensional explanation of the label, but this explanation has been obfuscated by noise and is hence unnecessarily difficult to predict directly (here impossible with a deterministic model). LINEBREAK we first sample a d-dimensional input x with independent gaussian components. this vector gets mapped to a 2-dimensional vector h using a random but fixed linear transformation a ∈ r2×d. the label is obtained by applying xor to h > 0. the privileged vector x∗ is constructed by independently sampling another two-dimensional vector s which is multiplied with h and concatenated to it. see figure 3 for a diagram and appendix b.1 for a detailed description of the dataset. using an mlp to predict x∗ from x fails because the optimal predictor of x∗ from x always outputs 0. however, in principle ldt can help in this situation: the teacher could learn to invert the stochastic mapping from h to x∗. we set up a study to examine whether ldt automatically discovers a suitable inversion in practice. as student- and teacher-models we use mlps with one hidden layer each. the teacher gets x∗ as input and produces target activations for the student’s hidden layer. to investigate the sample efficiency, we let both the unguided student and ldt learn for a grid of different input dimensionalities d and dataset sizes. the achieved test-set accuracies are shown in figure 3, indicating that using a privileged data and a teacher makes this learning problem substantially more sample-efficient. LINEBREAK task b in this task (figure 3c), instead of using deterministic labels and stochastic privileged data, we construct deterministic privileged data and noisy labels. a large neural network trained on these labels will tend to fit them exactly. as we discover empirically, this leads to ill-calibrated out-of-sample predictions. LINEBREAK an example for a practical situation where this applies is learning a value function in reinforcement learning using monte carlo or n-step temporal difference learning: environments and policies are typically stochastic, resulting in noisy empirical value targets. however, the trajectory of observations and actions as privileged data, can in principle explain away part of the influence of chance in the observed value target. we model this situation by providing as privileged data a transformed view of the logits that were used to sample the target. this transformation is unknown to the learner, and we investigate whether ldt can still use x(cid:63) to make the student learn a well-calibrated mapping. LINEBREAK we again sample the d components of each input x i.i.d. from n (0, 1). the random linear transformation a ∈ rdh×d now transforms x into a dh-dimensional space. the privileged data x∗ ∈ rdp is obtained via another linear transformation b ∈ rdp×dh of h. in our experiment we set d = 128, dh = 4 and dp = 32, and use 1000 training examples. the teacher gets x∗ as input and only needs to supervise the student’s output layer. as baseline we train the student without a teacher or privileged data, but regularize its output predictions by subtracting βh(ˆy) from the training loss of each example, where h(ˆy) is the entropy of the model’s prediction, and β is a scalar coefficient. as shown in figure 3d, learning the mapping from stochastic labels alone never learns a well-calibrated map from x to y, while ldt learns to interpret the privileged information at training time, leading to a student that generalizes well at test time. LINEBREAK game of life LINEBREAK we performed an additional experiment aimed at evaluating whether ldt can help to extract dynamical information from trajectories. for that reason we created a dataset based on the cellular automaton game of life by john conway. the input is a random initial state x, the output is the state of one particular cell after n evolution steps. the privileged data x∗ consists of the trajectory of n states after the first one. to make the task more difficult, x∗ is temporally permuted randomly, but consistently across examples. a detailed description is provided in appendix c. as shown in fig. 4, ldt can learn from the scrambled trajectory and help the student learn with less data than a model-free method. LINEBREAK figure 4: a datapoint in the game-of-life task (left) and the results of the experiment (right). LINEBREAK mujoco
| 6
|
[
108.249,
338.1440784,
171.2784122,
348.1066784
] |
MIDckA56aD.pdf
| 2,021
| 0
|
LINEBREAK learning perturbation sets for robust machine learning LINEBREAK eric wong computer science and artificial intelligence laboratory massachusetts institute of technology cambridge, ma 02139, usa [email protected] LINEBREAK j. zico kolter computer science department carnegie mellon university and bosch center for artificial intelligence pittsburgh, pa 15213, usa [email protected] LINEBREAK abstract LINEBREAK although much progress has been made towards robust deep learning, a significant gap in robustness remains between real-world perturbations and more narrowly defined sets typically studied in adversarial defenses. in this paper, we aim to bridge this gap by learning perturbation sets from data, in order to characterize real-world effects for robust training and evaluation. specifically, we use a conditional generator that defines the perturbation set over a constrained region of the latent space. we formulate desirable properties that measure the quality of a learned perturbation set, and theoretically prove that a conditional variational autoencoder naturally satisfies these criteria. using this framework, our approach can generate a variety of perturbations at different complexities and scales, ranging from baseline spatial transformations, through common image corruptions, to lighting variations. we measure the quality of our learned perturbation sets both quantitatively and qualitatively, finding that our models are capable of producing a diverse set of meaningful perturbations beyond the limited data seen during training. finally, we leverage our learned perturbation sets to train models which are empirically and certifiably robust to adversarial image corruptions and adversarial lighting variations, while improving generalization on non-adversarial data. all code and configuration files for reproducing the experiments as well as pretrained model weights can be found at https://github.com/locuslab/perturbation_learning. LINEBREAK introduction LINEBREAK within the last decade, adversarial learning has become a core research area for studying robustness and machine learning. adversarial attacks have expanded well beyond the original setting of imperceptible noise to more general notions of robustness, and can broadly be described as capturing sets of perturbations that humans are naturally invariant to. these invariants, such as facial recognition should be robust to adversarial glasses (sharif et al., 2019) or traffic sign classification should be robust to adversarial graffiti (eykholt et al., 2018), form the motivation behind many real world adversarial attacks. however, human invariants can also include notions which are not inherently adversarial, for example image classifiers should be robust to common image corruptions (hendrycks & dietterich, 2019) as well as changes in weather patterns (michaelis et al., 2019). LINEBREAK on the other hand, although there has been much success in defending against small adversarial perturbations, most successful and principled methods for learning robust models are limited to human invariants that can be characterized using mathematically defined perturbation sets, for example perturbations bounded in (cid:96)p norm. after all, established guidelines for evaluating adversarial robustness (carlini et al., 2019) have emphasized the importance of the perturbation set (or the threat model) as a necessary component for performing proper, scientific evaluations of adversarial defense proposals. however, this requirement makes it difficult to learn models which are robust to human invariants beyond these mathematical sets, where real world attacks and general notions of robustness can often be virtually impossible to write down as a formal set of equations. this incompatibility between existing methods for learning robust models and real-world, human invariants raises a fundamental question for the field of robust machine learning: LINEBREAK how can we learn models that are robust to perturbations without a predefined perturbation set? LINEBREAK in the absence of a mathematical definition, in this work we present a general framework for learning perturbation sets from perturbed data. more concretely, given pairs of examples where one is a perturbed version of the other, we propose learning generative models that can “perturb” an example by varying a fixed region of the underlying latent space. the resulting perturbation sets are welldefined and can naturally be used in robust training and evaluation tasks. the approach is widely applicable to a range of robustness settings, as we make no assumptions on the type of perturbation being learned: the only requirement is to collect pairs of perturbed examples. LINEBREAK given the susceptibility of deep learning to adversarial examples, such a perturbation set will undoubtedly come under intense scrutiny, especially if it is to be used as a threat model for adversarial attacks. in this paper, we begin our theoretical contributions with a broad discussion of perturbation sets and formulate deterministic and probabilistic properties that a learned perturbation set should have in order to be a meaningful proxy for the true underlying perturbation set. the necessary subset property ensures that the set captures real perturbations, properly motivating its usage as an adversarial threat model. the sufficient likelihood property ensures that real perturbations have high probability, which motivates sampling from a perturbation set as a form of data augmentation. we then prove the main theoretical result, that a learned perturbation set defined by the decoder and prior of a conditional variational autoencoder (cvae) (sohn et al., 2015) implies both of these properties, providing a theoretically grounded framework for learning perturbation sets. the resulting cvae perturbation sets are well motivated, can leverage standard architectures, and are computationally efficient with little tuning required. LINEBREAK we highlight the versatility of our approach using cvaes with an array of experiments, where we vary the complexity and scale of the datasets, perturbations, and downstream tasks. we first demonstrate how the approach can learn basic (cid:96)∞ and rotation-translation-skew (rts) perturbations (jaderberg et al., 2015) in the mnist setting. since these sets can be mathematically defined, our goal is simply to measure exactly how well the learned perturbation set captures the target perturbation set on baseline tasks where the ground truth is known. we next look at a more difficult setting which can not be mathematically defined, and learn a perturbation set for common image corruptions on cifar10 (hendrycks & dietterich, 2019). the resulting perturbation set can interpolate between common corruptions, produce diverse samples, and be used in adversarial training and randomized smoothing frameworks. the adversarially trained models have improved generalization performance to both in- and out-of-distribution corruptions and better robustness to adversarial corruptions. in our final setting, we learn a perturbation set that captures real-world variations in lighting using a multi-illumination dataset of scenes captured “in the wild” (murmann et al., 2019). the perturbation set generates meaningful lighting samples and interpolations while generalizing to unseen scenes, and can be used to learn image segmentation models that are empirically and certifiably robust to lighting changes. all code and configuration files for reproducing the experiments as well as pretrained model weights for both the learned perturbation sets as well as the downstream robust classifiers are at https://github.com/locuslab/perturbation_learning. LINEBREAK background and related work LINEBREAK perturbation sets for adversarial threat models adversarial examples were initially defined as imperceptible examples with small (cid:96)1, (cid:96)2 and (cid:96)∞ norm (biggio et al., 2013; szegedy et al., 2013; goodfellow et al., 2014), forming the earliest known, well-defined perturbation sets that were eventually generalized to the union of multiple (cid:96)p perturbations (tram`er & boneh, 2019; maini et al., 2019; croce & hein, 2019; stutz et al., 2019). alternative perturbation sets to the (cid:96)p setting that remain well-defined incorporate more structure and semantic meaning, such as rotations and translations (engstrom et al., 2017), wasserstein balls (wong et al., 2019), functional perturbations (laidlaw & feizi, 2019), distributional shifts (sinha et al., 2017; sagawa et al., 2019), word embeddings (miyato et al., 2016), and word substitutions (alzantot et al., 2018; jia et al., 2019). LINEBREAK other work has studied perturbation sets that are not necessarily mathematically formulated but welldefined from a human perspective such as spatial transformations (xiao et al., 2018b). real-world adversarial attacks tend to try to remain either inconspicuous to the viewer or meddle with features that humans would naturally ignore, such as textures on 3d printed objects (athalye et al., 2017), graffiti on traffic signs (eykholt et al., 2018), shapes of objects to avoid lidar detection (cao et al., LINEBREAK 2019), irrelevant background noise for audio (li et al., 2019a), or barely noticeable films on cameras (li et al., 2019b). although not necessarily adversarial, hendrycks & dietterich (2019) propose the set of common image corruptions as a measure of robustness to informal shifts in distribution. LINEBREAK generative modeling and adversarial robustness relevant to our work is that which combines aspects of generative modeling with adversarial examples. while our work aims to learn real-world perturbation sets from data, most work in this space differs in that they either aim to generate synthetic adversarial (cid:96)p perturbations (xiao et al., 2018a), run user studies to define the perturbation set (sharif et al., 2019), or simply do not restrict the adversary at all (song et al., 2018; bhattad et al., 2020). gowal et al. (2019) trained a stylegan to disentangle real-world perturbations when no perturbation information is known in advance. however the resulting perturbation set relies on a stochastic approximation, and it is not immediately obvious what this set will ultimately capture. most similar is the concurrent work of robey et al. (2020), which uses a gan architecture from image-to-image translation to model simple perturbations between datasets. in contrast to both of these works, our setting requires the collection of paired data to directly learn how to perturb from perturbed pairs without needing to disentangle any features or translate datasets, allowing us to learn more targeted and complex perturbation sets. furthermore, we formulate desirable properties of perturbation sets for downstream robustness tasks, and formally prove that a conditional variational autoencoder approach satisfies these properties. this results in a principled framework for learning perturbation sets that is quite distinct from these gan-based approaches in both setting and motivation. LINEBREAK adversarial defenses and data augmentation successful approaches for learning adversarially robust networks include methods which are both empirically robust via adversarial training (goodfellow et al., 2014; kurakin et al., 2016; madry et al., 2017) and also certifiably robust via provable bounds (wong & kolter, 2017; wong et al., 2018; raghunathan et al., 2018; gowal et al., 2018; zhang et al., 2019) and randomized smoothing (cohen et al., 2019; yang et al., 2020). critically, these defenses require mathematically-defined perturbation sets, which has limited these approaches from learning robustness to more general, real-world perturbations. we directly build upon these approaches by learning perturbation sets that can be naturally and directly incorporated into robust training, greatly expanding the scope of adversarial defenses to new contexts. our work also relates to using non-adversarial perturbations via data augmentation to reduce generalization error (zhang et al., 2017; devries & taylor, 2017; cubuk et al., 2019), which can occasionally also improve robustness to unrelated image corruptions (geirhos et al., 2018; hendrycks et al., 2019; rusak et al., 2020). our work differs in that rather than aggregating or proposing generic data augmentations, our perturbation sets can provide data augmentation that is targeted for a particular robustness setting. LINEBREAK perturbation sets learned from data LINEBREAK for an example x ∈ rm, a perturbation set s(x) ⊆ rm is defined informally as the set of examples which are considered to be equivalent to x, and hence can be viewed as “perturbations” of x. this set is often used when finding an adversarial example, which is typically cast as an optimization problem to maximize the loss of a model over the perturbation set in order to break the model. for example, for a classifier h, loss function (cid:96), and label y, an adversarial attack tries to solve the following: LINEBREAK maximize x(cid:48)∈s(x) LINEBREAK a common choice for s(x) is an (cid:96)p ball around the unperturbed example, defined as s(x) = {x + δ : (cid:107)δ(cid:107)p ≤ (cid:15)} for some norm p and radius (cid:15). this type of perturbation captures unstructured random noise, and is typically taken with respect to (cid:96)p norms for p ∈ {0, 1, 2, ∞}, though more general distance metrics can also be used. LINEBREAK although defining the perturbation set is critical for developing adversarial defenses, in some scenarios, the true perturbation set may be difficult to mathematically describe. in these settings, it may still be possible to collect observations of (non-adversarial) perturbations, e.g. pairs of examples (x, ˜x) where ˜x is the perturbed data. in other words, ˜x is a perturbed version of x, from which we can learn an approximation of the true perturbation set. while there are numerous possible approaches one can take to learn s(x) from examples (x, ˜x), in this work we take a generative modeling perspective, where examples are perturbed via an underlying latent space. specifically, let g : rk × rm → rm LINEBREAK be a generator that takes a k-dimensional latent vector and an input, and outputs a perturbed version of the input. then, we can define a learned perturbation set as follows: LINEBREAK in other words, we have taken a well-defined norm-bounded ball in the latent space and mapped it to a set of perturbations with a generator g, which perturbs x into ˜x via a latent code z. alternatively, we can define a perturbation set from a probabilistic modeling perspective, and use a distribution over the latent space to parameterize a distribution over examples. then, s(x) is now a random variable defined by a probability distribution p(cid:15)(z) over the latent space as follows: LINEBREAK s(x) ∼ pθ such that θ = g(z, x), LINEBREAK z ∼ p(cid:15) LINEBREAK where p(cid:15) has support {z : (cid:107)z(cid:107) ≤ (cid:15)} and pθ is a distribution parameterized by θ = g(z, x).
| 3
|
[
107.641,
569.9290828,
465.45465,
580.8068556
] |
xtbog7cfsr.pdf
| 2,023
| 0
|
LINEBREAK the implicit bias of minima stability in multivariate shallow relu networks LINEBREAK mor shpigel nacson∗ & rotem mulayoff∗ electrical & computer engineering, technion LINEBREAK tomer michaeli & daniel soudry electrical & computer engineering, technion LINEBREAK greg ongie mathematical and statistical sciences marquette university LINEBREAK abstract LINEBREAK we study the type of solutions to which stochastic gradient descent converges when used to train a single hidden-layer multivariate relu network with the quadratic loss. our results are based on a dynamical stability analysis. in the univariate case, it was shown that linearly stable minima correspond to network functions (predictors), whose second derivative has a bounded weighted l1 norm. notably, the bound gets smaller as the step size increases, implying that training with a large step size leads to ‘smoother’ predictors. here we generalize this result to the multivariate case, showing that a similar result applies to the laplacian of the predictor. we demonstrate the tightness of our bound on the mnist dataset, and show that it accurately captures the behavior of the solutions as a function of the step size. additionally, we prove a depth separation result on the approximation power of relu networks corresponding to stable minima of the loss. specifically, although shallow relu networks are universal approximators, we prove that stable shallow networks are not. namely, there is a function that cannot be wellapproximated by stable single hidden-layer relu networks trained with a nonvanishing step size. this is while the same function can be realized as a stable two hidden-layer relu network. finally, we prove that if a function is sufficiently smooth (in a sobolev sense) then it can be approximated arbitrarily well using shallow relu networks that correspond to stable solutions of gradient descent. LINEBREAK introduction LINEBREAK neural networks (nns) have been demonstrating phenomenal performance in a wide array of fields, from computer vision and speech processing to medical sciences. modern networks are typically taken to be highly overparameterized. in such setting, the training loss usually has multiple global minima, which correspond to models that perfectly fit the training data. some of those models are clearly sub-optimal in terms of generalization. yet, the training process seems to consistently avoid those bad global minima, and somehow steer the model towards global minima that generalize well. a long line of works attributed this behavior to “implicit biases” of the training algorithms, e.g., (zhang et al., 2017; gunasekar et al., 2017; soudry et al., 2018; arora et al., 2019). LINEBREAK recently, it has been recognized that a dominant factor affecting the implicit bias of gradient descent (gd) and stochastic gradient descent (sgd), is associated with dynamical stability. roughly speaking, the dynamical stability of a minimum point refers to the ability of the optimizer to stably converge to that point. particular research efforts have been devoted to understanding linear stability, namely the dynamical stability of the optimizer’s linearized dynamics around the minimum (wu et al., 2018; nar & sastry, 2018; mulayoff et al., 2021; ma & ying, 2021). for gd and sgd, it is well known that a minimum is linearly stable if the loss terrain is sufficiently flat w.r.t. the step size η. LINEBREAK concretely, a necessary condition for a minimum to be linearly stable for gd and sgd is that the top eigenvalue of the hessian at that minimum point be smaller than 2/η (see sec. 2). although this LINEBREAK ∗indicates equal contribution. correspondence: {mor.shpigel,rotem.mulayof}@gmail.com. LINEBREAK (a) small step size (η = 0.001) LINEBREAK (b) medium step size (η = 0.01) LINEBREAK (c) large step size (η = 0.1) LINEBREAK figure 1: larger step size leads to smoother prediction function. we train a single hidden-layer relu network on a regression task with two-dimensional data, depicted by red points. the different panels show the predictor function f obtained when training with different step sizes. LINEBREAK condition only characterizes the linearized dynamics, it has been empirically shown to hold in realworld neural-network training (cohen et al., 2020; gilmer et al., 2022). the linear stability condition turns out to have a strong effect on the nature of the network that is obtained upon convergence, both in terms of the end-to-end predictor function (mulayoff et al., 2021), and in terms of the way this function is implemented by the network (mulayoff & michaeli, 2020). LINEBREAK mulayoff et al. (2021) studied how linear stability affects a single hidden-layer univariate relu network, when trained with the quadratic loss. they showed that in this setting, stable solutions of sgd with step size η correspond to functions f satisfying 1 η LINEBREAK |f ′′(x)| g(x)dx ≤ LINEBREAK r LINEBREAK where f denotes the network input-output function, and g is a weight function that depends only on the training data. this result implies that for univariate shallow relu networks, sgd is biased towards ‘smooth’ solutions1. moreover, the larger the step size η, the smoother the solution becomes. LINEBREAK in this paper, we study the stable solutions of single hidden-layer relu networks with multidimensional inputs, trained using sgd and the quadratic loss. particularly, in sec. 3 we generalize the result of mulayoff et al. (2021) to the multivariate setting. as it turns out, the natural extension of (1) involves the radon transform of the laplacian of the predictor function, ∆f (see thm. 1). however, we show this result can also be interpreted in primal space as LINEBREAK rd LINEBREAK |∆f (x)|ρ(x)dx ≤ LINEBREAK where ρ is some weighting function. thus, stable solutions of sgd in the multivariate case also correspond to smooth predictors (i.e., functions whose laplacian has a small weighted l1 norm). the larger the step size, the smoother the function becomes. figure 1 illustrates this phenomenon. LINEBREAK additionally, we study the approximation power of single hidden-layer relu networks corresponding to stable minima. it is well known that shallow relu networks can approximate any continuous function over a compact set (pinkus, 1999). however this does not imply that sgd can stably converge to such approximations. if there exist functions whose approximations are all unstable, then this property may be of limited practical interest. in sec. 4 we prove that every convergent sequence of stable networks has a limit function that also satisfies the stability condition (thm. 1). building on this, we prove a depth separation result. specifically, we show that there exists a function that does not satisfy the stability condition for any positive step size. namely, it cannot be stably approximated by a single hidden-layer relu network trained with a non-vanishing step size. yet, the same function can be realized as a two hidden-layer relu network corresponding to a stable minimum. moreover, in sec. 5 we show that if a function is sufficiently smooth (sobolev) then it can be approximated arbitrarily well using single hidden-layer relu networks that correspond to stable solutions of gd. LINEBREAK finally, in sec. 3.3 and 6 we demonstrate our results. particularly, we illustrate how our stable minima characterization (thm. 1) can be used to predict certain properties of the solution. for example, for LINEBREAK 1in a slight abuse of terms, in this paper we say a function is ‘smooth’ if some weighted l1 norm of its LINEBREAK second derivative is bounded. LINEBREAK certain isotropic data (e.g., gaussian), we show that a large step size tends to increase the biases of all neurons. we also demonstrate on the mnist dataset the tightness of our stability bound, and that it predicts well the dependence of the stability and generalization performance on the step size. LINEBREAK background: minima stability of sgd LINEBREAK in this section we give a brief survey on minima stability. let us consider the problem of minimizing an empirical loss using sgd. we are interested in the typical regime of overparameterized models. in this setting, there exist multiple global minimizers of the loss. yet, sgd cannot stably converge to any minimum. the stability of a minimum is associated with the dynamics of sgd in its vicinity. specifically, a minimum is said to be stable if once sgd arrives near the minimum, it stays in its vicinity. if sgd repels from the minimum, then we say that it is unstable. formally, let ℓj : rd → r be differentiable almost everywhere for all j ∈ [n]. here we consider a loss function l and its stochastic analogue, LINEBREAK l(θ) = LINEBREAK ℓj(θ) and ˆlt(θ) = LINEBREAK j∈bt LINEBREAK ℓj(θ), LINEBREAK where bt is a batch of size b sampled at iteration t. we assume that the batches {bt} are drawn uniformly from the dataset, independently across iterations. sgd’s update rule is given by LINEBREAK θt+1 = θt − η∇ ˆlt(θt), (4) where η is the step size. analyzing the full dynamics of this system is intractable in most cases. therefore, several works studied the behavior of this system near minima using linearized dynamics (wu et al., 2018; ma & ying, 2021; nar & sastry, 2018; mulayoff et al., 2021), which is a common practice for characterizing the stability of nonlinear systems. definition 1 (linear stability). let θ∗ be a twice differentiable minimum of l. consider the linearized stochastic dynamical system LINEBREAK (cid:17) ∇ ˆlt(θ∗) + ∇2 ˆlt(θ∗)(θt − θ∗) LINEBREAK then θ∗ is ε linearly stable if for any θ0 in the ε-ball bε(θ∗), we have lim sup t→∞ LINEBREAK e[∥θt − θ∗∥] ≤ ε. LINEBREAK namely, a minimum is ε linearly stable if once θt enters an ε-ball around the minimum, it ends up at a distance no greater than ε from it in expectation. under mild conditions, any stable minimum of the nonlinear system is also linearly stable (vidyasagar, 2002, p. 268). we have the following condition. lemma 1 (necessary condition for linear stability (mulayoff et al., 2021, lemma 1)). consider sgd with step size η, where batches are drawn uniformly from the training set, independently across iterations. if θ∗ is an ε linearly stable minimum of l, then (cid:0)∇2l(θ∗)(cid:1) ≤ LINEBREAK λmax LINEBREAK this condition states that stable minima of sgd are flat w.r.t. the step size. although this result was proved for the linearized dynamics, it was observed to hold also in practice, where the full nonlinear dynamics apply. particularly, much empirical evidence on real-world neural-network training (cohen et al., 2020; gilmer et al., 2022) points out that gd and sgd converge only to linearly stable minima, i.e., minima satisfying (6). more on dynamical stability and its interaction with common practices (e.g., learning rate decay, absence of ε and b in lemma 1 result, etc.) in app. a. LINEBREAK large step size biases to smooth functions LINEBREAK consider the set of multivariate functions over rd that can be implemented by a single hidden-layer relu network with k neurons, LINEBREAK fk ≜ LINEBREAK f : rd → r LINEBREAK f (x) = LINEBREAK i LINEBREAK where σ(·) denotes the relu activation function. each f ∈ fk is a piecewise linear function with at most k knots2. given some training set {xj, yj}n j=1, we are interested in functions that globally LINEBREAK 2a ‘knot’ is a boundary between two pieces (i.e., intersection between hyperplanes). see fig. 2 for illustration. LINEBREAK minimize the quadratic loss3 LINEBREAK (cid:0)f (xj) − yj LINEBREAK definition 2 (solution). a function f ∈ fk is a ‘solution’ if l(f ) = 0, i.e., f (xj) = yj ∀j ∈ [n]. LINEBREAK we focus on the overparameterized regime (kd > n) in which there exist multiple solutions. we want to study the properties of solutions which correspond to stable minima of sgd. however, a key challenge is that any solution f ∈ fk typically has infinitely many different parameterizations. in other words, there are various parameter vectors LINEBREAK k LINEBREAK that can implement the same function f . different parameterizations correspond to different minima, which may have different hessian eigenvalues. therefore, for a given step size η, some parameterizations of f may be stable while others may not. thus, to determine whether sgd can stably converge to a solution f , we need to check whether there exists some stable minimum θ, which corresponds to a parametrization of f . we therefore use the following definition. definition 3 (stable solution). a solution f ∈ fk is said to be stable for step size η if there exists a minimum θ∗ of the loss that corresponds to f , where θ∗ is linearly stable for sgd with step size η. LINEBREAK the next theorem characterizes stable solutions using the radon transform r (see app. c) and the laplace operator ∆. particularly, we use the inverse of the dual radon transform, (r∗)−1, and interpret ∆f in the weak sense, i.e., as a sum of weighted dirac delta functions (see app. d). theorem 1 (properties of stable solutions). let f be a linearly stable solution for sgd with step size η. assume that the knots of f do not coincide with any training point. then LINEBREAK ∥f ∥r,g ≤ LINEBREAK where ∥·∥r,g is the stability norm, defined as LINEBREAK ∥f ∥r,g LINEBREAK sd−1×r LINEBREAK (cid:2)(r∗)−1∆f (cid:3) (v, b)(cid:12) LINEBREAK (cid:12) g(v, b)ds(v)db, LINEBREAK and g(v, b) ≜ min (cid:0)˜g(v, b), ˜g(−v, −b)(cid:1) is a non-negative weighting function, with ˜g given by LINEBREAK ˜g(v, b) ≜ p2(x ⊤v > b)e LINEBREAK here x is a random vector drawn from the dataset’s distribution (i.e., sampled uniformly from {xj}). LINEBREAK this theorem, whose proof is provided in app. e, shows that the step size constrains the stability norm of the solution. notably, the constraint becomes stricter as the step size increases. before interpreting this result, let us note that although it depends only on the step size, other hyper-parameters (e.g., batch size, initialization) may potentially improve the bound. yet, as we discuss in app. a, the effect of other hyper-parameters seems secondary in practical settings. the implications of thm. 1 can be understood in primal space and in radon space. in the following, we discuss both interpretations and give examples. LINEBREAK primal space interpretation LINEBREAK theorem 1 is stated in radon space, which may be difficult to interpret. however, in some cases it can also be interpreted in primal space, by deriving an alternative form for the stability norm ∥ · ∥r,g. specifically, in app. g we show that if g is piecewise continuous and l1-integrable4, then for all f ∈ fk and ρ = r−1g we have5 LINEBREAK ∥f ∥r,g = LINEBREAK rd LINEBREAK |∆f (x)|ρ(x)dx. LINEBREAK 3we focus on mse loss for simplicity, but the results can be extended to other loss functions, see app. j. 4which is true, for example, when the training set is finite. 5this integral should be interpreted in the distributional sense (see app. g for details). LINEBREAK (a) surface of f LINEBREAK (b) laplacian magnitude |∆f | LINEBREAK (c) weight function ρ LINEBREAK figure 2: illustration of the stability norm. panel (a) depicts an interpolating function f . panel (b) displays the absolute value of the laplacian of f , i.e., |∆f |. here the color codes the amplitude of the delta functions. panel (c) presents the weight function ρ. the stability norm is the weighted sum of line integrals of ρ, according to |∆f |. LINEBREAK in this presentation of the stability norm, ρ is not necessarily non-negative. nevertheless, all its hyper-plane integrals are non-negative, since rρ = g ≥ 0. thus, the stability norm can be interpreted as a non-negative linear combination of hyper-plane integrals of ρ along the knots of f . this is visualized in fig. 2. hence, thm. 1 combined with (13) implies that the larger the step size η, the smoother the solution becomes. LINEBREAK radon space interpretation LINEBREAK j v}, maxj{x⊤ LINEBREAK another interesting interpretation of thm. 1 can be derived in radon space. first, let us examine how the weight function g(v, b) behaves as a function of b. for every fixed v, the function g(v, ·) has a finite support, [minj{x⊤ j v}]. moreover, g(v, ·) typically has most of its mass concentrated around the center of the distribution of the projected data points {x⊤ j v}, and it decays towards the endpoints (see e.g., fig. 3). next, let us interpret how the term (r∗)−1∆f behaves. for a single hidden-layer relu network, (r∗)−1∆f is a sum of dirac deltas. specifically, as shown in (ongie et al., 2020), if f is a function of the form f (x) = (cid:80)k LINEBREAK i x − bi) + c with ∥vi∥2 = 1 for all i ∈ [k], then (see app. f.3) LINEBREAK i=1 aiσ(v⊤ LINEBREAK aiδ(vi,bi), LINEBREAK where ∆f is the (distributional) laplacian of f , and δ(v,b) denotes a dirac delta centered at (v, b) ∈ sd−1 × r. we can thus define a parameter space representation for the stability norm as (see app. f.3) LINEBREAK sθ ≜ LINEBREAK |ai| g (vi, bi) . LINEBREAK generally, this parametric representation of the stability norm satisfies ∥f ∥r,g ≤ sθ, where equality happens whenever the relu knots of the representation do not coincide (i.e., there is one dirac function for each relu unit). yet, this parametric view of the stability norm also obeys (see app. f.3) LINEBREAK 1 η hence, larger step sizes η push sθ to be smaller, and from (15) we see that |ai| will tend to be small. also, since g(v, ·) typically decays towards the boundary of its support, this pushes the neurons’ biases, bi, away from the center of the distribution. the resulting effect is that the predictor function f becomes flatter, especially near the center of the distribution. this is illustrated in figs. 1 and 4(b). LINEBREAK sθ ≤ LINEBREAK examples LINEBREAK earlier we introduced two interpretations for the stability norm ∥·∥r,g: one in primal space, which uses the weight function ρ, and one in radon space, which uses the weight function g. in this section, we compute g and ρ for two toy examples, for which (13) holds. LINEBREAK (a) two data points: g LINEBREAK (b) two data points: ρ LINEBREAK (c) gaussian data: g LINEBREAK (d) gaussian data: ρ LINEBREAK figure 3: visualization of g of thm. 1 and ρ of (13) for two toy examples. (a), (b) two data points x1 = (1, 0) and x2 = (−1, 0). (c),(d) two dimensional gaussian data, i.e., x ∼ n (0, i). LINEBREAK example 1: two data points in r2. assume the dataset contains two points: x1 = (1, 0) and x2 = (−1, 0). in this case we can analytically calculate g and ρ (see app. h.1). figure 3 depicts these functions. here, ρ has singularities at x1, x2 and at the origin. yet, despite these singularities, all line integrals of ρ are finite and thus the expression (cid:82) rd |∆f |(x) ρ(x)dx is well-defined. moreover, while ρ takes negative values, all its line integrals take positive values. example 2: isotropic distribution. suppose the data is isotropically distributed, i.e., p(x ⊤v > b) does not depend on the direction of v. thus g is independent of v, which implies that ρ = r−1g is a radial function. in app. h.2 we give an analytic expression for g for any isotropic distribution. in the special case of x ∼ n (0, i), g(v, ·) decays monotonically with b, and thus, as discussed in sec. 3.2, large step sizes will tend to increase the biases of all neurons. additionally, we show in app. h.2 that for 2d data, ρ is positive and strictly decreasing in ∥x∥, and it satisfies the asymptotics ρ(x) = o(log(∥x∥)) as ∥x∥ → 0, and ρ(x) = o(∥x∥−1) as ∥x∥ → ∞. figure 3 visualizes g and ρ for two dimensional gaussian data. LINEBREAK stability leads to depth separation LINEBREAK single hidden-layer neural networks are universal approximators, i.e., they can approximate arbitrarily well any continuous function over compact sets (pinkus, 1999). however, some of these approximations may correspond to unstable minima that are virtually unreachable by training via sgd. to understand what is the effective approximation power of neural networks, we need to identify the class of functions that have stable approximations. we have the following (see proof in app. i.1). proposition 1. let x be the interior of the convex hull of the training points, and f : x → r be any function. suppose there exists a sequence of single hidden-layer relu networks {fk} with bounded stability norm that converges to f in l1 over x. then ∥f ∥r,g is finite, and lim ∥fk∥r,g = ∥f ∥r,g. k→∞ LINEBREAK let {fk} be a convergent sequence of stable solutions with a growing number of knots, i.e., ∀fk ∈ fk : ∥fk∥r,g ≤ 1/η − 1/2 (see thm. 1). then, by the proposition above we have that the limit function f also satisfies this inequality. therefore, the effective class of functions that can be approximated arbitrarily well by single hidden-layer relu networks includes only continuous functions f that satisfy the stability condition ∥f ∥r,g ≤ 1/η − 1/2. as the step size decreases, more functions satisfy this condition, suggesting that more functions can be stably approximated by single hidden-layer relu networks. surprisingly, there exists at least one continuous function p that has ∥p∥r,g = ∞ and therefore does not satisfy the stability condition for any positive step size (see proof in app. i.2). therefore from prop. 1 and thm. 1, this function cannot be approximated arbitrarily well by single hidden-layer relu networks trained with a non-vanishing step size. proposition 2. assume the input dimension d ≥ 2, and let p(x) = σ(1 − ∥x∥1). suppose the support of p is contained in the interior of the convex hull of the training points. then ∥p∥r,g = ∞. LINEBREAK intriguingly, this function does have an implementation as a finite-width two hidden-layer network, p(x) = σ(1 − (cid:80)d i=1(σ(xi) + σ(−xi))), which is a stable solution for a fixed step size. indeed, in app. i.3 we demonstrate that for an appropriate choice of η, gd is able to converge to this implementation. thus, we have a depth separation result: the function p cannot be approximated by stable minima of one hidden-layer networks trained with a non-vanishing step size, yet with two hidden-layers, gd can converge to this function with a fixed step size. LINEBREAK shallow network approximations of smooth functions LINEBREAK in sec. 4 we showed that stable single-hidden layer relu networks are not universal approximators. in this section we give an approximation guarantee under smoothness assumptions. that is, we show that if a function is sufficiently smooth, then it can be approximated arbitrarily well using single hidden-layer networks that correspond to stable solutions of gd. (rd) denote the weighted sobolev space of all functions whose weak partial derivatives up let w d+1,1 w to order d+1 are bounded in a weighted l1-norm ∥·∥1,w with weight function w(x) := r∗[1+|b|](x). let ∥ · ∥w d+1,1 LINEBREAK (rd) denote the corresponding sobolev norm LINEBREAK w LINEBREAK w LINEBREAK (rd) = ∥f ∥1,w + LINEBREAK |β|=k LINEBREAK where β is a multi-index. for technical convenience, we restrict ourselves to odd input dimensions d only. our results use the “r-norm” ∥ · ∥r introduced by ongie et al. (2020) (see sec. 7 for details), and the stability norm ∥ · ∥r,ˆg with a different weight function ˆg defined below (see proof in app. l). (rd). then, there exists a sequence of proposition 3. assume d is odd and let f ∈ w d+1,1 single hidden-layer relu network functions {fk} such that fk ∈ fk converges to f in l1 over (cid:82) any compact subset k ⊂ rd, i.e., k |fk(x) − f (x)|dx = 0, and satisfies the bounds ∥fk∥r + ∥fk∥r,ˆg ≤ cd,ˆg∥f ∥w d+1,1 (cid:20)(cid:16) LINEBREAK (cid:17)2(cid:12) (cid:12) (cid:12) (cid:12) and cd,ˆg is a constant depending on d and ˆg but independent of f . here x is drawn uniformly at random from the dataset. LINEBREAK (rd) for all k, where LINEBREAK (cid:17) x ⊤v > b LINEBREAK ˆg(v, b) = p LINEBREAK x ⊤v > b LINEBREAK x ⊤v − b LINEBREAK lim k→∞ LINEBREAK e LINEBREAK w LINEBREAK w LINEBREAK (rd) there exists a sequence of single hidden-layer this proposition shows that for any f ∈ w d+1,1 relu network approximations {fk} for which {∥fk∥r} and {∥fk∥r,ˆg} are bounded. to prove that these functions can have stable parameterizations for gd, we need to show that if both the stability norm and r-norm are bounded (a function space property), then there exists a corresponding minimum with bounded sharpness6 in parameter space. to this end, we derive an upper bound on the minimal sharpness of a solution f among its different parameterizations in terms of the stability norm and the r-norm (see proof in app. k). lemma 2. let f ∈ fk be a solution for which the knots do not coincide with any training point. then there exists an implementation θ∗ corresponding to f such that (cid:19) (cid:113) LINEBREAK λmax LINEBREAK ∥f ∥r + inf x∈rd LINEBREAK ∥∇f (x)∥ LINEBREAK λmax LINEBREAK (cid:0)σx LINEBREAK (cid:1) LINEBREAK here x is drawn uniformly at random from the dataset, and σx is the covariance matrix of x. LINEBREAK combining prop. 3 and lemma 2 we get that any f ∈ w d+1,1 well by a sequence of stable solutions for gd with a fixed step size η. (rd). then, there exist η > 0 theorem 2. suppose the input dimension d is odd, and let f ∈ w d+1,1 and a sequence of single hidden-layer relu network functions {fk} such that fk ∈ fk converges to f in l1 over any compact subset k ⊂ rd, and every fk is stable for gd with step size η. LINEBREAK (rd) can be approximated arbitrarily LINEBREAK w LINEBREAK w LINEBREAK this theorem state that any sufficiently smooth function can be stably approximated in the limit of infinitely many neurons. we can also use lemma 2 to guarantee the stability of solutions in the finite case. since λmax ≤ 2/η is a sufficient condition for stability in gd, we have the following. theorem 3. let f ∈ fk be a solution for which the knots do not coincide with any training point. if LINEBREAK ∥f ∥r,ˆg + 2 LINEBREAK ∥f ∥r + inf x∈rd LINEBREAK ∥∇f (x)∥ LINEBREAK λmax LINEBREAK (cid:0)σx LINEBREAK (cid:1) LINEBREAK then f is a stable solution for gd with step size η. LINEBREAK theorem 3 complements thm. 1, as it gives a sufficient condition for stability in function space. LINEBREAK 6note that for gd, η < 2/λmax is a necessary and sufficient condition for linear stability. LINEBREAK (a) sharpness versus step size LINEBREAK (b) bias versus step size LINEBREAK figure 4: validating the bounds on synthetic data. we trained a two-layer relu network on a regression task with synthetic data using gd (see sec. 6). panel (a) depicts the sharpness of the minima to which gd converged, as a function of the step size η. as η increases, the minima get flatter in parameter space (yellow curve), which translates to smoother predictors in function space (purple curve). panel (b) shows the norm of the bias vector b as a function of the step size. here we see that the bias vector grows with the step size, as the predictor function gets smoother. LINEBREAK experiments LINEBREAK we now demonstrate our theoretical results. we start with a regression task on synthetic data. here, we drew n = 100 pairs (xj, yj) in r20 × r from the standard normal distribution to serve as our training set. we fit a single hidden-layer relu network with k = 40 neurons to the data using gd with various step sizes (runs were stopped when the loss dropped bellow 10−8). for each minimum θ∗ to which gd converged, we computed the loss’ sharpness, λmax(∇2l(θ∗)), and our lower bound on the sharpness, 1 + 2 ∥f ∥r,g (lemma 3 in the appendix). additionally, we numerically determined the sharpness of the flattest implementation for every solution. figure 4(a) depicts the results for this experiment. the red line marks the border of the stable region, which is 2/η. namely, (s)gd cannot stably converge to a minimum whose sharpness is above this line. the dashed yellow line shows the sharpness of the minima to which gd converged in practice. as can be seen, here gd converged at the edge of stability (the two lines coincide), a phenomenon discussed in (cohen et al., 2020). the blue curve is the sharpness of the flattest implementation of each solution (see app. a), while the the purple curve is our lower bound. we see that our bound is quite tight (blue vs. purple). furthermore, as the step size increases the minima get flatter in parameter space (yellow curve), which translates to smoother predictors in function space (purple curve). additionally, we see from fig. 4(b) that the norm of the bias vector b increases with the step size, as our theory predicts (sec. 3.2). LINEBREAK next, we present an experiment with binary classification on mnist (lecun, 1998) using sgd. in this experiment we used n = 512 samples from two mnist classes, ‘0’ and ‘1’. the classes were labeled as y = 1 and y = −1, respectively. for the validation set we used 4000 images from the remaining samples in each class. we trained a single hidden-layer relu network with k = 200 neurons using sgd with batch size b = 16, and the quadratic loss. to perform classification at inference time, we thresholded the net’s output at 0. we ran sgd until the loss dropped below 10−8 for 2000 consecutive epochs. figure 5(a) shows the same indices as in the previous experiment. here we see again that as the step size increases, the minima get flatter in parameter space (yellow curve), which translates to smoother predictors in function space (purple curve). figure 5(b) shows the classification accuracy on the validation set, where we see that the network generalizes better as the step size increases, as past work showed, e.g., (keskar et al., 2017). more experiments in app. n. LINEBREAK related work LINEBREAK dynamical stability analysis was applied to neural network training in several works. in particular, nar & sastry (2018) analyzed lyapunov stability of one hidden-layer relu networks without bias. they proved a bound on the network’s output which depends on the step size and training data and implies that the network’s output should be smaller for training samples with larger magnitude. mulayoff & michaeli (2020) characterized the flattest minima for linear nets and showed that these minima have unique properties. yet, in their setting all minima implement the same input-output LINEBREAK (a) sharpness versus step size LINEBREAK (b) val. accuracy vs. step size LINEBREAK figure 5: validating the bounds on mnist. we trained a single hidden-layer relu network for binary classification on two classes from mnist using sgd (see sec. 6). panel (a) depicts the sharpness versus the step size η. here as η increases, the minima get flatter in parameter space (yellow curve), which translates to smoother predictors in function space (purple curve). panel (b) shows the performance on the validation set. here the trained model generalizes better as the step size increases. LINEBREAK function. thus, their results only show that sgd is biased toward certain implementations of the same function, whereas our result shows that sgd is biased toward certain functions. LINEBREAK wu et al. (2018) proved a sufficient condition for dynamical stability of sgd in expectation using second moment. ma & ying (2021) extended their result by showing a necessary and sufficient condition for dynamical stability in higher moments. in addition, the authors combined this condition with the multiplicative structure of neural nets to prove an upper bound on the sobolev seminorm of the model’s input-output function at stable interpolating solutions. their upper bound extends to deep nets, yet it depends on the norm of the first layer of the network, which in general can be large. LINEBREAK mulayoff et al. (2021) characterized the stable solutions of sgd for univariate single hidden-layer relu networks with the square loss. our thm. 1 is the natural extension of (mulayoff et al., 2021, thm. 1) to the multivariate case. to prove it, we combine the proof technique of lower bounding the top eigenvalue of the hessian, used by mulayoff et al. (2021), with the radon transforms analysis used by ongie et al. (2020). combining these techniques is not a priori trivial, since radon transform was not used before for hessian analysis. also, it required several subtle steps that are not encountered in the univariate setting nor in (ongie et al., 2020) (e.g., working with the inverse of the dual radon transform to obtain the primal space representation). LINEBREAK ongie et al. (2020) studied the space of functions realizable as infinite-width single hidden-layer relu nets with bounded weights norm. their settings assumes explicit regularization, i.e., min-norm solution, whereas here we derived our results for sgd without regularization, via implicit bias. on the technical level, they introduced the “r-norm” ∥ · ∥r that is closely related to the stability norm. particularly, ∥ · ∥r = ∥ · ∥r,g, for g = 1 the constant 1 function. they proved similar results of depth separation and approximation guarantees, shown here in secs. 4-5. more related work in app. b. LINEBREAK conclusion LINEBREAK large step sizes are often used to improve generalization (li et al., 2019). this work suggests an explanation to this practice. specifically, we showed that large step sizes lead to smaller stability norm and thus can bias towards smooth predictors in shallow multivariate relu networks. we find the smoothness measure depends on the data via specific functions g or ρ, and exemplify their properties. moreover, we studied the approximation power of relu networks that correspond to stable solutions. although shallow networks are universal approximators, we proved that stable solutions of these networks are not. namely, there is a function that cannot be well-approximated by stable single hidden-layer relu networks trained with a non-vanishing step size. yet we showed that the same function can be realized as a stable two hidden-layer network, leading to a depth separation result. this result can explain the success of deep models over shallow ones. finally, we gave approximation guarantees for stable shallow relu networks. in particular, we proved that any sobolev function can be approximated arbitrarily well using gd with single hidden-layer relu networks. LINEBREAK acknowledgments LINEBREAK the research of rm was supported by the planning and budgeting committee of the israeli council for higher education, and by the andrew and erna finci viterbi graduate fellowship. go was supported by nsf crii award ccf-2153371. the research of ds was funded by the european union (erc, a-b-c-deep, 101039436). views and opinions expressed are however those of the author only and do not necessarily reflect those of the european union or the european research council executive agency (ercea). neither the european union nor the granting authority can be held responsible for them. ds also acknowledges the support of schmidt career advancement chair in ai. tm was supported by grant 2318/22 from the israel science foundation and by the ollendorff center of the viterbi faculty of electrical and computer engineering at the technion. LINEBREAK references LINEBREAK sanjeev arora, nadav cohen, and elad hazan. on the optimization of deep networks: implicit acceleration by overparameterization. in international conference on machine learning, pp. 244–253. pmlr, 2018. LINEBREAK sanjeev arora, nadav cohen, wei hu, and yuping luo. implicit regularization in deep matrix LINEBREAK factorization. advances in neural information processing systems, 32:7413–7424, 2019. LINEBREAK shahar azulay, edward moroshko, mor shpigel nacson, blake woodworth, nathan srebro, amir globerson, and daniel soudry. on the implicit bias of initialization shape: beyond infinitesimal mirror descent. international conference on machine learning, 2021. LINEBREAK david barrett and benoit dherin. implicit gradient regularization. in international conference on LINEBREAK learning representations, 2021. LINEBREAK mohamed ali belabbas. on implicit regularization: morse functions and applications to matrix LINEBREAK factorization. arxiv preprint arxiv:2001.04264, 2020. LINEBREAK emmanuel j candès. harmonic analysis of neural networks. applied and computational harmonic LINEBREAK emmanuel j candès and david l donoho. ridgelets: a key to higher-dimensional intermittency? philosophical transactions of the royal society of london. series a: mathematical, physical and engineering sciences, 357(1760):2495–2509, 1999. LINEBREAK sean m. carroll and bradley w. dickinson. construction of neural nets using the radon transform. LINEBREAK in international joint conference on neural networks, volume 1, pp. 607–611, 1989. LINEBREAK lenaic chizat, edouard oyallon, and francis bach. on lazy training in differentiable programming. LINEBREAK advances in neural information processing systems, 32, 2019. LINEBREAK jeremy cohen, simran kaur, yuanzhi li, j zico kolter, and ameet talwalkar. gradient descent on neural networks typically occurs at the edge of stability. in international conference on learning representations, 2020. LINEBREAK laurent dinh, razvan pascanu, samy bengio, and yoshua bengio. sharp minima can generalize for deep nets. in international conference on machine learning, pp. 1019–1028. pmlr, 2017. LINEBREAK armin eftekhari and konstantinos zygalakis. implicit regularization in matrix sensing: initialization LINEBREAK charles l epstein. introduction to the mathematics of medical imaging. society for industrial and LINEBREAK applied mathematics (siam), 2007. LINEBREAK gauthier gidel, francis bach, and simon lacoste-julien. implicit regularization of discrete gradient dynamics in linear neural networks. advances in neural information processing systems, 32, 2019. LINEBREAK justin gilmer, behrooz ghorbani, ankush garg, sneha kudugunta, behnam neyshabur, david cardoze, george edward dahl, zachary nado, and orhan firat. a loss curvature perspective on training instabilities of deep learning models. in international conference on learning representations, 2022. LINEBREAK suriya gunasekar, blake e woodworth, srinadh bhojanapalli, behnam neyshabur, and nati srebro. implicit regularization in matrix factorization. advances in neural information processing systems, 30, 2017. LINEBREAK suriya gunasekar, jason lee, daniel soudry, and nathan srebro. characterizing implicit bias in terms of optimization geometry. in international conference on machine learning, pp. 1832–1841. pmlr, 2018a. LINEBREAK suriya gunasekar, jason d lee, daniel soudry, and nati srebro. implicit bias of gradient descent on linear convolutional networks. advances in neural information processing systems, 31, 2018b. LINEBREAK sigurdur helgason. the radon transform. in the radon transform. springer, 1999. LINEBREAK yoshifusa ito. representation of functions by superpositions of a step or sigmoid function and their LINEBREAK applications to neural network theory. neural networks, 4(3):385–394, 1991. LINEBREAK arthur jacot, franck gabriel, and clément hongler. neural tangent kernel: convergence and generalization in neural networks. advances in neural information processing systems, 31, 2018. LINEBREAK ziwei ji and matus telgarsky. gradient descent aligns the layers of deep linear networks. LINEBREAK in LINEBREAK international conference on learning representations, 2019a. LINEBREAK ziwei ji and matus telgarsky. the implicit bias of gradient descent on nonseparable data. LINEBREAK in LINEBREAK conference on learning theory, pp. 1772–1798. pmlr, 2019b. LINEBREAK ziwei ji and matus telgarsky. characterizing the implicit bias via a primal-dual analysis. LINEBREAK in LINEBREAK algorithmic learning theory, pp. 772–804. pmlr, 2021. LINEBREAK ziwei ji, miroslav dudík, robert e schapire, and matus telgarsky. gradient descent follows the regularization path for general losses. in conference on learning theory, pp. 2109–2136. pmlr, 2020. LINEBREAK hui jin and guido montúfar. implicit bias of gradient descent for mean squared error regression with LINEBREAK wide neural networks. arxiv preprint arxiv:2006.07356, 2020. LINEBREAK nitish shirish keskar, dheevatsa mudigere, jorge nocedal, mikhail smelyanskiy, and ping tak peter tang. on large-batch training for deep learning: generalization gap and sharp minima. in international conference on learning representations, 2017. LINEBREAK yann lecun. the mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. LINEBREAK yuanzhi li, tengyu ma, and hongyang zhang. algorithmic regularization in over-parameterized matrix sensing and neural networks with quadratic activations. in conference on learning theory, pp. 2–47. pmlr, 2018. LINEBREAK yuanzhi li, colin wei, and tengyu ma. towards explaining the regularization effect of initial large learning rate in training neural networks. advances in neural information processing systems, 32, 2019. LINEBREAK donald ludwig. the radon transform on euclidean space. communications on pure and applied LINEBREAK kaifeng lyu and jian li. gradient descent maximizes the margin of homogeneous neural networks. LINEBREAK international conference on learning representations, 2020. LINEBREAK chao ma and lexing ying. on linear stability of sgd and input-smoothness of neural networks. LINEBREAK advances in neural information processing systems, 34, 2021. LINEBREAK cong ma, kaizheng wang, yuejie chi, and yuxin chen. LINEBREAK implicit regularization in nonconvex statistical estimation: gradient descent converges linearly for phase retrieval and matrix completion. in international conference on machine learning, pp. 3345–3354. pmlr, 2018a. LINEBREAK siyuan ma, raef bassily, and mikhail belkin. the power of interpolation: understanding the effectiveness of sgd in modern over-parametrized learning. in international conference on machine learning, pp. 3325–3334. pmlr, 2018b. LINEBREAK paul malliavin, hélène airault, leslie kay, and gérard letac. integration and probability, volume LINEBREAK 157. springer science & business media, 1995. LINEBREAK rotem mulayoff and tomer michaeli. unique properties of flat minima in deep networks. LINEBREAK in LINEBREAK international conference on machine learning, pp. 7108–7118. pmlr, 2020. LINEBREAK rotem mulayoff, tomer michaeli, and daniel soudry. the implicit bias of minima stability: a view from function space. advances in neural information processing systems, 34:17749–17761, 2021. LINEBREAK mor shpigel nacson, suriya gunasekar, jason lee, nathan srebro, and daniel soudry. lexicographic and depth-sensitive margins in homogeneous and non-homogeneous deep models. in international conference on machine learning, pp. 4683–4692. pmlr, 2019a. LINEBREAK mor shpigel nacson, jason lee, suriya gunasekar, pedro henrique pamplona savarese, nathan srebro, and daniel soudry. convergence of gradient descent on separable data. in the 22nd international conference on artificial intelligence and statistics, pp. 3420–3428. pmlr, 2019b. LINEBREAK mor shpigel nacson, nathan srebro, and daniel soudry. stochastic gradient descent on separable data: exact convergence with a fixed learning rate. in the 22nd international conference on artificial intelligence and statistics, pp. 3051–3059. pmlr, 2019c. LINEBREAK kamil nar and shankar sastry. step size matters in deep learning. advances in neural information LINEBREAK processing systems, 31, 2018. LINEBREAK greg ongie, rebecca willett, daniel soudry, and nathan srebro. a function space view of bounded norm infinite width relu nets: the multivariate case. in international conference on learning representations, 2020. LINEBREAK rahul parhi and robert d nowak. banach space representer theorems for neural networks and ridge LINEBREAK splines. journal of machine learning research, 22(43):1–40, 2021. LINEBREAK allan pinkus. approximation theory of the mlp model in neural networks. acta numerica, 8: LINEBREAK noam razin and nadav cohen. implicit regularization in deep learning may not be explainable by LINEBREAK norms. advances in neural information processing systems, 33:21174–21187, 2020. LINEBREAK michael shub. global stability of dynamical systems. springer science & business media, 2013. LINEBREAK samuel l smith, pieter-jan kindermans, chris ying, and quoc v le. don’t decay the learning rate, LINEBREAK increase the batch size. in international conference on learning representations, 2018. LINEBREAK samuel l smith, benoit dherin, david barrett, and soham de. on the origin of implicit regularization in stochastic gradient descent. in international conference on learning representations, 2021. LINEBREAK donald c solmon. asymptotic formulas for the dual radon transform and applications. mathematische LINEBREAK sho sonoda and noboru murata. neural network with unbounded activation functions is universal LINEBREAK approximator. applied and computational harmonic analysis, 43(2):233–268, 2017. LINEBREAK daniel soudry, elad hoffer, mor shpigel nacson, suriya gunasekar, and nathan srebro. the implicit bias of gradient descent on separable data. the journal of machine learning research, 19(1): 2822–2878, 2018. LINEBREAK gal vardi and ohad shamir. implicit regularization in relu networks with the square loss. in LINEBREAK conference on learning theory, pp. 4224–4258. pmlr, 2021. LINEBREAK mathukumalli vidyasagar. nonlinear systems analysis. society for industrial and applied mathemat LINEBREAK blake woodworth, suriya gunasekar, jason d lee, edward moroshko, pedro savarese, itay golan, daniel soudry, and nathan srebro. kernel and rich regimes in overparametrized models. in conference on learning theory, pp. 3635–3673. pmlr, 2020. LINEBREAK lei wu, chao ma, et al. how sgd selects the global minima in over-parameterized learning: a dynamical stability perspective. advances in neural information processing systems, 31: 8279–8288, 2018. LINEBREAK chiyuan zhang, samy bengio, moritz hardt, benjamin recht, and oriol vinyals. understanding deep learning requires rethinking generalization. in international conference on learning representations, 2017. LINEBREAK a additional discussion LINEBREAK the independence of lemma 1 and theorem 1 on the batch size b. theorem 1 relies on lemma 1 (see app. e), which was proved in (mulayoff et al., 2021). this lemma states that if a minimum θ∗ is linearly stable for sgd with batch-size b, then the hessian h of the loss at θ∗ must satisfy λmax(h) ≤ 2/η, where η is the step-size. importantly, this necessary condition holds true for any batch size b, and thus theorem 1 is independent of b. we note, however, that the precise stability threshold of sgd might depend on b, yet the important points to notice are: (1) here all we need is a necessary condition, and lemma 1 provides a simple bound that holds for any b. (2) empirical evidence shows that there is not much room for improvement upon this batch-size-independent bound in real-world settings. specifically, for practical batch sizes, the gap between 2/η and the stability threshold of sgd is often very small (see fig. 5 in our paper and figures 2-3 in (gilmer et al., 2022)). LINEBREAK the proof of lemma 1 is actually quite short and easy to follow (see (mulayoff et al., 2021, app. ii)). the idea is that if θ∗ is an ε linearly stable minimum, then by definition we have LINEBREAK lim sup t→∞ LINEBREAK e[∥θt − θ∗∥] ≤ ε, LINEBREAK where {θt}∞ inequality, for all t > 0 we get ∥e[θt] − θ∗∥ ≤ e[∥θt − θ∗∥]. thus, LINEBREAK t=0 are governed by the linearized stochastic dynamics given in eq. (5). using jensen’s LINEBREAK lim sup t→∞ LINEBREAK ∥e[θt] − θ∗∥ ≤ lim sup t→∞ LINEBREAK e[∥θt − θ∗∥] ≤ ε. LINEBREAK note that under the linearized dynamics, {e[θt]}∞ t=0 are precisely gd steps. therefore, we have that if θ∗ is linearly stable for sgd, then it must be linearly stable also for gd. now, a well-known fact is that θ∗ is linearly stable for gd if and only if λmax(h) ≤ 2/η . this is how we get the necessary condition in lemma 1, which does not depend on the batch size. LINEBREAK the independence of lemma 1 and theorem 1 on ε. lemma 1 states that a necessary condition (cid:0)∇2l(θ∗)(cid:1) ≤ 2/η. that is, the for a twice differentiable minimum to be ε linearly stable is λmax condition does not depend on ε which might seem not intuitive. however, the reason lemma 1 does not depend on ε is because it refers to linear stability, opposed to non-linear dynamical stability. in linear stability for twice-differentiable minima, all we care about is the second-order taylor approximation of the loss at the minimum. in see previous paragraph we explained that lemma 1 gives a necessary condition through reduction to gd. now, when applying gd on a quadratic loss (with a psd matrix), for any ε > 0 only one of two things can happen: LINEBREAK 1. either ∃θ0 ∈ bε(θ∗) : lim sup t→∞ LINEBREAK lim sup t→∞ LINEBREAK ∥θt − θ∗∥ = +∞ (unstable for any ε > 0), LINEBREAK ∥θt − θ∗∥ ≤ ∥θ0 − θ∗∥ ≤ ε (stable for any ε > 0). LINEBREAK in any outcome, the result does not depend on ε, and therefore ε does not appear in the result of lemma 1. note that for non-differentiable minima, ε does affect linear stability in gd, however lemma 1 only refers to twice-differentiable minima. LINEBREAK 0) and if it is not satisfied, then sgd repels from the minimum (lim sup LINEBREAK theorem 1 is based on lemma 1, and therefore does not depend on ε. yet, beyond this technical reasoning, it is important to note that here we consider interpolating solutions. for those solutions, the global minimum of the loss is also a global minimum w.r.t. each data sample (xj, yj) separately. therefore, despite the stochasticity of sgd, every step points towards a global minimum. this implies e[∥θt −θ∗∥] = that if the stability criterion is satisfied, then sgd converges to the minimum (lim sup e[∥θt − θ∗∥] = ∞ for the linearized dynamics). this is also seen in simulations where models are overfit to training data using sgd, e.g., (ma et al., 2018b). particularly, in our simulations the loss always converged to 0 when it converged (we arbitrarily decided to stop each run when the loss dropped below 10−8). in the general case of non-interpolating solutions, the expected final distance to the minimum in mini-batch sgd e[∥θt − θ∗∥]) can be a strictly positive finite number, and therefore in those cases ε does (lim sup t→∞ play a role. LINEBREAK t→∞
| 13
|
[
371.22,
130.0300828,
390.11492164,
137.0038828
] |
qFVVBzXxR2V.pdf
| 2,023
| 2
|
LINEBREAK language models are greedy reasoners: a systematic formal analysis of chain-ofthought LINEBREAK abulhair saparov & he he center for data science, new york university, new york, ny 10011, usa {as17582,hhe}@nyu.edu LINEBREAK abstract LINEBREAK large language models (llms) have shown remarkable reasoning capabilities given chain-of-thought prompts (examples with intermediate reasoning steps). existing benchmarks measure reasoning ability indirectly, by evaluating accuracy on downstream tasks such as mathematical reasoning. however, it is unclear how these models obtain the answers and whether they rely on simple heuristics rather than the generated chain-of-thought. to enable systematic exploration of the reasoning ability of llms, we present a new synthetic question-answering dataset called prontoqa, where each example is generated from a synthetic world model represented in first-order logic. this allows us to parse the generated chain-ofthought into symbolic proofs for formal analysis. our analysis on instructgpt and gpt-3 shows that llms are quite capable of making correct individual deduction steps, and so are generally capable of reasoning, even in fictional contexts. however, they have difficulty with proof planning: when multiple valid deduction steps are available, they are not able to systematically explore the different options. LINEBREAK introduction LINEBREAK the ability to reason—drawing new conclusions from provided facts—is a hallmark of human intelligence. recently, chain-of-thought (cot) prompting has enabled large language models (llms) to perform logical reasoning tasks with impressive accuracy (wei et al., 2022; chowdhery et al., 2022; lewkowycz et al., 2022). in cot prompting, each example consists of a question (e.g., “ 6 3 − 1?”), a short description of the reasoning required to answer the question called the “chain-of-thought” (e.g., “ 6 3 is 2. 2 − 1 is 1.”), and a label (e.g., “1”). when prompted with a few cot examples, the elicited reasoning allows llms to predict the label with much higher accuracy than standard question-answer prompting. however, it is unclear to what extent these models can reason due to several confounding factors. first, existing studies primarily rely on question-answering (qa) tasks from real-world settings such as math word problems (cobbe et al., 2021; han et al., 2022; weston et al., 2016). it is likely that llms have already acquired the knowledge through pretraining and simply retrieve the answer rather than reason over it. second, the reasoning task may contain spurious correlations that allow the model to obtain the correct answer through shortcuts (zhang et al., 2022b). in this work, we systematically investigate the reasoning capability of llms by directly evaluating their predicted chains-of-thought (the interpretable proof steps), rather than the predicted label. to enable easy analysis of the cot, we construct a new synthetic qa dataset called prontoqa, for proof and ontology-generated question-answering. inspired by the proofwriter dataset (tafjord et al., 2021), each example in prontoqa is generated from an ontology and has a unique proof (see figure 1 for an example). we convert the proofs into syntactically simple sentences using a grammar such that the inverse process is relatively easy: from the predicted cot, we semantically parse each sentence into a formal language and reconstruct the underlying proof steps. we then directly analyze the model’s reasoning by inspecting each step in the reconstructed proof and comparing them against the gold proof.1 we emphasize here that while the dataset is an important contribution of this paper, the main contribution is the analysis that is facilitated by the dataset. LINEBREAK 1all LINEBREAK analysis LINEBREAK code, LINEBREAK data, LINEBREAK data generation scripts, LINEBREAK and model outputs LINEBREAK are LINEBREAK available LINEBREAK at LINEBREAK github.com/asaparov/prontoqa. LINEBREAK q: each cat is a carnivore. every carnivore is not herbivorous. carnivores are mammals. all mammals are warm-blooded. mammals are vertebrates. every vertebrate is an animal. animals are multicellular. fae is a cat. true or false: fae is not herbivorous. a: fae is a cat. cats are carnivores. fae is a carnivore. every carnivore is not herbivorous. fae is not herbivorous. true LINEBREAK context query chain-of-thought label LINEBREAK figure 1: a question-answering example from prontoqa, with each component highlighted and labeled. LINEBREAK step 1: generate ontology LINEBREAK animal multicellular LINEBREAK vertebrate LINEBREAK mammal warm_blooded LINEBREAK carnivore ¬herbivorous LINEBREAK cat LINEBREAK step 2: generate proof from ontology LINEBREAK ax LINEBREAK cat(fae) LINEBREAK ∀x(cat(x) → carnivore(x)) LINEBREAK carnivore(fae) LINEBREAK ax LINEBREAK hop LINEBREAK ∀x(carnivore(x) → ¬herbivorous(x)) LINEBREAK ¬herbivorous(fae) LINEBREAK step 3: translate ontology to natural language context LINEBREAK “q: each cat is a carnivore. every carnivore is not herbivorous. carnivores are mammals. all mammals are warm-blooded. mammals are vertebrates. every vertebrate is an animal. animals are multicellular.” LINEBREAK step 4: translate proof into query, chain-of-thought, and label LINEBREAK “fae is a cat. true or false: fae is not herbivorous. a: fae is a cat. cats are carnivores. fae is a carnivore. every carnivore is not herbivorous. fae is not herbivorous. true” LINEBREAK ax LINEBREAK hop LINEBREAK figure 2: schematic of the generative process for each example in prontoqa. step 1: we generate an ontology from a prior distribution, shown here as a tree. each node denotes a concept (e.g., mammal), each with an optional property (e.g., warm_blooded), and each blue edge denotes a “subtype of” relation. step 2: generate proof from the ontology. each horizontal black line indicates a proof step, with its premises written above the line and the conclusion written below. step 3: convert the ontology into a natural language context. step 4: convert the proof into a natural language query, chain-of-thought, and answer label. there is a one-to-one correspondence between the conclusion of each proof step and the sentences in the chain-of-thought. LINEBREAK we systematically evaluate instructgpt2 (ouyang et al., 2022) and the original gpt-3 (brown et al., 2020) on prontoqa by controlling a number of variables that characterize the complexity of the reasoning task, such as the ontology type and the number of proof steps required. our analysis shows that these models are quite good at producing valid individual proof steps, even on fictional and counterfactual ontologies. however, llms have difficulty with proof planning: when the models encounter a point in the proof where multiple valid proof steps are available, they sometimes select the wrong step, and this often leads to an incomplete proof and subsequently an incorrect answer. interestingly, the models are much less likely to be misled with a true ontology, suggesting that the world knowledge acquired during pretraining plays an important role in llm reasoning. we also find that our results generalize to more sophisticated/informative prompts, such as self-consistency prompting (wang et al., 2022), and prompts with example traces of depth-first proof search instead of cot. LINEBREAK related work LINEBREAK our proposed dataset is most closely related to proofwriter (tafjord et al., 2021) and folio (han et al., 2022) which are qa datasets designed to test reasoning ability. proofwriter provides multi-hop proofs for each example. however, there are a number of key properties that led us to develop our own dataset (see table 1 for a summary). folio does not provide easily-parseable proofs/cots in their examples, and evaluation is done by inspecting the predicted labels, which may not necessarily be a good measure of reasoning ability. in our analysis, we focus on more specific variables that may affect the reasoning of the model, such as: (1) is the model’s reasoning dependent on whether the example is consistent with pretraining (“true”), inconsistent (“false”), or neither (“fictional”)? (2) is the model’s reasoning sensitive to whether the predicates in the examples are unary or binary? (3) is the model’s reasoning dependent on the rules of deduction in the examples? these variables are not controllable in existing datasets. further, in some datasets, the code to generate examples is not available. LINEBREAK 2instructgpt is the model resulting from fine-tuning gpt-3 via reinforcement learning from human feedback. throughout the paper, “instructgpt” refers to the model named text-davinci-002. but note that in our experiments, we also evaluate text-ada-001, text-babbage-001, text-curie-001, davinci, and text-davinci-001. LINEBREAK dataset LINEBREAK provides easily semanticallyparseable proofs LINEBREAK controls for true vs false vs fictional contexts LINEBREAK controls for unary vs binary predicates LINEBREAK controls for specific rules of deduction LINEBREAK tests reasoning beyond the domain of math word problems LINEBREAK generation code available LINEBREAK gsm8k cobbe et al. (2021) proofwriter tafjord et al. (2021) folio han et al. (2022) simplelogic zhang et al. (2022b) LINEBREAK prontoqa (proposed dataset) LINEBREAK humanannotated LINEBREAK humanannotated LINEBREAK table 1: comparison of existing datasets for the formal analysis of reasoning ability. LINEBREAK there are efforts to tweak or extend cot prompting to elicit more sophisticated reasoning behavior (creswell et al., 2022; wang et al., 2022; creswell & shanahan, 2022; anil et al., 2022; dohan et al., 2022), and they have shown that these prompting extensions to cot can improve the elicited reasoning behavior of llms, even with smaller models. rather than presenting a new prompting approach, the goal of this work is to measure the reasoning ability elicited by cot. there are other datasets that have been designed or used to measure the reasoning capabilities of transformer-based models and llms (han et al., 2022; weston et al., 2016). they show that llms are able to answer questions that require reasoning in the few-shot setting with reasonable accuracy. similar to our approach, betz (2020) converts logical forms into fairly simple natural language using templates. however, the examples in these datasets are consistent with the real-world, and so they may confound measuring reasoning ability with retrieval ability. valmeekam et al. (2022) found that llms had difficulty with a fairly simple planning task, but it is not clear whether this was due to an inability to reason or other abilities instrumental in planning, such as world modeling, keeping track of state changes, and reasoning about events that occur sequentially in time. this is despite their controlling for other variables involved in planning, such as plan generation, robustness to goal formulation, among others. they experimented with examples in a “blocksworld” environment, a significant portion of which the model can acquire from pretraining. our work aims to address this gap. as in our approach, dasgupta et al. (2022) specifically looked at whether llms can reason in fictional or counterfactual settings and found that reasoning ability is indeed negatively affected in these settings. however they did not analyze individual steps of reasoning to better understand the cause of the errors. since we are able to formally evaluate the llm’s predicted cot step-by-step, we are able to perform a more fine-grained analysis of their reasoning ability. zhang et al. (2022b) showed that bert is not able to learn to reason robustly, but they did not use cot prompting and it is not obvious if their results generalize to llms, which we evaluate. there are two broad research approaches for reasoning in nlp: (1) reasoning over a formal symbolic language, possibly with neuro-symbolic methods and/or semantic parsing (saparov & mitchell, 2022; zhang et al., 2022a; kapanipathi et al., 2021; dong et al., 2019; rocktäschel & riedel, 2017), or (2) reasoning directly over natural language (chen et al., 2021; bostrom et al., 2022; 2021; welleck et al., 2021; bhagavatula et al., 2020; angeli & manning, 2014; maccartney & manning, 2009). while prontoqa is generated from symbolic ontologies, the examples themselves are in natural language, and so provides value to both research directions. recent work has examined in-context learning and found that performance on certain tasks is sensitive to the prompt (razeghi et al., 2022; lu et al., 2022). however, they focused on sentiment classification and simple arithmetic tasks, and it is not clear if their results generalize to reasoning. the llm could feasibly use retrieval, rather than reasoning, to perform those tasks. our experiments on the fictional ontology show that the model is able to reason even when there is nothing to retrieve from. LINEBREAK prontoqa: a synthetic dataset for logical reasoning LINEBREAK we create a new dataset, called prontoqa for proof and ontology-generated question-answering, where each question is generated from a symbolic ontology and proof to facilitate formal analysis of the predicted cot. to focus the scope of our exploration, and to limit the complexity of the generated questions to those within reach of current llms, we only consider questions that are answerable using repeated applications of the modus ponens deduction rule. more formally, modus ponens is a simple deduction rule where given the premises ∀x(f (x) → g(x)) and f (a) , we conclude g(a) (e.g., given “all cats are carnivores” and “fae is a cat,” we conclude “fae is a carnivore;” see figure 6 LINEBREAK in the appendix).3 this rule can be easily chained together to construct proofs with controllable size. we generate cot examples consisting of: the context, query, cot, and label, where the context is a short paragraph containing information relevant to answer the query (see figure 1 for an example). each example is translated from a proof and ontology such that the inverse process is simple: the sentences in an example can be easily and uniquely parsed into symbolic logical forms amenable to formal analysis. more specifically, as shown in figure 2, we: (1) first generate an ontology from a set of concepts, (2) generate a proof by traversing the ontology, (3) translate the ontology into the natural language context, and (4) translate the proof into the query, cot, and label by mapping logical forms to natural language sentences. we describe each step in further detail below. ontology generation. the first step is to generate a small hierarchical ontology. the ontology is a set of concepts (e.g., mammal, cat, carnivore, etc) and subtype relations between them (e.g., ∀x(cat(x) → carnivore(x))). the ontology also describes properties of concepts (e.g., ∀x(mammal(x) → ¬cold_blooded(x))). to generate questions that are not overly complex, we restrict the ontologies to be linear (i.e., in the tree, every node has exactly 0 or 1 child nodes). since ontologies are randomly generated, they vary in size from as few as 3 concepts to as many as 10. proof generation. we generate proofs from the ontology by choosing a starting node uniformly at random, and generating the initial axiom indicating that an entity has a specific type (e.g., cat(fae)). then, we walk up the tree, with each step corresponding to an application of a deduction rule (i.e., a proof step). each proof step consists of zero or more premises and one conclusion. we stop when we reach a node (e.g., carnivore(fae)), or a node property (e.g., ¬herbivorous(fae)), such that the number of generated proof steps matches the target number of steps. translation to natural language example. given a generated ontology and proof, we now translate it into a natural language cot example consisting of the question (context and query), cot, and label. we describe how each component is generated below: we use a simple grammar to convert the formal statements of the ontology into the natural language utterances that make up the context. every edge in the ontology is converted into sentences such as “all cats are carnivores” or “every cat is a carnivore.” properties of nodes are also converted into sentences of the form “all mammals are not cold-blooded,” etc. the query is generated by using the same grammar to convert the initial axiom in the proof into a natural language sentence (e.g., “fae is a cat”). we then determine with probability 0.5 whether to ask if the conclusion of the proof is true or if its negation is false, and convert it into a natural language “true or false” query (e.g., “true or false: fae is not herbivorous.”) and label (e.g., “true”). we convert the ordered sequence of proof steps into the cot by translating the conclusion of each proof step into a cot sentence. avoiding shortcuts. order to remove shortcuts that would allow the model to “guess” the answer without reasoning. a unique feature of prontoqa is that it is easily programmable, with a handful of tunable knobs which we use to generate examples with varying degrees of complexity and study different aspects of reasoning in llms. these variables are described in greater detail in section 5.1. LINEBREAK in section a.2 in the appendix, we describe how we add distractor sentences in LINEBREAK formal analysis of predicted proofs LINEBREAK instead of measuring the accuracy of the predicted answers (i.e., “true” or “false”), we would like to directly evaluate the predicted cot to check if the model derives the right answer for the right reason. we endeavor to analyze whether the model is able to apply deduction rules correctly at each proof step (i.e., local correctness), but also whether the model can plan ahead and work toward proving the answer for the query (i.e., global correctness). to measure the local correctness of a given proof step, we compute whether the step follows from one or more applications of deduction rules, and whether it requires additional rules beyond those of the gold proofs. to measure the global correctness, we wish to identify proof steps that deviate from the gold proof. LINEBREAK to achieve this, we parse each sentence of the predicted cot into logical form via recursive-descent parsing using the simple grammar from the generative process. we then compute whether that logical form is provable from previous logical forms via one or more applications of deduction rules. this logical form corresponds to the conclusion of a proof step. we then evaluate the correctness of each proof step by categorizing it according to three dimensions: LINEBREAK 3in natural deduction, this rule is actually a composition of two steps: given ∀x(f (x) → g(x)), use universal LINEBREAK elimination to conclude f (a) → g(a), and given f (a), use implication elimination to conclude g(a). LINEBREAK step type LINEBREAK example (the conclusion of each step is highlighted green) LINEBREAK strictly-valid atomic correct step, LINEBREAK or canonical step LINEBREAK “fae is a cat. cats are carnivores. fae is a carnivore. every carnivore is not herbivorous. fae is not herbivorous. true” LINEBREAK (this is the gold cot for this example) LINEBREAK strictly-valid atomic misleading step LINEBREAK “fae is a cat. cats are carnivores. fae is a carnivore. every carnivore is a mammal. fae is a mammal...” LINEBREAK strictly-valid non-atomic correct step LINEBREAK “fae is a cat. fae is a carnivore. every carnivore is not herbivorous. fae is not herbivorous. true” LINEBREAK strictly-valid non-atomic misleading step LINEBREAK “fae is a cat. cats are carnivores. fae is a carnivore. fae is a mammal. every mammal is a vertebrate...” LINEBREAK broadly-valid correct step LINEBREAK “fae is a cat. every cat is not herbivorous. fae is not herbivorous...” LINEBREAK broadly-valid misleading step LINEBREAK “fae is a cat. every cat is a mammal. fae is a mammal...” LINEBREAK invalid step LINEBREAK “fae is a cat. cats are carnivores. fae is a carnivore. every carnivore is a cat. fae is a cat...” LINEBREAK table 2: the types of proof steps (and examples thereof) into which we categorize each step in the predicted chain-of-thought from llms. compare the given chain-of-thought examples with the gold example provided in the first row. LINEBREAK 1. validity: is the current proof step provable from previous steps? if it is provable using only the deduction rules that appear in the gold proofs, we say the step is strictly-valid. if it is provable with a more powerful proof calculus, like natural deduction, we say the step is broadly-valid. otherwise, we say the step is invalid. for example, given the premises, “cats are carnivores” and “carnivores are mammals,” the step with conclusion “cats are mammals” is broadly-valid since an additional deduction rule is required to prove it: given ∀x(f (x) → g(x)) and ∀x(g(x) → h(x)), conclude ∀x(f (x) → h(x)). notice that this is distinct from a strictly-valid non-atomic step since this conclusion is not provable via repeated applications of modus ponens.we note that this the only additional rule that we check, as we did not encounter any instances of other broadly-valid rules. LINEBREAK 2. atomicity: is the current proof step provable from previous steps with exactly one application of a deduction rule? if so, we say the proof step is atomic. otherwise, it is non-atomic. note that since all broadly-valid steps are non-atomic, this distinction is only useful for strictly-valid steps. for example, given the premises, “fae is a cat,” “cats are carnivores,” and “carnivores are mammals,” the step with conclusion “fae is a mammal” is non-atomic since the step “fae is a carnivore” was skipped. LINEBREAK 3. utility: if the current proof step’s premises are part of the gold proof, but its conclusion is not, LINEBREAK then we say the proof step is misleading. otherwise, it is correct. for example, given the premises “fae is a carnivore,” “all carnivores are not herbivorous,” and “carnivores are mammals,” and the goal is to prove “fae is not herbivorous,” the step “fae is a mammal” is misleading since although the step is strictly-valid, it does not help to prove the goal. the types of proof steps are listed in table 2 along with examples. unparseable proof steps are marked as incorrect. for brevity, we refer to strictly-valid atomic correct steps as canonical steps. psuedocode of the procedure to evaluate proofs is given in algorithm 1 in the appendix. metrics. given the above categorization of proof steps, a proof is defined to be correct if and only if there exists a path of proof steps from the premises to the conclusion (note that under this definition, it is possible for a correct proof to contain invalid proof steps). we could require that all proof steps in the path be canonical. but it is not obvious that this metric, which we call strict proof accuracy, would accurately measure the reasoning ability of the model. as such, we also consider more relaxed metrics: (a) we allow proof steps in the path to be strictly-valid non-atomic correct, which we call “skip” proof accuracy, (b) we allow proof steps to be broadly-valid, which we call broad proof accuracy, or (c) we allow proof steps to be strictly- or broadly-valid, which we call valid proof accuracy. LINEBREAK results LINEBREAK experimental setup LINEBREAK in each experiment, we generate qa examples, perform cot prompting on the llms, and analyze the predicted cots. we run the experiments on instructgpt and the original gpt-3 (openai LINEBREAK figure 3: scatter plots of label accuracy vs proof accuracy of all gpt-3 experiments in this paper. the black line indicates perfect agreement between label accuracy and proof accuracy. we emphasize that “proof accuracy” indicates the fraction of proofs (not proof steps) that are considered correct according to our metrics. label accuracy is not well-correlated with strict or broad proof accuracy, and is better correlated with “skip” and valid proof accuracy, suggesting that label accuracy is a good measure of reasoning ability. LINEBREAK models text-ada-001, text-babbage-001, text-curie-001, davinci, text-davinci-001, text-davinci-002), with greedy decoding (ouyang et al., 2022; brown et al., 2020). we use 8-shot in-context learning, so each input to the llm consists of 8 fully-labeled questions followed by a single test question with missing cot and label. the model’s task is to predict the cot and label for the test question. note that all examples across all inputs are independently and identically generated from prontoqa. there are a number of variables that we control when generating examples in prontoqa: (1) the number of hops, (2) the ordering in which the sentences are generated from the ontology, and (3) the type of the ontology. the number of hops directly controls the difficulty of the generated example, and we experiment with 1, 3, and 5 hops. we control the ontology traversal direction: we either traverse the tree top-down (i.e., preorder) or bottom-up (i.e., postorder), generating a sentence for each traversed edge/node. the ordering also affects the difficulty of the generated example: if the sentences are generated bottom-up, they will follow the same order as the steps in the gold proof. on the other hand, if they are generated top-down, the order is reversed, and the task may be more difficult. to avoid any confounding effects from knowledge acquired during pretraining, prontoqa generates examples with fictional concept names (e.g., “wumpus” instead of “cat,” etc). but we are also interested in measuring this confounding effect, and so in addition to fictional ontologies, we also generate “true” and “false” ontologies. true ontologies use real concept names and are consistent with the real-world (we randomly sample from a list of three hand-coded real ontologies). false ontologies use real concept names but the trees are generated using the random process described in section 3, and so it is very likely to generate a false statement, such as “all mammals are cats.” for each combination of variables, we run the model on 400 examples generated from the testbed, for a total of 48 experiments. we compute 95% confidence intervals for each experiment, as the number of correct proofs is distributed as binomial(400, p) with p being the model’s accuracy (wilson, 1927). LINEBREAK do correct answers imply correct reasoning? LINEBREAK label accuracy may not necessarily measure whether the model is performing reasoning correctly, since the model may find ways to guess the label via heuristics. to gauge whether label accuracy is a good metric and which proof accuracy metric is best to measure reasoning ability, we investigate how label accuracy is related to the various proof accuracy metrics. we plot proof accuracy vs label accuracy (i.e., simply checking whether the predicted label “true” or “false” is correct) of every experiment that we conducted in figure 3. each point in the scatter plot corresponds to one of our 48 experiments described above. observe that the label accuracy is poorly correlated with strict proof accuracy, and that strict proof accuracy may underestimate the model’s reasoning ability. rather, the most permissive accuracy metric has the highest correlation with label accuracy, suggesting that label accuracy is appropriate to measure reasoning accuracy. it also suggests that the most permissive proof accuracy metric is most appropriate for measuring the reasoning ability of the model. LINEBREAK proof analysis results
| 5
|
[
108.249,
99.2340784,
245.0999513,
109.1966784
] |
3PN4iyXBeF.pdf
| 2,022
| 2
|
LINEBREAK amortized implicit differentiation for stochastic bilevel optimization LINEBREAK michael arbel & julien mairal univ. grenoble alpes, inria, cnrs, grenoble inp, ljk, 38000 grenoble, france. LINEBREAK abstract LINEBREAK we study a class of algorithms for solving bilevel optimization problems in both stochastic and deterministic settings when the inner-level objective is strongly convex. specifically, we consider algorithms based on inexact implicit differentiation and we exploit a warm-start strategy to amortize the estimation of the exact gradient. we then introduce a unified theoretical framework inspired by the study of singularly perturbed systems (habets, 1974) to analyze such amortized algorithms. by using this framework, our analysis shows these algorithms to match the computational complexity of oracle methods that have access to an unbiased estimate of the gradient, thus outperforming many existing results for bilevel optimization. we illustrate these findings on synthetic experiments and demonstrate the efficiency of these algorithms on hyper-parameter optimization experiments involving several thousands of variables. LINEBREAK introduction LINEBREAK bilevel optimization refers to a class of algorithms for solving problems with a hierarchical structure involving two levels: an inner and an outer level. the inner-level problem seeks a solution y(cid:63)(x) minimizing a cost g(x, y) over a set y given a fixed outer variable x in a set x . the outer-level problem minimizes an objective of the form l(x)=f (x, y(cid:63)(x)) over x for some upper-level cost f . when the solution y(cid:63)(x) is unique, the bilevel optimization problem takes the following form: LINEBREAK l(x) := f (x, y(cid:63)(x)), LINEBREAK min x∈x LINEBREAK such that y(cid:63)(x) = arg min y∈y LINEBREAK g(x, y). LINEBREAK first introduced in the field of economic game theory by stackelberg (1934) and long studied in optimization (ye and zhu, 1995; ye and ye, 1997; ye et al., 1997), this problem has recently received increasing attention in the machine learning community (domke, 2012; gould et al., 2016; liao et al., 2018; blondel et al., 2021; liu et al., 2021; shaban et al., 2019; ablin et al., 2020). indeed, many machine learning applications can be reduced to (1) including hyper-parameter optimization (feurer and hutter, 2019), meta-learning (bertinetto et al., 2018), reinforcement learning (hong et al., 2020b; liu et al., 2021) or dictionary learning (mairal et al., 2011; lecouat et al., 2020a;b). LINEBREAK the hierarchical nature of (1) introduces additional challenges compared to standard optimization problems, such as finding a suitable trade-off between the computational budget for approximating the inner and outer level problems (ghadimi and wang, 2018; dempe and zemkoho, 2020). these considerations are exacerbated in machine learning applications, where the costs f and g often come as an average of functions over a large or infinite number of data points (franceschi et al., 2018). all these challenges highlight the need for methods that are able to control the computational costs inherent to (1) while dealing with the large-scale setting encountered in machine learning. LINEBREAK gradient-based bilevel optimization methods appear to be viable approaches for solving (1) in largescale settings (lorraine et al., 2020). they can be divided into two categories: iterative differentiation (itd) and approximate implicit differentiation (aid). itd approaches approximate the map y(cid:63)(x) by a differentiable optimization algorithm a(x) viewed as a function of x. the resulting surrogate loss ˜l(x) = f (x, a(x)) is optimized instead of l(x) using reverse-mode automatic differentiation (see baydin et al., 2018). aid approaches (pedregosa, 2016) rely on an expression of the gradient ∇l resulting from the implicit function theorem (lang, 2012, theorem 5.9). unlike itd, aid avoids differentiating the algorithm approximating y(cid:63)(x) and, instead, approximately LINEBREAK solves a linear system using only hessian and jacobian-vector products to estimate the gradient ∇l (rajeswaran et al., 2019). these methods can also rely on stochastic approximation to increase scalability (franceschi et al., 2018; grazzi et al., 2020; 2021). LINEBREAK in the context of machine-learning, ghadimi and wang (2018) provided one of the first comprehensive studies of the computational complexity for a class of bilevel algorithms based on aid approaches. subsequently, hong et al. (2020b); ji et al. (2021); ji and liang (2021); yang et al. (2021) proposed different algorithms for solving (1) and obtained improved overall complexity by achieving a better trade-off between the cost of the inner and outer level problems. still, the question of whether these complexities can be improved by better exploiting the structure of (1) through heuristics such as warm-start remains open (grazzi et al., 2020). moreover, these studies proposed separate analysis of their algorithms depending on the convexity of the loss l and whether a stochastic or deterministic setting is considered. this points out to a lack of unified and systematic theoretical framework for analyzing bilevel problems, which is what the present work addresses. LINEBREAK we consider the amortized implicit gradient optimization (amigo) algorithm, a bilevel optimization algorithm based on approximate implicit differentiation (aid) approaches that exploits a warm-start strategy when estimating the gradient of l. we then propose a unified theoretical framework for analyzing the convergence of amigo when the inner-level problem is strongly convex in both stochastic and deterministic settings. the proposed framework is inspired from the early work of habets (1974) on singularly perturbed systems and analyzes the effect of warm start by viewing the iterates of amigo algorithm as a dynamical system. the evolution of such system is described by a total energy function which allows to recover the convergence rates of unbiased oracle methods which have access to an unbiased estimate of ∇l (c.f. table 1). to the best of our knowledge, this is the first time a bilevel optimization algorithm based on a warm-start strategy provably recovers the rates of unbiased oracle methods across a wide range of settings including the stochastic ones. LINEBREAK related work LINEBREAK singularly perturbed systems (sps) are continuous-time deterministic dynamical systems of coupled variables (x(t), y(t)) with two time-scales where y(t) evolves much faster than x(t). as such, they exhibit a hierarchical structure similar to (1). the early work of habets (1974); saberi and khalil (1984) provided convergence rates for sps towards equilibria by studying the evolution of a single scalar energy function summarizing these systems. the present work takes inspiration from these works to analyze the convergence of amigo which involves three time-scales. LINEBREAK two time-scale stochastic approximation (ttsa) can be viewed as a discrete-time stochastic version of sps. (kaledin et al., 2020) showed that ttsa achieves a finite-time complexity of o(cid:0)(cid:15)−1(cid:1) for linear systems while doan (2020) obtained a complexity of o(cid:0)(cid:15)−3/2(cid:1) for general non-linear systems by extending the analysis for sps. hong et al. (2020b) further adapted the non-linear ttsa for solving (1). in the present work, we obtain faster rates by taking into account the dynamics of a third variable zk appearing in amigo, thus resulting in a three time-scale dynamics. LINEBREAK warm-start in bilevel optimization. ji et al. (2021); ji and liang (2021) used a warm-start for the inner-level algorithm to obtain an improved computational complexity over algorithms without warm-start. in the deterministic non-convex setting, ji et al. (2021) used a warm-start strategy when solving the linear system appearing in aid approaches to obtain improved convergence rates. however, it remained open whether using a warm-start when solving both inner-level problem and linear system arising in aid approaches can yield faster algorithms in the more challenging stochastic setting (grazzi et al., 2020). in the present work, we provide a positive answer to this question. LINEBREAK amortized implicit gradient optimization LINEBREAK general setting and main assumptions LINEBREAK notations. in all what follows, x and y are euclidean spaces. for a differentiable function h(x, y) : x × y → r, we denote by ∇h its gradient w.r.t. (x, y), by ∂xh and ∂yh its partial derivatives w.r.t. x and y and by ∂xyh and ∂yyh the partial derivatives of ∂yh w.r.t x and y, respectively. LINEBREAK geometries LINEBREAK setting LINEBREAK (sc) LINEBREAK (nc) LINEBREAK (d) LINEBREAK (s) LINEBREAK (d) LINEBREAK (s) LINEBREAK algorithms ba (ghadimi and wang, 2018) accbio (ji and liang, 2021) amigo (corollary 1) bsa (ghadimi and wang, 2018) ttsa (hong et al., 2020b) amigo (corollary 2) LINEBREAK ba (ghadimi and wang, 2018) aid-bio (ji et al., 2021) amigo (corollary 3) bsa (ghadimi and wang, 2018) ttsa (hong et al., 2020b) stocbio (ji et al., 2021) mrbo/vrbo(cid:63) (yang et al., 2021) amigo (corollary 4) LINEBREAK complexity l ∨ κ2 l κ1/2 g LINEBREAK o(κlκg log (cid:15)−1) LINEBREAK (cid:104) table 1: cost of finding an (cid:15)-accurate solution as measured by e[l(xk)−l(cid:63)]∧2−1µe (cid:80)k LINEBREAK (cid:107)xk−x(cid:63)(cid:107)2(cid:105) when l is µ-strongly-convex (sc) and 1 when l is non-convex (nc). the k settings (d) and (s) stand for the deterministic and stochastic settings. the cost corresponds to the total number of gradients, jacobian and hessian-vector products used by the algorithm. κl and κg are the conditioning numbers of l and g whenever applicable. the dependence on κl and κg for ttsa and accbio are derived in proposition 11 of appendix a.4. the rate of mrbo/vrbo is obtained under the additional mean-squared smoothness assumption (arjevani et al., 2019). LINEBREAK to ensure that (1) is well-defined, we consider the setting where the inner-level problem is strongly convex so that the solution y(cid:63)(x) is unique as stated by the following assumption: assumption 1. for any x ∈ x , the function y (cid:55)→ g(x, y) is lg-smooth and µg-strongly convex. LINEBREAK assumption 1 holds in the context of hyper-parameter selection when the inner-level is a kernel regression problem (franceschi et al., 2018), or when the variable y represents the last linear layer of a neural network as in many meta-learning tasks (ji et al., 2021). under assumption 1 and additional smoothness assumptions on f and g, the next proposition shows that l is differentiable: proposition 1. let g be a twice differentiable function satisfying assumption 1. assume that f is differentiable and consider the quadratic problem: LINEBREAK min z∈rdy LINEBREAK q(x, y, z) := LINEBREAK z(cid:62)(∂yyg(x, y))z + z(cid:62)∂yf (x, y). LINEBREAK then, (2) admits a unique minimizer z(cid:63)(x, y) for any (x, y) in x × y. moreover, y(cid:63)(x) is unique and well-defined for any x in x and l is differentiable with gradient given by: ∇l(x) = ∂xf (x, y(cid:63)(x)) + ∂xyg(x, y(cid:63)(x))z(cid:63)(x, y(cid:63)(x)). LINEBREAK proposition 1 follows by application of the implicit function theorem (lang, 2012, theorem 5.9) and provides an expression for ∇l solely in terms of partial derivatives of f and g evaluated at (x, y(cid:63)(x)). following ghadimi and wang (2018), we further make two smoothness assumptions on f and g: assumption 2. there exist positive constants lf and b such that for all x, x(cid:48) ∈ x and y, y(cid:48) ∈ y: LINEBREAK assumption 3. there exit positive constants l(cid:48) LINEBREAK g, mg such that for any x, x(cid:48) ∈ x and y, y(cid:48) ∈ y: max {(cid:107)∂xyg(x, y) − ∂xyg(x(cid:48), y(cid:48))(cid:107), (cid:107)∂yyg(x, y) − ∂yyg(x(cid:48), y(cid:48))(cid:107)} ≤ mg(cid:107)(x, y) − (x(cid:48), y(cid:48))(cid:107) LINEBREAK assumptions 1 to 3 allow a control of the variations of y(cid:63) and z(cid:63) and ensure l is l-smooth for some positive constant l as shown in proposition 6 of appendix b.2. as an l-smooth function, l is necessarily weakly convex (davis et al., 2018), meaning that l satisfies the inequality l(x)−l(y) ≤ 2 (cid:107)x − y(cid:107)2 for some fixed µ ∈ r with |µ| ≤ l. in particular, l is convex when ∇l(x)(cid:62)(x − y) − µ µ ≥ 0, strongly convex when µ > 0 and generally non-convex when µ < 0. we thus consider two cases for l, the strongly convex case (µ > 0) and the non-convex case (µ < 0). when l is convex, we denote by l(cid:63) its minimum value achieved at a point x(cid:63) and define κl=l/µ when µ > 0. LINEBREAK stochastic/deterministic settings. we consider the general setting where f (x, y) and g(x, y) are expressed as an expectation of stochastic functions ˆf (x, y, ξ) and ˆg(x, y, ξ) over a noise variable ξ. we recover the deterministic setting as a particular case when the variable ξ has zero variance, thus allowing us to treat both stochastic (s) and deterministic (d) settings in a unified framework. as often in machine-learning, we assume we can always draw a new batch d of i.i.d. samples of the noise variable ξ with size |d| ≥ 1 and use it to compute stochastic approximations of f and g defined by abuse of notation as ˆf (x, y, d) := 1 ξ∈d ˆg(x, y, ξ). |d| we make the following noise assumptions which are implied by those in ghadimi and wang (2018): assumption 4. for any batch d, ∇ ˆf (x, y, d) and ∂y ˆg(x, y, d) are unbiased estimator of ∇f (x, y) and ∂yg(x, y) with a uniformly bounded variance, i.e. for all x, y ∈ x × y: LINEBREAK ˆf (x, y, ξ) and ˆg(x, y, d) := 1 |d| LINEBREAK ξ∈d LINEBREAK e LINEBREAK (cid:20)(cid:13) (cid:13)∇ ˆf (x, y, d) − ∇f (x, y) (cid:13) LINEBREAK assumption 5. for any batch d, the matrices f1(x, y, d) := ∂xy ˆg(x, y, d) − ∂xyg(x, y) and f2(x, y, d) := ∂yy ˆg(x, y, d) − ∂yyg(x, y) have zero mean and satisfy for all x, y ∈ x × y: (cid:13)e(cid:2)f1(x, y, d)(cid:62)f1(x, y, d)(cid:3)(cid:13) (cid:13) |d|−1, LINEBREAK (cid:13)op ≤ ˜σ2 gxy LINEBREAK (cid:13)op ≤ ˜σ2 gyy LINEBREAK for conciseness, we will use the notations σ2 σ2 LINEBREAK gyy LINEBREAK gyy LINEBREAK |d|−1, without explicit reference to the batch d. next, we describe the algorithm. LINEBREAK g|d|−1, σ2 gxy LINEBREAK gxy LINEBREAK |d|−1 and LINEBREAK algorithms LINEBREAK amortized implicit gradient optimization (amigo) is an iterative algorithm for solving (1). it constructs iterates xk, yk and zk such that xk approaches a stationary point of l while yk and zk track the quantities y(cid:63)(xk) and z(cid:63)(xk, yk). amigo computes the iterate xk+1 using an update ˆψk for some given step-size γk and a stochastic estimate ˆψk of ∇l(xk) equation xk+1 = xk − γk based on (3) and defined according to (4) below for some new batches of samples df and dgxy . LINEBREAK ˆψk := ∂x LINEBREAK ˆf (xk, yk, df ) + ∂x,y ˆg(xk, yk, dgxy )(cid:62)zk. LINEBREAK algorithm 1 amigo 1: inputs: x0, y−1, z−1. 2: parameters: γk, k. 3: for k ∈ {0, ..., k} do yk ← ak(xk, yk−1) 4: sample batches df , dg. 5: (uk, vk) ← ∇ ˆf (xk, yk, df ). 6: zk ← bk(xk, yk, vk, zk−1) 7: wk ← ∂xy ˆg(xk, yk, dgxy )zk 8: ˆψk−1 ← uk + wk xk ← xk−1 − γk LINEBREAK ˆf (xk, yk, df ) and vk = ∂y LINEBREAK amigo computes ˆψk in 4 steps given iterates xk, yk−1 and zk−1. a first step computes an approximation yk to y(cid:63)(xk) using a stochastic algorithm ak initialized at yk−1. a second step computes unbiased estimates uk = ˆf (xk, yk, df ) of the partial ∂x derivatives of f w.r.t. x and y. a third step computes an approximation zk to z(cid:63)(xk, yk) using a second stochastic algorithm bk for solving (2) initialized at zk−1. to increase efficiency, algorithm bk uses the pre-computed vector vk for approximating the partial derivative ∂yf in (2). finally, the stochastic estimate ˆψk is computed using (4) by summing the pre-computed vector uk with the (cid:1)zk. jacobian-vector product wk = ∂xy ˆg(cid:0)xk, yk, dgxy amigo is summarized in algorithm 1. LINEBREAK algorithms ak and bk. while various choices for ak and bk are possible, such as adaptive algorithms (kingma and ba, 2015), or accelerated stochastic algorithms (ghadimi and lan, 2012), we LINEBREAK focus on simple stochastic gradient descent algorithms with a pre-defined number of iterations t and n . these algorithms compute intermediate iterates yt and zn optimizing the functions y (cid:55)→ g(xk, y) and z (cid:55)→ q(xk, yk, z) starting from some initial values y0 and z0 and returning the last iterates yt and zn as described in algorithms 2 and 3. algorithm ak updates the current iterate yt−1 using a stochastic gradient ∂y ˆg(xk, yt−1, dg) for some new batch of samples dg and a fixed step-size αk. algorithm bk updates the current iterate zt−1 using a stochastic estimate of ∂zq(xk, yk, zt−1) with step-size βk. the stochastic gradient is computed by evaluating the hessian-vector product ∂yy ˆg(xk, yk, dgyy )zt−1 for some new batch of samples dgyy and summing it with a vector vk approximating ∂yf (xk, yk) provided as input to algorithm bk. warm-start for y0 and z0. following the intuition that y(cid:63)(xk) remains close to y(cid:63)(xk−1) when xk (cid:39) xk−1, and assuming that yk−1 is an accurate approximation to y(cid:63)(xk−1), it is natural to initialize ak with the iterate yk−1. the same intuition applies when initializing bk with zk−1. next, we introduce a framework for analyzing the effect of warm-start on the convergence speed of amigo. LINEBREAK algorithm 2 ak(x, y0) 1: parameters: αk, t 2: for t ∈ {1, ..., t } do sample batch dg t,k. 3: (cid:16) yt ← yt−1 − αk∂y ˆg LINEBREAK 4: 5: end for 6: return yt . LINEBREAK x, yt−1, dg t,k LINEBREAK algorithm 3 bk(x, y, v, z0) 1: parameters: βk, n . 2: for n ∈ {1, ..., n } do sample batch dgyy n,k . 3: (cid:16) zn ← zn−1 −βk LINEBREAK 4: 5: end for 6: return zn . LINEBREAK ∂yy ˆg LINEBREAK x, y, dgyy n,k LINEBREAK zn−1 + v LINEBREAK analysis of amortized implicit gradient optimization LINEBREAK general approach and main result LINEBREAK the proposed approach consists in three main steps: (1) analysis of the outer-level problem , (2) analysis of the inner-level problem and (3) analysis of the joint dynamics of both levels. outer-level problem. we consider a quantity ex LINEBREAK k describing the evolution of xk defined as follows: + (1 − u)e[l(xk) − l(cid:63)], µ ≥ 0 LINEBREAK ex LINEBREAK k := LINEBREAK δk 2γk δk LINEBREAK where u ∈ {0, 1} is set to 1 in the stochastic setting and to 0 in the deterministic one and δk is a positive sequence that determines the convergence rate of the outer-level problem and is defined by: LINEBREAK δk := ηkγk, LINEBREAK ηk+1 := ηk(1 + γk+1(ηk − µ))1µ≥0 + l1µ<0. with η0 such that γ−1 0 ≥η0≥µ if µ≥0 and η0=l if µ<0 and where we choose the step-size γk to be a non-increasing sequence with γ0 ≤ 1 k recovers the quantity considered in the stochastic estimate sequences framework of kulunchakov and mairal (2020) to analyze the convergence of stochastic optimization algorithms when l is convex. when l is non-convex, ex k recovers a standard measure of stationarity (davis and drusvyatskiy, k−1 of ˆψk given by k using bias and variance error eψ 2018). in section 4.3, we control ex (6) below where ek denotes expectation conditioned on (xk, yk, zk−1). LINEBREAK l . with this choice for δk and by setting u = 1 in (5), ex LINEBREAK k−1 and v ψ LINEBREAK eψ LINEBREAK k := e LINEBREAK (cid:20)(cid:13) ˆψk − ek (cid:13) (cid:13) inner-level problems. we consider the mean-squared errors ey k and ez k between initializations (y0=yk−1 and z0=zk−1) and stationary values (y(cid:63)(xk) and z(cid:63)(xk, yk)) of algorithms ak and bk: LINEBREAK v ψ k := e LINEBREAK − ∇l(xk) LINEBREAK ey LINEBREAK k := e LINEBREAK k − z(cid:63)(xk, yk)(cid:13) (cid:13) in section 4.3, we show that the warm-start strategy allows to control ey k and ez previous iterates ey such bias and variance errors are, in turn, controlled by ey LINEBREAK k in terms of k−1 as well as the bias and variance errors in (6). we further prove that LINEBREAK k−1 and ez LINEBREAK k := e LINEBREAK ez LINEBREAK k and ez k. LINEBREAK joint dynamics. following habets (1974), we consider an aggregate error etot combination of ex LINEBREAK k with carefully selected coefficients ak and bk: LINEBREAK k and ez LINEBREAK k , ey LINEBREAK k defined as a linear LINEBREAK etot LINEBREAK k = ex LINEBREAK k + akey LINEBREAK k + bkez k. LINEBREAK k LINEBREAK k LINEBREAK represents the dynamics of the whole system. the following theorem provides an error in both convex and non-convex settings for a suitable choice of the coefficients ak LINEBREAK as such etot bound for etot and bk provided that t and n are large enough: theorem 1. choose a batch-size (cid:12) and the step-sizes αk=l−1 γk=l−1. set the coefficients ak and bk to be ak:=δ0(1−αkµg)1/2 and bk:=δ0 and set the number of iterations t and n of algorithms 2 and 3 to be of order t =o(κg) and n =o(κg) up to a logarithmic dependence on κg. let ˆxk=u(1−δk)ˆxk−1+(1−u(1−δk))xk, with ˆx0=x0. then, under assumptions 1 to 5, etot satisfies: 1 − (2κl)−1(cid:17)k(cid:2)etot LINEBREAK ˜σ2 gyy µglg LINEBREAK (cid:12)dgyy LINEBREAK k ≤ LINEBREAK k LINEBREAK (e[l(x0) − l(cid:63)] + ey LINEBREAK e[l(ˆxk) − l(cid:63)] + etot LINEBREAK etot LINEBREAK t ≤ LINEBREAK where w 2, defined in (20) of appendix a.2, is the effective variance of the problem with w 2=0 in the deterministic setting and, in the stochastic setting, w 2>0 is of the following order: LINEBREAK (cid:12) (cid:12)dgyy LINEBREAK ˜σ2 gyy LINEBREAK (cid:12) (cid:12)dgxy LINEBREAK ˜σ2 gxy LINEBREAK f LINEBREAK we describe the strategy of the proof in section 4.3 and provide a proof outline in appendix a.1 with exact expressions for all variables including the expressions of t , n and w 2. the full proof is provided in appendix a.2. the choice of ak and bk ensures that ey k contribute less to etot as the algorithms ak and bk become more accurate. the effective variance w 2 accounts for k interactions between both levels in the presence of noise and becomes proportional to the outer-level variance σ2 f when the inner-level problem is solved exactly. in the deterministic setting, all variances gyy vanish so that w 2=0. hence, we characterize such setting by w 2=0 and the gxy and ˜σ2 g, ˜σ2 ˜σ2 f , ˜σ2 stochastic one by w 2>0. next, we apply theorem 1 to obtain the complexity of amigo. LINEBREAK k and ez LINEBREAK complexity analysis LINEBREAK we define the complexity c((cid:15)) of a bilevel algorithm to be the total number of queries to the gradients of f and g, jacobian/hessian-vector products needed by the algorithm to achieve an error (cid:15) according to some pre-defined criterion. let the number of iterations k, t and n and sizes of the batches |dg|, |df |, (cid:12) LINEBREAK (cid:12) (cid:12), be such that amigo achieves a precision (cid:15). then c((cid:15)) is given by: (cid:12) (cid:12) + (cid:12) LINEBREAK c((cid:15)) = k(cid:0)t |dg| + n (cid:12) LINEBREAK (cid:12)dgxy LINEBREAK (cid:12)dgxy LINEBREAK (cid:12)dgyy LINEBREAK (cid:12)dgyy LINEBREAK we provide the complexity of amigo in the 4 settings of table 1 in the form of corrolaries 1 to 4 . 2 (cid:107)xk − x(cid:63)(cid:107)2≤(cid:15) corollary 1 (case µ>0 and w 2=0). use batches of size 1. achieving l(xk)−l(cid:63)+ µ requires c((cid:15))=o LINEBREAK κlκg log LINEBREAK corollary 1 outperforms the complexities in table 1 in terms of the dependence on (cid:15). it is possible to improve the dependence on κg to κ1/2 using acceleration in ak and bk as discussed in g appendix a.5.1, or using generic acceleration methods such as catalyst (lin et al., 2018). corollary 2 (case µw 2>0). choose |dg|=θ(cid:0)(cid:15)−1κlκ2 and (cid:12) LINEBREAK (cid:1), (cid:12) (cid:12)dgxy (cid:104) . achieving e[l(ˆxk)−l(cid:63)]+ µ e 2 LINEBREAK ≤(cid:15) requires: LINEBREAK , |df |=θ LINEBREAK (cid:12)dgyy LINEBREAK gxy LINEBREAK gyy LINEBREAK log LINEBREAK c((cid:15)) = o LINEBREAK κl LINEBREAK gyy LINEBREAK gxy LINEBREAK corollary 2 improves over the results in table 1 in the stochastic strongly-convex setting and recovers the dependence on (cid:15) of stochastic gradient descent for smooth and strongly convex functions up to a logarithmic factor. corollary 3 (case µ<0 and w 2=0). choose batches of size 1. achieving 1 k LINEBREAK requires c((cid:15)) = o LINEBREAK g LINEBREAK corollary 3 recovers the complexity of aid-bio (ji et al., 2021) in the deterministic non-convex setting. this is expected since aid-bio also exploits warm-start for both ak and bk. (cid:12) corollary 4 (case µ<0 and w>0). choose (cid:12) (cid:15) ˜σ2 (cid:12)=θ (cid:107)∇l(xi)(cid:107)2(cid:105) LINEBREAK and |dg|=θ LINEBREAK ≤ (cid:15) requires: LINEBREAK . achieving an error 1 k LINEBREAK |df |=θ LINEBREAK (cid:12)dgxy LINEBREAK gyy LINEBREAK g LINEBREAK g LINEBREAK g LINEBREAK g LINEBREAK f LINEBREAK c((cid:15)) = o LINEBREAK g LINEBREAK gyy LINEBREAK gxy LINEBREAK (e[l(xk) − l(cid:63)] + ey LINEBREAK corollary 4 recovers the optimal dependence on (cid:15) of o( 1 (cid:15)2 ) achieved by stochastic gradient descent in the smooth non-convex case (arjevani et al., 2019, theorem 1). it also improves over the results in (ji et al., 2021) which involve an additional logarithmic factor log((cid:15)−1) as n is required to be o(κg log((cid:15)−1)). in our case, n remains constant since bk benefits from warm-start. the faster rates of mrbo/vrbo(cid:63) (yang et al., 2021) are obtained under the additional mean-squared smoothness assumption (arjevani et al., 2019), which we do not investigate in the present work. such assumption allows to achieve the improved complexity of o((cid:15)−3/2 log((cid:15)−1)). however, these algorithms still require n =o(log((cid:15)−1)), indicating that the use of warm-start in bk could further reduce the complexity to o((cid:15)−3/2) which would be an interesting direction for future work. LINEBREAK outline of the proof LINEBREAK the proof of theorem 1 proceeds by deriving a recursion for both outer-level error ex level errors ey outer-level recursion. to allow a unified analysis of the behavior of ex convex settings, we define fk as follows: LINEBREAK k and then combining those to obtain an error bound on the total error etot k . LINEBREAK k in both convex and non LINEBREAK k and inner LINEBREAK k and ez LINEBREAK fk :=uδke[l(xk) − l(cid:63)]1µ>0 + (cid:0)e[l(xk) − l(xk−1)] + ex LINEBREAK k−1 − ex k LINEBREAK the following proposition, with a proof in appendix c.1, provides a recursive inequality on ex k involving the errors in (6) due to the inexact gradient ˆψk: proposition 2. let ρk be a non-increasing sequence with 0<ρk<2. assumptions 1 to 3 ensure that: LINEBREAK fk + ex LINEBREAK with sk defined as sk := 1 LINEBREAK k−1 + γkskv ψ LINEBREAK (cid:0)sk + ρ−1 LINEBREAK k LINEBREAK (cid:1)eψ LINEBREAK in the ideal case where yk = y(cid:63)(xk) and zk = z(cid:63)(xk, yk), the bias eψ k vanishes and (10) simplifies to (kulunchakov and mairal, 2019, proposition 1) which recovers the convergence rates for stochastic gradient methods in the convex case. however, yk and zk are generally inexact solutions and introduce a positive bias eψ k . therefore, controlling the inner-level iterates is required to control the bias eψ LINEBREAK k which, in turn, impacts the convergence of the outer-level as we discuss next. LINEBREAK controlling the inner-level iterates yk and zk. proposition 3 below controls the expected mean squared errors between iterates yk and zk and their limiting values y(cid:63)(xk) and z(cid:63)(xk, yk): ∧ µg proposition 3. let the step-sizes αk and βk be such that αk≤l−1 g+σ2 µ2 LINEBREAK and βk≤ 1 2lg LINEBREAK . let LINEBREAK g LINEBREAK gyy LINEBREAK where ry LINEBREAK k=o(cid:0)κgσ2 LINEBREAK g LINEBREAK ≤ λkey (cid:16) LINEBREAK k=o LINEBREAK gyy LINEBREAK . under assumptions 1, 4 and 5, it holds that: (cid:107)zk − z(cid:63)(xk, yk)(cid:107)2(cid:105) LINEBREAK ≤ πkez LINEBREAK k + rz k, LINEBREAK k + ry k, LINEBREAK are defined in (14) of appendix a.2. LINEBREAK k and eψ LINEBREAK k in terms of the warm-start error ey LINEBREAK while proposition 3 is specific to the choice of the algorithms ak and bk in algorithms 2 and 3, our analysis directly extends to other algorithms satisfying inequalities similar to (11) such as accelerated or variance reduced algorithms discussed in appendices a.5.1 and a.5.2. proposition 4 below controls the bias and variance terms v ψ proposition 4. under assumptions 1 to 5, the following inequalities hold: v ψ k ≤ w2 x + σ2 (cid:17) gσ2 LINEBREAK k + ry k), (cid:16) , σ2 where w2 x=o constants defined in (13) and (16) of appendix a.2 with lψ controlling the variations of ek[ ˆψk]. proposition 4 highlights the dependence of eψ k and v ψ ing the evolution of ey proposition 5. let ζk > 0, a 2×2 matrix pk, two vectors uk and vk in r2 all independent of xk, yk and zk be as defined in proposition 8 of appendix a.2. under assumptions 1 to 5, it holds that: LINEBREAK k to quantify how large the bias and variances can get: LINEBREAK k on the inner-level errors. it suggests analyz LINEBREAK xπkez k, and lψ=o(κ2 LINEBREAK k + πkez gσ2 LINEBREAK g) are positive LINEBREAK k and ez k. LINEBREAK k and ez LINEBREAK x=o LINEBREAK gxy LINEBREAK gxy LINEBREAK gyy LINEBREAK gyy LINEBREAK (cid:18)ey k ez k LINEBREAK ≤ pk LINEBREAK k−1 + ry k−1 + rz LINEBREAK k−1 + v ψ eψ LINEBREAK k−1 + ζkex LINEBREAK uk + vk. LINEBREAK proposition 5 describes the evolution of the inner-level errors as the number of iterations k increases. the matrix pk and vectors uk and vk arise from discretization errors and depend on the step-sizes and constants of the problem. the second term of (12) represents interactions with the outer-level through ex k , ez k) from which the evolution of etot LINEBREAK k−1. propositions 2, 4 and 5 describe the joint dynamics of (ex LINEBREAK can be deduced as shown in appendices a.1 and a.2. LINEBREAK k−1 and eψ LINEBREAK k , ey LINEBREAK k LINEBREAK experiments LINEBREAK we run three sets of experiments described in sections 5.1 to 5.3. in all cases, we consider amigo with either gradient descent (amigo-gd) or conjugate gradient (amigo-cg) for algorithm bk. we amigo with aid methods without warm-start for bk which we refer to as (aid-gd) and (aid-cg) and with (aid-cg-ws) which uses warm-start for bk but not for ak. we also consider other variants using either a fixed-point algorithm (aid-fp) (grazzi et al., 2020) or neumann series expansion (aid-n) (lorraine et al., 2020) for bk. finally, we consider two algorithms based on iterative differentiation which we refer to as (itd) (grazzi et al., 2020) and (reverse) (franceschi et al., 2017). for all methods except (aid-cg-ws), we use warm-start in algorithm ak, however only amigo, amigo-cg and aid-cg-ws exploits warm-start in bk the other aid based methods initializing bk with z0=0. in sections 5.2 and 5.3, we also compare with bsa algorithm (ghadimi and wang, 2018), ttsa algorithm (hong et al., 2020a) and stocbio (ji et al., 2021). an implementation of amigo is available in https://github.com/michaelarbel/amigo. LINEBREAK synthetic problem LINEBREAK to study the behavior of amigo in a controlled setting, we consider a synthetic problem where both inner and outer level losses are quadratic functions with thousands of variables as described in details in appendix f.1. figure 1(a) shows the complexity c((cid:15)) needed to reach 10−6 relative error amongst the best choice for t and m over a grid as the conditioning number κg increases. amigo-cg achieves the lowest time and is followed by aid-cg thus showing a favorable effect of warm-start for bk. the same conclusion holds for amigo-gd compared to aid-gd. note that aid-cg is still faster than amigo-cg for larger values of κg highlighting the advantage of using κg) complexity such as (cg) instead non-accelerated ones with o(κ−1 algorithms bk with o( g ) such as (gd). figure 1(b) shows the relative error after 10s and maintains the same conclusions. for moderate values of κg, only amigo and aid-cg reach an error of 10−20 as shown in figure 1(c). we refer to figures 2 and 3 of appendix f for additional results on the effect of the choice of t and m showing that amigo consistently performs well for a wide range of values of t and m . LINEBREAK hyper-parameter optimization
| 7
|
[
108.249,
91.4680784,
282.0944766,
101.4306784
] |
D6nH3719vZy.pdf
| 2,022
| 0
|
LINEBREAK on improving adversarial transferability of vision transformers LINEBREAK muzammal naseer§† kanchana ranasinghe◦ fahad shahbaz khan§‡ †australian national university, ◦stony brook university, §mohamed bin zayed university of ai, ∇qualcomm usa [email protected] LINEBREAK fatih porikli∇ LINEBREAK salman khan§ LINEBREAK ‡linköping university LINEBREAK abstract LINEBREAK vision transformers (vits) process input images as sequences of patches via selfattention; a radically different architecture than convolutional neural networks (cnns). this makes it interesting to study the adversarial feature space of vit models and their transferability. in particular, we observe that adversarial patterns found via conventional adversarial attacks show very low black-box transferability even for large vit models. we show that this phenomenon is only due to the sub-optimal attack procedures that do not leverage the true representation potential of vits. a deep vit is composed of multiple blocks, with a consistent architecture comprising of self-attention and feed-forward layers, where each block is capable of independently producing a class token. formulating an attack using only the last class token (conventional approach) does not directly leverage the discriminative information stored in the earlier tokens, leading to poor adversarial transferability of vits. using the compositional nature of vit models, we enhance transferability of existing attacks by introducing two novel strategies specific to the architecture of vit models. (i) self-ensemble: we propose a method to find multiple discriminative pathways by dissecting a single vit model into an ensemble of networks. this allows explicitly utilizing class-specific information at each vit block. (ii) token refinement: we then propose to refine the tokens to further enhance the discriminative capacity at each block of vit. our token refinement systematically combines the class tokens with structural information preserved within the patch tokens. an adversarial attack when applied to such refined tokens within the ensemble of classifiers found in a single vision transformer has significantly higher transferability and thereby brings out the true generalization potential of the vit’s adversarial space. code: https://t.ly/hbbw. LINEBREAK introduction LINEBREAK transformers compose a family of neural network architectures based on the self-attention mechanism, originally applied in natural language processing tasks achieving state-of-the-art performance (vaswani et al., 2017; devlin et al., 2018; brown et al., 2020). the transformer design has been subsequently adopted for vision tasks (dosovitskiy et al., 2020), giving rise to a number of successful vision transformer (vit) models (touvron et al., 2020; yuan et al., 2021; khan et al., 2021). due to the lack of explicit inductive biases in their design, vits are inherently different from convolutional neural networks (cnns) that encode biases e.g., spatial connectivity and translation equivariance. vits process an image as a sequence of patches which are refined through a series of self-attention mechanisms (transformer blocks), allowing the network to learn relationships between any individual parts of the input image. such processing allows wide receptive fields which can model global context as opposed to the limited receptive fields of cnns. these significant differences between vits and cnns give rise to a range of intriguing characteristics unique to vits (caron et al., 2021; tuli et al., 2021; mao et al., 2021; paul & chen, 2021; naseer et al., 2021b). LINEBREAK adversarial attacks pose a major hindrance to the successful deployment of deep neural networks in real-world applications. recent success of vits means that adversarial properties of vit models LINEBREAK figure 1: left: conventional adversarial attacks view vit as a single classifier and maximize the prediction loss (e.g., cross entropy) to fool the model based on the last classification token only. this leads to sub-optimal results as class tokens in previous vit blocks only indirectly influence adversarial perturbations. in contrast, our approach (right) effectively utilizes the underlying vit architecture to create a self-ensemble using class tokens produced by all blocks within vit to design the adversarial attack. our self-ensemble enables to use hierarchical discriminative information learned by all class tokens. consequently, an attack based on our self-ensemble generates transferable adversaries that generalize well across different model types and vision tasks. LINEBREAK also become an important research topic. a few recent works explore adversarial robustness of vits (shao et al., 2021; mahmood et al., 2021; bhojanapalli et al., 2021) in different attack settings. surprisingly, these works show that large vit models exhibit lower transferability in black-box attack setting, despite their higher parameter capacity, stronger performance on clean images, and better generalization (shao et al., 2021; mahmood et al., 2021). this finding seems to indicate that as vit performance improves, its adversarial feature space gets weaker. in this work, we investigate whether the weak transferability of adversarial patterns from high-performing vit models, as reported in recent works (shao et al., 2021; mahmood et al., 2021; bhojanapalli et al., 2021), is a result of weak features or a weak attack. to this end, we introduce a highly transferable attack approach that augments the current adversarial attacks and increase their transferability from vits to the unknown models. our proposed transferable attack leverages two key concepts, multiple discriminative pathways and token refinement, which exploit unique characteristics of vit models. LINEBREAK our approach is motivated by the modular nature of vits (touvron et al., 2020; yuan et al., 2021; mao et al., 2021): they process a sequence of input image patches repeatedly using multiple multi-headed self-attention layers (transformer blocks) (vaswani et al., 2017). we refer to the representation of patches at each transformer block as patch tokens. an additional randomly initialized vector (class token1) is also appended to the set of patch tokens along the network depth to distill discriminative information across patches. the collective set of tokens is passed through the multiple transformer blocks followed by passing of the class token through a linear classifier (head) which is used to make the final prediction. the class token interacts with the patch tokens within each block and is trained gradually across the blocks until it is finally utilized by the linear classifier head to obtain class-specific logit values. the class token can be viewed as extracting information useful for the final prediction from the set of patch tokens at each block. given the role of the class token in vit models, we observe that class tokens can be extracted from the output of each block and each such token can be used to obtain a class-specific logit output using the final classifier of a pretrained model. this leads us to the proposed self-ensemble of models within a single transformer (fig. 1). we show that attacking such a self-ensemble (sec. 3) containing multiple discriminative pathways significantly improves adversarial transferability from vit models, and in particular from the large vits. LINEBREAK going one step further, we study if the class information extracted from different intermediate vit blocks (of the self-ensemble) can be enhanced to improve adversarial transferability. to this end, we introduce a novel token refinement module directed at enhancing these multiple discriminative pathways. the token refinement module strives to refine the information contained in the output of each transformer block (within a single vit model) and aligns the class tokens produced by the intermediate blocks with the final classifier in order to maximize the discriminative power of intermediate blocks. our token refinement exploits the structural information stored in the patch tokens and fuses it with the class token to maximize the discriminative performance of each block. both the refined tokens and self-ensemble ideas are combined to design an adversarial attack that is shown to significantly boost the transferability of adversarial examples, thereby bringing out the true LINEBREAK 1average of patch tokens can serve as a class token in our approach for vit designs that do not use an explicit LINEBREAK class token such as swin transformer (liu et al., 2021) or mlp-mixer (tolstikhin et al., 2021) LINEBREAK generalization of vits’ adversarial space. through our extensive experimentation, we empirically demonstrate favorable transfer rates across different model families (convolutional and transformer) as well as different vision tasks (classification, detection and segmentation). LINEBREAK background and related work LINEBREAK adversarial attack modeling: adversarial attack methods can be broadly categorized into two categories, white-box attacks and black-box attacks. while the white-box attack setting provides the attacker full access to the parameters of the target model, the black-box setting prevents the attacker from accessing the target model and is therefore a harder setting to study adversarial transferability. LINEBREAK white-box attack: fast gradient sign method (fgsm) (goodfellow et al., 2014) and projected gradient descent (pgd) (madry et al., 2018) are two initially proposed white-box attack methods. fgsm corrupts the clean image sample by taking a single step within a small distance (perturbation budget (cid:15)) along the objective function’s gradient direction. pgd corrupts the clean sample for multiple steps with a smaller step size, projecting the generated adversarial example onto the (cid:15)-sphere around the clean sample after each step. other state-of-the-art white-box attack methods include jacobian-based saliency map attack (papernot et al., 2016), sparse attack (modas et al., 2019), onepixel attack (su et al., 2019), carlini and wagner optimization (carlini & wagner, 2017), elastic-net (chen et al., 2018), diversified sampling (tashiro et al., 2020), and more recently auto-attack (croce & hein, 2020b). we apply white-box attacks on surrogate models to find perturbations that are then transferred to black-box target models. LINEBREAK black-box attack and transferability: black-box attacks generally involve attacking a source model to craft adversarial signals which are then applied on the target models. while gradient estimation methods that estimate the gradients of the target model using black-box optimization methods such as finite differences (fd) (chen et al., 2017; bhagoji et al., 2018) or natural evolution strategies (nes) (ilyas et al., 2018; jiang et al., 2019) exist, these methods are dependent on multiple queries to the target model which is not practical in most real-world scenarios. in the case of adversarial signal generation using source models, it is possible to directly adopt white-box methods. in our work, we adopt fgsm and pgd in such a manner. methods like (dong et al., 2018) incorporate a momentum term into the gradient to boost the transferability of existing white-box attacks, building attacks named mim. in similar spirit, different directions are explored in literature to boost transferability of adversarial examples; a) enhanced momentum: lin et al. (lin et al., 2019) and wang et al. (wang & he, 2021) improve momentum by using nesterov momentum and variance tuning respectively during attack iterations, b) augmentations: xie et al. (xie et al., 2019) showed that applying differentiable stochastic transformations can bring diversity to the gradients and improve transferability of the existing attacks, c) exploiting features: multiple suggestions are proposed in the literature to leverage the feature space for adversarial attack as well. for example, zhou et al. (zhou et al., 2018) incorporate the feature distortion loss during optimization. similarly, (inkawhich et al., 2020b;a; huang et al., 2019) also exploit intermediate layers to enhance transferability. however, combining the intermediate feature response with final classification loss is non-trivial as it might require optimization to find the best performing layers (inkawhich et al., 2020b;a), and d) generative approach: orthogonal to iterative attacks, generative methods (poursaeed et al., 2018; naseer et al., 2019; 2021a) train an autoencoder against the white-box model. in particular, naseer et al. show that transferability of an adversarial generator can be increased with relativistic cross-entropy (naseer et al., 2019) and augmentations (naseer et al., 2021a). ours is the first work to address limited transferability of vit models. LINEBREAK the role of network architecture: recent works exploit architectural characteristics of networks to improve the transferability of attacks. while wu et al. (2020) exploit skip connections of models like resnets and densenets to improve black-box attacks, guo et al. (2020) build on similar ideas focused on the linearity of models. LINEBREAK our work similarly focuses on unique architectural characteristics of vit models to generate more transferable adversarial perturbations with the existing white-box attacks. LINEBREAK robustness of vits: adversarial attacks on vit models are relatively unexplored. shao et al. (2021) and bhojanapalli et al. (2021) investigate adversarial attacks and robustness of vit models studying various white-box and black-box attack techniques. the transferability of perturbations from vit models is thoroughly explored in (mahmood et al., 2021) and they conclude that vit LINEBREAK figure 2: adversarial examples for vits have only moderate transferability. in fact transferabililty (%) of mim (dong et al., 2018) perturbations to target models goes down as the source model size increases such as from deit-t (touvron et al., 2020) (5m parameters) to deit-b (touvron et al., 2020) (86m parameters). however, the performance of the attack improves significantly when applied on our proposed ensemble of classifiers found within a vit (mime & mimre). LINEBREAK models do not transfer well to cnns, whereas we propose a methodology to solve this shortcoming. moreover, mahmood et al. (2021) explores the idea of an ensemble of cnn and vit models to improve the transferability of attacks. our proposed ensemble approach explores a different direction by converting a single vit model into a collection of models (self-ensemble) to improve attack transferability. in essence, our proposed method can be integrated with existing attack approaches to take full advantage of the vits’ learned features and generate transferable adversaries. LINEBREAK enhancing adversarial transferability of vits LINEBREAK preliminaries: given a clean input image sample x with a label y, a source vit model f and a target model m which is under-attack, the goal of an adversarial attack is generating an adversarial signal, x(cid:48), using the information encoded within f, which can potentially change the target network’s prediction (m(x(cid:48))argmax (cid:54)= y). a set of boundary conditions are also imposed on the adversarial signal to control the level of distortion in relation to the original sample, i.e., (cid:107)x − x(cid:48)(cid:107)p < (cid:15), for a small perturbation budget (cid:15) and a p-norm, often set to infinity norm ((cid:96)∞). LINEBREAK motivation: the recent findings (shao et al., 2021; mahmood et al., 2021) demonstrate low black-box transferability of vits despite their higher parametric complexity and better feature generalization. motivated by this behaviour, we set-up a simple experiment of our own to study the adversarial transferability of vits (see fig. 2). we note that transferability of adversarial examples found via momentum iterative fast gradient sign method (dong et al., 2018) (mim) at (cid:96)∞ ≤ 16 on deit (touvron et al., 2020) does not increase with model capacity. in fact, adversarial transferability from deit base model (deit-b) on resnet152 and large vision transformer (vit-l (dosovitskiy et al., 2020)) is lower than deit tiny model (deit-t). this is besides the fact that deit-b has richer representations and around 17× more parameters than deit-t. we investigate if this behavior is inherent to vits or merely due to a sub-optimal attack mechanism. to this end, we exploit unique architectural characteristics of vits to first find an ensemble of networks within a single pretrained vit model (self-ensemble, right fig. 1). the class token produced by each self-attention block is processed by the final local norm and classification mlp-head to refine class-specific information (fig. 2). in other words, our mime and mimre variants attack class information stored in the class tokens produced by all the self-attention blocks within the model and optimize for the adversarial example (sec. 3.1 and 3.2). exploring the adversarial space of such multiple discriminative pathways in a self-ensemble generates highly transferable adversarial examples, as we show next. LINEBREAK self-ensemble: discriminative pathways of vision transformer LINEBREAK a vit model (dosovitskiy et al., 2020; touvron et al., 2020), f, with n transformer blocks can be defined as f = (f1 ◦ f2 ◦ f3 ◦ . . . fn) ◦ g, where fi represents a single vit block comprising of multi-head self-attention and feed-forward layers and g is the final classification head. to avoid notation clutter, we assume that g consists of the final local norm and mlp-head (touvron et al., 2020; dosovitskiy et al., 2020). self-attention layer within the vision transformer model takes a sequence of m image patches as input and outputs the processed patches. we will refer to the representations associated with the sequence of image patches as patch tokens, pt ∈ rm×d (where d is the dimensionality of each patch representation). attention in vit layers is driven by minimizing the empirical risk during training. in the case of classification, patch tokens are further appended with the class token (qt ∈ r1×d). these patch and class tokens are refined across multiple blocks (fi) and attention in these layers is guided such that the most discriminative information from patch tokens is preserved within the class token. the final class token is then projected to the number of classes by the classifier, g. due to the availability of class token at each transformer block, we can create an LINEBREAK figure 3: distribution of discriminative information across blocks of deit models. note how multiple intermediate blocks contain features with considerable discriminative information as measured by top-1 accuracy on the imagenet val. set. these are standard models pretrained on imagenet with no further training. each block (x-axis) corresponds to a classifier fk as defined in equation 1. LINEBREAK ensemble of classifiers by learning a shared classification head at each block along the vit hierarchy. this provides us an ensemble of n classifiers from a single vit, termed as the self-ensemble: LINEBREAK fk = LINEBREAK fi LINEBREAK ◦ g, where k = 1, 2, . . . , n. LINEBREAK we note that the multiple classifiers thus formed hold significant discriminative information. this is validated by studying the classification performance of each classifier (eq. 1) in terms of top-1 (%) accuracy on imagenet validation set, as demonstrated in fig. 3. note that multiple intermediate layers perform well on the task, especially towards the end of the vit processing hierarchy. LINEBREAK for an input image x with label y, an adversarial attack can now be optimized for the vit’s selfensemble by maximizing the loss at each vit block. however, we observe that initial blocks (1-6) for all considered deit models do not contain useful discriminative information as their classification accuracy is almost zero (fig. 3). during the training of vit models (touvron et al., 2020; yuan et al., 2021; mao et al., 2021), parameters are updated based on the last class token only, which means that the intermediate tokens are not directly aligned with the final classification head, g in our self-ensemble approach (fig. 3) leading to a moderate classification performance. to resolve this, we introduce a token refinement strategy to align the class tokens with the final classifier, g, and boost their discriminative ability, which in turn helps improve attack transferability. LINEBREAK token refinement LINEBREAK as mentioned above, the multiple discriminative pathways within a vit give rise to an ensemble of classifiers (eq. 1). however, the class token produced by each attention layer is being processed by the final classifier, g. this puts an upper bound on classification accuracy for each token which is lower than or equal to the accuracy of the final class token. our objective is to push the accuracy of the class tokens in intermediate blocks towards the upper bound as defined by the last token. for this purpose, we introduced a token refinement module to fine-tune the class tokens. LINEBREAK our proposed token refinement module is illustrated in fig. 4. it acts as an intermediate layer inserted between the outputs of each block (after the shared norm layer) and the shared classifier head. revisiting our baseline ensemble method (fig. 1), we note that the shared classifier head contains weights directly trained only on the outputs of the last transformer block. while the class tokens of previous layers may be indirectly optimized to align with the final classifier, there exists a potential for misalignment of these features with the classifier: the pretrained classifier (containing weights compatible with the last layer class token) may not extract all the useful information from the previous layers. our proposed module aims to solve this misalignment by refining the class tokens in a way such that the shared (pretrained) classifier head is able to extract all discriminative information LINEBREAK figure 4: recent vits process 196 image patches, leading to 196 patch tokens. we rearranged these to create a 14x14 feature grid which is processed by a convolutional block to extract structural information, followed by average pooling to create a single patch token. class token is refined via a mlp layer before feeding to the classifier. both tokens are subsequently merged. LINEBREAK figure 5: self-ensemble for deit (touvron et al., 2020): we measure the top-1 accuracy on imagenet using the class-token of each block and compare to our refined tokens. these results show that fine-tuning helps align tokens from intermediate blocks with the final classifier enhancing their classification performance. thus token refinement leads to strengthened discriminative pathways allowing more transferable adversaries. LINEBREAK contained within the class tokens of each block. moreover, intermediate patch tokens may contain additional information that is not at all utilized by the class tokens of those blocks, which would also be addressed by our proposed block. therefore, we extract both patch tokens and the class token from each block and process them for refinement, as explained next. LINEBREAK −patch token refinement: one of the inputs to the token refinement module is the set of patch tokens output from each block. we first rearrange these patch tokens to regain their spatial relationships. the aim of this component within the refinement module is to extract information relevant to spatial structure contained within the intermediate patch tokens. we believe that significant discriminative information is contained within these patches. the obtained rearranged patch tokens are passed through a convolution block (standard resnet block containing a skip connection) to obtain a spatially aware feature map, which is then average pooled to obtain a single feature vector (of same dimension as the class token). this feature vector is expected to extract all spatial information from patch tokens. LINEBREAK −class token refinement: by refining the class tokens of each block, we aim to remove any misalignment between the existing class tokens and the shared (pretrained) classifier head. also, given how the class token does not contain a spatial structure, we simply use a linear layer to refine it. we hypothesize that refined class token at each block would be much more aligned with the shared classifier head allowing it to extract all discriminative information contained within those tokens. LINEBREAK −merging patch and class token: we obtain the refined class token and the patch feature vector (refined output of patch tokens) and sum them together to obtain a merged token. while we tested multiple approaches for merging, simply summing them proved sufficient. LINEBREAK −training: given a vit model containing k transformer blocks, we plugin k instances of our token refinement module to the output of each block as illustrated in figure 4. we obtain the pretrained model, freeze all existing weights, and train only the k token refinement modules for only a single epoch on imagenet training set. we used sgd optimizer with learning rate set to 0.001. training finishes in less than one day on a single gpu-v100 even for a large vit model such as deit-b. LINEBREAK as expected, the trained token refinement module leads to increased discriminability of the class tokens, which we illustrate in figure 5. note how this leads to significant boosting of discriminative power especially in the earlier blocks, solving the misalignment problem. we build on this enhanced discriminability of the ensemble members towards better transferability, as explained next. LINEBREAK adversarial transfer LINEBREAK our modifications to vit models with respect to multiple discriminative pathways and token refinement are exploited in relation to adversarial transfer. we consider black-box attack perturbations that are generated using a source (surrogate) vit model. the source model is only pretrained on imagenet, modified according to our proposed approach and is subsequently fine-tuned to update only the token refinement module for a single epoch. we experiment with multiple white-box attacks, generating the adversarial examples using a joint loss over the outputs of each block. the transferability of adversarial examples is tested on a range of cnn and vit models. given input sample x and its label y, the adversarial object for our self-ensemble (eq. 1) for the untargeted attack is defined as, LINEBREAK source (↓) attack LINEBREAK fast gradient sign method (fgsm) (goodfellow et al., 2014) LINEBREAK convolutional LINEBREAK transformers LINEBREAK vit-l LINEBREAK tnt LINEBREAK mnas LINEBREAK vit-s LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK projected gradient decent (pgd) (madry et al., 2018) LINEBREAK vgg19bn pgd LINEBREAK mnas LINEBREAK pgd LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK pgd pgde pgdre LINEBREAK pgd pgde pgdre LINEBREAK pgd pgde pgdre LINEBREAK table 1: fool rate (%) on 5k imagenet val. adversarial samples at (cid:15) ≤ 16. perturbations generated from our proposed self-ensemble with refined tokens from a vision transformer have significantly higher success rate. LINEBREAK max x(cid:48) LINEBREAK [[fk(x(cid:48))argmax (cid:54)= y]], LINEBREAK where [[·]] is an indicator function. in the case of target attack, the attacker optimizes the above objective towards a specific target class instead of an arbitrary misclassification. LINEBREAK experiments LINEBREAK we conduct thorough experimentation on a range of standard attack methods to establish the performance boosts obtained through our proposed transferability approach. we create (cid:96)∞ adversarial attacks with (cid:15) ≤ 16 and observe their transferability by using the following protocols: LINEBREAK source (white-box) models: we mainly study three vision transformers from deit (touvron et al., 2020) family due to their data efficiency. specifically, the source models are deit-t, deit-s, and deit-b (with 5, 22, and 86 million parameters, respectively). they are trained without cnn distillation. adversarial examples are created on these models using an existing white-box attack (e.g., fgsm (goodfellow et al., 2014), pgd (madry et al., 2018) and mim (dong et al., 2018)) and then transferred to the black-box target models. LINEBREAK target (black-box) models: we test the black-box transferability across several vision tasks including classification, detection and segmentation. we consider convolutional networks including bit-resnet50 (bit50) (beyer et al., 2021), resnet152 (res152) (he et al., 2016), wide-resnet-50-2 (wrn) (zagoruyko & komodakis, 2016), densenet201 (dn201) (huang et al., 2017) and other vit models including token-to-token transformer (t2t) (yuan et al., 2021), transformer in transformer (tnt) (mao et al., 2021), dino (caron et al., 2021), and detection transformer (detr) (carion et al., 2020) as the black-box target models. LINEBREAK datasets: we use imagenet training set to fine tune our proposed token refinement modules. for evaluating robustness, we selected 5k samples from imagenet validation set such that 5 random samples from each class that are correctly classified by resnet50 and vit small (vit-s) (dosovitskiy et al., 2020) are present. in addition, we conduct experiments on coco (lin et al., 2014) (5k images) and pascal-voc12 (everingham et al., 2012) (around 1.2k images) validation set. LINEBREAK source (↓) attack LINEBREAK momemtum iterative fast gradient sign method (mim) (dong et al., 2018) LINEBREAK convolutional LINEBREAK transformers LINEBREAK mnas LINEBREAK wrn LINEBREAK vit-l LINEBREAK tnt LINEBREAK vit-s LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK mim with input diversity (dim) (xie et al., 2019) LINEBREAK vgg19bn dim LINEBREAK mnas LINEBREAK dim LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK table 2: fool rate (%) on 5k imagenet val. adversarial samples at (cid:15) ≤ 16. perturbations generated from our proposed self-ensemble with refined tokens from a vision transformer have significantly higher success rate. LINEBREAK evaluation metrics: we report fooling rate (percentage of samples for which the predicted label is flipped after adding adversarial perturbations) to evaluate classification. in the case of object detection, we report the decrease in mean average precision (map) and for automatic segmentation, we use the popular jaccard index. given the pixel masks for the prediction and the ground-truth, it calculates the ratio between the pixels belonging to intersection and the union of both masks. LINEBREAK baseline attacks: we show consistent improvements for single step fast gradient sign method (fgsm) (goodfellow et al., 2014) as well as iterative attacks including pgd (madry et al., 2018), mim (dong et al., 2018) and input diversity (transformation to the inputs) (dim) (xie et al., 2019) attacks. iterative attacks ran for 10 iterations and we set transformation probability for dim to default 0.7 (xie et al., 2019). our approach is not limited to specific attack settings, but existing attacks can simply be adopted to our self-ensemble vits with refined tokens. refer to appendices a-j for extensive analysis with more vit designs, attacks, datasets (cifar10 & flowers), computational cost comparison, and latent space visualization of our refined token. LINEBREAK 4.1 classification LINEBREAK in this section, we discuss the experimental results on adversarial transferability across black-box classification models. for a given attack method ‘attack’, we refer ‘attacke’ and ‘attackre’ as self-ensemble and self-ensemble with refined tokens, respectively, which are the two variants of our approach. we observe that adversarial transferability from vit models to cnns is only moderate for conventional attacks (tables 1 & 2). for example, perturbations found via iterative attacks from deit-b to res152 has even lower transfer than vgg19bn. however, the same attacks when applied using our proposed ensemble strategy (eq. 1) with refined tokens consistently showed improved transferability to other convolutional as well as transformer based models. we observe that models without inductive biases that share architecture similarities show higher transfer rate of adversarial perturbations among them (e.g., from deit to vit (dosovitskiy et al., 2020)). we further observe that models trained with the same mechanism but lower parameters are more vulnerable to black-box attacks. for example, vit-s and t2t-t are more vulnerable than their larger counterparts, vit-l and t2t-24. also models trained with better strategies that lead to higher generalizability are less vulnerable to black-box attacks e.g., bit50 is more robust than resnet152 (tables 1 and 2). LINEBREAK source (→) LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK no attack mim mimre mim mimre mim mimre LINEBREAK 24.0 dim dimre dim dimre dim dimre 20.5 LINEBREAK source (→) LINEBREAK deit-t LINEBREAK deit-s LINEBREAK deit-b LINEBREAK no attack mim mimre mim mimre mim mimre LINEBREAK 32.5 dim dimre dim dimre dim dimre 31.9 LINEBREAK figure 6: ablative study: fooling rate of intermediate layers under mim (white-box) attack using our self-ensemble approach. we obtain favorable improvements for our method. LINEBREAK table 3: cross-task transferability (classification→detection) object detector detr (carion et al., 2020) is fooled. map at [0.5:0.95] iou on coco val. set. our self-ensemble approach with refined token (re) significantly improves cross-task transferability. (lower the better) LINEBREAK table 4: cross-task transferability (classification→segmentation) dino (caron et al., 2021) is fooled. jaccard index metric is used to evaluate segmentation performance. best adversarial transfer results are achieved using our method. (lower the better) LINEBREAK clean image LINEBREAK adv image LINEBREAK clean image LINEBREAK adv image LINEBREAK clean image LINEBREAK adv image LINEBREAK figure 7: visualization of detr failure cases for our proposed dimre attack generated from deit-s source model. (best viewed in zoom) LINEBREAK the strength of our method is also evident by blockwise fooling rate in white-box setting (fig. 6). it is noteworthy how mim fails to fool the initial blocks of vit, while our approach allows the attack to be as effective in the intermediate blocks as for the last class token. this ultimately allows us to fully exploit vit’s adversarial space leading to high transfer rates for adversarial perturbations. LINEBREAK 4.2 cross-task transferability LINEBREAK self-attention is the core component of transformer architecture regardless of the task; classification (dosovitskiy et al., 2020; touvron et al., 2020; yuan et al., 2021; mao et al., 2021), object detection (carion et al., 2020), or unsupervised segmentation (caron et al., 2021). we explore the effectiveness of our proposed method on two additional tasks: object detection (detr) (carion et al., 2020) and segmentation (dino) (caron et al., 2021). we select these methods considering the use of transformer modules employing the self-attention mechanism within their architectures. while the task of object detection contains multiple labels per image and involves bounding box regression, the unsupervised model dino is trained in a self-supervised manner with no traditional image-level labels. moreover, dino uses attention maps of a vit model to generate pixel-level segmentations, which means adversaries must disrupt the entire attention mechanism to degrade its performance. LINEBREAK we generate adversarial signals on source models with a classification objective using their initial predictions as the label. in evaluating attacks on detection and segmentation tasks at their optimal setting, the source vit need to process images of different sizes (e.g., over 896×896 pix for detr). to cater for this, we process images in parts (refer appendix g) which allows generation of stronger adversaries. the performance degradation of detr and dino on generated adversaries are summarised in tables 3 & 4. for detr, we obtain clear improvements. in the more robust dino model, our transferability increases well with the source model capacity as compared to the baseline. LINEBREAK 5 conclusion LINEBREAK we identify a key shortcoming in the current state-of-the-art approaches for adversarial transferability of vision transformers (vits) and show the potential for much strong attack mechanisms that would exploit the architectural characteristics of vits. our proposed novel approach involving multiple discriminative pathways and token refinement is able to fill in these gaps, achieving significant performance boosts when applied over a range of state-of-the-art attack methods. LINEBREAK reproducibility statement: our method simply augments the existing attack approaches and we used open source implementations. we highlight the steps to reproduce all of the results presented in our paper, a) attacks: we used open source implementation of patchwise attack (gao et al., 2020) and auto-attack (croce & hein, 2020b) (refer appendix b) with default setting. wherever necessary, we clearly mention attack parameters, e.g., iterations for pgd (madry et al., 2018), mim (dong et al., 2018) and dim (xie et al., 2019) in section 4 (experiments: baseline attack). similarly, transformation probability for dim is set to the default value provided by the corresponding authors that is 0.7, b) refined tokens: we fine tuned class tokens for the pretrained source models (used to create perturbations) using open source code base (https: //github.com/pytorch/examples/tree/master/imagenet). we provided training details for fine tuning in section 3.2. further, we will publicly release all the models with refined tokens, c) cross-task attack implementation: we provided details in section 4.2 and pseudo code in appendix g for cross-task transferability (from classification to segmentation and detection), and d) dataset: we describe the procedure of selecting subset (5k) samples from imagenet val. set in section 4. we will also release indices of these samples to reproduce the results. LINEBREAK ethics statement: since our work focuses on improving adversarial attacks on models, in the short run our work can assist various parties with malicious intents of disrupting real-world deployed deep learning systems dependent on vits. however, irrespective of our work, the possibility of such threats emerging exists. we believe that in the long run, works such as ours will support further research on building more robust deep learning models that can withstand the kind of attacks we propose, thus negating the short term risks. furthermore, a majority of the models used are pre-trained on imagenet (ilsvrc’12). we also conduct our evaluations using this dataset. the version of imagenet used contains multiple biases that portray unreasonable social stereotypes. the data contained is mostly limited to the western world, and encodes multiple gender / ethnicity stereotypes yang et al. (2020) while also posing privacy risks due to unblurred human faces. in future, we hope to use the more recent version of imagenet yang et al. (2021) which could address some of these issues. LINEBREAK references LINEBREAK maksym andriushchenko, francesco croce, nicolas flammarion, and matthias hein. square attack: a queryefficient black-box adversarial attack via random search. in european conference on computer vision, pp. 484–501. springer, 2020. 14, 15 LINEBREAK lucas beyer, xiaohua zhai, amélie royer, larisa markeeva, rohan anil, and alexander kolesnikov. knowledge LINEBREAK distillation: a good teacher is patient and consistent. arxiv preprint arxiv:2106.05237, 2021. 7 LINEBREAK arjun nitin bhagoji, warren he, bo li, and dawn song. practical black-box attacks on deep neural networks LINEBREAK using efficient query mechanisms. in eccv, 2018. 3 LINEBREAK srinadh bhojanapalli, ayan chakrabarti, daniel glasner, daliang li, thomas unterthiner, and andreas veit. LINEBREAK understanding robustness of transformers for image classification. arxiv, abs/2103.14586, 2021. 2, 3 LINEBREAK tom b brown, benjamin mann, nick ryder, melanie subbiah, jared kaplan, prafulla dhariwal, arvind neelakantan, pranav shyam, girish sastry, amanda askell, et al. language models are few-shot learners. arxiv preprint arxiv:2005.14165, 2020. 1 LINEBREAK nicolas carion, francisco massa, gabriel synnaeve, nicolas usunier, alexander kirillov, and sergey zagoruyko. end-to-end object detection with transformers. in european conference on computer vision, pp. 213–229. springer, 2020. 7, 9 LINEBREAK nicholas carlini and david wagner. towards evaluating the robustness of neural networks. in s&p, 2017. 3 LINEBREAK mathilde caron, hugo touvron, ishan misra, hervé jégou, julien mairal, piotr bojanowski, and armand joulin. emerging properties in self-supervised vision transformers. arxiv preprint arxiv:2104.14294, 2021. 1, 7, 9 LINEBREAK pin-yu chen, huan zhang, yash sharma, jinfeng yi, and cho-jui hsieh. zoo: zeroth order optimization based LINEBREAK black-box attacks to deep neural networks without training substitute models. in aisec, 2017. 3 LINEBREAK pin-yu chen, yash sharma, huan zhang, jinfeng yi, and cho-jui hsieh. ead: elastic-net attacks to deep neural LINEBREAK networks via adversarial examples. in aaai, 2018. 3 LINEBREAK francesco croce and matthias hein. minimally distorted adversarial examples with a fast adaptive boundary LINEBREAK attack. in international conference on machine learning, pp. 2196–2205. pmlr, 2020a. 14, 15 LINEBREAK francesco croce and matthias hein. reliable evaluation of adversarial robustness with an ensemble of diverse LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep bidirectional LINEBREAK transformers for language understanding. arxiv preprint arxiv:1810.04805, 2018. 1 LINEBREAK yinpeng dong, fangzhou liao, tianyu pang, hang su, jun zhu, xiaolin hu, and jianguo li. boosting LINEBREAK alexey dosovitskiy, lucas beyer, alexander kolesnikov, dirk weissenborn, xiaohua zhai, thomas unterthiner, mostafa dehghani, matthias minderer, georg heigold, sylvain gelly, et al. an image is worth 16x16 words: transformers for image recognition at scale. arxiv preprint arxiv:2010.11929, 2020. 1, 4, 7, 8, 9 LINEBREAK m. everingham, l. van gool, c. k. i. williams, j. winn, and a. zisserman. the pascal visual object classes LINEBREAK lianli gao, qilong zhang, jingkuan song, xianglong liu, and hengtao shen. patch-wise attack for fooling LINEBREAK deep neural network. in european conference on computer vision, 2020. 10, 14, 15 LINEBREAK ian j goodfellow, jonathon shlens, and christian szegedy. explaining and harnessing adversarial examples. in LINEBREAK yiwen guo, qizhang li, and hao chen. backpropagating linearly improves transferability of adversarial LINEBREAK examples. in advances in neural information processing systems, 2020. 3 LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 770–778, 2016. 7, 20, 24 LINEBREAK gao huang, zhuang liu, laurens van der maaten, and kilian q weinberger. densely connected convolutional networks. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 4700–4708, 2017. 7 LINEBREAK qian huang, isay katsman, horace he, zeqi gu, serge belongie, and ser-nam lim. enhancing adversarial example transferability with an intermediate level attack. in proceedings of the ieee international conference on computer vision, pp. 4733–4742, 2019. 3 LINEBREAK andrew ilyas, logan engstrom, anish athalye, and jessy lin. black-box adversarial attacks with limited LINEBREAK queries and information. in icml, 2018. 3 LINEBREAK nathan inkawhich, kevin liang, lawrence carin, and yiran chen. transferable perturbations of deep in international conference on learning representations, 2020a. url https: LINEBREAK feature distributions. //openreview.net/forum?id=rjxao2vywr. 3 LINEBREAK nathan inkawhich, kevin j liang, binghui wang, matthew inkawhich, lawrence carin, and yiran chen. perturbing across the feature hierarchy to improve standard and strict blackbox attack transferability. arxiv preprint arxiv:2004.14861, 2020b. 3 LINEBREAK linxi jiang, xingjun ma, shaoxiang chen, james bailey, and yu-gang jiang. black-box adversarial attacks on LINEBREAK video recognition models. in acm mm, 2019. 3 LINEBREAK salman khan, muzammal naseer, munawar hayat, syed waqas zamir, fahad shahbaz khan, and mubarak LINEBREAK shah. transformers in vision: a survey. arxiv preprint arxiv:2101.01169, 2021. 1 LINEBREAK alex krizhevsky, geoffrey hinton, et al. learning multiple layers of features from tiny images. 2009. 14 LINEBREAK jiadong lin, chuanbiao song, kun he, liwei wang, and john e hopcroft. nesterov accelerated gradient and LINEBREAK scale invariance for adversarial attacks. arxiv preprint arxiv:1908.06281, 2019. 3 LINEBREAK tsung-yi lin, michael maire, serge belongie, james hays, pietro perona, deva ramanan, piotr dollár, and c lawrence zitnick. microsoft coco: common objects in context. in european conference on computer vision, pp. 740–755. springer, 2014. 7 LINEBREAK ze liu, yutong lin, yue cao, han hu, yixuan wei, zheng zhang, stephen lin, and baining guo. swin transformer: hierarchical vision transformer using shifted windows. arxiv preprint arxiv:2103.14030, 2021. 2, 14, 16 LINEBREAK aleksander madry, aleksandar makelov, ludwig schmidt, dimitris tsipras, and adrian vladu. towards deep LINEBREAK learning models resistant to adversarial attacks. in iclr, 2018. 3, 7, 8, 10, 14, 16, 17, 23 LINEBREAK kaleel mahmood, rigel mahmood, and marten van dijk. on the robustness of vision transformers to adversarial LINEBREAK yuxin mao, jing zhang, zhexiong wan, yuchao dai, aixuan li, yunqiu lv, xinyu tian, deng-ping fan, and nick barnes. transformer transforms salient object detection and camouflaged object detection. arxiv preprint arxiv:2104.10127, 2021. 1, 2, 5, 7, 9 LINEBREAK apostolos modas, seyed-mohsen moosavi-dezfooli, and pascal frossard. sparsefool: a few pixels make a big LINEBREAK difference. in cvpr, 2019. 3 LINEBREAK muzammal naseer, salman h khan, harris khan, fahad shahbaz khan, and fatih porikli. cross-domain transferability of adversarial perturbations. advances in neural information processing systems, 2019. 3 LINEBREAK muzammal naseer, salman khan, munawar hayat, fahad shahbaz khan, and fatih porikli. on generating LINEBREAK transferable targeted perturbations. arxiv preprint arxiv:2103.14641, 2021a. 3, 14 LINEBREAK muzammal naseer, kanchana ranasinghe, salman khan, munawar hayat, fahad shahbaz khan, and ming LINEBREAK hsuan yang. intriguing properties of vision transformers, 2021b. 1 LINEBREAK maria-elena nilsback and andrew zisserman. automated flower classification over a large number of classes. in 2008 sixth indian conference on computer vision, graphics & image processing, pp. 722–729. ieee, 2008. 14 LINEBREAK nicolas papernot, patrick mcdaniel, somesh jha, matt fredrikson, z berkay celik, and ananthram swami. LINEBREAK the limitations of deep learning in adversarial settings. in euros&p, 2016. 3 LINEBREAK sayak paul and pin-yu chen. vision transformers are robust learners, 2021. 1 LINEBREAK f. pedregosa, g. varoquaux, a. gramfort, v. michel, b. thirion, o. grisel, m. blondel, p. prettenhofer, r. weiss, v. dubourg, j. vanderplas, a. passos, d. cournapeau, m. brucher, m. perrot, and e. duchesnay. scikit-learn: machine learning in python. journal of machine learning research, 12:2825–2830, 2011. 21 LINEBREAK omid poursaeed, isay katsman, bicheng gao, and serge belongie. generative adversarial perturbations. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 4422–4431, 2018. 3 LINEBREAK rulin shao, zhouxing shi, jinfeng yi, pin-yu chen, and cho-jui hsieh. on the adversarial robustness of visual LINEBREAK jiawei su, danilo vasconcellos vargas, and kouichi sakurai. one pixel attack for fooling deep neural networks. LINEBREAK in ieee transactions on evolutionary computation. ieee, 2019. 3 LINEBREAK yusuke tashiro, yang song, and stefano ermon. output diversified initialization for adversarial attacks. arxiv LINEBREAK ilya tolstikhin, neil houlsby, alexander kolesnikov, lucas beyer, xiaohua zhai, thomas unterthiner, jessica yung, daniel keysers, jakob uszkoreit, mario lucic, et al. mlp-mixer: an all-mlp architecture for vision. arxiv preprint arxiv:2105.01601, 2021. 2, 14, 20, 22 LINEBREAK hugo touvron, matthieu cord, matthijs douze, francisco massa, alexandre sablayrolles, and hervé jégou. training data-efficient image transformers & distillation through attention. arxiv preprint arxiv:2012.12877, 2020. 1, 2, 4, 5, 6, 7, 9, 14, 15 LINEBREAK shikhar tuli, ishita dasgupta, erin grant, and thomas l. griffiths. are convolutional neural networks or LINEBREAK transformers more like human vision?, 2021. 1 LINEBREAK laurens van der maaten and geoffrey hinton. visualizing data using t-sne. journal of machine learning LINEBREAK ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n gomez, lukasz kaiser, LINEBREAK and illia polosukhin. attention is all you need. arxiv preprint arxiv:1706.03762, 2017. 1, 2 LINEBREAK xiaosen wang and kun he. enhancing the transferability of adversarial attacks through variance tuning. arxiv LINEBREAK dongxian wu, yisen wang, shu-tao xia, james bailey, and xingjun ma. skip connections matter: on the LINEBREAK transferability of adversarial examples generated with resnets. in iclr, 2020. 3 LINEBREAK haiping wu, bin xiao, noel codella, mengchen liu, xiyang dai, lu yuan, and lei zhang. cvt: introducing LINEBREAK convolutions to vision transformers. arxiv preprint arxiv:2103.15808, 2021. 14, 20, 22 LINEBREAK cihang xie, zhishuai zhang, yuyin zhou, song bai, jianyu wang, zhou ren, and alan l yuille. improving transferability of adversarial examples with input diversity. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 2730–2739, 2019. 3, 8, 10, 14, 17, 18, 19, 23 LINEBREAK kaiyu yang, klint qinami, li fei-fei, jia deng, and olga russakovsky. towards fairer datasets: filtering and balancing the distribution of the people subtree in the imagenet hierarchy. in faacct, pp. 547–558, 2020. 10 LINEBREAK kaiyu yang, jacqueline yau, li fei-fei, jia deng, and olga russakovsky. a study of face obfuscation in LINEBREAK li yuan, yunpeng chen, tao wang, weihao yu, yujun shi, francis eh tay, jiashi feng, and shuicheng yan. tokens-to-token vit: training vision transformers from scratch on imagenet. arxiv preprint arxiv:2101.11986, 2021. 1, 2, 5, 7, 9, 15 LINEBREAK sergey zagoruyko and nikos komodakis. wide residual networks. arxiv preprint arxiv:1605.07146, 2016. 7 LINEBREAK wen zhou, xin hou, yongjun chen, mengyun tang, xiangqi huang, xiang gan, and yong yang. transferable adversarial perturbations. in proceedings of the european conference on computer vision (eccv), pp. 452–467, 2018. 3 LINEBREAK appendix LINEBREAK adversarial perturbations found with ensemble of models are shown to be more transferable (dong et al., 2018; naseer et al., 2021a). in appendix a, we demonstrate the effectiveness of our selfensemble to boost adversarial transferability within ensemble of different models. our approach augments and enhances the transferability of the existing attack. we further demonstrate this with recent attacks, patchwise (gao et al., 2020) and auto-attack (croce & hein, 2020b) in appendix b. auto-attack is a strong white-box attack which is a combination of pgd with novel losses and other attacks such as boundary-based, fab (croce & hein, 2020a) and, query based square attack (andriushchenko et al., 2020). this highlights that our method can be used as plug-and-play with existing attack methods. we then evaluate adversarial transferability of auto-attack and pgd (100 iterations) at (cid:15) 4, 8, and 16 in appendix c. our self-ensemble with refined tokens approach consistently performs better with these attack settings as well. in appendix d, we extended our approach to other dataset including cifar10 (krizhevsky et al., 2009) and flowers (nilsback & zisserman, 2008) datasets. we highlight vulnerability of swin transformer (liu et al., 2021) against our approach in appendix e. we showed the results on full imagenet validation set (50k samples) in appendix f. this demonstrates the effectiveness of our method regardless of dataset or task. we discuss the generation of adversarial samples for images of sizes that are different to the source vit models’ input size (e.g., greater than 224) in appendix g. we provide computational cost analysis in appendix h and visualize the latent space of refined tokens in appendix h.1. finally, we extended our approach to diverse vit designs (wu et al., 2021; tolstikhin et al., 2021) and cnn in appendices i and j. LINEBREAK a self-ensemble within ensemble LINEBREAK we created an ensemble of pre-trained deit models (touvron et al., 2020) including deit-t, deits and deit-b. these models have 12 blocks (layers) and differ in patch embedding size. these models are trained in a similar fashion without distillation from cnn. as expected, adversarial transferability improves with an ensemble of models (table 5). we also note that unlike such multiple-model ensemble approaches, our self-ensemble attack achieves performance improvements with minimal increase in computational complexity of the attack that is from a single vit. our self-ensemble extended three classifiers ensemble to an ensemble of 36 classifiers. such multi-model ensemble combined with our proposed self-ensemble with refined tokens approach leads to clear attack improvements in terms of transferability (refer table 5). LINEBREAK projected gradient decent (pgd) (madry et al., 2018) LINEBREAK source (↓) LINEBREAK attack LINEBREAK convolutional LINEBREAK transformers LINEBREAK tnt LINEBREAK vit-s LINEBREAK deit-[t+s+b] LINEBREAK pgd pgde pgdre 64.1(+18) LINEBREAK momemtum iterative fast gradient sign method (mim) (dong et al., 2018) LINEBREAK deit-[t+s+b] LINEBREAK mim with input diversity (xie et al., 2019) LINEBREAK deit-[t+s+b]
| 13
|
[
111.891,
121.8160784,
168.5084558,
131.7786784
] |
dqnNW2omZL6.pdf
| 2,023
| 0
|
LINEBREAK graph neural networks are inherently good generalizers: insights by bridging gnns and mlps LINEBREAK chenxiao yang, qitian wu, jiahua wang & junchi yan∗ department of cse & moe key lab of artificial intelligence, shanghai jiao tong university {chr26195,echo740,wangjiahua2001,yanjunchi}@sjtu.edu.cn LINEBREAK abstract LINEBREAK graph neural networks (gnns), as the de-facto model class for representation learning on graphs, are built upon the multi-layer perceptrons (mlp) architecture with additional message passing layers to allow features to flow across nodes. while conventional wisdom commonly attributes the success of gnns to their advanced expressivity, we conjecture that this is not the main cause of gnns’ superiority in node-level prediction tasks. this paper pinpoints the major source of gnns’ performance gain to their intrinsic generalization capability, by introducing an intermediate model class dubbed as p(ropagational)mlp, which is identical to standard mlp in training, but then adopts gnn’s architecture in testing. intriguingly, we observe that pmlps consistently perform on par with (or even exceed) their gnn counterparts, while being much more efficient in training. codes are available at https://github.com/chr26195/pmlp. this finding provides a new perspective for understanding the learning behavior of gnns, and can be used as an analytic tool for dissecting various gnn-related research problems including expressivity, generalization, over-smoothing and heterophily. as an initial step to analyze pmlp, we show its essential difference to mlp at infinite-width limit lies in the ntk feature map in the post-training stage. moreover, through extrapolation analysis (i.e., generalization under distribution shifts), we find that though most gnns and their pmlp counterparts cannot extrapolate non-linear functions for extreme out-of-distribution data, they have greater potential to generalize to testing data near the training data support as natural advantages of the gnn architecture used for inference. LINEBREAK introduction LINEBREAK in the past decades, neural networks (nns) have achieved great success in many areas. as a classic nn architecture, multi-layer perceptrons (mlps) (rumelhart et al., 1986) stack multiple feedforward (ff) layers with nonlinearity to universally approximate functions. later, graph neural networks (gnns) (scarselli et al., 2008b; bruna et al., 2014; gilmer et al., 2017; kipf & welling, 2017; veliˇckovi´c et al., 2017; hamilton et al., 2017; klicpera et al., 2019; wu et al., 2019) build themselves upon the mlp architecture, e.g., by inserting additional message passing (mp) operations amid ff layers (kipf & welling, 2017) to accommodate the interdependence between instance pairs. LINEBREAK two cornerstone concepts lying in the basis of deep learning research are model’s representation and generalization power. while the former is concerned with what function class nns can approximate and to what extent they can minimize the empirical risk (cid:98)r(·), the latter instead focuses on the inductive bias in the learning procedure, asking how well the learned function can generalize to unseen in- and out-of-distribution samples, reflected by the generalization gap r(·) − (cid:98)r(·). there exist a number of works trying to dissect gnns’ representational power (e.g., scarselli et al. (2008a); xu et al. (2018a); maron et al. (2019); oono & suzuki (2019)), while their generalizability and connections with mlp are far less well-understood. LINEBREAK ∗correspondence author is junchi yan who is also affiliated with shanghai ai laboratory. the work was in part supported by national key research and development program of china (2020aaa0107600), nsfc (62222607), and stcsm (22511105100). LINEBREAK figure 1: (a) model illustration for mlp, gnn (in gcn-style) and pmlp. (b) learning curves for node classification on cora that depicts a typical empirical phenomenon. (c) intrinsic generalizability of gnn reflected by close generalization performance of gnn and pmlp. (d) extrapolation illustration: both mlp and pmlp linearize outside the training data support (•: train sample, ◦: test sample), while pmlp transits more smoothly and exhibits larger tolerance for ood testing sample. LINEBREAK in this work, we bridge gnns and mlps by introducing an intermediate model class called propagational mlps (pmlps). during training, pmlps are exactly the same as a standard mlp (e.g., same architecture, data for training, initialization, loss function, optimization algorithm). in the testing phase, pmlps additionally insert non-parametric mp layers amid ff layers, as shown in fig. 1(a), to align with various gnn architectures including (but not limited in) gcn (kipf & welling, 2017), sgc (wu et al., 2019) and appnp (klicpera et al., 2019). LINEBREAK (empirical results and implications) according to experiments across sixteen node classification benchmarks and additional discussions on different architectural choices (i.e., layer number, hidden size), model instantiations (i.e., ff/mp layer implementation) and data characteristics (i.e., data split, amount of structural information), we identify two-fold intriguing empirical phenomenons: • phenomenon 1: pmlp significantly outperforms mlp. despite that pmlp shares the same weights (i.e., trained model parameters) with a vanilla mlp, it tends to yield lower generalization gap and thereby outperforms mlp by a large margin in testing, as illustrated in fig. 1(c) and (b) respectively. this observation suggests that the message passing / graph convolution modules in gnns can inherently improve model’s generalization capability for handling unseen samples. the word “inherently” underlines that such particular generalization effects are implicit in the gnn architectures (with message passing mechanism) used in inference, but isolated from factors in the training process, such as: larger hypothesis space for representing a rich set of “graph-aware” functions (scarselli et al., 2008a; xu et al., 2018a), more suitable inductive biases in model selection that prioritize those functions capable of relational reasoning (battaglia et al., 2018), etc. • phenomenon 2: pmlp performs on par with or even exceed gnns. pmlp achieves close testing performance to its gnn counterpart in inductive node classification tasks, and can even outperform gnn by a large margin in some cases (i.e., removing self-loops and adding noisy edges). given that the only difference between gnn and pmlp is the model architecture used in training and the representation power of pmlp is exactly the same with mlp before testing, this observation suggests that the major (but not only) source of performance improvement of gnns over mlp in node classification stems from the aforementioned inherent generalization capability of gnns. LINEBREAK (practical significance) we also highlight that pmlp, as a novel class of models (using mlp architecture in training and gnn architecture in inference), can be used for broader analysis purpose or applied as a simple, flexible and very efficient graph encoder model for scalable training. ⋄ pmlp as an analytic tool. pmlps can be used for dissecting various gnn-related problems such as over-smoothing and heterophily (see sec. 3.3 for preliminary explorations), and in a broader sense can potentially bridge theoretical research in two areas by enabling us to conveniently leverage well-established theoretical frameworks for mlps to enrich those for gnns. ⋄ pmlp as efficient graph encoders. while being as effective as gnns in many cases, pmlps are significantly more efficient in training (5 ∼ 17× faster on large datasets, and 65× faster for very deep gnns with more than 100 mp layers). in fact, pmlps are equivalent to gnns with all edges dropped in training, which itself (rong et al., 2020) is a widely recognized way (i.e., dropedge) for accelerating gnn training. moreover, pmlps are more robust against noisy edges, can be trivially LINEBREAK combined with mini-batch training (and many other training tricks for general nns), and help to quickly evaluate gnn architectures to facilitate model development. notably, pmlps can further be extended to transductive learning setting, and are compatible with many other gnn architectures with residual connections (e.g., gcnii (chen et al., 2020b)) or parametric message passing layers (e.g., gat (veliˇckovi´c et al., 2017)) with slight modifications as will be specified. LINEBREAK (theoretical results and contributions) as mentioned above, our empirical finding narrows down many different factors between mlps and gnns to a key one that attributes to their performance gap, i.e., improvement in generalizability due to the change in network architecture. then, a natural question arises: “why this is the case and how does the gnn architecture (in testing) helps the model to generalize?”. we take an initial step towards answering this question: ◦ comparison of three classes of models in ntk regime. we compare mlp, pmlp, and gnn in the neural tangent kernel (ntk) regime (jacot et al., 2018), where models are over-parameterized and gradient descent finds the global optima. from this perspective, the distinction of pmlp and mlp is rooted in the change of ntk feature map determined by model architecture while fixing their minimum rkhs-norm solutions (proposition 1). for deeper investigation, we first extend the definition of graph neural tangent kernel (gntk) (du et al., 2019) to the node regression setting (lemma 2), and derive the explicit formula for computing the feature map for pmlp/gnn. ◦ ood generalization / extrapolation analysis for pmlps and gnns. we consider an important (yet overlooked) aspect of generalization analysis, i.e., extrapolation for out-of-distribution (ood) testing samples (xu et al., 2021) where testing node features become increasingly outside the training data support. particularly, we reveal that alike mlp, both pmlp and gnn eventually converge to linear functions when testing samples are infinitely far away from the training data support (theorem 4). nevertheless, their convergence rates are smaller than that of mlp by a factor related to node degrees and features’ cosine similarity (theorem 5), which indicates both pmlp and gnn are more tolerant to ood samples and thus have larger potential to generalize near the training data support (which is often the real-world case). we provide an illustration in fig. 1(d). LINEBREAK related works LINEBREAK generalization, especially for feed-forward nns (i.e., mlps), has been extensively studied in the general ml field (arora et al., 2019a; allen-zhu et al., 2019; cao & gu, 2019). however for gnns, the large body of existing theoretical works focus on their representational power(e.g., scarselli et al. (2008a); xu et al. (2018a); maron et al. (2019); oono & suzuki (2019)), while their generalization capability is less well-understood. for node-level prediction setting, those works in generalization analysis (scarselli et al., 2018; verma & zhang, 2019; baranwal et al., 2021; ma et al., 2021) mainly aim to derive generalization bounds, but did not establish connections with mlps since they assume the same gnn architecture in training and testing. for theoretical analysis, the most relevant work is (xu et al., 2021) that studies the extrapolation behavior of mlp. their results will later be used in this work. the authors also shed lights on the extrapolation power of gnns, but for graph-level prediction with max/min propagation from the perspective of algorithmic alignment, which cannot apply to gnns with average/sum propagation in node-level prediction that are more commonly used. LINEBREAK regarding the relation between mlps and gnns, there are some recent attempts to boost the performance of mlp to approach that of gnn, by using label propagation (huang et al., 2021), contrastive learning (hu et al., 2021), knowledge distillation (zhang et al., 2022) or additional regularization in training (zhang et al., 2023). however, it is unclear whether these graph-enhanced mlps can explain the success of gnns since it is still an open research question to understand these training techniques themselves. there are also few works probing into similar model architectures as pmlp, e.g. klicpera et al. (2019), which can generally be seen as special cases of pmlp. a concurrent work (han et al., 2023) further finds that pmlp with an additional fine-tuning procedure can be used to significantly accelerate gnn training. moreover, a recent work (baranwal et al., 2023) also theoretically studies how message passing operations benefit multi-layer networks in node classification tasks, which complements our results. LINEBREAK background and model formulation LINEBREAK assume a graph dataset g = (v, e) where the node set v contains n nodes instances {(xu, yu)}u∈v , where xu ∈ rd denotes node features and yu is the label. without loss of generality, yu can be a categorical variable or a continuous one depending on specific prediction tasks (classification or LINEBREAK regression). instance relations are described by the edge set e and an associated adjacency matrix a ∈ {0, 1}n×n. in general, the problem is to learn a predictor model with ˆy = f (x; θ, gk x) for node-level prediction, where gk LINEBREAK x denotes the k-hop ego-graph around x over g. LINEBREAK graph neural networks and multi-layer perceptrons. to probe into the connection between mainstream gnns and mlp from the architectural view, we re-write the gnn formulation in a general form that explicitly disentangles each layer into two operations, namely a message-passing (mp) operation and then a feed-forwarding (ff) operation: LINEBREAK (mp): LINEBREAK ˜h(l−1) u LINEBREAK ag(u, v) · h(l−1) LINEBREAK u LINEBREAK v∈nu∪{u} LINEBREAK (ff): h(l) LINEBREAK u LINEBREAK where nu is the set of neighbored nodes centered at u, ag(u, v) is the affinity function dependent on graph structure g, ψ(l) denotes a feature transformation mapping at the l-th layer, and h(0) u = xu is the initial node feature. for example, in graph convolution network (gcn) (kipf & welling, ˜dv, where ˜du denotes the degree of node u (with self-loop), and 2017), ag(u, v) = auv/ ψ(l) is a fully-connected layer with non-linearity. for an l-layer gnn, the prediction is given by ˆyu = ψ(l)(h(l−1) ), where ψ(l) is often set as linear transformation for regression tasks or with softmax for classification tasks. note that gnn models in forms of eq. 1 degrade to an mlp with a series of ff layers after removing all the mp operations: LINEBREAK u LINEBREAK ˆyu = ψ(l)(· · · (ψ(1)(xu)) = ψ(xu). LINEBREAK typical types of gnn architectures. besides gcn, many other mainstream gnn models can be written as the architectural form defined by eq. 1 whose layer-wise updating rule involves mp and ff operations, e.g., gat (veliˇckovi´c et al., 2017) and graphsaint (zeng et al., 2019). some recently proposed node-level transformer models such as nodeformer (wu et al., 2022) and difformer (wu et al., 2023) also fall into this category. furthermore, there are also other types of gnn architecture represented by sgc (wu et al., 2019) and appnp (klicpera et al., 2019) where the former adopts multiple mp operations on the initial node features, and the later stacks a series of mp operations at the end of ff layers. these two classes of gnns are also widely explored and studied. for example, sign (rossi et al., 2020), s2gc (zhu & koniusz, 2021) and gbp (chen et al., 2020a) follow the sgc-style, and dagnn (liu et al., 2020c), ap-gcn (spinelli et al., 2020) and gpr-gnn (chien et al., 2020) follow the appnp-style. LINEBREAK bridging gnns and mlps: propagational mlp. after decoupling the mp and ff operations from gnns’ layer-wise updating, we notice that the unique and critical difference of gnns and mlp lies in whether to adopt mp (somewhere between the input node features and output prediction). to connect two families, we introduce a new model class, dubbed as propagational mlp (pmlp), which has exactly the same architecture as conventional mlp, namely, the same feed-forwarding network. during the inference/testing stage, pmlpgcn incorporates a message passing layer into each layer’s feed-forwarding, pmlpsgc adds multiple mp layers in the first layer, and pmlpap p adds them in the last layer. for clear head-to-head comparison, table 6 in the appendix summarizes the architecture of these models in training and testing stages. LINEBREAK extensions of pmlp. the proposed pmlp is generic and compatible with many other gnn architectures with some slight modifications. for example, we can extend the definition of pmlps to gnns with residual connections such as jknet (xu et al., 2018b) and gcnii (chen et al., 2020b) by removing their message passing modules in training, and correspondingly, pmlpkjn et and pmlpgcn ii become mlps with different residual connections in training, which will be further discussed in the next section. for gnns whose mp layers are parameterized such as gat (veliˇckovi´c et al., 2017), one can additionally fine-tune the pmlp model using the corresponding gnn architecture on top of pre-trained ff layers or training mp layers independently. LINEBREAK empirical evaluation LINEBREAK we conduct experiments on a variety of node-level prediction benchmarks. section 3.1 shows that the proposed pmlps can significantly outperform the original mlp though they share the same weights, and approach or even exceed their gnn counterparts. section 3.2 shows this phenomenon holds across different experimental settings. section 3.3 sheds new insights on some research LINEBREAK table 1: mean and std of testing accuracy on node-level prediction benchmark datasets. LINEBREAK dataset #nodes LINEBREAK s gcn n n g LINEBREAK sgc LINEBREAK appnp LINEBREAK mlp LINEBREAK coauthor-cs coauthor-physics LINEBREAK s p l m LINEBREAK table 2: mean and std of testing accuracy on three large-scale datasets. LINEBREAK gcn LINEBREAK sgc LINEBREAK appnp LINEBREAK mlp LINEBREAK pmlpgcn LINEBREAK pmlpsgc LINEBREAK pmlpap p LINEBREAK ogbn-arxiv (∆gn n /∆m lp ) LINEBREAK train loss train time LINEBREAK ogbn-products (∆gn n /∆m lp ) LINEBREAK train loss train time LINEBREAK flickr (∆gn n /∆m lp ) LINEBREAK train loss train time LINEBREAK problems around gnns including over-smoothing, model depth and heterophily. we present the key experimental results in the main text and defer extra results and discussions to appendix f and g. LINEBREAK we consider sixteen node classification benchmarks involving different types of networks. for fair comparison, we set the layer number and hidden size to the same values for gnn, pmlp and mlp in the same dataset. we basically use gcn convolution for mp layer and relu activation for ff layer for all models unless otherwise stated. pmlps use the mlp architecture for validation. for sgc, we use a mlp instead of one ff layer after linear message passing, and for appnp, we remove the residual connection (i.e., α = 0) such that the mp layer is aligned with other models. more details about implementation, datasets and hyperparameters are deferred to appendix f. LINEBREAK we adopt inductive learning setting as the evaluation protocol, which is a commonly used benchmark setting by the community, and guarantee a fair comparison between pmlp and its gnn counterpart by ensuring the information of validation/testing nodes is not used in training for all models. specifically, for node set v = vtr ∪ vte where vtr (resp. vte) denotes training (resp. testing) nodes, the training process is only exposed to gtr = {vtr, etr}, where etr ⊂ vtr × vtr only contains edges for nodes in vtr and the trained model is tested with the whole graph g for prediction on vte. LINEBREAK main results LINEBREAK how do pmlps perform compared with gnns and mlp on common benchmarks? the main results for comparing the testing accuracy of mlp, pmlps and gnns on seven benchmark datasets are shown in table. 1. we found that, intriguingly, three variants of pmlps consistently outperform mlp by a large margin on all the datasets despite using the same model with the same set of trainable parameters. moreover, pmlps are as effective as their gnn counterparts and can even exceed gnns in some cases. these results suggest two implications. first, the performance improvement brought by gnns (or more specifically, the mp operation) over mlp may not purely stem from the more advanced representational power, but the generalization ability. second, the message passing can indeed contribute to better generalization ability of mlp, though it currently remains unclear how it helps mlp to generalize on unseen testing data. we will later try to shed some light on this question via theoretical analysis in section 4. LINEBREAK how do pmlps perform on larger datasets? we next apply pmlps to larger graphs which can be harder for extracting informative features from observed data. as shown in table 2, pmlp still LINEBREAK (a) number of layers LINEBREAK (b) size of hidden states LINEBREAK figure 2: performance variation with increasing layer number and size of hidden states. (see complete results in appendix g). LINEBREAK (a) activation functions LINEBREAK (b) transition matrix LINEBREAK figure 3: performance variation with different activation functions in ff layer and different transition matrices in mp layer. (see complete results in appendix g) LINEBREAK figure 4: impact of graph structural information by changing data split, sparsifying the graph, adding random structural noise on cora. (see complete results in appendix g) LINEBREAK considerably outperforms mlp. yet differently, there is a certain gap between pmlp and gnn. we conjecture that this is because in such large graphs the relations between inputs and target labels can be more complex, which requires more expressive architectures for learning desired node-level representations. this hypothesis is further validated by the results of training losses in table 2, which indeed shows that gnns can yield lower fitting error on the training data. LINEBREAK further discussions LINEBREAK we next conduct more experiments and comparison for verifying the consistency of the observed phenomenon across different settings regarding model implementation and graph property. we also try to reveal how pmlps work for representation learning through visualizations of the produced embeddings, and the results are deferred to appendix g. LINEBREAK q1: what is the impact of model layers and hidden sizes? in fig. 2(a) and (b), we plot the testing accuracy of gcn, pmlpgcn and mlp w.r.t. different layer numbers and hidden sizes. the results show that the observed phenomenon in section 3.1 consistently holds with different settings of model depth and width, which suggests that the generalization effect of the mp operation is insensitive to model architectural hyperparameters. the increase of layer numbers cause performance degradation for all three models, presumably because of over-fitting. we will further discuss the impact of model depth (where layer number exceeds 100) and residual connections in the next subsection. LINEBREAK q2: what is the impact of different activation functions in ff layers? as shown in fig. 3(a), the relative performance rankings among gcn, pmlp and mlp stay consistent across four different activation functions (tanh, cos, elu, relu) and in particular, in some cases the performance gain of pmlp over gcn is further amplified (e.g., with cos activation). LINEBREAK q3: what is the impact of different propagation schemes in mp layers? we replace the original transition matrix psym = ˜d− 1 2 used in the mp layer by other commonly used transition 2 , i.e., removing self-loop; 2) prw = ˜d−1 ˜a, i.e., random walk matrices: 1) pno-loop = d− 1 matrix; 3) pdiff = (cid:80)∞ e·k! ( ˜d−1 ˜a)k, i.e., heat kernel diffusion matrix. the results are presented 1 in fig. 3(b) where we found that the relative performance rankings of three models keep nearly unchanged after replacing the original mp layer. and, intriguingly, the performance of gnns degrade dramatically after removing the self-loop, while the accuracy of pmlps stays at almost the same level. the possible reason is that the self-loop connection plays an important role in gcn’s training stage for preserving enough centered nodes’ information, but does not affect pmlp. LINEBREAK q4: what is the impact of training proportion? we use random split to control the amount of graph structure information used in training. as shown in fig. 4(left), the labeled portion of nodes and the amount of training edges have negligible impacts on the relative performance of three models. LINEBREAK q5: what is the impact of graph sparsity? as suggested by fig. 4(middle), when the graph goes sparser, the absolute performance of gcn and pmlp degrades yet their performance gap remains unchanged. this shows that the quality of input graphs indeed impacts the testing performance and tends to control the performance upper bound of the models. critically though, the generalization effect brought by pmlp is insensitive to the graph completeness. LINEBREAK q6: what is the impact of noisy structure? as shown in fig. 4(right), the performances of both pmlp and gcn tend to decrease as we gradually add random connections to the graph, whose amount is controlled by the noise ratio (defined as # noisy edges/|e|), while pmlp shows better robustness to such noise. this indicates noisy structures have negative effects on both training and generalization of gnns and one may use pmlp to mitigate this issue. LINEBREAK over-smoothing, model depth, and heterophily LINEBREAK we conduct additional experiments to shed lights on broader aspects of gnns including oversmoothing, model depth and graph heterophily. detailed results and respective discussions are deferred to appendix e. in a nutshell, we find the phenomenon still holds for gnns with residual connections (i.e., jknet and gcnii), very deep gnns (with more than 100 layers) and heterophilic graphs. this indicates that both over-smoothing and heterophily are problems closely related to failure cases of gnn generalization, and can be mitigated by using mp layers that are more suitable for the data or backbone mlp models with better generalization capability, aligning with some previous studies (battaglia et al., 2018; cong et al., 2021). LINEBREAK extension to transductive settings LINEBREAK notably, the current training procedure of pmlp does not involve unlabeled nodes but can be extended to such scenario by combining with existing semi-supervised learning approaches (van engelen & hoos, 2020) such as using label propagation (zhu et al., 2003) to generate pseudo labels for unlabeled nodes, or additionally using the gnn architecture for fine-tuning, which is still shown to be more efficient than training gnns from scratch (han et al., 2023). LINEBREAK theoretical insights on gnn generalization LINEBREAK towards theoretically answering why “gnns are inherently good generalizers” and explaining the superior generalization performance of pmlp and gnn, we next compare mlp, pmlp and gnn from the neural tangent kernel (ntk) perspective, derive the formula for computing graph neural tangent kernel (gntk) in node regression, and then use the results to examine their extrapolation behaviors, i.e., generalization under distribution shifts. note that our analysis focuses on the model architecture used in inference, and thus the results presented in sec. 4.2 are applicable for both gnn and pmlp in both inductive and transductive settings. LINEBREAK ntk perspective on mlp, pmlp and gnn LINEBREAK linearization of neural networks. for a neural network f (x; θ) : x → r with initial parameters θ0 and a fixed input sample x, performing first-order taylor expansion around θ0 yields the linearized form of nns (lee et al., 2019) as follows: LINEBREAK f lin(x; θ) = f (x; θ0) + ∇θf (x; θ0)⊤ (θ − θ0) , LINEBREAK where the gradient ∇θf (x; θ0) could be thought of as a feature map ϕ(x) : x → r|θ|, depending on the specific initialization. as such, when θ0 is initialized by gaussian distribution with certain scaling and the network width tends to infinity (i.e., m → ∞, where m denotes the layer width), the feature map becomes constant and is determined by the model architecture (e.g., mlp, gnn and cnn), inducing a kernel called ntk (jacot et al., 2018): LINEBREAK ntk(xi, xj) = ϕntk(xi)⊤ϕntk(xj) = ⟨∇θf (xi; θ), ∇θf (xj; θ)⟩ LINEBREAK kernel regression with ntk. recent works (liu et al., 2020b;a) show that the spectral norm of m), and hence the hessian matrix in the taylor series tends to zero with increasing width by θ(1/ linearization becomes almost exact. therefore, training an over-parameterized nn using gradient descent with infinitesimal step size is equivalent to kernel regression with ntk (arora et al., 2019b): LINEBREAK f (x; w) = w⊤ϕntk(x), l(w) = LINEBREAK (cid:0)yi − w⊤ϕntk(xi)(cid:1)2 LINEBREAK we next show the equivalence of mlp and pmlp in training at infinite width limit (ntk regime). proposition 1. mlp and its corresponding pmlp have the same minimum rkhs-norm ntk kernel regression solution, but differ from that of gnns, i.e., w∗ LINEBREAK mlp = w∗ LINEBREAK pmlp ̸= w∗ LINEBREAK gnn. LINEBREAK implications. from the ntk perspective, stacking additional message passing layers in the testing phase implies transforming the fixed feature map from that of mlp ϕmlp(x) to that of gnn ϕgnn(x), while fixing w. given w∗ pmlp, the superior generalization performance of pmlp (i.e., the key factor of performance surge from mlp to gnn) can be explained by such transformation of feature map from ϕmlp(x) to ϕgnn(x) in testing: LINEBREAK mlp = w∗ LINEBREAK fmlp(x) = w∗⊤ LINEBREAK mlp ϕmlp(x), LINEBREAK fpmlp(x) = w∗⊤ LINEBREAK mlp ϕgnn(x), LINEBREAK fgnn(x) = w∗⊤ LINEBREAK gnn ϕgnn(x). LINEBREAK this perspective simplifies the subsequent theoretical analysis by setting the focus on the difference of feature map, which is determined by the network architecture used in inference, and empirically suggested to be the key factor attributing to superior generalization performance of gnn and pmlp. to step further, we next derive the formula for computing ntk feature map of pmlp and gnn (i.e., ϕgnn(x)) in node regression tasks. LINEBREAK gntk in node regression. following previous works that analyse shallow and wide nns (arora et al., 2019a; chizat & bach, 2020; xu et al., 2021), we focus on a two-layer gnn using average aggregation with self-connection. by extending the original definition of gntk (du et al., 2019) from graph-level regression to node-level regression as specified in appendix. c, we have the following explicit form of ϕgnn(x) for a two-layer gnn. lemma 2. the explicit form of gntk feature map for a two-layer gnn ϕgnn(x) with average aggregation and relu activation in node regression is LINEBREAK ϕgnn(xi) = c LINEBREAK x⊤aj · i+ LINEBREAK w(k)⊤ LINEBREAK x⊤aj LINEBREAK , w(k)⊤ LINEBREAK x⊤aj · i+ LINEBREAK w(k)⊤ LINEBREAK x⊤aj LINEBREAK j∈ni∪{i} LINEBREAK where c = o( ˜d−1) is a constant proportional to the inverse of node degree, x ∈ rn×d is node features, ai ∈ rn denotes adjacency vector of node i, w(k) ∼ n (0, id) is a random gaussian vector in rd, two components in the brackets repeat infinitely many times with k ranging from 1 to ∞, and i+ is an indicator function that outputs 1 if the input is positive otherwise 0. LINEBREAK mlp v.s. pmlp in extrapolation LINEBREAK as indicated by proposition 1, the fundamental difference between mlp and pmlp at infinite width limit stems from the difference of feature map in the testing phase. this reduces the problem of explaining the success of gnn to the question that why this change is significant for generalizability. LINEBREAK extrapolation behavior of mlp. one important aspect of generalization analysis is regarding model’s behavior when confronted with ood testing samples (i.e., testing nodes that are considerably outside the training support), a.k.a. extrapolation analysis. a previous study on this direction (xu et al., 2021) reveal that a standard mlp with relu activation quickly converges to a linear function as the testing sample escapes the training support, which is formalized by the following theorem. LINEBREAK theorem 3. (xu et al., 2021). suppose fmlp(x) is an infinitely-wide two-layer mlp with relu trained by square loss. for any direction v ∈ rd and step size ∆t > 0, let x0 = tv, we have LINEBREAK (fmlp(x0 + ∆tv) − fmlp(x0)) /∆t cv LINEBREAK = o( LINEBREAK where cv is a constant linear coefficient. that is, as t → ∞, fmlp(x0) converges to a linear function. LINEBREAK the intuition behind this phenomenon is the fact that relu mlps learn piece-wise linear functions with finitely many linear regions and thus eventually becomes linear outside training data support. now a naturally arising question is how does pmlp compare with mlp regarding extrapolation? LINEBREAK extrapolation behavior of pmlp. based on the explicit formula for ϕgnn(x) in lemma 2, we extend the theoretical result of extrapolation analysis from mlp to pmlp. our first finding is that, as the testing node feature becomes increasingly outside the range of training data, alike mlp, pmlp (as well as gnn) with average aggregation also converges to a linear function, yet the corresponding linear coefficient reflects its ego-graph property rather than being a fixed constant. theorem 4. suppose fpmlp(x) is an infinitely-wide two-layer mlp with relu activation trained using squared loss, and adds average message passing layer before each feed-forward layer in the testing phase. for any direction v ∈ rd and step size ∆t > 0, let x0 = tv, and as t → ∞, we have LINEBREAK (fpmlp(x0 + ∆tv) − fpmlp(x0)) /∆t → cv LINEBREAK ( ˜d · ˜di)−1. LINEBREAK where cv is the same constant as in theorem 3, ˜d0 = ˜d is the node degree (with self-connection) of x0, and ˜di is the node degree of its neighbors. remark. this result also applies to infinitely-wide two-layer gnn with relu activation and average aggregation in node regression settings, except the constant cv is different from that of mlp. LINEBREAK convergence comparison. though both mlp and pmlp tend to linearize for outlier testing samples, indicating that they have common difficulty to extrapolate non-linear functions, we find that pmlp in general has more freedom to deviate from the convergent linear coefficient, implying smoother transition from in-distribution (non-linear) to out-of-distribution (linear) regime and thus could potentially generalize to out-of-distribution samples near the range of training data. theorem 5. suppose all node features are normalized, and the cosine similarity of node xi and the average of its neighbors is deonoted as αi ∈ [0, 1]. then, the convergence rate for fpmlp(x) is LINEBREAK (fpmlp(x0 + ∆tv) − fpmlp(x0)) /∆t LINEBREAK (cid:12) (cid:12) (cid:12) − 1 (cid:12) (cid:12) where αmin = min{αi}i∈n0∪{0} ∈ [0, 1], and ˜dmax ≥ 1 denotes the maximum node degree in the testing node x0’s neighbors (including itself). LINEBREAK = o LINEBREAK min LINEBREAK cv LINEBREAK this result indicates larger node degree and feature dissimilarity imply smoother transition and better compatibility with ood samples. specifically, when the testing node’s degree is 1 (connection to itself), pmlp becomes equivalent to mlp. as reflection in eq. 10, ˜dmax = 1, and the bound degrades to that of mlp in eq. 8. moreover, when all node features are equal, message passing will become meaningless. correspondingly, ˜αmin = 1, and the bound also degrades to that of mlp. LINEBREAK more discussions and conclusion LINEBREAK we defer more discussions on other sources of performance gap between mlp and gnn, our current limitations and outlooks to appendix a. LINEBREAK conclusion. in this work, we bridge mlp and gnn by introducing an intermediate model class called pmlp, which is equivalent to mlp in training, but shows significantly better generalization performance after adding unlearned message passing layers in testing and can rival with its gnn counterpart in most cases. this phenomenon is consistent across different datasets and experimental settings. to shed some lights on this phenomenon, we show despite that both mlp and pmlp cannot extrapolate non-linear functions, pmlp converges slower, indicating smoother transition and better tolerance for out-of-distribution samples. LINEBREAK references LINEBREAK zeyuan allen-zhu, yuanzhi li, and yingyu liang. learning and generalization in overparameterized neural networks, going beyond two layers. advances in neural information processing systems, 32, 2019. LINEBREAK sanjeev arora, simon du, wei hu, zhiyuan li, and ruosong wang. fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. in international conference on machine learning, pp. 322–332. pmlr, 2019a. LINEBREAK sanjeev arora, simon s du, wei hu, zhiyuan li, russ r salakhutdinov, and ruosong wang. on exact computation with an infinitely wide neural net. advances in neural information processing systems, 32, 2019b. LINEBREAK aseem baranwal, kimon fountoulakis, and aukosh jagannath. graph convolution for semisupervised classification: improved linear separability and out-of-distribution generalization. arxiv preprint arxiv:2102.06966, 2021. LINEBREAK aseem baranwal, kimon fountoulakis, and aukosh jagannath. effects of graph convolutions in LINEBREAK multi-layer networks. in international conference on learning representations, 2023. LINEBREAK peter w battaglia, jessica b hamrick, victor bapst, alvaro sanchez-gonzalez, vinicius zambaldi, mateusz malinowski, andrea tacchetti, david raposo, adam santoro, ryan faulkner, et al. relational inductive biases, deep learning, and graph networks. arxiv preprint arxiv:1806.01261, 2018. LINEBREAK alberto bietti and julien mairal. on the inductive bias of neural tangent kernels. advances in neural LINEBREAK information processing systems, 32, 2019. LINEBREAK joan bruna, wojciech zaremba, arthur szlam, and yann lecun. spectral networks and locally LINEBREAK connected networks on graphs. iclr, 2014. LINEBREAK yuan cao and quanquan gu. generalization bounds of stochastic gradient descent for wide and deep LINEBREAK neural networks. advances in neural information processing systems, 32, 2019. LINEBREAK ming chen, zhewei wei, bolin ding, yaliang li, ye yuan, xiaoyong du, and ji-rong wen. scalable graph neural networks via bidirectional propagation. advances in neural information processing systems, 33:14556–14566, 2020a. LINEBREAK ming chen, zhewei wei, zengfeng huang, bolin ding, and yaliang li. simple and deep graph convolutional networks. in international conference on machine learning, pp. 1725–1735. pmlr, 2020b. LINEBREAK eli chien, jianhao peng, pan li, and olgica milenkovic. adaptive universal generalized pagerank LINEBREAK graph neural network. arxiv preprint arxiv:2006.07988, 2020. LINEBREAK lenaic chizat and francis bach. implicit bias of gradient descent for wide two-layer neural networks trained with the logistic loss. in conference on learning theory, pp. 1305–1338. pmlr, 2020. LINEBREAK weilin cong, morteza ramezani, and mehrdad mahdavi. on provable benefits of depth in training graph convolutional networks. advances in neural information processing systems, 34:9936–9949, 2021. LINEBREAK simon s du, kangcheng hou, russ r salakhutdinov, barnabas poczos, ruosong wang, and keyulu xu. graph neural tangent kernel: fusing graph neural networks with graph kernels. advances in neural information processing systems, 32, 2019. LINEBREAK justin gilmer, samuel s schoenholz, patrick f riley, oriol vinyals, and george e dahl. neural message passing for quantum chemistry. in international conference on machine learning, pp. 1263–1272. pmlr, 2017. LINEBREAK will hamilton, zhitao ying, and jure leskovec. inductive representation learning on large graphs. LINEBREAK advances in neural information processing systems, 30, 2017. LINEBREAK xiaotian han, tong zhao, yozen liu, xia hu, and neil shah. mlpinit: embarrassingly simple gnn training acceleration with mlp initialization. in international conference on learning representations, 2023. LINEBREAK weihua hu, matthias fey, marinka zitnik, yuxiao dong, hongyu ren, bowen liu, michele catasta, and jure leskovec. open graph benchmark: datasets for machine learning on graphs. neurips, 33:22118–22133, 2020. LINEBREAK yang hu, haoxuan you, zhecan wang, zhicheng wang, erjin zhou, and yue gao. graph-mlp: node LINEBREAK classification without message passing in graph. arxiv preprint arxiv:2106.04051, 2021. LINEBREAK qian huang, horace he, abhay singh, ser-nam lim, and austin r benson. combining label propagation and simple models out-performs graph neural networks. international conference on learning representations, 2021. LINEBREAK like hui and mikhail belkin. evaluation of neural architectures trained with square loss vs cross LINEBREAK entropy in classification tasks. arxiv preprint arxiv:2006.07322, 2020. LINEBREAK arthur jacot, franck gabriel, and cl´ement hongler. neural tangent kernel: convergence and generalization in neural networks. advances in neural information processing systems, 31, 2018. LINEBREAK katarzyna janocha and wojciech marian czarnecki. on loss functions for deep neural networks in LINEBREAK classification. arxiv preprint arxiv:1702.05659, 2017. LINEBREAK thomas n kipf and max welling. semi-supervised classification with graph convolutional networks. LINEBREAK johannes klicpera, aleksandar bojchevski, and stephan g¨unnemann. predict then propagate: graph LINEBREAK neural networks meet personalized pagerank. iclr, 2019. LINEBREAK jaehoon lee, lechao xiao, samuel schoenholz, yasaman bahri, roman novak, jascha sohldickstein, and jeffrey pennington. wide neural networks of any depth evolve as linear models under gradient descent. advances in neural information processing systems, 32, 2019. LINEBREAK chaoyue liu, libin zhu, and mikhail belkin. toward a theory of optimization for over-parameterized systems of non-linear equations: the lessons of deep learning. arxiv preprint arxiv:2003.00307, 2020a. LINEBREAK chaoyue liu, libin zhu, and misha belkin. on the linearity of large non-linear models: when and why the tangent kernel is constant. advances in neural information processing systems, 33: 15954–15964, 2020b. LINEBREAK meng liu, hongyang gao, and shuiwang ji. towards deeper graph neural networks. in proceedings of the 26th acm sigkdd international conference on knowledge discovery & data mining, pp. 338–348, 2020c. LINEBREAK jiaqi ma, junwei deng, and qiaozhu mei. subgroup generalization and fairness of graph neural LINEBREAK networks. advances in neural information processing systems, 34:1048–1061, 2021. LINEBREAK haggai maron, heli ben-hamu, hadar serviansky, and yaron lipman. provably powerful graph LINEBREAK networks. advances in neural information processing systems, 32, 2019. LINEBREAK julian mcauley, christopher targett, qinfeng shi, and anton van den hengel. LINEBREAK image-based recommendations on styles and substitutes. in proceedings of the 38th international acm sigir conference on research and development in information retrieval, pp. 43–52, 2015. LINEBREAK andrew kachites mccallum, kamal nigam, jason rennie, and kristie seymore. automating the LINEBREAK construction of internet portals with machine learning. information retrieval, 2000. LINEBREAK galileo namata, ben london, lise getoor, bert huang, and umd edu. query-driven active surveying for collective classification. in international workshop on mining and learning with graphs, 2012. LINEBREAK kenta oono and taiji suzuki. graph neural networks exponentially lose expressive power for node LINEBREAK classification. arxiv preprint arxiv:1905.10947, 2019. LINEBREAK hongbin pei, bingzhe wei, kevin chen-chuan chang, yu lei, and bo yang. geom-gcn: geometric graph convolutional networks. international conference on learning representations, 2020. LINEBREAK yu rong, wenbing huang, tingyang xu, and junzhou huang. dropedge: towards deep graph convolutional networks on node classification. international conference on learning representations, 2020. LINEBREAK emanuele rossi, fabrizio frasca, ben chamberlain, davide eynard, michael bronstein, and federico monti. sign: scalable inception graph neural networks. arxiv preprint arxiv:2004.11198, 7:15, 2020. LINEBREAK david e rumelhart, geoffrey e hinton, and ronald j williams. learning representations by LINEBREAK franco scarselli, marco gori, ah chung tsoi, markus hagenbuchner, and gabriele monfardini. computational capabilities of graph neural networks. ieee transactions on neural networks, 20 (1):81–102, 2008a. LINEBREAK franco scarselli, marco gori, ah chung tsoi, markus hagenbuchner, and gabriele monfardini. the LINEBREAK graph neural network model. ieee transactions on neural networks, 20(1):61–80, 2008b. LINEBREAK franco scarselli, ah chung tsoi, and markus hagenbuchner. the vapnik–chervonenkis dimension LINEBREAK of graph and recursive neural networks. neural networks, 108:248–259, 2018. LINEBREAK prithviraj sen, galileo namata, mustafa bilgic, lise getoor, brian galligher, and tina eliassi-rad. LINEBREAK collective classification in network data. ai magazine, 2008. LINEBREAK oleksandr shchur, maximilian mumme, aleksandar bojchevski, and stephan g¨unnemann. pitfalls LINEBREAK of graph neural network evaluation. arxiv preprint arxiv:1811.05868, 2018. LINEBREAK arnab sinha, zhihong shen, yang song, hao ma, darrin eide, bo-june hsu, and kuansan wang. an overview of microsoft academic service (mas) and applications. in proceedings of the 24th international conference on world wide web, pp. 243–246, 2015. LINEBREAK indro spinelli, simone scardapane, and aurelio uncini. adaptive propagation graph convolutional network. ieee transactions on neural networks and learning systems, 32(10):4755–4760, 2020. LINEBREAK jesper e van engelen and holger h hoos. a survey on semi-supervised learning. machine learning, LINEBREAK petar veliˇckovi´c, guillem cucurull, arantxa casanova, adriana romero, pietro lio, and yoshua LINEBREAK bengio. graph attention networks. arxiv preprint arxiv:1710.10903, 2017. LINEBREAK saurabh verma and zhi-li zhang. stability and generalization of graph convolutional neural networks. in proceedings of the 25th acm sigkdd international conference on knowledge discovery & data mining, pp. 1539–1548, 2019. LINEBREAK felix wu, amauri souza, tianyi zhang, christopher fifty, tao yu, and kilian weinberger. simplifying graph convolutional networks. in international conference on machine learning, pp. 6861–6871. pmlr, 2019. LINEBREAK qitian wu, wentao zhao, zenan li, david wipf, and junchi yan. nodeformer: a scalable graph structure learning transformer for node classification. in advances in neural information processing systems (neurips), 2022. LINEBREAK qitian wu, chenxiao yang, wentao zhao, yixuan he, david wipf, and junchi yan. difformer: LINEBREAK scalable (graph) transformers induced by energy constrained diffusion. iclr, 2023. LINEBREAK keyulu xu, weihua hu, jure leskovec, and stefanie jegelka. how powerful are graph neural LINEBREAK keyulu xu, chengtao li, yonglong tian, tomohiro sonobe, ken-ichi kawarabayashi, and stefanie jegelka. representation learning on graphs with jumping knowledge networks. in international conference on machine learning, pp. 5453–5462. pmlr, 2018b. LINEBREAK keyulu xu, mozhi zhang, jingling li, simon s du, ken-ichi kawarabayashi, and stefanie jegelka. LINEBREAK how neural networks extrapolate: from feedforward to graph neural networks. iclr, 2021. LINEBREAK hanqing zeng, hongkuan zhou, ajitesh srivastava, rajgopal kannan, and viktor prasanna. graphsaint: graph sampling based inductive learning method. arxiv preprint arxiv:1907.04931, 2019. LINEBREAK hengrui zhang, shen wang, vassilis n ioannidis, soji adeshina, jiani zhang, xiao qin, christos faloutsos, da zheng, george karypis, and philip s yu. orthoreg: improving graph-regularized mlps via orthogonality regularization. arxiv preprint arxiv:2302.00109, 2023. LINEBREAK shichang zhang, yozen liu, yizhou sun, and neil shah. graph-less neural networks: teaching old mlps new tricks via distillation. in international conference on learning representations, 2022. LINEBREAK hao zhu and piotr koniusz. simple spectral graph convolution. in international conference on LINEBREAK learning representations, 2021. LINEBREAK jiong zhu, yujun yan, lingxiao zhao, mark heimann, leman akoglu, and danai koutra. beyond homophily in graph neural networks: current limitations and effective designs. advances in neural information processing systems, 33:7793–7804, 2020. LINEBREAK xiaojin zhu, zoubin ghahramani, and john d lafferty. semi-supervised learning using gaussian fields and harmonic functions. in proceedings of the 20th international conference on machine learning (icml-03), pp. 912–919, 2003. LINEBREAK a more discussions LINEBREAK other sources of performance gap between mlp and gnn / when pmlp fails? besides the intrinsic generalizability of gnns that is revealed by the performance gain from mlp to pmlp in this work, we note that there are some other less significant but non-negligible sources that attributes to the performance gap between gnn and mlp in node prediction tasks: LINEBREAK • expressiveness: while our experiments find that gnns and pmlps can perform similarly in most cases, showing great advantage over mlps in generalization, in practice, there still exists a certain gap between their expressiveness, which can be amplified in large datasets and causes certain degrees of performance difference. this is reflected by our experiments on three large-scale datasets. despite that, we can see from table 2 that the intrinsic generalizability of gnn (corresponding to ∆mlp) is still the major source of performance gain from mlp. LINEBREAK • semi-supervised / transductive learning: as our default experimental setting, inductive learning ensures that testing samples are unobserved during training and keeps the comparison among models fair. however in practice, the ability to leverage the information of unlabeled nodes in training is a well-known advantage of gnn (but not the advantage of pmlp). still, pmlp can be used in transductive setting with training techniques as described in sec. 3.4. LINEBREAK current limitations and outlooks. the result in theorem 5 provides a bound to show pmlp’s better potential in ood generalization, rather than guaranteeing its superior generalization capability. explaining when and why pmlps perform closely to their gnn counterparts also need further investigations. moreover, following most theoretical works on ntk, we consider the regression task with squared loss for analysis instead of classification. however, as evidences (janocha & czarnecki, 2017; hui & belkin, 2020) show squared loss can be as competitive as softmax cross-entropy loss, the insights obtained from regression tasks could also adapt to classification tasks. LINEBREAK b proof for proposition 1 LINEBREAK to analyse the extrapolation behavior of pmlp and compare it with mlp, as mentioned in the main text, training an infinitely wide neural network using gradient descent with infinitesimal step size is equivalent to solving kernel regression with the so-called ntk by minimizing the following squared loss function: LINEBREAK f (x; w) = w⊤ϕntk(x), l(w) = LINEBREAK (cid:0)yi − w⊤ϕntk(xi)(cid:1)2 LINEBREAK let us now consider an arbitrary minimizer w∗ ∈ h in ntk’s reproducing kernel hilbert space. the minimizer could be further decomposed as w∗ = ˆw∗ + w⊥, where ˆw∗ lies in the linear span of feature mappings for training data and w⊥ is orthogonal to ˆw∗, i.e., LINEBREAK ˆw∗ = LINEBREAK λi · ϕntk(xi), LINEBREAK ⟨ ˆw∗, w⊥⟩h = 0. LINEBREAK one observation is that the loss function is unchanged after removing the orthogonal component w⊥: LINEBREAK l(w∗) = LINEBREAK yi − ⟨ LINEBREAK yi − ⟨ LINEBREAK λi · ϕntk(xi) + w⊥, ϕntk(xi)⟩h LINEBREAK λi · ϕntk(xi), ϕntk(xi)⟩h LINEBREAK = l( ˆw∗). LINEBREAK this indicates that ˆw∗ is also a minimizer whose h-norm is smaller than that of w∗, i.e., ∥ ˆw∗∥h ≤ ∥w∗∥h. it follows that the minimum h-norm solution for eq. 11 can be expressed as a linear combination of feature mappings for training data. therefore, solving eq. 11 boils down to solving a linear system with coefficients λ = [λi]n LINEBREAK i=1. resultingly, the minimum h-norm solution is LINEBREAK w∗ = LINEBREAK (cid:2)yik−1(cid:3) LINEBREAK i ϕntk(xi), LINEBREAK where k ∈ rn×n is the kernel matrix for training data. we see that the final solution is only dependent on training data {xi, yi}n i=1 and the model architecture used in training (since it determines the form of ϕntk(xi)). it follows immediately that the min-norm ntk kernel regression solution is equivalent for mlp and pmlp (i.e., w∗ pmlp) given that they are the same model trained on the same set of data. in contrast, the architecture of gnn is different from that of mlp, implying different form of feature map, and hence they have different solutions in their respective ntk kernel regression problems (i.e., w∗ LINEBREAK mlp = w∗ LINEBREAK mlp ̸= w∗ LINEBREAK gnn). LINEBREAK c proof for lemma 3 LINEBREAK c.1 gntk for graph-level regression LINEBREAK graph neural tangent kernel (gntk) (du et al., 2019) is a natural extension of ntk to graph neural networks. originally, the squared loss function is defined for graph-level regression and the kernel function is defined over a pair of graphs: LINEBREAK gntk(gi, gj) = ϕgnn(gi)⊤ϕgnn(gj) = ⟨∇θf (gi; θ), ∇θf (gj; θ)⟩ , LINEBREAK l(θ) = LINEBREAK (yi − f (gi; θ))2 , LINEBREAK where f (gi; θ) yields prediction for a graph such as the property of a molecule. the formula for calculating gntk is given by the following (where we modify the original notation for clarity and alignment with our definition of gntk in node-level regression setting): LINEBREAK σ(0) (gi, gj) LINEBREAK uu′ LINEBREAK uu′ LINEBREAK = x⊤ LINEBREAK u xu′, LINEBREAK where xu ∈ vi, xu′ ∈ vj. LINEBREAK the message passing operation in each layer corresponds to: LINEBREAK (cid:105) mp (gi, gj) LINEBREAK (cid:105) mp (gi, gj) LINEBREAK = cucu′ LINEBREAK = cucu′ LINEBREAK uu′ LINEBREAK uu′ LINEBREAK v∈nu∪{u} (cid:88) LINEBREAK v′∈nu′ ∪{u′} (cid:88) LINEBREAK v∈nu∪{u} LINEBREAK v′∈nu′ ∪{u′} LINEBREAK vv′ LINEBREAK vv′ LINEBREAK where cu denotes a scaling factor. the calculation formula of feed-forward operation (from gntk(ℓ−1) (gi, gj) to gntk(ℓ) (gi, gj)) is similar to that for ntks of mlp (jacot et al., 2018). the final output of gntk (without jumping knowledge) is calculated by LINEBREAK mp LINEBREAK gntk (gi, gj) = LINEBREAK u∈vi,u′∈vj LINEBREAK uu′ LINEBREAK c.2 gntk for node-level regression LINEBREAK we next extend the above definition of gntk to the node-level regression setting, where the model f (x; θ, g) outputs prediction of a node, and the kernel function is defined over a pair of nodes in a single graph: LINEBREAK gntk(xi, xj) = ϕgnn(xi)⊤ϕgnn(xj) = ⟨∇θf (xi; θ, g), ∇θf (xj; θ, g)⟩ , LINEBREAK l(θ) = LINEBREAK (yi − f (xi; θ, g))2 . LINEBREAK then, the explicit formula for gntk in node-level regression is as follows. LINEBREAK gntk(0)(xi, xj) = σ(0) (xi, xj) = x⊤ LINEBREAK i xj, LINEBREAK without loss of generality, we consider using random walk matrix as implementation of message passing. then, the message passing operation in each layer corresponds to: 1 (|ni| + 1)(|nj| + 1) LINEBREAK σ(ℓ) (xi′, xj′) LINEBREAK mp (xi, xj) = LINEBREAK gntk(ℓ) LINEBREAK mp (xi, xj) = LINEBREAK j′∈nj ∪{j} moreover, the feed-forward operation in each layer corresponds to: LINEBREAK i′∈ni∪{i} LINEBREAK i′∈ni∪{i} (cid:88) LINEBREAK j′∈nj ∪{j} (cid:88) LINEBREAK gntk(ℓ) (xi′, xj′) , LINEBREAK σ(ℓ) (xi, xj) = c · LINEBREAK ˙σ(ℓ) (xi, xj) = c · LINEBREAK e u,v∼n (0,λ(ℓ)) e u,v∼n (0,λ(ℓ)) LINEBREAK [σ(u)σ(v)], LINEBREAK [ ˙σ(u) ˙σ(v)], LINEBREAK gntk(ℓ)(xi, xj) = gntk(ℓ−1) LINEBREAK (xi, xj) · ˙σ(ℓ) (xi, xj) + σ(ℓ) (xi, xj) , LINEBREAK where LINEBREAK mp σ(ℓ−1) mp σ(ℓ−1) mp LINEBREAK (xi, xi) σ(ℓ−1) (xj, xi) σ(ℓ−1) LINEBREAK mp LINEBREAK mp LINEBREAK (xi, xj) (xj, xj) LINEBREAK suppose the gnn has l layers and the last layer uses linear transformation that is akin to mlp, the final gntk in node-level regression is defined as LINEBREAK gntk(xi, xj) = gntk(l−1) LINEBREAK mp LINEBREAK (xi, xj) LINEBREAK c.3 gntk and feature map for a two-layer gnn LINEBREAK we next derive the explicit ntk formula for a two-layer graph neural network in node-level regression setting. for notational convenience, we use ai ∈ rn to denote adjacency, i.e., LINEBREAK 0 and g = xx⊤ ∈ rn×n to denote the gram matrix of all nodes. then we have LINEBREAK (ai)j = LINEBREAK if (i, j) ∈ e if (i, j) /∈ e LINEBREAK (first message passing layer) LINEBREAK gntk(0)(xi, xj) = σ(0) (xi, xj) = x⊤ gntk(0) mp (xi, xj) = a⊤ LINEBREAK mp(xi, xj) = σ(0) LINEBREAK i xj, i gaj, LINEBREAK (first feed-forward layer) LINEBREAK σ(1) (xi, xj) = c · LINEBREAK ˙σ(1) (xi, xj) = c · LINEBREAK (cid:20) a⊤ i gai a⊤ j gai a⊤ a⊤ LINEBREAK i gaj j gaj LINEBREAK (cid:20) x⊤ai x⊤aj LINEBREAK [σ(u)σ(v)], LINEBREAK [ ˙σ(u) ˙σ(v)], LINEBREAK · (cid:2) x⊤ai x⊤aj LINEBREAK (cid:3) LINEBREAK i gaj = (x⊤ai)⊤x⊤aj and substituting σ(k) = k · i+(k), ˙σ(k) = i+(k), where by noting that a⊤ i+(k) is an indicator function that outputs 1 if k is positive otherwise 0, we have the following equivalent form for the covariance LINEBREAK σ(1) (xi, xj) = c · LINEBREAK ˙σ(1) (xi, xj) = c · LINEBREAK e w∼n (0,id) e w∼n (0,id) LINEBREAK (cid:2)w⊤x⊤ai · i+(w⊤x⊤ai) · w⊤x⊤aj · i+(w⊤x⊤aj)(cid:3) , LINEBREAK (cid:2)i+(w⊤x⊤ai) · i+(w⊤x⊤aj)(cid:3) . LINEBREAK hence, we have mp(xi, xj) · ˙σ(1) (xi, xj) + σ(1) (xi, xj) gntk(1)(xi, xj) = gntk(0) e w∼n (0,id) e w∼n (0,id) LINEBREAK i gaj · i+(w⊤x⊤ai) · i+(w⊤x⊤aj)(cid:3) LINEBREAK (cid:2)a⊤ LINEBREAK = c · LINEBREAK + c · LINEBREAK (cid:2)w⊤x⊤ai · i+(w⊤x⊤ai) · w⊤x⊤aj · i+(w⊤x⊤aj)(cid:3) LINEBREAK (second message passing layer / the last layer) LINEBREAK since the gnn uses a linear transformation on top of the (second) message passing layer for output, the neural tangent kernel for a two-layer gnn is given by LINEBREAK gntk(xi, xj) = gntk(1) LINEBREAK mp(xi, xj) LINEBREAK gntk(1) (xi′, xj′) LINEBREAK i′∈ni∪{i} LINEBREAK j′∈nj ∪{j} LINEBREAK ai, LINEBREAK aj LINEBREAK h LINEBREAK where k(1) ∈ rn×n and ϕ(1) : rd → h is the kernel matrix and feature map induced by gntk(1). by eq. 31, the final feature map ϕgnn(x) is LINEBREAK ϕgnn(xi) = LINEBREAK ai. LINEBREAK also, notice that in eq. 30, LINEBREAK i gaj · i+(w⊤x⊤ai) · i+(w⊤x⊤aj) = ϕ⊤ a⊤ w⊤x⊤ai · i+(w⊤x⊤ai) · w⊤x⊤aj · i+(w⊤x⊤aj) = (w⊤ϕi)⊤w⊤ϕj, where ϕi = x⊤ai · i+(w⊤x⊤ai). LINEBREAK i ϕj, LINEBREAK then, the feature map ϕ(1) can be written as w(1)⊤ LINEBREAK ϕ(1)(xi) = c′ · LINEBREAK x⊤ai LINEBREAK x⊤ai · i+ LINEBREAK w(2)⊤x⊤ai LINEBREAK x⊤ai · i+ LINEBREAK x⊤ai · i+ LINEBREAK x⊤ai LINEBREAK x⊤ai LINEBREAK x⊤ai · i+ LINEBREAK w(∞)⊤x⊤ai LINEBREAK · · · , w(∞)⊤ LINEBREAK x⊤ai · i+ LINEBREAK w(∞)⊤ LINEBREAK x⊤ai LINEBREAK where w(k) ∼ n (0, id) is random gaussian vector in rd, with the superscript (k) denoting that it is the k-th sample among infinitely many i.i.d. sampled ones, c′ is a constant. we write eq. 34 in short as LINEBREAK ϕ(1)(xi) = c′ · LINEBREAK x⊤ai · i+ LINEBREAK w(k)⊤ LINEBREAK x⊤ai LINEBREAK , w(k)⊤ LINEBREAK x⊤ai · i+ LINEBREAK w(k)⊤ LINEBREAK x⊤ai LINEBREAK finally, substituting eq. 35 into eq. 32 completes the proof. LINEBREAK d proof for theorem 4 and theorem 5 LINEBREAK to analyse the extrapolation behavior of pmlp along a certain direction v in the testing phase and compare it to mlp, we consider a newly arrived testing node x0 = tv, whose degree (with self-connection) is ˜d and its corresponding adjacency vector is a ∈ rn+1, where (a)i = 1/ ˜d if (i, 0) ∈ e otherwise 0. following (xu et al., 2021; bietti & mairal, 2019), we consider a constant bias term and denote the data x plus this term as ˆx = [x|1]. then, the asymptotic behavior of f (·) at large distances from the training data range can be characterized by the change of network output with a fixed-length step ∆t · v along the direction v, which is given by the following in the ntk regime LINEBREAK (fmlp ( ˆx) − fmlp ( ˆx0)) = LINEBREAK (fpmlp ( ˆx) − fpmlp ( ˆx0)) = LINEBREAK w∗⊤ LINEBREAK mlp(ϕmlp( ˆx) − ϕmlp( ˆx0)) LINEBREAK w∗⊤ LINEBREAK mlp(ϕgnn( ˆx) − ϕgnn( ˆx0)) LINEBREAK where x = x0 + ∆t · v = (t + ∆t)v, ˆx = [ ˆx|1] and ˆx0 = [ ˆx0|1]. as our interest is in how pmlp extrapolation, we use f (·) to refer to fpmlp(·) in the rest of the proof. by lemma. 2, the explicit formula for computing this node’s feature map is given by LINEBREAK ϕgnn( ˆx0) = LINEBREAK a, LINEBREAK where LINEBREAK [ ˆx0, x]⊤a · i+ LINEBREAK w(k)⊤ LINEBREAK w(k)⊤ LINEBREAK [ ˆx0, x]⊤a · i+ LINEBREAK (cid:16) w(k)⊤ LINEBREAK and similarly LINEBREAK [ ˆx0, x]⊤ai · i+ LINEBREAK w(k)⊤ LINEBREAK [ ˆx0, x]⊤ai LINEBREAK w(k)⊤ LINEBREAK [ ˆx0, x]⊤ai · i+ LINEBREAK w(k)⊤ LINEBREAK [ ˆx0, x]⊤ai LINEBREAK w(k) ∼ n (0, id), with k going to infinity, c′ is a constant, i+(k) is an indicator function that outputs 1 if k is positive otherwise 0, and (ai)1 = 1/(|ni| + 1) if i is connected to the new testing node. it follows from eq. 37 that LINEBREAK (f ( ˆx) − f ( ˆx0)) LINEBREAK w∗⊤ mlp LINEBREAK w∗⊤ mlp LINEBREAK w∗⊤ mlp LINEBREAK a LINEBREAK (cid:0)ϕ(1)( ˆx) − ϕ(1)( ˆx0)(cid:1). recall that w∗⊤ now, let us consider w∗⊤ mlp is from infinite dimensional mlp hilbert space, and w(k) is drawn from gaussian with k going to infinity in eq. 39 and eq. 40, where each w(k) corresponds to some certain dimensions of w∗ mlp. let us denote the part that corresponds to the first line in eq. 39 as βw(k) and the second line in eq. 39 as γw(k) . consider the following way of rearrangement for (the first element in) ϕ(1)( ˆx) − ϕ(1)( ˆx0) LINEBREAK [ ˆx, x]⊤a · i+ LINEBREAK =[ ˆx, x]⊤a LINEBREAK w(k)⊤ (cid:16) LINEBREAK w(k)⊤ LINEBREAK [ ˆx, x]⊤a LINEBREAK [ ˆx, x]⊤a LINEBREAK − [ ˆx0, x]⊤a · i+ LINEBREAK w(k)⊤ LINEBREAK [ ˆx0, x]⊤a LINEBREAK [∆tv | 0] · i+ LINEBREAK w(k)⊤ LINEBREAK [∆tv | 0] is obtained by subtracting [ ˆx0, x]⊤a from [ ˆx, x]⊤a. then, we can re-write LINEBREAK where 1 ˜d (cid:0)ϕ(1)( ˆx) − ϕ(1)( ˆx0)(cid:1) into a more convenient form: w∗⊤ mlp LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1) dp(w) LINEBREAK w∗⊤ mlp LINEBREAK 1 ∆t (cid:90) 1 ˜d w[ ˆx/∆t, x/∆t]⊤a (cid:0)i+ β⊤ LINEBREAK w[v | 0] · i+ β⊤ LINEBREAK γww⊤[v | 0] · i+ LINEBREAK (cid:90) 1 ˜d γww⊤[ ˆx/∆t, x/∆t]⊤a (cid:0)i+ LINEBREAK (cid:0)w⊤[ ˆx, x]⊤a(cid:1) − i+ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1)(cid:1) dp(w) LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1) dp(w) LINEBREAK (cid:0)w⊤[ ˆx, x]⊤a(cid:1) − i+ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1)(cid:1) dp(w) LINEBREAK (cid:0)ϕ(1)(xi; ˆx) − ϕ(1)(xi; ˆx0)(cid:1) where i ∈ n0, ∆t w∗⊤ remark. for other components in eq. 41, i.e., 1 the corresponding result of the expansion in eq. 43 is similar, which only differs by a scaling factor (since the first element in both a and ai indicating whether the current node is connected to the new testing node is non-zero) and replacing a with ai. therefore, in the following proof we focus on eq. 43 and then generalize the result to other components in eq. 41. LINEBREAK mlp LINEBREAK d.1 proof for theorem 4 (convergence to a linear function) LINEBREAK we first analyse the convergence of eq. 43. specifically, for eq. 44: LINEBREAK w[v | 0] · i+ β⊤ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1) dp(w) LINEBREAK w[v | 0] · i+ β⊤ LINEBREAK (cid:0)w⊤[ ˆx0/t, x/t]⊤a(cid:1) dp(w) LINEBREAK w[v | 0] · i+ β⊤ LINEBREAK (cid:0)w⊤[v | 0](cid:1) dp(w) = LINEBREAK c′ v ˜d LINEBREAK as t → ∞ LINEBREAK where the final result is a constant that depends on training data, direction v and node degree ˜d. moreover, the convergence of eq. 45 is given by LINEBREAK w[ ˆx/∆t, x/∆t]⊤a (cid:0)i+ β⊤ (cid:18) LINEBREAK w[ ˆx/∆t, x/∆t]⊤a β⊤ LINEBREAK i+ LINEBREAK w[ ˆx/∆t, x/∆t]⊤a (cid:0)i+ β⊤ LINEBREAK (cid:0)w⊤[ ˆx, x]⊤a(cid:1) − i+ (cid:18) LINEBREAK w⊤[[v | LINEBREAK 1 t + ∆t (cid:0)w⊤[v | 0](cid:1) − i+ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1)(cid:1) dp(w) (cid:19) LINEBREAK ]⊤a LINEBREAK − i+ LINEBREAK w⊤[[v | LINEBREAK x t + ∆t LINEBREAK (cid:0)w⊤[v | 0](cid:1)(cid:1) dp(w) = 0, LINEBREAK ]⊤a LINEBREAK dp(w) LINEBREAK x t LINEBREAK as t → ∞ LINEBREAK the similar results in eq. 48 and eq. 49 also apply to analysis of eq. 46 and eq. 47, respectively. by combining these results, we conclude that LINEBREAK it follows that LINEBREAK w∗⊤ mlp LINEBREAK cv ˜d LINEBREAK as t → ∞ LINEBREAK (f ( ˆx) − f ( ˆx0)) → cv LINEBREAK as t → ∞. LINEBREAK in conclusion, both mlp and pmlp with relu activation will eventually converge to a linear function along directions away from the training data. in fact, this result also holds true for two-layer gnns with weighted-sum style message passing layers by simply replacing w∗ gnn in the proof. LINEBREAK mlp by w∗ LINEBREAK however, a remarkable difference between mlp and pmlp is that the linear coefficient for mlp is a constant cv that is fixed upon a specific direction v and not affected by the inter-connection between testing node x and training data {(xi, yi)}n i=1. in contrast, the linear coefficient for pmlp (and gnn) is also dependent on testing node’s degree and the degrees of adjacent nodes. moreover, by proposition. 1, mlp and pmlp share the same w∗ mlp (including βw and γw), and thus the constant cv in eq. 51 is exactly the linear coefficient of mlp. this can also be verified by setting x to be an isolated node, in which case ˜d−1 (cid:80) ˜d−1 i = 1 and pmlp is equivalent to mlp. therefore, we can directly compare the linear coefficients for mlp and pmlp. as an immediate consequence, if all node degrees of adjacent nodes are larger than the node degree of the testing node, the linear coefficient will become smaller, vice versa. LINEBREAK d.2 proof for theorem 5 LINEBREAK we next analyse the convergence rate for eq. 48 and eq. 49 to see to what extent can pmlp deviate from the converged linear coefficient as an indication of its tolerance to out-of-distribution sample. for eq. 48, we have (cid:12) (cid:12) (cid:12) (cid:12) c′ 1 ˜d c′ 1 ˜d LINEBREAK (cid:0)w⊤[[x0 | 1], x]⊤a(cid:1) − i+ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1) − i+ LINEBREAK (cid:0)w⊤[ ˆx0, x]⊤a(cid:1) − i+ LINEBREAK (cid:0)w⊤[v | 0](cid:1)(cid:1) dp(w) LINEBREAK w[v | 0] · (cid:0)i+ β⊤ LINEBREAK (cid:12) dp(w) LINEBREAK (cid:12) dp(w) LINEBREAK based on the observation that the integral of |i+(w⊤v1) − i+(w⊤v2)| represents the volume of non-overlapping part of two half-balls that are orthogonal to v1 and v2, which grows linearly with the angle between v1 and v2, denoted by ∡ (v1, v2). therefore, we have LINEBREAK (cid:0)w⊤[[x0 | 1], x]⊤a(cid:1) − i+ LINEBREAK (cid:12) dp(w)
| 19
|
[
403.39,
654.32744,
436.30345514,
667.7766
] |
0aW6lYOYB7d.pdf
| 2,021
| 1
|
LINEBREAK large-width functional asymptotics for deep gaussian neural networks LINEBREAK daniele bracale1, stefano favaro1,2, sandra fortini3, stefano peluchetti4 1 university of torino, 2 collegio carlo alberto, 3 bocconi university, 4 cogent labs LINEBREAK abstract LINEBREAK in this paper, we consider fully-connected feed-forward deep neural networks where weights and biases are independent and identically distributed according to gaussian distributions. extending previous results (matthews et al., 2018a;b; yang, 2019) we adopt a function-space perspective, i.e. we look at neural networks as infinite-dimensional random elements on the input space ri . under suitable assumptions on the activation function we show that: i) a network defines a continuous stochastic process on the input space ri ; ii) a network with re-scaled weights converges weakly to a continuous gaussian process in the large-width limit; iii) the limiting gaussian process has almost surely locally γ-hölder continuous paths, for 0 < γ < 1. our results contribute to recent theoretical studies on the interplay between infinitely-wide deep neural networks and gaussian processes by establishing weak convergence in function-space with respect to a stronger metric. LINEBREAK introduction LINEBREAK the interplay between infinitely-wide deep neural networks and classes of gaussian processes has its origins in the seminal work of neal (1995), and it has been the subject of several theoretical studies. see, e.g., der & lee (2006), lee et al. (2018), matthews et al. (2018a;b), yang (2019) and references therein. let consider a fully-connected feed-forward neural network with re-scaled weights composed of l ≥ 1 layers of widths n1, . . . , nl, i.e. LINEBREAK (x) = LINEBREAK i,j xj + b(1) w(1) LINEBREAK i LINEBREAK f (l) i (x) = LINEBREAK i,j φ(f (l−1) w(l) LINEBREAK j LINEBREAK (x)) + b(l) i LINEBREAK l = 2, . . . , l, i = 1, . . . , nl LINEBREAK i LINEBREAK i,j and biases b(l) LINEBREAK where φ is a non-linearity and x ∈ ri is a real-valued input of dimension i ∈ n. neal (1995) considered the case l = 2, a finite number k ∈ n of fixed distinct inputs (x(1), . . . , x(k)), with each x(r) ∈ ri , and weights w(l) independently and identically distributed (iid) as gaussian distributions. under appropriate assumptions on the activation φ neal (1995) showed that: i) for a fixed unit i, the k-dimensional random vector (f (2) (x(k))) converges in distribution, as the width n1 goes to infinity, to a k-dimensional gaussian random vector; ii) the large-width convergence holds jointly over finite collections of i’s and the limiting k-dimensional gaussian random vectors are independent across the index i. these results concerns neural networks with a single hidden layer, but neal (1995) also includes preliminary considerations on infinitely-wide deep neural networks. more recent works, such as lee et al. (2018), established convergence results corresponding to neal (1995) results i) and ii) for deep neural networks under the assumption that widths n1, . . . , nl go to infinity sequentially over network layers. matthews et al. (2018a;b) extended the work of neal (1995); lee et al. (2018) by assuming that the width n grows to infinity jointly over network layers, instead of sequentially, and by establishing joint convergence over all i and countable distinct inputs. the joint growth over the layers is certainly more realistic than the sequential growth, since the infinite gaussian limit is considered as an approximation of a very wide network. we operate in the same setting of matthews et al. (2018b), hence from here onward n ≥ 1 denotes the LINEBREAK i LINEBREAK i LINEBREAK common layer width, i.e. n1, . . . , nl = n. finally, similar large-width limits have been established for a great variety of neural network architectures, see for instance yang (2019). LINEBREAK i (x(1)), . . . , f (l) LINEBREAK the assumption of a countable number of fixed distinct inputs is the common trait of the literature on large-width asymptotics for deep neural networks. under this assumption, the large-width limit of a network boils down to the study of the large-width asymptotic behavior of the k-dimensional random vector (f (l) i (x(k))) over i ≥ 1 for finite k. such limiting finite-dimensional distributions describe the large-width distribution of a neural network a priori over any dataset, which is finite by definition. when the limiting distribution is gaussian, as it often is, this immediately paves the way to bayesian inference for the limiting network. such an approach is competitive with the more standard stochastic gradient descent training for the fully-connected architectures object of our study (lee et al., 2020). however, knowledge of the limiting finite-dimensional distributions is not enough to infer properties of the limiting neural network which are inherently uncountable such as the continuity of the limiting neural network, or the distribution of its maximum over a bounded interval. results in this direction give a more complete understanding of the assumptions being made a priori, and hence whether a given model is appropriate for a specific application. for instance, van der vaart & van zanten (2011) shows that for gaussian processes the function smoothness under the prior should match the smoothness of the target function for satisfactory inference performance. LINEBREAK in this paper we thus consider a novel, and more natural, perspective to the study of large-width limits of deep neural networks. this is an infinite-dimensional perspective where, instead of fixing a countable number of distinct inputs, we look at f (l) i (x, n) as a stochastic process over the input space ri . under this perspective, establishing large-width limits requires considerable care and, in addition, it requires to show the existence of both the stochastic process induced by the neural network and its large-width limit. we start by proving the existence of i) a continuous stochastic process, indexed by the network width n, corresponding to the fully-connected feed-forward deep neural network; ii) a continuous gaussian process corresponding to the infinitely-wide limit of the deep neural network. then, we prove that the stochastic process i) converges weakly, as the width n goes to infinity, to the gaussian process ii) jointly over all units i. as a by-product of our results, we show that the limiting gaussian process has almost surely locally γ-hölder continuous paths, for 0 < γ < 1. to make the exposition self-contained we include an alternative proof of the main result of matthews et al. (2018a;b), i.e. the finite-dimensional limit for full-connected neural networks. the major difference between our proof and that of matthews et al. (2018b) is due to the use of the characteristic function to establish convergence in distribution, instead of relying on a clt (blum et al., 1958) for exchangeable sequences. LINEBREAK the paper is structured as follows. in section 2 we introduce the setting under which we operate, whereas in section 3 we present a high-level overview of the approach taken to establish our results. section 4 contains the core arguments of the proof of our large-width functional limit for deep gaussian neural networks, which are spelled out in detail in the supplementary material (sm). we conclude in section 5. LINEBREAK setting
| 1
|
[
108.299,
221.0426768,
171.5461438,
232.9978768
] |
tUMr0Iox8XW.pdf
| 2,022
| 0
|
LINEBREAK efficient computation of deep nonlinear ∞width neural networks that learn features LINEBREAK greg yang ∗ microsoft LINEBREAK michael santacroce microsoft LINEBREAK edward j. hu microsoft LINEBREAK abstract LINEBREAK while a popular limit of infinite-width neural networks, the neural tangent kernel (ntk) often exhibits performance gaps from finite-width neural networks on standard datasets, due to lack of feature learning. although the feature learning maximal update limit, or µ-limit (yang and hu, 2020) of wide networks has closed the gap for 1-hidden-layer linear models, no one has been able to demonstrate this for deep nonlinear multi-layer perceptrons (mlp) because of µ-limit’s computational difficulty in this setting. here, we solve this problem by proposing a novel feature learning limit, the π-limit, that bypasses the computational issues. the π-limit, in short, is the limit of a form of projected gradient descent, and the π-limit of an mlp is roughly another mlp where gradients are appended to weights during training. we evaluate it on cifar10 and omniglot against ntk as well as finite networks, finding the π-limit outperform finite-width models trained normally (without projection) in both settings, closing the performance gap between finite- and infinite-width neural networks previously left by ntk. code for this work is available at github.com/santacml/pilim. LINEBREAK figure 1: pca of representations of images from 5 classes (= 5 colors) in omniglot test set. we compare the representations from our best performing finite-width µ-parametrized network, our proposed ∞-width π-limit, and ntk. the representations from former two form neat clusters according to their classes while those from the latter are mixed up together. see appendix b.5.3. LINEBREAK introduction LINEBREAK the theory of neural tangent kernel (ntk) (jacot et al., 2018) led to many theoretical discoveries of neural networks, but they ultimately apply only to a limited, unrealistic regime where the network does not learn features. recently, yang and hu (2020) discovered the maximal update, or µ, parametrization that induces a feature learning ∞-width limit, called the µ-limit of deep neural networks, which generalizes the mean field limit of shallow networks (sirignano and spiliopoulos, 2018; mei et al., 2018; chizat and bach, 2018; rotskoff and vanden-eijnden, 2018). they explicitly trained such ∞-width limits on word2vec and maml, tasks relying crucially on feature learning. these µ-limits outperformed both ntk baselines and finite-width networks. thus, the µ-limit seems to capture key properties of neural networks in practice and is a promising direction to further our theoretical understanding of them. however, a significant roadblock to this end is that the µ-limit for general neural networks is both hard to compute empirically and hard to analyze theoretically. indeed, yang and hu (2020) restricted main experiments to linear mlps where exact calculation is fast as a special case. according to them, the main complications come from the interleaving of forward and backward propagations that leads to the need to evaluate gaussian integrals involving nested nonlinearities. likewise, these complicated integrals also contribute to the difficulty of theoretical analysis, especially in deep networks. LINEBREAK ∗correspondence to {gregyang,michael.santacroce}@microsoft.com LINEBREAK in this work, we bypass these issues by considering a form of projected gradient contributions descent instead. roughly speaking, with vφ denoting the v-transform (aka dual) of φ (definition 3.1). LINEBREAK mlp with nonlinearity φ trained by projected gradient accumulation LINEBREAK −−−−−−−−−−−−−−→ mlp with nonlinearity vφ LINEBREAK width→∞ LINEBREAK trained by gradient concatenation LINEBREAK here gradient accumulation is just the normal training process where gradient is added to a parameter, whereas in gradient concatenation, gradient is appended to a parameter. the rhs retains the feature learning capability while making the computation and the mathematics much simpler compared to the µ-limit. we explicitly evaluate our new limit, which we call the π-limit, on cifar10 and omniglot, and compare against finite-width neural networks as well as ntk and nngp. we find the π-limit always outperform wide standard-parametrized or µ-parametrized networks, and they all significantly outperform the kernels. for example, on omniglot, this is evidenced by fig. 1. we also demonstrate transfer learning from imagenet to cifar10. to our knowledge, this is the first time deep nonlinear feature learning ∞-width limits are evaluated on nontrivial natural datasets. LINEBREAK why is the µ-limit hard to compute? an example LINEBREAK while the µ-limit is the “optimal” feature learning limit of a neural network as described in yang and hu (2020), it is difficult to calculate analytically. let’s demonstrate this difficulty with a simple 1-hidden-layer µ-parametrized network (abbreviated µ-net, whose ∞-width limit is the µ-limit) f with 1-dimensional input ξ ∈ r and output f (ξ) ∈ r: √ f (ξ) = n−1/2v(cid:62)φ( LINEBREAK (1) where u, v ∈ rn are column vectors and φ : r → r is the nonlinearity (e.g. relu). note here n is the width of f . according to µ-parametrization, we initialize uα, vα ∼ n (0, 1 at initialization, one easily sees limn→∞ f (ξ) = 0 because LINEBREAK nuξ) ∈ r, LINEBREAK n ). LINEBREAK f (ξ) = LINEBREAK nv)αφ(ξ LINEBREAK nuα) LINEBREAK is the average of a large number of iid random variables ( language of tensor programs (yang, 2019b;a; 2020a;b), we have an almost sure convergence √ LINEBREAK nuα) with zero mean. in the LINEBREAK nv)αφ(ξ LINEBREAK f (ξ) → e z LINEBREAK nvφ(ξz LINEBREAK at initialization, LINEBREAK nu represent the independent standard gaussian random variables describing the LINEBREAK nv and z where z coordinate distributions of however, one can see that f (ξ) has a limit of the form √ LINEBREAK nv and LINEBREAK nu. LINEBREAK f (ξ) → e(z LINEBREAK nv + · · · )φ(ξz LINEBREAK nu + (· · · )φ(cid:48)(· · · )), LINEBREAK (2) where u and v still represent values at initialization, and · · · represent terms coming from the gradient update.1 even though the · · · appearing inside φ() turn out to be all gaussians, this expectation is hard to evaluate analytically due to the nesting of φ(cid:48) inside φ, unless φ is polynomial. furthermore, as more sgd steps are taken, this nesting quickly becomes more complicated, so even if φ is polynomial, the time needed for evaluation compounds exponentially. LINEBREAK after 1 step of sgd, LINEBREAK solution: project the gradient LINEBREAK to alleviate this difficulty, we propose to study the limit of training a neural network under a projected form of gradient descent which we call π-sgd, i.e., we update θ ← θ − ηπ∇θl where π is a linear projection and θ is the vector of all parameters. we shall first describe this projection π for the simple motivating example above before doing so for the general case. LINEBREAK 3.1 continuing the 1-hidden-layer example in the example of eq. (1), π acts on the gradients as follows: 1) π leaves the output layer gradient ∇vl untouched, but 2) projects the input layer gradient2 ∇ul = (· · · )φ(cid:48)(· · · ) to the linear span of u0, the initial value of input weights u:3 LINEBREAK π(∇vl, ∇ul) = (∇vl, πu0∇ul) = (∇vl, cu0) LINEBREAK for some c ∈ r. LINEBREAK 1see appendix c for a detailed calculation. 2the precise form is ∇ul = l(cid:48)vφ(cid:48)( 3this projection may look excessively reductive, but this is just an artifact of the 1-dimensional input and the LINEBREAK shallow depth. see section 3.2 for the general case. LINEBREAK here πu0 denotes the orthogonal projection to the span of u0. in particular, after projection, ∇ul now has roughly iid gaussian coordinates (proportional to u0).4 then unlike eq. (2), we avoid the nesting of φ(cid:48) inside φ: LINEBREAK f (ξ) → e(z LINEBREAK nv + · · · )φ(˜cz LINEBREAK nu), LINEBREAK after 1 step of π-sgd, LINEBREAK for some deterministic scalar ˜c. this expectation can then be evaluated routinely using the vtransform of φ (e.g. cho and saul (2009) for relu; see definition 3.1 below), and likewise, so can the expectations involved in all later steps. after formalization inside a tensor program, this rigorously gives rise to the ∞-width limit of f trained under π-sgd, which we call the π-limit of f . see theorem 3.2. definition 3.1. let vφ : r3 → r denote the v-transform of φ, such that vφ(e xy, e x 2, e y 2) = e φ(x)φ(y ) for any centered jointly gaussian random variables (x, y ) ∈ r2. we will treat vφ like an activation function and automatically vectorize when vφ is applied to 3 vectors of the same length. LINEBREAK 3.1.1 computing the π-limit here we sketch how to compute the π-limit of eq. (1). let ut, vt, ft denote corresponding objects at time t, with t = 0 denoting initialization. LINEBREAK memory and time requirements what information do we need to store in order to calculate the π-limit? because of the projection, ut = ctu0 for some ct ∈ r. so to calculate the limit of ft, we need to track ct (or rather its ∞-width limit). this memory requirement is θ(1) in training time t. to see the form of vt, it helps to simplify our setup a bit more by 1) initializing v0 = 0 and by 2) assuming each π-sgd step involves a minibatch containing a sole input ξt. correspondingly, because the gradient of vt is always proportional to φ(ξt nu0), there exist coefficients {as ∈ r}t−1 LINEBREAK nut) = φ(ξtct s=0 (which are random, but deterministic conditioned on u0, v0) such that LINEBREAK s=0, {bs ∈ r}t−1 LINEBREAK nvt = LINEBREAK asφ(bs LINEBREAK here bs = ξscs and as is formed from the learning rate and loss derivative. so to calculate the limit of ft, we need {as ∈ r}t−1 s=0 (or rather their n → ∞ limits). note that ct, as, bs all have nontrivial fluctuations for finite n, but become deterministic as n → ∞. this implies a memory requirement of θ(t), which is also the total requirement for computing the limit of ft. as we will see, each forward and backward pass has runtime θ(t) as well, so the total runtime for calculating limn→∞ ft is θ(t2),5 compared to the exponential runtime of general µ-limit. LINEBREAK s=0, {bs ∈ r}t−1 LINEBREAK forward pass using eq. (4), we can intuit (and formalize using tensor programs) that LINEBREAK ft(ξ) = LINEBREAK asφ(bs LINEBREAK φ(ξct LINEBREAK ˚as e φ(˚bsz LINEBREAK nu0)φ(ξ˚ctz LINEBREAK where ˚as,˚bs,˚ct denote the deterministic limits of the corresponding quantities. the expectation in the rhs can be evaluated using v-transforms. the t terms in the summation implies a runtime of θ(t). LINEBREAK backward pass the gradient update for the output weights vt is clearly represented by setting (at+1, bt+1) ← (−ηl(cid:48), ξct), where l(cid:48) denotes the loss derivative ∂l(ft(ξ), label)/∂ft(ξ). however, a priori, it seems unclear how to calculate the limit of the projected gradient πu0∇utl of the input weights. fortunately, because we can express the entire unrolled π-sgd training inside a tensor program, the master theorem (yang, 2020b) can automatically give us the exact formulas for the gradient limit; see appendix f. but in fact, there is a more intuitive way of obtaining the backward pass limit by recognizing that a projected gradient is just the maximal ascent direction in the projected space.6 in our case, πu0 ∇utl LINEBREAK 4this is because, while c has fluctuations for finite n, it is roughly constant for large n. 5assuming minibatch size is constant, and we train for a constant number of epochs, this translates to θ(n 2) to train lim ft, where n is dataset size, and θ(n ) to do inference on a single input. this compares favorably with gaussian processes, which requires θ(n 3) to “train” (i.e. inverting the kernel), and θ(n ) for inference. however, in our experiments here, the constant in our θ(n 2) in practice will make training lim ft slower than the corresponding ntk or nngp kernel regression. LINEBREAK 6see lemma f.1 for more details. LINEBREAK figure 2: summary of the π-limit for the 1-hidden-layer network of eq. (1). (left) representation of width-n µ-net with nonlinearity φ and its π-sgd update. here v is depicted as 1√ n a(cid:62)φ(b ⊗ √ nu0), which is equivalent to eq. (4). in π-sgd, the first layer gradient is projected to the space spanned by u0 before being accumulated to the weights. (right) this network’s ∞-width limit can be roughly thought of as another 1-hidden-layer neural network with nonlinearity vφ (eq. (6)). but updates are appended to a, b instead of added. see theorem 3.2 and compare to eq. ((cid:63)). LINEBREAK is just the maximal ascent direction of l in the span of u0, i.e. πu0 ∇utl = (∇ctl)u0, where ∇ctl is the derivative w.r.t. the coefficient ct of ut in terms of u0. in the ∞-width limit, this derivative can be obtained by just auto-differentiating eq. (5) when the v-transform has an explicit form, like for φ = relu (cho and saul, 2009). so a π-sgd step on ut is equivalent to taking ct+1 ← ct − η∇ctl. LINEBREAK summary below, for brevity, we say training routine to mean the package of learning rate η, training sequence of singleton minibatches {(ξt, yt)}t≥0 (where ξt is the input and yt is the label),7 and a loss function l(f (ξ), y) that is continuously differentiable in the prediction of the model f (ξ). theorem 3.2. consider the simple motivating example of 1-hidden-layer network f in eq. (1) with 1dimensional input and outputs, initialized by uα ∼ n (0, 1/n) and vα ← 0. suppose its nonlinearity φ has a polynomially bounded 2nd derivative. for any training routine, f trained by π-sgd for t steps has an ∞-width limit ˚ft , in the sense that, LINEBREAK as n → ∞, LINEBREAK ft (ξ) → ˚ft (ξ), LINEBREAK for any ξ ∈ r, LINEBREAK where the limit is almost sure. ˚ft is given as follows: initialize a0, b0 as empty column vectors, and initialize c0 ∈ r as 1. recall vφ is the v-transform of φ. for each t = 0, 1, . . ., define the function (where dot product of empty vectors is 0) LINEBREAK ˚ft(ξ) def= a(cid:62) LINEBREAK t vφ(ctξbt, bt ◦ bt, c 2 LINEBREAK for any ξ ∈ r, LINEBREAK where ◦ denotes coordinatewise product and 1 denotes the all-1s vector of appropriate shape, and at, bt, ct are inductively given by ct+1 LINEBREAK def= ct − η∇ctl(˚ft(ξt), yt) and LINEBREAK def= append(at, −η∇˚ft(ξt)l(˚ft(ξt), yt)), LINEBREAK def= append(bt, ctξt) LINEBREAK where append(v, p) appends element p to the end of vector v, increasing the dimension of v by 1. here at, bt correspond to the column vectors formed from the ∞-width limits of {as ∈ r}t−1 r}t−1 memory and θ(t 2) time. theorem 3.2 is summarized by fig. 2. LINEBREAK s=0, {bs ∈ s=0, and ct corresponds to the limit of ct.8 as discussed above, computing ˚ft requires θ(t ) LINEBREAK π-parametrization for deep networks LINEBREAK we can straightforwardly generalize π-sgd and the π-limit theorem (theorem 3.2) to deep mlps. however, due to the n × n gaussian matrix initialization in the middle of the network, the memory requirement will be θ(t 2) and runtime will be θ(t 3) for training t steps, for the same reason as discussed in yang and hu (2020, sec 8). this is not scalable to datasets like cifar10. therefore, we propose a different initialization that brings down the memory requirement to θ(t ) and runtime to θ(t 2), just like the 1-hidden-layer case. consider an l-hidden-layer µ-net f : rd → rdout : for LINEBREAK 7for simplicity, we only consider batch size 1; it’s straightforward to generalize to larger batch sizes. 8technically, we should have written ˚at, ˚bt, ˚ct to maintain the convention that ˚(cid:3) denotes limit of (cid:3), but LINEBREAK for the sake of brevity, we drop this convention in theorem 3.2. LINEBREAK weight matrices w1 ∈ rn×d and w2, . . . , wl ∈ rn×n, and nonlinearity φ : r → r, such a neural network on input ξ ∈ rd is given by h1(ξ) = xl(ξ) = φ(hl(ξ)) ∈ rn, LINEBREAK (7) and the network output is f (ξ) = n−1/2wl+1xl(ξ) for wl+1 ∈ rdout×n. in µ-parametrization, we would initialize wl LINEBREAK nw1ξ ∈ rn, and hl+1(ξ) = wl+1xl(ξ) ∈ rn, LINEBREAK αβ ∼ n (0, 1/n) for any α, β, l. next, we describe our alternative proposal. LINEBREAK for l = 1, . . . , l − 1, LINEBREAK π-initialization choose integers r, m , to be explained shortly; these numbers should all be thought of as constant in width n. suppose we are given a collection p of matrices LINEBREAK p def= {al, bl ∈ rm ×r}l LINEBREAK (8) then we can initialize weights wl by first sampling a standard random gaussian matrix ω ∈ rn×r, ωαi ∼ n (0, 1), before setting LINEBREAK l=2 ∪ {a1 ∈ rd×r} ∪ {bl+1 ∈ rm ×r, al+1 ∈ rm ×dout }. LINEBREAK wl ← LINEBREAK ωal(cid:62)φ(blω(cid:62)) ∈ rn×n, for all hidden l = 2, . . . , l; LINEBREAK al+1(cid:62)φ(bl+1ω(cid:62)) ∈ rdout×n LINEBREAK as an example, the initialization of the 1-hidden-layer case in theorem 3.2 corresponds to d = dout = r = 1, m = 0 and a1 = 1. see fig. 3(left) for an illustration. let’s digest this initialization scheme: 1) of course, al, bl need to be initialized themselves, and in this paper we will just do so with gaussian random initialization; see appendix b.1 for the pseudo-algorithm. 2) al, bl, l ∈ [2, l], will play the same roles as a, b in the 1-hidden-layer example above, whereas a1 plays the same role as c there. 3) r is a measure of dimension of the the projection. more precisely, we will project hidden weight gradients from rn×n to rn×r; see below. 4) al, bl will grow in the m dimension with training time, just like how the sizes of a, b grow in the 1-hidden-layer example. 5) eq. (9) can be interpreted as saying wl are generated by 1-hidden-layer mlps fal,bl : rr → (rr or rdout ) with weights al, bl, like so: LINEBREAK αβ ← 1/n(cid:104)ωα, fal,bl (ωβ)(cid:105), for all hidden l = 2, . . . , l; wl+1 LINEBREAK :β ← 1/nfal+1,bl+1(ωβ). (10) this is reminiscent of hypernetworks (ha et al., 2016), but the crucial difference is that the “batch dimension” (indexed by α, β) of the generator fal,bl becomes the width dimension of the generated network f , so that the same generators can generate networks of arbitrary width. LINEBREAK wl LINEBREAK π-projection we leave the output weights wl+1 alone, but for any w ∈ {w1, w2, . . . , wl}, where w has shape n × n or n × d, we project the gradient ∇wl of the same shape by left multiplying by πω, the projection matrix to the r-dimensional space spanned by the columns of ω. this means that preactivations hl are always in this space. however, the input side of w is not projected, so we are optimizing the hidden weights in a (r × n)-dimensional space, which still becomes infinitedimensional as n → ∞. we refer to sgd with π-projected gradients as π-sgd. this brings us to the following definition 3.3 (π-parametrization and π-limit). we define π-parametrization as the package of π-initialization and π-sgd,9 where r and the initial m are clear from context. a network in π-parametrization is abbreviated π-network or π-net, and we define π-limit as its ∞-width limit. LINEBREAK 3.2.1 computing the π-limit of deep mlp here we show the π-limit forward and backward passes can be efficiently computed. LINEBREAK π-limit forward pass let’s write f p for the (random) neural network π-initialized by p as in eqs. (8) and (9). then it’s straightforward to see f p has a deterministic limit ˚f p expressible as a composition of matrix multiplications and v-transforms: theorem 3.4 (π-limit forward pass). suppose φ has a polynomially bounded 2nd derivative. then LINEBREAK f p (ξ) → ˚f p (ξ), where convergence is almost sure, and ˚f p (ξ) is defined as follows. write g1 def= a1(cid:62)ξ ∈ rr, LINEBREAK for any ξ ∈ rd, LINEBREAK as n → ∞, LINEBREAK (cid:26)rr LINEBREAK rdout LINEBREAK for l = 2, . . . , l for l = l + 1, LINEBREAK and ˚f p (ξ) def= gl+1, where b ◦ b yields a size-m column vector of squared norms of b’s rows. LINEBREAK 9with learning rate independent of width (but may vary with training time) LINEBREAK figure 3: summary of the π-limit for deep mlps eq. (7), in the same style as fig. 2. here we take the example of 3-hidden-layer mlps. see theorems 3.4 and 3.5 and compare to eq. ((cid:63)). LINEBREAK see fig. 3(right) for an illustration. here, gl represents the coefficients of preactivation hl (c.f. eq. (7)) in the columns of ω. as we will see next, π-projection ensures that at any point during training, ft has an ∞-width limit of the form ˚f p for some p. LINEBREAK π-limit backward pass just like the 1-hidden-layer case, we can interpret the projected gradient as the maximal ascent direction in the column space of ω. formalizing the intuition using tensor programs yields the following theorem that we also empirically verify in appendix e. theorem 3.5 (π-limit backward pass). let p0 denote the matrices (c.f. eq. (8)) used in the πinitialization of f as in eq. (9). suppose its nonlinearity φ has a polynomially bounded 2nd derivative. then for any training routine, f trained by π-sgd for t steps has an ∞-width limit which is equal to ˚f pt for some pt given below, i.e. LINEBREAK as n → ∞, LINEBREAK ft (ξ) → ˚f pt (ξ), LINEBREAK for any ξ ∈ rd, LINEBREAK where the limit is almost sure. pt is given inductively through its elements al a1 LINEBREAK t − η∇a1l(˚f pt(ξt), yt), and, for l = 2, . . . , l + 1, LINEBREAK def= a1 LINEBREAK t , bl LINEBREAK t as follows: LINEBREAK al LINEBREAK def= append(al LINEBREAK t, −η∇gl LINEBREAK t LINEBREAK l(˚f pt(ξt), yt)), LINEBREAK bl LINEBREAK def= append(bl LINEBREAK t, gl−1 t LINEBREAK t corresponds to gl in theorem 3.4 evaluated for input ξt and function ˚f pt, and append(b, g) LINEBREAK here gl means appending g as a new row vector of b, increasing by 1 the dimension represented by m . theorems 3.4 and 3.5 are summarized by fig. 3.10 as conveyed by eq. ((cid:63)), the π-limit can be thought of as another mlp with activation vφ and trained by gradient concatenation.11 because π-parametrization has similar scaling with width as µ-parametrization, it is easy to show that the former admits feature learning in the same way the latter does, i.e. the feature kernel of every layer evolves nontrivially during training. using tensor programs, it is straightforward to extend the above theorems to more general settings such as biases, large batch size, per layer learning rate, or metalearning (appendix a). appendix d also makes several observations on the π-limit theorems. LINEBREAK π-limit vs µ-limit while the projection means optimization is slower in the π-limit, we believe with sufficiently large r, the π-limit should perform similarly to the µ-limit. indeed, prior works such as li et al. (2018) has shown that optimizing a neural network in a much smaller, random parameter subspace can recover most of the performance of training all parameters. this is also evidenced by our experimental results below, where the π-limit generally only slightly outperform wide µ-networks. LINEBREAK 10one may wonder how would theorem 3.5 compare with just directly accumulating gradients on p. in fact, this would train very badly because vφ is very smooth around 0, so ˚f p would look very linear for a long time. empirically, direct sgd on p would yield ≤ 53% test and ≤ 80% training accuracy on cifar10. LINEBREAK 11note that once a vector is appended to al or bl, it is not touched again. therefore, despite the similarity LINEBREAK between the π-limit and an mlp, al and bl should not be thought of “parameters” in the usual sense. LINEBREAK table 1: best test accuracies on cifar10 and omniglot, best of mlps up to 4 hidden layers, width 2048, r 400, as well as random search over a host of hyperparameters; see appendix b. note the µ-net numbers are also the optimal numbers for standard parametrization finite networks, as discussed in footnote 12. π-limit imagenet transfer means pretraining a π-limit with r = 200 on imagenet32 and perform kernel regression with its feature kernel (i.e. kernel of last layer activations) on cifar10; see section 4.2 and appendix b.4 for details and finite network results. also compare with feature kernel regression without pretraining (table 8). LINEBREAK nngp ntk LINEBREAK π-net LINEBREAK π-limit LINEBREAK π-limit imagenet transfer 64.39 LINEBREAK cifar10 omniglot LINEBREAK experiments LINEBREAK here we compare the performance of the relu π-limit on cifar10 (krizhevsky, 2009) and omniglot (lake et al., 2015) against that of ntk, nngp, and finite-width π- and µ-nets.12 as we will see, 1) π-limits of large enough r beat finite µ-nets; 2) finite π-nets underperform the above on cifar10 but, interestingly, outperform them on omniglot; 3) all of the above beat ntk and nngp. LINEBREAK 4.1 classification on cifar10 experimental setup for π- and µ-networks, infinite or finite, we train for 50 epochs. we adopt a step learning rate schedule, with a learning rate drop of 0.15 at a certain milestone, which is a hyperparameter. we sweep over a variety of hyperparameters such as the learning rate, gradient clipping, weight decay, the lr drop milestone, etc, as well as width, r, and depth. for ntk and nngp, we perform kernel regression following lee et al. (2018) using centered labels. for them, we sweep over the initialization variances and learning rate multipliers, along with ridge coefficient. see appendix b for more details. LINEBREAK results in the literature, the performance gap between cnn and its ntk (arora et al., 2019) is often cited for the deficiency of the ntk theory for explaining neural networks in practice. however, in fact, on mlps we already see a nontrivial gap, as seen in table 1 (compare µ-net with ntk, nngp).13 the π-limit closes this gap, having almost a 2-point advantage over ntk. the finite-width π-net outperforms ntk and underperforms π-limit both by about 1 point. LINEBREAK feature learning in π-limit and finite networks we show the advantage of π-limit over ntk and nngp is due to feature learning. to do so, we track the kernel regression performance of its (last-layer) feature kernel over the course of training. as seen in fig. 4(left), while the feature kernel at initialization underperforms both nngp and ntk, it improves consistently over time to eventually exceed them.14 similarly, the kernel performance of the best π- and µ-nets improves over time as well, though the accuracy of the feature kernel regression is slightly less than the network itself, likely due to the low rank property of the feature kernel. on the contrary, the π-limit benefits from feature kernel regression, improving the test accuracy from 61.5% to 61.85%; see table 8. LINEBREAK effects of width, r, and depth as shown in fig. 4(middle), accuracy of π-net increases monotonically with width and with r, approaching the accuracy of π-limit and µ-net, respectively, from below. this can also be seen in feature kernel regression across training time, fig. 6. in contrast, performance is not monotonic in depth for any of µ-net, π-net, or π-limit, beyond a consistent improvement from 1 to 2 hidden layers; see fig. 7. LINEBREAK 12because 1) standard parametrization differs from µ-parametrization only in factors depending on width, 2) we sweep such factors in hyperparameter optimization, and 3) our finite networks have width at most 2048 (so these factors are in practice constants), our best accuracies for µ-nets will also be best accuracies for standard-parametrized mlps. we also train π-nets with untied ωs; see appendix a.7. LINEBREAK 13note that, contrary to lee et al. (2018; 2020), which claimed that finite-width neural networks underperform the kernels, here we find the former outperform the latter. this is primarily due to the single learning rate drop we adopted, while lee et al. (2018; 2020) used a constant learning rate. we believe this provides a fairer comparison to the kernels since 1) the step lr schedule is more common than constant learning rate in practice, and 2) the kernels would obtain the same performance if we did kernel gradient descent for infinite-time (which is equivalent to kernel regression) with learning rate drop, since this optimization is convex. LINEBREAK 14in both nngp and ntk limits, the feature kernel stays fixed throughout training (yang and hu, 2020), so LINEBREAK the dotted line in fig. 4(left) shows the result if we do the same experiments for nngp and ntk. LINEBREAK figure 4: (left) feature kernels of π-limit, π-net, and µ-net all improve in quality with training, as measured by kernel regression on cifar10. all models are the best from our hyperparameter sweeps, but note that feature kernel regression causes accuracy decrease in finite models. (middle) cifar10 validation accuracy is monotonic across width and r for π-net, π-limit, and µ-net. (right) omniglot validation accuracy, in contrast, is not monotonic in width, and µ-net can underperform π-net of large r. (note we did not run π-limit with r ≥ 800 in consideration of computational costs). all numbers in the heatmaps are the best from our random hyperparameter searches for 2-hidden-layer networks. LINEBREAK transfer learning from imagenet to cifar10 LINEBREAK pretraining-and-transfer-learning is an important setting where feature learning is crucial. as pointed out in yang and hu (2020), the ntk limit trivializes pretraining, while the µ-limit both theoretical and empirically benefit from it. here we investigate pretraining for the π-limit in the image domain by pretraining on imagenet32 (chrabaszcz et al., 2017)15 and transferring to cifar10. LINEBREAK experimental setup we pretrain the π-limit with r = 200 (as well as µ-net, π-net with r = 200, and π-net with r = 400) for 30 epochs on a fixed subset of imagenet32 with 250 (out of 1000) randomly subsampled classes. to evaluate on cifar10, we compute the kernel induced by the pretrained final-layer-features and perform kernel regression. LINEBREAK results as shown in table 1, imagenet32 pretraining nontrivially raises the downstream cifar10 performance over without pretraining, altogether creating a 5% gap compared to ntk (which has the same test accuracy whether or not it is pretrained on imagenet32 because of the disparate classes, as shown in yang and hu (2020)). this again demonstrates the feature learning capability of the π-limit. table 7 shows the benefit of pretraining seems to be directly related to the capacity of the model. LINEBREAK few-shot learning via metalearning on omniglot LINEBREAK following yang and hu (2020), we also evaluate few-shot learning on omniglot. compared to traditional classification settings like cifar10, doing well on omniglot requires learning features that can rapidly be adapted to new unseen data (raghu et al., 2019). we will adopt a metalearning approach to this, following finn et al. (2017). unlike yang and hu (2020), we will train our models using anil (almost no inner loop) (raghu et al., 2019) rather than first-order maml (model agnostic meta-learning). briefly, anil is a variant of second-order maml, where in the inner loop, we only adapt the output layer, while in the outer loop, we only train the network body. we adopt anil because: 1) we would like to train deep mlps with sgd and without adam or batchnorm, but empirically this makes optimization of first-order maml difficult for both finite and ∞-width networks compared to second-order maml. 2) while a π-parametrized network trained by second-order maml has an ∞-width limit calculable using tensor programs, it does not stay in the f p form of theorem 3.4 because of the second-order gradient, rendering the limit computation inefficient. 3) fortunately, π-networks trained by anil do not have this issue because the inner and outer loop gradients are on different parameters. in addition, anil performs on par with maml on standard finite-width networks (raghu et al., 2019). 4) furthermore, anil training more clearly delineates the role of the network body for learning reusable features and the role of the head for adapting to new data, which is more fitting for our goals in this paper. LINEBREAK experimental setup we focus on the 5-way, 1-shot task16, with only 1 step of anil adaption. for π- and µ-networks, infinite or finite, we train for 50 epochs, 1000 batches per epoch, and 8 tasks per batch. following antoniou et al. (2019), we use cosine annealing schedule on the meta-learning rate. LINEBREAK 15i.e. imagenet (deng et al., 2009; russakovsky et al., 2015) downsampled to 32 × 32 resolution 16i.e. each task consists of 5 different classes, with 1 example provided for each class in training. LINEBREAK for ntk and nngp, anil meta-training has no effect, and meta-testing amounts to just taking 1 kernel gradient descent step on each task.17 we sweep over a variety of hyperparameters such as the outer and inner learning rates, gradient clipping, etc, as well as width, r, and depth. see appendix b for more details. LINEBREAK results as seen in table 1, µ-net, π-net, and π-limit all outperform nngp and ntk by about 40 points. interestingly, while π-limit is slightly better than µ-net, they are both outperformed by π-net. this is related to the width nonmonotonicity seen on omniglot, as we describe next. LINEBREAK effect of width, r, and depth while π-net performance with r is still roughly monotonic, in contrast to in cifar10, here it can decrease with width, as seen in fig. 4(right). in addition, µ-net seems to underperform π-net of the same width for sufficiently large r. we find this is primarily due to optimization and not generalization because omniglot is hard to overfit; see fig. 8. counterintuitively, π-net of large r can optimize faster than µ-net despite the projection. this is likely a side effect of π-initialization, as we see this advantage persist when r > width, where projection is a no-op. we do not see width nonmonotonicity on cifar10 because overfitting is much easier there, so the results depend much more on the implicit bias of each model. on the other hand, performance seems to monotonically increase along diagonals of fixed r/width ratio, peaking around r/width ≈ 1/2. this suggests a different limit of r ∝ width → ∞, which warrants investigation in future works. unlike cifar10, test accuracy is more monotonic in depth here (fig. 7). again, this is probably because the extra weights help with optimization, which is the bottleneck on omniglot. LINEBREAK related works LINEBREAK the π-limit bears some superficial similarities to hierarchical kernel processes such as deep gps (damianou and lawrence, 2013; salimbeni and deisenroth, 2017) or deep kernel processes (aitchison et al., 2021). the crucial difference here is that 1) during inference, the π-limit is deterministic and not a hierarchically sampled process, and 2) the π-limit is not trained variationally. relatedly, deep gps or kernel processes can be construed as a kind of randomly initialized infinitewidth neural network with finite bottleneck layers (agrawal et al., 2020; aitchison, 2020). however, their variational inference procedures do not correspond to the limit of sgd. in contrast, littwin et al. (2021) derived such an sgd limit where the network between consecutive bottlenecks is in ntk parametrization, and the limit takes the form of a kind of intertwined system of kernel gradient descent. however, the computation of this limit is not scalable to datasets like cifar10. during training, the π-limit’s al and bl grow in size, reminiscent of works on growing neural networks (liu et al., 2019; wu et al., 2021; gu et al., 2021; gong et al., 2019). of course, these works focus on improving training efficiency of practical models, which is not our goal here. nevertheless, it will be interesting to explore whether insights from π-limit can contribute back to this literature. our π-initialization (given fixed p) can be construed as a special form of the initialization in deep mean field limits of mlps (araújo et al., 2019; sirignano and spiliopoulos, 2020; fang et al., 2020; nguyen, 2019; nguyen and pham, 2020). however, without π-projection, these limits’ analytical computation suffers exponential runtime blowup like the µ-limit. LINEBREAK conclusion LINEBREAK a good model for studying wide neural networks should 1) capture the desired behavior of neural networks in practice, including feature learning and performance on real datasets, and 2) come with a set of theoretical tools for working researchers. but an attractive model must also balance these properties with 3) computational simplicity for empirical investigations, and 4) mathematical simplicity for theoretical investigations. previously, ntk and nngp satisfy 2), 3), 4) but not 1), as shown in this and prior works. the µ-limit satisfies 1) and 2) but, arguably, not 3) and 4). in this work, we presented the π-limit which, we believe, satisfies all 4 properties and that can prove fruitful for future researches. while our work closed the ∞-width performance gap, it also opens many new questions, e.g., can we derive the π-limit for a fixed r/width ratio? when precisely does the width nonmonotonicity of π-net occur? what about modern architectures, beyond mlp? we leave these questions to future work. LINEBREAK 17ntk and nngp can be trained under second-order maml, but we found their performance strictly LINEBREAK decreases with metatraining, as the randomization of labels across tasks confuse the readout layer. LINEBREAK references LINEBREAK devanshu agrawal, theodore papamarkou, and jacob hinkle. wide neural networks with bottlenecks are deep gaussian processes. arxiv:2001.00921 [cs, stat], january 2020. url http://arxiv.org/abs/2001.00921. LINEBREAK laurence aitchison. why bigger is not always better: on finite and infinite neural networks. in proceedings of the 37th international conference on machine learning, pages 156–164. pmlr, november 2020. url https://proceedings.mlr.press/v119/aitchison20a. html. LINEBREAK laurence aitchison, adam yang, and sebastian w. ober. deep kernel processes. in proceedings of the 38th international conference on machine learning, pages 130–140. pmlr, july 2021. url https://proceedings.mlr.press/v139/aitchison21a.html. LINEBREAK antreas antoniou, harrison edwards, and amos storkey. LINEBREAK how to train your maml. LINEBREAK dyego araújo, roberto i. oliveira, and daniel yukimura. a mean-field limit for certain deep neural networks. arxiv:1906.00193 [cond-mat, stat], june 2019. url http://arxiv.org/abs/ 1906.00193. LINEBREAK sanjeev arora, simon s. du, wei hu, zhiyuan li, ruslan salakhutdinov, and ruosong wang. on LINEBREAK exact computation with an infinitely wide neural net, 2019. LINEBREAK lenaic chizat and francis bach. on the global convergence of gradient descent for overparameterized models using optimal transport. arxiv:1805.09545 [cs, math, stat], may 2018. url http://arxiv.org/abs/1805.09545. LINEBREAK youngmin cho and lawrence k. saul. kernel methods for deep learning. in advances in neural information processing systems, pages 342–350, 2009. url http://papers.nips.cc/ paper/3628-kernel-methods-for-deep-learning. LINEBREAK patryk chrabaszcz, ilya loshchilov, and frank hutter. a downsampled variant of imagenet as an LINEBREAK alternative to the cifar datasets, 2017. LINEBREAK andreas c. damianou and neil d. lawrence. deep gaussian processes, 2013. LINEBREAK jia deng, wei dong, richard socher, li-jia li, kai li, and li fei-fei. imagenet: a large-scale hierarchical image database. in 2009 ieee conference on computer vision and pattern recognition, pages 248–255, 2009. doi:10.1109/cvpr.2009.5206848. LINEBREAK cong fang, jason d. lee, pengkun yang, and tong zhang. modeling from features: a mean-field framework for over-parameterized deep neural networks. arxiv:2007.01452 [cs, math, stat], july 2020. url http://arxiv.org/abs/2007.01452. LINEBREAK chelsea finn, pieter abbeel, and sergey levine. model-agnostic meta-learning for fast adaptation of deep networks. arxiv:1703.03400 [cs], july 2017. url http://arxiv.org/abs/1703. 03400. LINEBREAK linyuan gong, di he, zhuohan li, tao qin, liwei wang, and tieyan liu. efficient training of bert by progressively stacking. in proceedings of the 36th international conference on machine learning, pages 2337–2346. pmlr, may 2019. url https://proceedings.mlr. press/v97/gong19a.html. LINEBREAK xiaotao gu, liyuan liu, hongkun yu, jing li, chen chen, and jiawei han. on the transformer growth for progressive bert training. in proceedings of the 2021 conference of the north american chapter of the association for computational linguistics: human language technologies, pages 5174–5180, online, june 2021. association for computational linguistics. doi:10.18653/v1/2021.naacl-main.406. url https://aclanthology.org/2021. naacl-main.406. LINEBREAK david ha, andrew dai, and quoc v. le. hypernetworks. arxiv:1609.09106 [cs], december 2016. LINEBREAK arthur jacot, franck gabriel, and clément hongler. neural tangent kernel: convergence and generalization in neural networks. arxiv:1806.07572 [cs, math, stat], june 2018. url http: //arxiv.org/abs/1806.07572. LINEBREAK alex krizhevsky. learning multiple layers of features from tiny images. 2009. LINEBREAK brenden m. lake, ruslan salakhutdinov, and joshua b. tenenbaum. human-level concept learning through probabilistic program induction. science, 350(6266):1332–1338, 2015. issn 0036-8075. doi:10.1126/science.aab3050. url https://science.sciencemag.org/content/ 350/6266/1332. LINEBREAK jaehoon lee, yasaman bahri, roman novak, sam schoenholz, jeffrey pennington, and jascha sohldickstein. deep neural networks as gaussian processes. in international conference on learning representations, 2018. url https://openreview.net/forum?id=b1ea-m-0z. LINEBREAK jaehoon lee, samuel s. schoenholz, jeffrey pennington, ben adlam, lechao xiao, roman novak, and jascha sohl-dickstein. finite versus infinite neural networks: an empirical study. arxiv:2007.15801 [cs, stat], september 2020. url http://arxiv.org/abs/2007. 15801. LINEBREAK chunyuan li, heerad farkhoor, rosanne liu, and jason yosinski. measuring the intrinsic dimension of objective landscapes. arxiv:1804.08838 [cs, stat], april 2018. url http://arxiv.org/ abs/1804.08838. LINEBREAK etai littwin, omid saremi, shuangfei zhai, vimal thilak, hanlin goh, joshua m. susskind, and greg yang. implicit acceleration and feature learning in infinitely wide neural networks with bottlenecks, 2021. LINEBREAK qiang liu, lemeng wu, and dilin wang. splitting steepest descent for growing neural architectures, LINEBREAK song mei, andrea montanari, and phan-minh nguyen. a mean field view of the landscape of two-layer neural networks. proceedings of the national academy of sciences, 115(33):e7665– e7671, august 2018. issn 0027-8424, 1091-6490. doi:10.1073/pnas.1806579115. url https: //www.pnas.org/content/115/33/e7665. LINEBREAK phan-minh nguyen. mean field limit of the learning dynamics of multilayer neural networks. arxiv:1902.02880 [cond-mat, stat], february 2019. url http://arxiv.org/abs/1902. 02880. LINEBREAK phan-minh nguyen and huy tuan pham. a rigorous framework for the mean field limit of multilayer neural networks. arxiv:2001.11443 [cond-mat, stat], january 2020. url http: //arxiv.org/abs/2001.11443. LINEBREAK aniruddh raghu, maithra raghu, samy bengio, and oriol vinyals. rapid learning or feature reuse? towards understanding the effectiveness of maml. arxiv:1909.09157 [cs, stat], september 2019. url http://arxiv.org/abs/1909.09157. LINEBREAK grant m. rotskoff and eric vanden-eijnden. neural networks as interacting particle systems: asymptotic convexity of the loss landscape and universal scaling of the approximation error. arxiv:1805.00915 [cond-mat, stat], may 2018. url http://arxiv.org/abs/1805. 00915. LINEBREAK olga russakovsky, jia deng, hao su, jonathan krause, sanjeev satheesh, sean ma, zhiheng huang, andrej karpathy, aditya khosla, michael bernstein, alexander c. berg, and li fei-fei. imagenet large scale visual recognition challenge, 2015. LINEBREAK hugh salimbeni and marc deisenroth. doubly stochastic variational inference for deep gaussian processes. arxiv:1705.08933 [stat], november 2017. url http://arxiv.org/abs/1705. 08933. LINEBREAK justin sirignano and konstantinos spiliopoulos. mean field analysis of neural networks. LINEBREAK justin sirignano and konstantinos spiliopoulos. mean field analysis of deep neural networks. arxiv:1903.04440 [math, stat], february 2020. url http://arxiv.org/abs/1903. 04440. LINEBREAK lemeng wu, bo liu, peter stone, and qiang liu. firefly neural architecture descent: a general LINEBREAK approach for growing neural networks, 2021. LINEBREAK greg yang. tensor programs i: wide feedforward or recurrent neural networks of any architecture are gaussian processes. arxiv:1910.12478 [cond-mat, physics:math-ph], december 2019a. url http://arxiv.org/abs/1910.12478. LINEBREAK greg yang. scaling limits of wide neural networks with weight sharing: gaussian process behavior, gradient independence, and neural tangent kernel derivation. arxiv:1902.04760 [condmat, physics:math-ph, stat], february 2019b. url http://arxiv.org/abs/1902.04760. LINEBREAK greg yang. tensor programs ii: neural tangent kernel for any architecture. arxiv:2006.14548 LINEBREAK [cond-mat, stat], august 2020a. url http://arxiv.org/abs/2006.14548. LINEBREAK greg yang. tensor programs iii: neural matrix laws. arxiv:2009.10685 [cs, math], may 2020b. LINEBREAK greg yang and edward j. hu. feature learning in infinite-width neural networks. arxiv:2011.14522 LINEBREAK [cond-mat], november 2020. url http://arxiv.org/abs/2011.14522. LINEBREAK greg yang and etai littwin. tensor programs iib: architectural universality of neural tangent kernel training dynamics. arxiv:2105.03703 [cs, math], may 2021. url http://arxiv. org/abs/2105.03703. LINEBREAK greg yang, edward j. hu, igor babuschkin, szymon sidor, xiaodong liu, david farhi, nick ryder, jakub pachocki, weizhu chen, and jianfeng gao. tensor programs v: tuning large neural networks via zero-shot hyperparameter transfer. arxiv:2203.03466 [cond-mat], march 2022. url http://arxiv.org/abs/2203.03466. LINEBREAK a extensions of π-limit LINEBREAK a.1 biases LINEBREAK biases are straightforward to add. consider an l-hidden-layer µ-net f : rd → rdout with biases: such a neural network on input nb1 ∈ rn, and ξ ∈ rd is given by h1(ξ) = √ LINEBREAK xl(ξ) = φ(hl(ξ)) ∈ rn, LINEBREAK hl+1(ξ) = wl+1xl(ξ) + LINEBREAK nbl ∈ rn, LINEBREAK for l = 1, . . . , l − 1, LINEBREAK and the network output is f (ξ) = n−1/2wl+1xl(ξ) + bl+1 for wl+1 ∈ rdout×n. parametrization, the biases are initialized as bl n (0, σ2 LINEBREAK in µ∼ b ), for a hyperparameter σb. however, in π-parametrization, we will do this a bit differently. LINEBREAK b /n) for l = 1, . . . , l, and bl+1 LINEBREAK i LINEBREAK π-initialization suppose we are given a collection p of matrices and vectors LINEBREAK p def= (rhs of eq. (8)) ∪ {βl ∈ rr}l LINEBREAK l=1 ∪ {βl+1 ∈ rdout }. LINEBREAK then we can initialize weights and biases by first sampling a standard random gaussian matrix ω ∈ rn×r, ωαi ∼ n (0, 1), and 1) set wl as in eq. (9), and 2) set biases as LINEBREAK and bl ← LINEBREAK ωβl LINEBREAK for all l = 1, . . . , l. LINEBREAK this constitutes the π-initialization of biases. LINEBREAK π-projection for π-projection, we also project the bias gradients by πω. LINEBREAK π-limit calculation LINEBREAK theorem a.1 (π-limit forward pass with bias). let p be some collection as in eq. (12). as n → ∞, LINEBREAK f p (ξ) → ˚f p (ξ), LINEBREAK for any ξ ∈ rd, LINEBREAK where convergence is almost sure, and ˚f p (ξ) is defined as follows. write g1 def= a1(cid:62)ξ + β1 ∈ rr, LINEBREAK (cid:26)rr LINEBREAK rdout LINEBREAK for l = 2, . . . , l for l = l + 1, LINEBREAK and ˚f p (ξ) def= gl+1, where b ◦ b yields a size-m column vector of squared norms of b’s rows. theorem a.2 (π-limit backward pass). for the same setting as in theorem 3.5 but with p as in eq. (12), al, bl are updated exactly as in theorem 3.5, and βl is updated by gradient accumulation like a1: LINEBREAK def= βl LINEBREAK t − η∇βl l(˚f pt(ξt), yt), LINEBREAK for all l = 1, . . . , l + 1 LINEBREAK a.2 parameter multipliers LINEBREAK we can insert to eq. (11) constant parameter multipliers αw for each parameter w like so LINEBREAK hl+1(ξ) = αwl+1wl+1xl(ξ) + LINEBREAK nαbl bl ∈ rn, LINEBREAK for l = 1, . . . , l − 1, LINEBREAK these multipliers are tuneable hyperparameters. they affect both the forward and backward passes of the network. in the π-limit, the forward pass is the same as in theorem a.1 except we replace al with αwl al and βl with αbl βl. the backward pass is the same as in theorem a.2, but we just have to make sure that we backprop through the multipliers (in contrast, if we instead have absorbed the multipliers into the initialization, then we would not backprop through the multilpliers). in our experiments, we only consider the input weight multiplier, output weight multiplier, and a single multiplier for all biases. LINEBREAK a.3 learning rate multipliers LINEBREAK we may have custom learning rates for specific weights or biases. in our experiments, we implement this with learning rate multipliers relative to the global learning rate η, e.g., the learning rate of a parameter w becomes γwη if the multiplier is denoted γw. then in the limit, we just need to replace η in theorem 3.5 or theorem a.2 with γwl η, i.e. t − γw1η∇a1 l(˚f pt(ξt), yt) t, −γwl η∇gl t − γbl η∇βl l(˚f pt(ξt), yt), LINEBREAK def= a1 def= append(al def= βl LINEBREAK for all l = 1, . . . , l + 1. LINEBREAK for all l = 2, . . . , l + 1 LINEBREAK l(˚f pt(ξt), yt)), LINEBREAK a1 al LINEBREAK t LINEBREAK but note we do not modify the bl update. in our experiments, we will only sometimes use a lr multiplier on the input layer (“input layer lr mult”), one on the output layer (“output layer lr mult”), and/or a single multiplier for all biases (“bias lr mult”). LINEBREAK a.4 large batch size for batch size s > 1, we still accumulate gradients into a1 and βl as if they are regular parameters, and for the hidden weights, we just append the s gradient vectors as if they are from s unit-sized batches. LINEBREAK a.5 gradient clipping the frobenius norms of the projected gradients of the input weight w1 and all biases bl converge to exactly the frobenius norms of the gradients of a1 and βl, i.e. LINEBREAK where the convergence is almost sure. for any hidden weights wl, suppose its gradient over an s-sized batch in the π-limit is given by LINEBREAK al LINEBREAK def= append(al LINEBREAK t, −η ˜a), LINEBREAK bl LINEBREAK def= append(bl LINEBREAK t, ˜b). LINEBREAK where ˜a, ˜b ∈ rs×r, and append(b, ˜b) means appending all s rows of ˜b into b, increasing the latter’s column length by s. then LINEBREAK tr LINEBREAK where the convergence is almost sure. then clipping the gradient in the π-limit just means clipping the gradients of a1 and βl, and, for hidden weights, rescale ˜a such that LINEBREAK is at LINEBREAK tr LINEBREAK most the clipping threshold. LINEBREAK a.6 weight decay the limit of decaying wl ← wl(1 − lr · wd) is just al ← al(1 − lr · wd). LINEBREAK a.7 decoupling layers we can actually use different rs and m s for every layer, and a similar limit theorem can be proved. we can also use different, independently sampled ω for each layer (“untied ωs”). however, the limit would be exactly the same as before, as is apparent in our proof. in addition, we verify that even in finite π-nets, there is no difference in performance between tying ω across layers or not (fig. 5). all of our experiments are actually done with untied ωs. LINEBREAK b experimental details LINEBREAK all of our experiments are done on v100 gpus. all of our networks use relu activation. the v-transform of relu is (cho and saul, 2009) 1 2π LINEBREAK 1 − c2 + (π − arccos(c))c LINEBREAK vrelu(r1r2c, r2 LINEBREAK for any r1, r2 > 0 and c ∈ [−1, 1]. LINEBREAK figure 5: tying vs untying ω across layers make no difference in π-nets. using the same procedure as in section 4.1, we train π-net with r = 400 using the best hyperparameter combination we found (whose result shown in table 1) 50 times, each with different independently sampled ωs, either with ω tied across layers (blue curve) or not (orange curve). we plot their mean training loss and test loss curves here, with shade indicating 95% confidence interval. LINEBREAK b.1 network initialization and parametrization at initialization, 1) biases are always 0, 2) m is set to r so that al, bl are square matrices for l = 2, . . . , l, and 3) we sample al, bl as standard gaussians and then scale them as follows: LINEBREAK a1 = a1/a1.norm(dim = 0, keepdim = t rue) bl = bl/bl.norm(dim = 1, keepdim = t rue) al = al/(cid:112)a1.shape[0] LINEBREAK for all l = 2, . . . , l, and LINEBREAK for all l = 2, . . . , l LINEBREAK b.2 feature kernel when we talk about the “feature kernel” of a π-limit ˚f p , we always mean the n → ∞ limit of the feature kernel of f p , and not the kernel induced by gl in ˚f p . this feature kernel k on inputs {ξ1, . . . , ξk} is calculated as LINEBREAK kij = vφ((cid:104)gl LINEBREAK i , gl LINEBREAK where gl LINEBREAK i and gl LINEBREAK j are the gl in theorem 3.4 evaluated for two inputs ξi and ξj. LINEBREAK b.3.1 µ-net, π-net, and π-limit for π- and µ-networks, infinite or finite, we train for 50 epochs. we adopt a step learning rate schedule, with a learning rate drop of 0.15 at a milestone hyperparameter. we also clip gradients with a hyperparameter threshold, where the clip is triggered individually for each parameter by the parameter’s norm, rather than total parameter norm. LINEBREAK hyperparameter optimization we first perform random search on hyperparameters listed in table 2 for 2-hidden-layer π-net, π-limit, and µ-net: we sample at least 512 hyperparameter combinations 1) for each (width, r) ∈ {128, 256, 512, 1024, 2048} × {50, 100, 200, 400} for π-net, 2) for each width ∈ {128, 256, 512, 1024, 2048} for µ-net, and 3) for each r ∈ {50, 100, 200, 400} for π-limit. the best accuracies per (width, r) are shown in fig. 4(middle). then we take the best hyperparameter combinations overall for π-net, π-limit, and µ-net, and for depth ∈ {1, 2, 3, 4} (where depth denotes number of hidden layers), we resweep only learning rate and weight decay in a grid search, where the grid is (lr∗ · {2−2, 2−1.5, . . . , 21.5}) × (wd∗ · {2−2, 2−1.5, . . . , 21.5}) and lr∗ and wd∗ are the optimal hyperparameters from the 2-hidden-layer sweep. the best test accuracies per depth are shown in fig. 7, while the overall best test accuracies over all depth are shown in table 1. LINEBREAK table 2: cifar10 hyperparameter grid for µ-net, π-net, and π-limit LINEBREAK hyperparameter LINEBREAK gradient clip learning rate weight decay bias mult lr drop milestone input weight lr mult output weight lr mult input weight mult output weight mult batch size LINEBREAK hyperparameter LINEBREAK bias variance bias lr multiplier input weight lr multiplier output weight lr multiplier ridge LINEBREAK b.3.2 nngp and ntk for nngp and ntk, we perform kernel regression following lee et al. (2018) using centered labels. for each depth ∈ {1, 2, 3, 4}, we sweep over hyperparameters listed in table 3 (which change the kernels) using (complete) grid search, with weight initialization variance fixed at 1 in the ntk parametrization.18 for each of nngp and ntk, the best test accuracy over all depths is listed in table 1. LINEBREAK imagenet transfer LINEBREAK we pretrain the π-limit with r = 200 and 2 hidden layers for 30 epochs on a fixed subset of imagenet32 with 250 (out of 1000) randomly subsampled classes. to evaluate on cifar10, we compute the kernel induced by the pretrained final-layer-features and perform kernel ridge regression. we optimize the hyperparameters in table 4 via random search. LINEBREAK b.5 omniglot LINEBREAK we focus on the 5-way, 1-shot task, with only 1 step of anil adaption. LINEBREAK b.5.1 µ-net, π-net, and π-limit for π- and µ-networks, infinite or finite, we train for 50 epochs, 1000 batches per epoch, and 8 tasks per batch. in each epoch, we validate on 500 batches from the validation set. following antoniou et al. (2019), we use cosine annealing learning rate schedule. we also clip gradients with a hyperparameter threshold, where the clip is triggered by the total parameter norm. LINEBREAK hyperparameter optimization we first perform random search on hyperparameters listed in table 5 for 2-hidden-layer π-net, π-limit, and µ-net: we sample at least 512 hyperparameter combinations 1) for each (width, r) ∈ {128, 256, 512, 1024, 2048} × {50, 100, 200, 400} for π-net, 2) for each width ∈ {128, 256, 512, 1024, 2048} for µ-net, and 3) for each r ∈ {50, 100, 200, 400} for π-limit. then we take the best hyperparameter combinations overall (based on validation accuracy) for π-net, π-limit, and µ-net, and for depth ∈ {1, 2, 3, 4} (where depth denotes number of hidden layers), we resweep only the meta learning rate (i.e. outer learning rate) and step size (i.e. inner learning rate) in a grid search, where the grid is (ilr∗ · {2−2, 2−1.5, . . . , 21.5}) × (olr∗ · {2−2, 2−1.5, . . . , 21.5}) LINEBREAK 18this is without loss of generality because relu is homogeneous and we are sweeping the bias variance. LINEBREAK table 4: imagenet transfer hyperparameter grid for µ-net, π-net, and π-limit LINEBREAK hyperparameter LINEBREAK bias mult batch size learning rate input weight mult output weight mult weight decay gradient clip ridge LINEBREAK table 5: omniglot hyperparameter grid for µ-net, π-net, and π-limit LINEBREAK hyperparameter LINEBREAK step size meta learning rate gradient clip bias mult input weight mult input weight lr mult LINEBREAK and ilr∗ and olr∗ are the optimal inner and outer learning rates from the 2-hidden-layer sweep. the best validation accuracies per depth are shown in fig. 7. then we take the models with overall best validation accuracies over all depth and evaluate them on the test set using 10000 batches. these test results are shown in table 1. to investigate the width non-monotonicity more thoroughly, we further perform random search on hyperparameters listed in table 5 for 2-hidden-layer π-net and µ-net. we sample at least 512 hyperparameter combinations 1) for each (width, r) ∈ {128, 256, 512, . . . , 8192} × {50, 100, 200, . . . , 32000} for π-net, and 2) for each width ∈ {128, 256, 512, . . . , 8192} for µ-net. the best validation accuracies per (width, r) are shown in fig. 4(right). LINEBREAK b.5.2 nngp and ntk as discussed in section 4.3, for ntk and nngp, anil meta-training has no effect, and meta-testing amounts to just taking 1 kernel gradient descent step on each task. we fix the step size (i.e. inner learning rate) at 0.5. for each depth ∈ {1, 2, 3, 4}, we sweep over hyperparameters listed in table 6 using (complete) grid search, with weight initialization variance fixed at 1 in the ntk parametrization. for each of nngp and ntk, the best test accuracy over all depths is listed in table 1. LINEBREAK b.5.3 visualization of image representations we sample 5 random classes and 10 random images from each class from the omniglot test set, for a total of 50 images. we take the best performing ntk, µ-net, and π-limit and evaluate their feature kernels (c.f. appendix b.2) on the 50 images. we then do pca on these kernels to produce fig. 1. in fig. 9, we also do the same for our best performing π-net. LINEBREAK c detailed calculations of 1-step sgd LINEBREAK suppose we present an input ξ0 to the network and perform a step of gradient descent with learning rate η and loss l. then simple calculations show that the updates ∆u, ∆v to u, v are √ LINEBREAK n∆v = cφ(ξ0 LINEBREAK nu) LINEBREAK where c = −ηl(cid:48). then, via tensor programs, f (ξ) for any ξ now has a limit of the form LINEBREAK lim n→∞ LINEBREAK f (ξ) = e(z LINEBREAK = e(z LINEBREAK nv + z LINEBREAK n∆v)φ(z LINEBREAK nuξ + z √ LINEBREAK n∆uξ) √ LINEBREAK nv + ˚cφ(z LINEBREAK nuξ0))φ(z LINEBREAK nuξ + ˚cz LINEBREAK nvφ(cid:48)(z LINEBREAK where ˚c is the deterministic limit of c that is shown to exist by tensor programs. LINEBREAK table 6: omniglot hyperparameter grid for nngp and ntk LINEBREAK hyperparameter LINEBREAK bias variance bias lr mult input layer lr mult output layer lr mult LINEBREAK table 7: pretraining on imagenet32 and evaluating on cifar10, full results. we pretrained µ-net, π-net with r = 200, π-net with r = 400, and π-limit with r = 400 on imagenet32 and evaluated the result model on cifar10. here, the π-limit number 64.39 is the same as in table 1 under π-limit imagenet transfer. for reference, we also include the nngp and ntk numbers in the left block. the * indicates we are comparing the π-limit transfer performance with r = 200 vs π-limit cifar10 number with r = 400, so the +2.79 is an underestimate of the improvement due to pretraining. the benefit of pretraining seems to be directly related to the capacity of the model, as π-net with r = 200 < π-net with r = 400 < µ-net < π-limit. π-net r=200 58.02 LINEBREAK nngp ntk µ-net LINEBREAK transfer vs table 1 LINEBREAK d remarks on the π-limit theorems LINEBREAK 1. π-projection actually ensures that, even for finite n, ft = f p for some p. however, this p is random, with fluctuation coming from the sampling of ω (which is fixed at initialization). taking n → ∞ reduces this fluctuation to 0. LINEBREAK 2. again, even with the projection, we are optimizing in an infinite-dimensional space, though “linearly infinite” r × ∞ instead of “quadratically infinite” ∞ × ∞ like in the µ-limit. 3. the forward pass of ˚f p can be thought of as that of another mlp with nonlinearity vφ, as LINEBREAK illustrated in fig. 3. in this view, m becomes the width of this mlp. LINEBREAK e numerical verification of the π-limit theorems LINEBREAK here we numerically show that wide π-nets have nearly identical loss curves as the π-limit. see figs. 10, 11 and 13. in addition, fig. 12 verifies the convergence of the feature kernel to its infinitewidth limit. LINEBREAK f proofs LINEBREAK we will just prove theorems 3.4 and 3.5, as theorem 3.2 is a special case of them. at a high level, we need to do two things: 1) show that ft converges almost surely to something, and 2) this something is ˚f pt . here we assume the reader is familiar with tensor programs (yang, 2019b;a; 2020a;b; yang and hu, 2020; yang and littwin, 2021; yang et al., 2022), in particular the techniques used in yang and hu (2020). LINEBREAK f.1 almost sure convergence LINEBREAK showing almost sure convergence is straightforward using the tensor programs technique, i.e. express π-initialization and the entire π-sgd training trajectory inside a tensor program (a netsor(cid:62)+ program in particular) and apply the master theorem (c.f. yang (2020b) in general and yang and hu (2020, sec h.3, h.4) in particular). below we sketch the program construction. LINEBREAK initial vectors and matrices unlike the program for the µ-limit, our program does not have initial matrix variables because in π-parametrization we do not initialize any n × n matrices as iid gaussians. this means that we do not use matmul instructions in our program. the initial vector variables in our program are just the r columns ω:1, . . . , ω:r of ω. LINEBREAK table 8: feature kernel regression (fkr) on cifar10. we take the best performing µ-net, π-net, and π-limit, and evaluate their learned feature kernels on cifar10 via kernel regression. we list their test accuracies in the middle block. for reference, we also include the nngp and ntk numbers in the left block, as well as the imagenet transfer results in the right block. LINEBREAK nngp ntk µ-net LINEBREAK π-net LINEBREAK π-limit LINEBREAK π-limit imagenet transfer LINEBREAK fkr vs table 1 LINEBREAK figure 6: feature kernel regression of π-nets vs training time, for varying widths. we took our best performing π-limit and trained finite-width versions of it, for width from 500 to 40000. throughout training, we measure their feature kernel regression accuracy. altogether, we see consistent increase in performance across width at any moment in time. note that the visible gap between π-limit and the widest π-net (even at initialization) is to a large extent due to the dependence of kernel regression accuracy on the smallest eigenvalues of the kernel. see fig. 12. LINEBREAK network preactivations all preactivations of the network will be of the form ωc for some c ∈ rr whose entries are scalar variables in the program, so that ωc can be expressed as a vector variable using nonlin+. LINEBREAK weight matrices we will sketch the constructions surrounding hidden weight matrices; the input and output weight matrices are similar and easier. like in eq. (4), each hidden weight matrix in deep π-nets can be written mathematically as a sum of vector outer products. LINEBREAK wl = LINEBREAK m +t (cid:88) LINEBREAK (ωal LINEBREAK s) ⊗ φ(ωbl LINEBREAK s), LINEBREAK at time t LINEBREAK s, bl LINEBREAK s=1 s ∈ rr are the sth rows of al and bl. here φ(ωbl LINEBREAK s) is the activation going into wl at where al time s, and ωal s is the projected gradient πω∇hl l at time s. note the sum here is from 1 to m + t, where m comes from the initialization and t is from t steps of training. all entries of al and bl will be constructed as scalar variables in the program, so ωal in the program, we do not express wl directly, but rather through its matrix-vector product with vectors such as the incoming activation xl−1, which would be expressed via a combination of moment and nonlin+ instructions like so: LINEBREAK s) are both vector variables. LINEBREAK s and φ(ωbl LINEBREAK wlxl−1 = LINEBREAK m +t (cid:88) LINEBREAK θs(ωal LINEBREAK s) ∈ rn LINEBREAK nonlin+ LINEBREAK where LINEBREAK θs = LINEBREAK moment LINEBREAK we express (wl)(cid:62) indirectly through its matrix-vector products likewise, just with the roles of (ωal LINEBREAK s), φ(ωbl LINEBREAK s) reversed. LINEBREAK gradient projection in the program, we do not express πω directly, but rather indirectly by expressing the matrix-vector product πωv for vector variables v, such as v = ∇hl l. the projection LINEBREAK figure 7: performance vs depth on cifar10 and omniglot. we take best performing µ-net, π-net, and π-limit from our thorough sweep of 2-hidden-layer networks, and resweep the learning rate and weight decay (for cifar10) or outer and inner learning rates (for omniglot) for {1, 2, 3, 4} hidden layers. we plot the best test accuracies of each depth here. see appendix b for more details. LINEBREAK figure 8: best training accuracy vs width vs r on cifar10 and omniglot, taken over all of our random hyperparameter searches. while networks with moderately large r and width can overfit cifar10 completely, no µ-net, π-limit, or π-net with width up to 8192 and r up to 3200 is able to do so on omniglot. see appendix b.3.1 for experimental details. LINEBREAK matrix πω is mathematically equal to ω(ω(cid:62)ω)+ω(cid:62) (for any width), where ()+ denotes pseudon ω(cid:62)ω ∈ rr×r using many moment inverse. in the program, we would first express (the entries of) 1 instructions LINEBREAK ω(cid:62)ω)ij = LINEBREAK moment LINEBREAK then its pseudo-inverse can be expressed as another moment instruction (with purely scalar arguments). LINEBREAK ij = LINEBREAK fij(; {( LINEBREAK ω(cid:62)ω)ij}ij) ∈ r LINEBREAK = fij(; {( LINEBREAK ω(cid:62)ω)ij}ij) ∈ r LINEBREAK moment LINEBREAK moment LINEBREAK where fij takes a matrix to the ijth entry of its pseudoinverse. note the above expressions depend on ω n ω(cid:62)v ∈ rr only, and not on v. finally, we express πωv = ωγ ∈ rn, γ = ( 1 in the program like so LINEBREAK πωv = ωγ = LINEBREAK γiω:i ∈ rn LINEBREAK where γi = LINEBREAK ijθj ∈ r LINEBREAK where LINEBREAK θj = LINEBREAK nonlin+ LINEBREAK moment LINEBREAK moment LINEBREAK wrapping up other than what is discussed above, the unrolling of π-sgd follows identical to the unrolling of sgd in yang and hu (2020, sec h.3, h.4). in particular, ft(ξ) for any input ξ and time t is a scalar variable in the program. LINEBREAK figure 9: pca of representations of images from 5 classes in omniglot test set. same setting as in fig. 1, but here including our best performing π-net as well. LINEBREAK table 9: cifar10 compute time (in seconds) comparison. we measure the average training time (in seconds) per epoch for 50 epochs of cifar10 using half precision on a nvidia v100 gpu. we evaluate a µ-net, π-net, and the π-limit, each of depth 1, 2, 3, and 4; the π-nets and the π-limits have r = 400. because the π-limit has a linearly increasing compute time per epoch, we also give an estimate expression for the compute time of the π-limit in terms of t epochs. π-limit epoch estimate LINEBREAK hidden layers µ-net LINEBREAK π-limit average LINEBREAK π-net LINEBREAK getting almost sure convergence we apply the master theorem (yang and hu (2020, thm 7.4) or yang (2020b, thm e.15)) to the program to get almost sure convergence to some limit. we just need to check the conditions of the theorem. they are all straightforward except that we need to check the pseudoinverse operation we took is almost surely continuous (in order to satisfy yang and hu (2020, assm f.4(1))).19 however, the only pseudoinverse we took was ( 1 n ω(cid:62)ω)+, and ω has rank r (full rank) almost surely for any n > r. therefore, our pseudoinverse operation is almost surely continuous as pseudoinverse is continuous on matrices of constant rank. LINEBREAK f.2 form of the limit LINEBREAK forward pass (theorem 3.4) eq. (17) becomes LINEBREAK in the large-n limit, by the master theorem, for hidden weights, LINEBREAK z wlxl−1 LINEBREAK m +t (cid:88) LINEBREAK θs LINEBREAK al LINEBREAK siz ω:i = LINEBREAK θs = e LINEBREAK where LINEBREAK z ω:i LINEBREAK m +t (cid:88) LINEBREAK θsal si LINEBREAK bl LINEBREAK siz ω:i LINEBREAK inductively, if gl ∈ rr represents the coefficients of z hl (z ω:1, . . . , z ω:r ) (which is distributed as a standard isotropic gaussian vector), then LINEBREAK = z wlxl−1 LINEBREAK in terms of z ω def= LINEBREAK gl i = LINEBREAK m +t (cid:88) LINEBREAK al si LINEBREAK which can be rearranged straightforwardly into the equation of theorem 3.4. the equations for input and output layers can be derived similarly. LINEBREAK backward pass (theorem 3.5) for hidden weight wl, since we maintain wl in the form of eq. (16), the gradient update LINEBREAK wl ← wl − ηπω∇wl l = wl + (−ηπω∇hl l) ⊗ φ(hl−1) LINEBREAK 19yang and hu (2020, assm f.4(1)) actually requires moment nonlinearities with only parameter arguments to be continuous eveywhere, but because our result is almost sure anyway, we can ignore any measure zero event. LINEBREAK table 10: omniglot compute time (in seconds) comparison. we measure average training time (in seconds) per epoch for 50 epochs of omniglot using half precision on a nvidia v100 gpu. we evaluate a µ-net, π-net, and the π-limit, each of depth 1, 2, 3, and 4; the π-nets and the π-limits have r = 400. because the π-limit has a linearly increasing compute time per epoch due to gradient concatenation, we also give an estimate expression for the compute time of the π-limit in terms of t epochs. this is not necessary for the 1-hidden-layer case, as there anil only trains the first layer, which does gradient accumulation. LINEBREAK hidden layers µ-net LINEBREAK π-net LINEBREAK π-limit average LINEBREAK π-limit epoch estimate LINEBREAK figure 10: wide 1-hidden-layer π-nets with r = 2 have nearly identical loss curves as their π-limit. (left) we train π-nets of r = 2 and width 23, 29, 215 as well as their common π-limit on a 128-image subset of cifar10 over 200 steps, with batch size 32 per step. we plot the training loss vs steps on the left. while the width-8 π-net fluctuates a bit around the π-limit curve, width-512 and -32768 π-nets have nearly identical loss curves as the π-limit. (right) with the same dataset and training procedure, we sweep widths 2{3,4,...,15} and 100 random seeds (which affect only the random initialization). for each width and seed, we calculate the median loss deviation of the π-net of that width from the π-limit, where the median is calculated over the 200 steps of training. finally, for each width, we plot the median of those medians over the 100 seeds as the blue curve (with 95% confidence interval in shade). this curve shows that the loss curve of a π-net converges roughly as 1/ LINEBREAK width to that of the π-limit. LINEBREAK in the limit corresponds to LINEBREAK al ← append(al, coef(z −nηπω∇hl l)), bl ← append(bl, coef(z hl−1 where coef(z v) is the coefficient of z v in terms of z ω = (z ω:1, . . . , z ω:r ). (note the factor of n in z −nηπω∇hl l) is just there so that nηπω∇hl l has θ(1)-sized coordinates). of course, coef(z hl−1 ) is just gl−1 ∈ rr by definition. it remains to show that coef(z −nηπω∇hl l) = ∇gl lim l, where lim l = limn→∞ l(f (ξ), y) is the loss at the limit (which is deterministic). using the master theorem, it is not hard to see that, for each preactivation hl, z n∇hl l is the frechet derivative ∂ lim l , where the frechet derivative is defined with respect to the hilbert space h of square integrable random variables in the σ-algebra generated by z ω def= (z ω:1, . . . , z ω:r ). furthermore, using the limits of eqs. (18) to (20) obtained from the master theorem, it is easy to see that LINEBREAK ∂zhl with respect to the random variable z hl LINEBREAK z nπω∇hl l = πzω z n∇hl l where πzω is the orthogonal projection to the linear subspace of h spanned by the random variables z ω:1, . . . , z ω:r . then lemma f.1 applies and we get that LINEBREAK z nπω∇hl l = LINEBREAK ∂ lim l ∂gl i coef(z nπω∇hl l) = ∇gl lim l, LINEBREAK z ω:i LINEBREAK figure 11: wide 2-hidden-layer π-nets with r = 2 have nearly identical loss curves as their π-limit. we repeat the procedure in fig. 10 for 2-hidden-layer π-nets. (left) width-32768 π-net has almost identical loss curve as the π-limit. compared to the 1-hidden-layer case, the width 512 π-net is not as close to the limit, but this is expected as depth slows down convergence with width. (right) nevertheless, we still see 1/ LINEBREAK width convergence to the π-limit in terms of training loss. LINEBREAK figure 12: convergence of feature kernel at initialization, as measured by (left) frobenius distance and (right) kernel regression accuracy. we perform all experiments here on a subset of cifar10 with 400 training and 400 testing examples. (left) we empirically verify that, at initialization, the feature kernels of π-nets (with 2 hidden layers, r = 400) converge to the feature √ kernel of the π-limit in frobenius norm at a 1/ width rate. here in blue we plot the frobenius distance of the π-net feature kernel to the limit kernel, normalized by the frobenius norm of the limit kernel. the shade represents 95% interval of the mean, taken over 10 random seeds. (right) we compute the feature kernel regression accuracy of randomly initialized π-nets of different widths (blue solid curve) and their common π-limit (orange dashed curve). the shade represents 95% confidence interval of the mean, taken over 10 random seeds. we see a convergence of this accuracy as one would expect from the theory. however, note that because the stability of kernel regression depends crucially on small eigenvalues of the kernel, the width needs to quite large compared to the data size (= kernel size) in order to visibly see convergence of accuracy; for data size beyond 400 training samples, we cannot see such convergence for width < 40, 000. this is why in fig. 6, even at initialization we see a large gap in accuracy between π-nets and the π-limit. LINEBREAK where the derivative is now an ordinary partial derivative. lemma f.1. let h be a hilbert space and v be a k-dimensional subspace of v , where k is finite. let l : h → r be a frechet differentiable function. suppose γ have for columns an orthonormal set of basis for v , and w = γb ∈ v for some b ∈ rk. then LINEBREAK πv ∇wl(w) = ∇bl(γb), LINEBREAK where πv : h → v is the orthogonal projection to v . LINEBREAK proof. by the theory of proximal gradients, LINEBREAK πv ∇wl(w) = w − min v∈v LINEBREAK figure 13: wide 2-hidden-layer π-nets with r = 400 have nearly identical loss curves as their π-limit. we repeat the procedure in fig. 10 for 2-hidden-layer π-nets, but now with r = 400 and widths 128, 2048, and 32768. (left) training loss. (right) training accuracy. in both subplots, width-32768 π-net has almost identical curves as the π-limit, and the width-2048 curves follow them closely. LINEBREAK changing coordinates via γ, we have
| 23
|
[
108,
521.1690784,
256.0940394,
531.3508556
] |
PpshD0AXfA.pdf
| 2,021
| 1
|
LINEBREAK generative time-series modeling with fourier flows LINEBREAK ahmed m. alaa university of california, los angeles, usa [email protected] LINEBREAK alex j. chan university of cambridge, uk [email protected] LINEBREAK mihaela van der schaar university of cambridge, uk university of california, los angeles, usa cambridge center for ai in medicine, uk the alan turing institute, uk [email protected] LINEBREAK abstract LINEBREAK generating synthetic time-series data is crucial in various application domains, such as medical prognosis, wherein research is hamstrung by the lack of access to data due to concerns over privacy. most of the recently proposed methods for generating synthetic time-series rely on implicit likelihood modeling using generative adversarial networks (gans)—but such models can be difficult to train, and may jeopardize privacy by “memorizing” temporal patterns in training data. in this paper, we propose an explicit likelihood model based on a novel class of normalizing flows that view time-series data in the frequency-domain rather than the time-domain. the proposed flow, dubbed a fourier flow, uses a discrete fourier transform (dft) to convert variable-length time-series with arbitrary sampling periods into fixedlength spectral representations, then applies a (data-dependent) spectral filter to the frequency-transformed time-series. we show that, by virtue of the dft analytic properties, the jacobian determinants and inverse mapping for the fourier flow can be computed efficiently in linearithmic time, without imposing explicit structural constraints as in existing flows such as nice (dinh et al. (2014)), realnvp (dinh et al. (2016)) and glow (kingma & dhariwal (2018)). experiments show that fourier flows perform competitively compared to state-of-the-art baselines. LINEBREAK introduction LINEBREAK lack of access to data is a key hindrance to the development of machine learning solutions in application domains where data sharing may lead to privacy breaches (walonoski et al. (2018)). areas where this problem is most conspicuous include medicine, where access to (highly-sensitive) clinical data is stringently regulated by medical institutions; such strict regulations undermine scientific progress by hindering model development and reproducibility. generative models that produce sensible and realistic synthetic data present a viable solution to this problem—artificially-generated data sets produced by such models can be shared widely without privacy concerns (buczak et al. (2010)). LINEBREAK in this paper, we focus on the time-series data setup, where observations are collected sequentially over arbitrary periods of time with different observation frequencies across different features. this general data setup is pervasive in the medical domain—it captures the kind of data maintained in electronic health records (shickel et al. (2017)) or collected in intensive care units (johnson et al. (2016)). while many machine learning-based predictive models that capitalize on such data have been proposed over the past few years (jagannatha & yu (2016); choi et al. (2017); alaa & van der schaar (2019)), much less work has been done on generative models that could emulate and synthesize these data sets. LINEBREAK existing generative models for (medical) time-series are based predominantly on implicit likelihood modeling using generative adversarial networks (gans), e.g., recurrent conditional gan (rcgan) (esteban et al. (2017)) and timegan (yoon et al. (2019)). these models apply representation learning LINEBREAK via recurrent neural networks (rnn) combined with adversarial training in order to map noise sequences in a latent space to synthetic sequential data in the output space. albeit capable of flexibly learning complex representations, gan-based models can be difficult to train (srivastava et al. (2017)), especially in the complex time-series data setup. moreover, because they hinge on implicit likelihood modeling, gan-based models can be hard to evaluate quantitatively due to the absence of an explicitly computable likelihood function. finally, gans are vulnerable to training data memorization (nagarajan et al. (2018))—a problem that would be exacerbated in the temporal setting where memorizing only a partial segment of a medical time-series may suffice to reveal a patient’s identify, which defeats the original purpose of using synthetic data in the first place. LINEBREAK here, we propose an alternative explicit likelihood approach for generating time-series data based on a novel class of normalizing flows which we call fourier flows. our proposed flow-based model operates on time-series data in the frequency-domain rather than the time-domain—it converts variable-length time-series with varying sampling rates across different features to a fixed-size spectral representation using the discrete fourier transform (dft), and then learns the distribution of the data in the frequency domain by applying a chain of data-dependent spectral filters to frequency-transformed time-series. LINEBREAK using the convolution property of dft (oppenheim (1999)), we show that spectral filtering of a timeseries in the frequency-domain—an operation that mathematically resembles affine transformations used in existing flows (dinh et al. (2016))—is equivalent to a convolutional transformation in the timedomain. this enhancement in the richness of distributions learned by our flow comes at no extra computational cost: using fast fourier transform (fft) algorithms, we show that the entire steps of our flow run in o(t log t ) time, compared to the polynomial complexity of o(t 2) for a direct, time-domain convolutional transformation. we also show that, because the dft is a linear transform with a vandermonde transformation matrix, computation of its jacobian determinant is trivial. the zero-padding and interpolation properties of dft enables a natural handling of variable-length and inconsistently-sampled time-series. unlike existing explicit-likelihood models for time-series data, such as deep state-space models (krishnan et al., 2017; alaa & van der schaar, 2019), our model can be optimized and assessed through the exact likelihood rather than a variational lower bound. LINEBREAK problem setup LINEBREAK we consider a general temporal data setup where each instance of a (discrete) time-series comprises a sequence of vectors x = [x0, . . . , xt −1], xt ∈ x , ∀ 0 ≤ t ≤ t − 1, covering a period of t time steps. we assume that each dimension in the feature vector xt is sampled with a different rate, i.e., at each time step t, the observed feature vector is xt = [ xt,1[r1], . . . , xt,d[rd] ], where rd ∈ n+ is the sampling period of feature dimension d ∈ {1, . . . , d}. that is, for a given sampling period rd, we observe a value of xt,d every rd time steps, and observe a missing value (denoted as *) otherwise, i.e., LINEBREAK xt,d[rd] (cid:44) LINEBREAK (cid:26) xt,d, ∗, LINEBREAK t mod rd = 0, t mod rd (cid:54)= 0. LINEBREAK the data setup described above is primarily motivated by medical time-series modeling problems, wherein a patient’s clinical measurements and bio-markers are collected over time at different rates (johnson et al. (2016); jagannatha & yu (2016)). despite our focus on medical data, our proposed generative modeling approach applies more generally to other applications, such as speech synthesis (prenger et al. (2019)) and financial data generation (wiese et al. (2020)). LINEBREAK each realization of the time-series x is drawn from a probability distribution x ∼ p(x). in order to capture variable-length time-series (common in medical problems), the length t of each sequence is also assumed to be a random variable—for notational convenience, we absorb the distribution of t into p. one possible way to represent the joint distribution p(x) is through the factorization:1 LINEBREAK p(x) = p(x0, . . . , xt −1, t ) = p(t ) · LINEBREAK p(xt | x0, . . . , xt−1, t ). LINEBREAK we assume that the sampling period rd for each feature d is fixed for all realizations of x. the feature space x is assumed to accommodate a mix of continuous and discrete variables on its d dimensions. LINEBREAK 1our proposed method is not restricted to any specific factorization of p(x). LINEBREAK key objective. using a training data set d = {x(i)}n i=1 comprising n time-series, our goal is to (1) estimate a density function ˆp(x) that best approximates p(x), and (2) sample synthetic realizations of the time-series x from the estimated density ˆp(x). when dealing with data sets with variable lengths for the time-series, we model the distribution p(t ) independently following the factorization in (2). we model p(t ) using a binomial distribution. throughout the paper, we focus on developing a flow-based model for the conditional distribution p(x0, . . . , xt −1 | t ). LINEBREAK preliminaries LINEBREAK let z ∈ rd be a random variable with a known and tractable probability density function p(z), and let g : rd → rd be an invertible and differentiable mapping with an inverse mapping f = g−1. let x = g(z) be a transformed random variable—the probability density function p(x) can be obtained using the change of variable rule as p(x) = p(z) · | det j [g]|−1 = p(f (x)) · | det j [f ]|, where j [f ] and j [g] are the jacobian matrices of functions f and g, respectively (durrett (2019)). LINEBREAK normalizing flows are compositions of m mappings that transform random draws from a predefined distribution z ∼ p(z) to a desired distribution p(x). formally, a flow comprises a chain of bijective maps g = g(1) ◦ g(2) ◦ · · · ◦ g(m ) with an inverse mapping f = f (1) ◦ f (2) ◦ · · · ◦ f (m ). using the change of variables formula described above, and applying the chain rule to the jacobian of the composition, the log-likelihood of x can be written as (rezende & mohamed (2015)): LINEBREAK log p(x) = log p(z) + LINEBREAK log | det j [fm]|. LINEBREAK existing approaches to generative modeling with normalizing flows construct composite mappings g with structural assumptions that render the computation of the jacobian determinant in (3) viable. examples of such structurally-constrained mappings include: sylvester transformations, with a jacobian corresponding to a perturbed diagonal matrix (rezende & mohamed (2015)), 1 × 1 convolutions for cross channel mixing, which exhibit a block diagonal jacobian (kingma & dhariwal (2018)), and affine coupling layers that correspond to triangular jacobian matrices (dinh et al. (2016)). LINEBREAK fourier transform LINEBREAK the fourier transform is a mathematical operation that converts a finite-length, regularly-sampled time domain signal x to its frequency domain representation x (bracewell & bracewell (1986)). a t -point discrete fourier transform (dft), denoted as x = ft {x}, transforms a (complex-valued) time-stamped sequence x (cid:44) {x0, . . . , xt −1} into a length-t sequence of (complex-valued) frequency components, x (cid:44) {x0, . . . , xt −1}, through the following operation (oppenheim (1999)): LINEBREAK xk = LINEBREAK xt · e−2πj· kt LINEBREAK where j corresponds to the imaginary unit of a split-complex number. using euler’s formula, the com(cid:1). thus, plex exponential terms in (4) can be expressed as e−2πj· kt the fourier transform decomposes any time-series into a linear combination of sinusoidal signals of varying frequencies—the resulting sequence of frequency components, x, corresponds to the coefficients assigned to the different frequencies of the sinusoidal signals constituting the time domain signal x. the dft is a key computational and conceptual tool in many practical applications involving digital signal processing and communications (oppenheim (1999)). LINEBREAK (cid:1) − j · sin (cid:0)2π · kt LINEBREAK t = cos (cid:0)2π · kt LINEBREAK t LINEBREAK t LINEBREAK fourier transform properties LINEBREAK we will rely in developing our model on various key properties of the dft. these properties describe various operations on the time-domain data and their dual (equivalent) operations in the frequency domain. the dft properties relevant to the development of our model are listed as follows: LINEBREAK convolution: x1 ⊗ x2 ⇐⇒ x1 (cid:12) x2. LINEBREAK symmetry: if x is real-valued ⇒ xk = x ∗ LINEBREAK k−m, ∀m ∈ n. LINEBREAK even/odd transforms: f{even(x)} = re(x), f{odd(x)} = im(x), LINEBREAK where (cid:12) denotes element-wise multiplication, ⊗ denotes circular convolution, re(.) and im(.) denote the real and imaginary components, even(x) = (x + x−)/2, odd(x) = (x − x−)/2, where x− signifies the reflection of x with respect to the x = 0 axis, and x = even(x) + odd(x). another property that is relevant to our model is the interpolation property, which posits that zero-padding of x in the time domain corresponds to an up-sampled version of x in the frequency domain. LINEBREAK table 1: the two main layers in an n -point fourier flow, their inverses, and the corresponding log-determinantjacobian. the input to the flow, x, is a d × t matrix comprising a set of d time-series each of length t , and the output, y , is a 2 × d × n/2 tensor comprising the filtered spectral representation of x. here, we show the application of the fourier transform layer to a given feature dimension d—the same operation is applied independently to all feature dimensions. the vector (cid:99)x −d is the reversed conjugate of (cid:99)x d, and h = [hi,j]i,j. when cascading multiple fourier flows, we alternate between feeding either of the real and imaginary channels of (cid:99)x, im( (cid:99)x) and re( (cid:99)x), to the birnn network in the different flows within the cascade. LINEBREAK layer LINEBREAK function LINEBREAK inverse function LINEBREAK log |detj | LINEBREAK fourier transform LINEBREAK spectral filtering LINEBREAK ¯xd = xd ∪ 0n −t , ¯xt,d ← 0, ∀ t mod rd (cid:54)= 0, ¯x d = fn { ¯xd}, (cid:99)x d = [ ¯x0,d, . . . , ¯x0,(cid:100)n/2(cid:101) ]. LINEBREAK ¯x d = [ (cid:99)x d, (cid:99)x −d ], n { ¯x d}, ¯xd = f −1 ¯xt,d ← ∗, ∀ t mod rd (cid:54)= 0, 0, . . . , ¯xd LINEBREAK xd = [ ¯xd LINEBREAK log | det w | = 0. LINEBREAK (log h, µ) = birnn(im( (cid:99)x)), y1, y2 = split(y ), y1 = h (cid:12) re( (cid:99)x) + m , y2 = im( (cid:99)x), y = concat(y1, y2). LINEBREAK (log h, µ) = birnn(y2), (cid:80) re( (cid:99)x) = (y1 − m )/h, (cid:99)x = re( (cid:99)x) + j im( (cid:99)x). LINEBREAK i,j log(|hi,j|). LINEBREAK fourier flows LINEBREAK we propose a new flow for time-series data, the fourier flow, which hinges on the frequency domain view of time-series data (explained in section 3.1), and capitalizes on the fourier transform properties discussed in section 3.2. in a nutshell, a fourier flow comprises two steps: (a) a frequency transform layer (section 4.1), followed by (b) a data-dependent spectral filtering layer (section 4.2). the steps involved in a fourier flow are summarized in table 1 and figure 1. LINEBREAK fourier transform layer LINEBREAK in the first step of the proposed flow, we transform the time-series x = [ x0, . . . , xt −1 ] into its spectral representation via fourier transform—we do so by applying the dft operation (described in section 3.1) to each feature dimension d independently. let xd = [ x0,d[rd], . . . , xt −1,d[rd] ] be the time-series associated with feature dimension d; the fourier transform layer computes the n -point dft of xd for all d ∈ {1, . . . , d} through the following three steps: LINEBREAK temporal zero padding: LINEBREAK ¯xd = xd ∪ 0n −t , ¯xt,d[rd] = 0, ∀ t, t mod rd (cid:54)= 0, ¯x d = fn { ¯xd}, LINEBREAK fourier transform: spectral cropping: (cid:99)x d = [ ¯x0,d, . . . , ¯x0,(cid:100)n/2(cid:101) ]. LINEBREAK here, 0n −t denotes a set of n −t zeros, and the union ∪ denotes the padding operation that appends the zeros 0n −t to the time-series xd. the temporal zero-padding step capitalizes on the frequency interpolation and sampling properties of dft (section 3.2) to ensure that the padded time-series ¯xd and its frequency spectrum ¯x d have a fixed (predetermined) length of n , irrespective of the interval length t and the sampling period rd. because the dft coefficients are complex-valued, ¯x d is a tensor with dimensions 2 × 1 × n , and the collection of fourier transforms for the d feature dimensions, ¯x, is a tensor with dimensions 2 × d × n . that is, the dft layer converts each time-series x into a two-channel, “image-like” d × n matrices re( ¯x) and im( ¯x) as shown in figure 1. a flow with an n -point dft will be referred to as an n -point fourier flow in the rest of the paper. to guarantee a lossless recovery of the time-series x via inverse dft, we ensure that n ≥ t . LINEBREAK finally, the spectral cropping step in (5) discards the n/2 + 1th to n th frequency components in both re( ¯x) and im( ¯x). this is because x is real-valued, hence re( ¯x) and im( ¯x) are symmetric and anti-symmetric, respectively (see section 3.2), which renders the discarded frequency components redundant. the final output of this layer, (cid:99)x, is a 2 × d × n/2 tensor. dft computation. since the dft operation in (4) is linear, we can represent the frequency transform step in (5) through a linear transformation and apply dft via matrix multiplication as follows: LINEBREAK ¯x d = w ¯xd, w = LINEBREAK , and ω = e−2πj/n . LINEBREAK when n is set to be a power of 2, the dft operation in (6) can be implemented using any variant of the fast fourier transform (fft) methods (nussbaumer (1981); van loan (1992)), such as the cooleytukey fft algorithm (cooley & tukey (1965)), with a computational complexity of o(n log n ). LINEBREAK determinant of the dft jacobian. the dft is a natural and intuitive transformation for temporal data, but how does introducing the dft mapping affect the complexity of the jacobian determinant of the flow? to answer this question, we note that the dft matrix w in (6) is a (square) vandermonde matrix, thus we can evaluate the dft jacobian determinant in closed-form as follows: LINEBREAK | det(j [w ]) | LINEBREAK (a) = | det(w ) | LINEBREAK (b) = LINEBREAK (ωm − ωn) LINEBREAK 1<n<m≤n LINEBREAK where (a) follows from the fact that the jacobian of a linear transformation is equal to the transformation matrix w , and (b) follows from the scalar multiplication property of determinants, which posits that det(αvn ×n ) = αn det(vn ×n ) for a scalar α and matrix v , combined with the formula for the determinants of vandermonde matrices (bj¨orck & pereyra (1970)). (c) follows from the fact that the magnitude of the complex exponential is | ω | = 1, and the polynomial product in (7) comprises a total of n n/2 terms, each of which is of the form | ωnωm | = 1. the result in (7) shows that the dft mapping does not incur extra computational costs when evaluating the flow likelihood in (3). LINEBREAK spectral filtering layer LINEBREAK the second layer of the fourier flow is an affine coupling layer, similar to that originally introduced in (dinh et al. (2014; 2016)), but applied to the time-series x in the frequency domain as follows: LINEBREAK (log h, m ) = birnn(im( (cid:99)x)), y1 = h (cid:12) re( (cid:99)x) + m , y2 = im( (cid:99)x), y = concat(y1, y2), where h and µ are d × n matrices, birnn denotes a bi-directional recurrent neural network (schuster & paliwal (1997)), and (cid:12) denotes the hadamard (element-wise) product. here, we split the real and imaginary channels in (cid:99)x rather than splitting the feature dimensions as in (dinh et al. (2016)). the detailed steps of the flow and its inversion are given in table 1. LINEBREAK the affine transformation in the frequency domain can be thought of as a spectral filtering operation whereby the frequency transform of the even part of the time-series, re((cid:98)x), is applied to a filter with a transfer function h (recall the even-odd decomposition properties of dft in section 3.2). the transfer function itself is data-dependent: it depends on im((cid:98)x), or equivalently, the frequency transform of the odd part of the time-series x. the mapping from im((cid:98)x) to the transfer function h is implemented through an rnn that shares parameters across all different frequency components, since n can grow very large for time-series with a large t . we use a bi-directional rnn since all frequency components are available at our disposal at the same time. LINEBREAK fourier flows in the time-domain LINEBREAK how does the fourier flow mapping look like in the time domain? using the convolution property of the dft (section 3.2), the time-domain view of the fourier flow can be expressed as follows LINEBREAK y1 = h( ¯x) ⊗ even( ¯x) + µ, y2 = odd( ¯x), y = concat(y1, y2), LINEBREAK figure 1: pictorial depiction of the two layers underlying a fourier flow. here, we consider an exemplary instance of a time-series with d = 5 and t = 6, to which we apply a 10-point fourier flow (n = 10). in all displays, the x-axis corresponds to either the time or frequency indexes, the y-axis corresponds to the feature dimension, and the red dots correspond to the value associated with a given time (frequency) index in a given feature dimension. (darker shades of red correspond to higher values.) (a) dft layer. in this example, we assume the sampling periods to be r1 = 2, and rd = 1, ∀d (cid:54)= 1. in the first step of the flow, we set all missing values in the under-sampled feature dimension to 0, and padd n − t = 4 zeros to all features. (padded zeros are depicted as white dotted circles), which results in a padded time-series ¯x in the form of a d × n matrix. next, the dft operation is applied to each row in ¯x, resulting in a 2 × d × n tensor ¯x comprising the real and imaginary components of the frequency transform. (b) spectral filtering layer. the imaginary component of the (cropped) spectrum is passed to a bi-directional rnn, which views the input as an n/2-length sequence of d-dimensional features. the rnn outputs a n/2 × d sequence that corresponds to the spectral filter h, which is then multiplied by re( (cid:99)x). the final output concatenates the filtered spectrum, y1, with y2 = im( (cid:99)x). LINEBREAK where yi = f −1 n {h} is the impulse response of the spectral filter h. that is, the fourier flow in the time domain corresponds to a circular convolution between the even part of ¯x and the inverse dft of the filter h, which depends on the odd part of ¯x. LINEBREAK n {m }, and h = f −1 LINEBREAK the time-domain view of a fourier flow elucidates its multifaceted modeling advantages. first, there is a representational advantage of having a more expressive convolutional transformation in (8) compared to the element-wise affine transformations in the coupling layers of existing methods (dinh et al. (2014; 2016); kingma & dhariwal (2018)). moreover, a fourier flow does not require splitting feature dimensions disjointly, but rather decomposes each feature to its even and odd components. second, this richer representation comes with no extra computational cost: while time-domain convolution would run in o(n 2d2) time (hunt (1971)), our spectral filter applies an o(n ) element-wise affine operation in the frequency domain, and the dft runs in o(dn log n ) time. computation of the jacobian determinant is achieved by simply adding all elements of h (table 1) as it is the case in time-domain affine coupling methods. finally, the dft operation enables handling of variable-length time-series and inconsistent sampling periods across features without any extra modeling efforts. LINEBREAK related work. existing explicit-likelihood models for sequential data are based predominantly on state-space modeling approaches, which assume that hidden state dynamics control the sequence of observed data. examples of such models include hidden markov model (beal et al. (2002)), deep markov models (krishnan et al. (2017)), and attentive state-space models (alaa & van der schaar (2019)). the key advantage of our model compared to these is that ours is optimized and assessed using the exact likelihood rather than a variational lower bound. LINEBREAK existing models based on normalizing flows have been primarily focused on static (non-temporal) data (ziegler & rush (2019))—examples include nice (dinh et al., 2014), realnvp (dinh et al., 2016), and glow (kingma & dhariwal, 2018; prenger et al., 2019). these flows assume highly-structured transformation with easy-to-compute jacobian determinants, e.g., diagonal, block diagonal and triangular jacobian matrices. fourier flows assume a structured transformation in the frequency domain, which corresponds to a richer and more complex representation than existing flows in time domain. in particular, a fourier flow can be thought of as the frequency-domain dual of the affine transformation LINEBREAK figure 2: performance of ff, realnvp and timegan in learning to generate random sinusoidal time-series with random frequencies. (a) here, we estimate the dominant frequency of the sinusoidal signals generated by each baseline and plot the histogram for the estimated frequencies across that of the ground-truth distribution of the true frequency f . we plot a kernel density estimate of the histogram in each plot. note that the ranges of the xand y-axes in each plot change according to the estimated distributions. (b) assessment of the time-series data generated by the different baselines in terms of exact data likelihood, spectral properties and predictive utility. LINEBREAK of realnvp, which translates to a more complex convolutional mapping in the time domain. the closest work to ours is the invertible convolutional flows developed independently in (karami et al. (2019)). this work does not deal with time-series data, but introduces a convolutional transformation on the feature dimension using toeplitz matrices, and implements the transformation using dft. LINEBREAK experiments
| 6
|
[
108.299,
345.9916768,
200.0834953,
357.9468768
] |
p6jsTidUkPx.pdf
| 2,023
| 0
|
LINEBREAK quantile risk control: a flexible framework for bounding the probability of highloss predictions LINEBREAK jake c. snell∗ princeton university [email protected] LINEBREAK thomas p. zollo columbia university [email protected] LINEBREAK zhun deng columbia university [email protected] LINEBREAK toniann pitassi columbia university & university of toronto [email protected] LINEBREAK richard zemel columbia university & university of toronto [email protected] LINEBREAK abstract LINEBREAK rigorous guarantees about the performance of predictive algorithms are necessary in order to ensure their responsible use. previous work has largely focused on bounding the expected loss of a predictor, but this is not sufficient in many risksensitive applications where the distribution of errors is important. in this work, we propose a flexible framework to produce a family of bounds on quantiles of the loss distribution incurred by a predictor. our method takes advantage of the order statistics of the observed loss values rather than relying on the sample mean alone. we show that a quantile is an informative way of quantifying predictive performance, and that our framework applies to a variety of quantile-based metrics, each targeting important subsets of the data distribution. we analyze the theoretical properties of our proposed method and demonstrate its ability to rigorously control loss quantiles on several real-world datasets. LINEBREAK introduction LINEBREAK learning-based predictive algorithms have a great opportunity for impact, particularly in domains such as healthcare, finance and government, where outcomes carry long-lasting individual and societal consequences. predictive algorithms such as deep neural networks have the potential to automate a plethora of manually intensive tasks, saving vast amounts of time and money. moreover, when deployed responsibly, there is great potential for a better decision process, by improving the consistency, transparency, and guarantees of the system. as just one example, a recent survey found that a majority of radiologists anticipated that ai-based solutions will lead to fewer medical errors, less time spent on each exam, and more time spent with patients (waymel et al., 2019). in order to realize such benefits, it is crucial that predictive algorithms are rigorously yet flexibly validated prior to deployment. the validation should be rigorous in the sense that it produces bounds that can be trusted with high confidence. it should also be flexible in several ways. first, we aim to provide bounds on a variety of loss-related quantities (risk measures): the bound could apply to the mean loss, or the 90th percentile loss, or the average loss of the 20% worst cases. furthermore, the guarantees should adapt to the difficulty of the instance: easy instances should have strong guarantees, and as the instances become harder, the guarantees weaken to reflect the underlying uncertainty. we also want to go beyond simply bounding the performance of a fixed predictor and instead choose the optimal predictor from a set of candidate hypotheses that minimizes some target risk measure. LINEBREAK validating the trustworthiness and rigor of a given predictive algorithm is a very challenging task. one major obstacle is that the guarantees output by the validation procedure should hold with respect to any unknown data distribution and across a broad class of predictors including deep neural LINEBREAK ∗work done while at university of toronto and vector institute. LINEBREAK (a) bounding multiple qbrms with ˆf −1 LINEBREAK n (p). LINEBREAK (b) selecting the optimal h∗ with a target risk measure. LINEBREAK n (p) on the true quantile function f −1(p) ≜ inf{x : f (x) ≥ p}. LINEBREAK figure 1: an overview of our quantile risk control framework. given n validation samples x1, . . . , xn drawn i.i.d. from the loss distribution with cdf f we produce a upper confidence bound ˆf −1 (a). the same bound on the quantile function can be used to bound multiple quantile-based risk measures. (b). an upper bound ˆf −1,h is computed for the quantile function of the loss distribution of each predictor h ∈ h and the one minimizing an upper confidence bound on the target risk measure ψ (h) = (cid:82) 1 ˆr+ LINEBREAK (p) dp is selected. here the target measure is the β-var. LINEBREAK n LINEBREAK n LINEBREAK networks and complicated black-box algorithms. recent work has built upon distribution-free uncertainty quantification to provide rigorous bounds for a single risk measure: the expected loss (bates et al., 2021; angelopoulos et al., 2021). however, to our knowledge there has been no work that unifies distribution-free control of a set of expressive risk measures into the same framework. LINEBREAK our key conceptual advancement is to work with lower confidence bounds on the cumulative distribution function (cdf) of a predictor’s loss distribution as a fundamental underlying representation. we demonstrate that a lower bound on the cdf can be converted to an upper bound on the quantile function. this allows our framework to seamlessly provide bounds for any risk measure that can be expressed as weighted integrals of the quantile function, known as quantile-based risk measures (qbrm) (dowd & blake, 2006). qbrms are a broad class of risk measures that include expected loss, value-at-risk (var), conditional value-at-risk (cvar) (rockafellar & uryasev, 2000), and spectral risk measures (acerbi, 2002). our approach inverts a one-sided goodness-of-fit statistic to construct a nonparametric lower confidence bound on the loss cdf for each candidate predictor. furthermore, our confidence lower bounds hold simultaneously across an entire set of candidate predictors, and thus can be used as the basis for optimization of a target risk measure. for example, our approach can be used to choose a threshold or set of thresholds on the scores produced by a complicated black-box prediction algorithm. figure 1 illustrates an overview of our framework. LINEBREAK we conduct experiments on real-world datasets where the goal is to tune the threshold of a deep neural network with respect to four representative risk measures. (1). the expected loss is the mean loss over the test distribution. (2). the β-var measures the maximum loss incurred on a specific quantile, after excluding a 1 − β proportion of high-loss outliers. (3). the β-cvar measures the mean loss for the worst 1 − β proportion of the population. (4), finally, the var-interval can be interpreted as optimizing an uncertain loss quantile that belongs to a known range, i.e., for a range of β values. we compare various methods for controlling these risk measures, including a novel one that is tailored to the cvar and var-interval settings, and show that our approach bounds the loss cdf well across all scenarios. we also demonstrate how our framework can be used to achieve fairness by equalizing a target risk measure across groups within the population. LINEBREAK our work unifies the rigorous control of quantile-based risk measures into a simple yet expressive framework grounded in lower confidence bounds on the loss cdf. unlike previous approaches which only target a single risk measure, our approach provides a flexible and detailed understanding of how a predictive algorithm will perform after deployment. we provide a family of bounds that hold for any quantile-based risk measure, even those not optimized for prior to deployment. practitioners using our method can thus easily and confidently respond to inquiries from regulators and other key stakeholders, thereby building trust between organizations deploying predictive algorithms and the individuals whose lives are affected by them. this rigorous and flexible validation is an important step towards the responsible use of predictive algorithms in order to benefit society. LINEBREAK background & related work LINEBREAK distribution-free uncertainty quantification. this line of work originated with conformal prediction (vovk et al., 2005; shafer & vovk, 2008), which seeks to produce coverage guarantees: prediction sets or prediction intervals that are guaranteed to contain the target output with high probability. conformal prediction offers a lightweight algorithm that can be applied on top of complex predictors to obtain provable coverage guarantees. recent work has generalized conformal prediction to bounding the expected loss with respect to more complex loss functions (bates et al., 2021; angelopoulos et al., 2021). like these works, we also are interested in provable distribution-free guarantees for general loss functions. while previous work focuses on bounding the expected loss, part of our contribution lies in bounding the loss for quantiles of the data distribution. angelopoulos & bates (2022) offer an accessible overview of distribution-free uncertainty quantification. LINEBREAK empirical processes. several methods consider the relationship between the empirical and true cdf. the dkw inequality (dvoretzky et al., 1956) generates cdf-based confidence bounds. later variants (massart, 1990; naaman, 2021) provide tighter bounds or generalize to wider settings. the confidence bound provided by the dkw inequality is closely related to the kolmogorov–smirnov (ks) test (massey, 1951) – a classic test of goodness of fit. the ks test has low power for detecting deviations in the tails and so other variance-weighted tests of goodness of fit address this, e.g., anderson & darling (1952); cram´er (1928). in order to handle extreme tails, berk & jones (1979) propose a statistic which looks for the most statistically significant deviation. moscovich et al. (2016) and moscovich (2020) study properties of the berk-jones statistics and provide methods for fast computation. to our knowledge, none of these techniques have been used as in our work, to produce bounds on quantiles of the loss distribution incurred by a predictor. for more background on quantile functions, the reader may refer to (shorack, 2000, chapter 7). for an overview of empirical processes, shorack & wellner (2009) is a comprehensive reference. LINEBREAK risk metrics. a number of approaches have been used to estimate confidence intervals for estimated risk measures. our focus is on a broad class of quantile-based risk measures (qbrms), which includes var, cvar, and spectral risk measures. the value-at-risk at the β level (β-var) has long been used to express the risk associated with an investment and represents the maximum loss that the investment will incur with probability β. conditional value-at-risk (cvar) (rockafellar & uryasev, 2000) represents the mean loss incurred in the tail of the distribution. the work of dowd (2010) inspires us; it presents a general approach for estimating confidence intervals for any type of quantile-based risk measure (qbrm). here we construct confidence bounds on the loss cdf in order to bound such measures for the general problem of predictor selection. LINEBREAK preliminaries LINEBREAK in this section, we introduce our problem formulation and briefly discuss previous approaches that rigorously bound the expected loss. we then review quantile-based risk measures (qbrms), an expressive class of risk measures that includes var, cvar, and spectral risk measures. LINEBREAK problem setup & notation LINEBREAK we assume the presence of a black-box predictor h : z → ˆy that maps from an input space z to a space of predictions ˆy. we also assume a loss function ℓ : ˆy × y → r that quantifies the quality of a prediction ˆy with respect to the target output y . let (z, y ) be drawn from an unknown data distribution d over z × y and define the random variable x ≜ ℓ(h(z), y ) to be the loss induced by h on d. recall that the cumulative distribution function (cdf) of a random variable x is defined as f (x) ≜ p (x ≤ x). our goal is to produce rigorous upper bounds on the risk r(f ) for a rich class of risk measures r ∈ r, given a set of validation loss samples x1:n = {x1, . . . , xn}. for a detailed summary of the notations we used in this paper, please refer to table 4 in appendix a. LINEBREAK distribution-free control of expected loss LINEBREAK previous work has investigated distribution-free rigorous control of the expected loss. recall that f is the cdf of the loss r.v. x. expected loss may be defined as r(f ) ≜ e[x]. these methods LINEBREAK typically involve constructing a confidence region based on the sample mean ¯x ≜ 1 i=1 xi n within which the true expected loss will lie with high probability. for example, suppose that x ∈ [0, 1] and let µ ≜ e[x]. hoeffding’s inequality states that p (µ − ¯x ≥ ε) ≤ exp(−2nε2). this may be inverted to provide an upper confidence bound on the expected loss: p (r(f ) ≤ ˆr+(x1:n)) ≥ 1 − δ, where ˆr+(x1:n) = ¯x + δ . more sophisticated concentration inequalities, such as the hoeffding-bentkus inequality (bates et al., 2021), have also been used to control the expected loss. methods in this class differ primarily in how they achieve simultaneous control of multiple predictors: rcps (bates et al., 2021) does so by assuming monotonicity of the loss with respect to a one-dimensional space of predictors and learn then test (ltt) (angelopoulos et al., 2021) applies a bonferroni correction to δ in order to achieve family-wise error rate control (lehmann & romano, 2008, sec. 9.1). LINEBREAK quantile-based risk measures LINEBREAK unlike previous work that considers only expected loss, we consider a class of risk measures known as quantile-based risk measures (qbrms) (dowd & blake, 2006). recall that the quantile function is defined as f −1(p) ≜ inf{x : f (x) ≥ p}. definition 1 (quantile-based risk measure). let ψ(p) be a weighting function such that ψ(p) ≥ 0 and (cid:82) 1 LINEBREAK 0 ψ(p) dp = 1. the quantile-based risk measure defined by ψ is LINEBREAK rψ(f ) ≜ LINEBREAK ψ(p)f −1(p) dp. LINEBREAK several representative qbrms are shown in table 1. the expected loss targets the overall expectation across the data distribution, whereas the var targets the maximum loss incurred by the majority of the population excluding a (1 − β) proportion of the population as outliers. cvar on the other hand targets the worst-off/highest loss tail of the distribution. finally, the var-interval is valuable when the precise cutoff for outliers is not known. other qbrms, e.g., spectral risk measures (acerbi, 2002), can easily be handled by our framework, but we do not consider them here. LINEBREAK risk measure LINEBREAK expected loss β-var LINEBREAK β-cvar LINEBREAK weighting function ψ(p) LINEBREAK ψ(p) = LINEBREAK otherwise LINEBREAK [βmin, βmax]-var-interval ψ(p) = LINEBREAK βmax−βmin 0, LINEBREAK otherwise LINEBREAK , βmin ≤ p ≤ βmax LINEBREAK table 1: several quantile-based risk measures and their corresponding weight functions (see definition 1). see figure 1 for visualizations. the dirac delta function centered at β is denoted by δβ. LINEBREAK quantile risk control LINEBREAK in this section we introduce our framework quantile risk control (qrc) for achieving rigorous control of quantile-based risk measures (qbrm). qrc inverts a one-sided goodness-of-fit test statistic to produce a lower confidence bound on the loss cdf. this can subsequently be used to form a family of upper confidence bounds that hold for any qbrm. more formally, specify a confidence level δ ∈ (0, 1) and let x(1) ≤ . . . ≤ x(n) denote the order statistics of the validation loss samples. qrc consists of the following high-level steps: LINEBREAK 1. choose a one-sided test statistic of the form s ≜ min1≤i≤n si(f (x(i))), where f is the LINEBREAK (unknown) cdf of x1, . . . , xn. LINEBREAK 2. compute the critical value sδ such that p (s ≥ sδ) ≥ 1 − δ. ˆfn LINEBREAK confidence (x(1), b1), . . . , (x(n), bn), where bi ≜ s−1 LINEBREAK 3. construct LINEBREAK a cdf LINEBREAK bound LINEBREAK lower LINEBREAK (sδ). LINEBREAK i LINEBREAK defined LINEBREAK by LINEBREAK coordinates LINEBREAK 4. for any desired qbrm defined by weighting function ψ, report rψ( ˆfn) as the upper con LINEBREAK fidence bound on rψ(f ). LINEBREAK we show below that in fact p (rψ(f ) ≤ rψ( ˆfn)) ≥ 1 − δ for any qbrm weighting function ψ. if the target weighting function is known a priori, this information can be taken into account when choosing the statistic s. qrc can also be used to bound the risk of multiple predictors simultaneously by setting the critical value to δ′ ≜ δ/m, where m is the number of predictors. LINEBREAK novelty of qrc. there are two primary novel aspects of qrc. the first is the overall framework that uses nonparametric cdf lower confidence bounds as an underlying representation to simultaneously bound any qbrm. previous works in distribution-free uncertainty quantification have targeted the mean and var, but to our knowledge none have focused on either the cvar or var-interval. on the other hand, dowd (2010) shows how to bound qbrms given a cdf estimate but does not provide the tools to bound the cdf from a finite data sample. qrc brings these two ideas together by leveraging modern goodness-of-fit test statistics to produce high-quality nonparametric cdf lower bounds from finite data. the second novel aspect of qrc is our proposed forms of a truncated berk-jones statistic (appendix c), which refocus the statistical power of standard berk-jones to target either the cvar (one-sided truncation) or var-interval (two-sided truncation). LINEBREAK cdf lower bounds are risk upper bounds LINEBREAK we begin by establishing that a lower bound g on the true loss cdf f incurred by a predictor can be used to bound rψ(f ) for any quantile-based risk measure weighting function. however, when we only have access to a finite sample x1:n, it need to consider lower confidence bounds (lcb) on the cdf. for cdfs f and g, let f ⪰ g denote f (x) ≥ g(x) for all x ∈ r. we call ˆfn a (1 − δ)-cdf-lcb if for any f , p (f ⪰ ˆfn) ≥ 1 − δ, where ˆfn is a function of x1:n ∼iid f . theorem 1. let f and g be cdfs such that f ⪰ g. then rψ(f ) ≤ rψ(g) for any weighting function ψ(p) as defined in definition 1. moreover, suppose that ˆfn is a (1 − δ)-cdf-lcb. then p (rψ(f ) ≤ rψ( ˆfn)) ≥ 1 − δ. LINEBREAK inverting goodness-of-fit statistics to construct cdf lower bounds LINEBREAK our technique centers around producing a set of lower confidence bounds on the uniform order statistics, and using these to bound f . let u1, . . . , un ∼iid u(0, 1) and let u(1) ≤ . . . ≤ u(n) denote the corresponding order statistics. consider a one-sided minimum goodness-of-fit (gof) statistic of the following form: LINEBREAK s ≜ min 1≤i≤n LINEBREAK si(u(i)), LINEBREAK where s1, . . . , sn : [0, 1] → r are right continuous monotone nondecreasing functions. this statistic can be used to determine a set of constraints on a cdf as follows. theorem 2. let sδ = inf r{r : p (s ≥ r) ≥ 1 − δ}, where δ ∈ (0, 1) and s is defined above. let x1, . . . , xn ∼iid f , where f is an arbitrary cdf and let x(1) ≤ . . . ≤ x(n) be the corresponding (s) ≜ inf u{u : order statistics. then p (∀i : f (x(i)) ≥ s−1 si(u) ≥ s} is the generalized inverse of si. LINEBREAK (sδ)) ≥ 1 − δ, where ∀s ∈ r, s−1 LINEBREAK i LINEBREAK i LINEBREAK we use the constraints given by theorem 2 to form a (1 − δ)-cdf-lcb via conservative completion of the cdf. an illustration of the process can be found in figure 2. LINEBREAK conservative cdf completion LINEBREAK here we show how to use constraints generated by theorem 2 to form a lower bound on f via the so-called conservative completion of the cdf (learned-miller & thomas, 2020). this defines the “lowest lower bound” of f given constraints. LINEBREAK figure 2: example illustrating the construction of a distribution-free cdf lower bound by bounding order statistics. on the left, order statistics u(1), . . . , u(n) are drawn from a uniform distribution. on the right, order statistics x(1), . . . , x(n) are drawn from an arbitrary distribution (in this case a gamma distribution), and the corresponding berk-jones cdf lower confidence bound is shown as g. our distribution-free method gives bound bi on each sorted order statistic such that the bound depends only on i, as illustrated in the plots for i = 9 (shown in orange). on the left, 1000 realizations of u(1), . . . , u(n) are shown in blue. on the right, 1000 empirical cdfs ¯fn(x) ≜ 1 n LINEBREAK 1{xi ≤ x} are shown in blue, and the true cdf f is shown in red. LINEBREAK theorem 3. let f be an arbitrary cdf satisfying f (xi) ≥ bi for all i ∈ {1, . . . , n}, where x1 ≤ . . . ≤ xn and 0 ≤ b1 ≤ . . . ≤ bn < 1. let us denote x = (x1, x2, · · · , xn) and b = (b1, b2, · · · , bn) and let x+ ∈ r ∪ ∞ be an upper bound on x ∼ f , i.e. f (x+) = 1. let g(x,b)(x) be defined as 0 if x < x1; bi if xi ≤ x < xi+1 for i ∈ {1, 2, · · · , n − 1}; bn if xn ≤ x < x+; and 1 if x+ ≤ x. then, f ⪰ g(x,b). corollary 1. let s be a test statistic defined as equation 2 and recall sδ = inf r{r : p(s ≥ r) ≥ 1 − δ}. let x1, . . . , xn ∼iid f , where f is an arbitrary cdf and let x(1) ≤ . . . ≤ x(n) be the 1:n(sδ)), where corresponding order statistics. then with probability at least 1 − δ, f ⪰ g(x(1:n),s−1 x(1:n) ≜ (x(1), . . . , x(n)) and s−1 LINEBREAK n (sδ)). LINEBREAK thus we now have a way to construct a lower confidence bound on f given the order statistics of a finite sample from f that is defined by a set of functions s1, . . . , sn. in other words, ˆfn ≜ g(x(1:n),s−1 1:n(sδ)) is a (1 − δ)-cdf-lcb and can be used to select a predictor to minimize a risk measure as in section 4.4. we also refer to sδ as the critical value and it can be computed efficiently by bisection using software packages, e.g. moscovich (2020), that compute the one-sided non-crossing probability. LINEBREAK several standard tests of uniformity may be viewed as instances of the minimum-type statistic s defined in equation 2. for example, the one-sided kolmogorov-smirnov (ks) statistic and the berkjones statistic, which achieves greater tail sensitivity. in later sections, we use the term order stats to refer to a modified berk-jones statistic where only a single order statistic is used. this method along with some classical ones (e.g. dkw inequality) can be adapted to handle a var interval combined with bonferroni correction. please see more detailed discussion in appendix b. LINEBREAK bounding multiple predictors simultaneously LINEBREAK we now suppose that we have a finite set of predictors h defined by a set of functions applied to the output of a complex algorithm such as a deep neural network. let ϕ be an arbitrary black box function and let t1, . . . , tm be a set of functions, e.g. different thresholding operations. then the set of predictors is h = {t1 ◦ ϕ, . . . , tm ◦ ϕ}. the loss r.v. for a random predictor h ∈ h is denoted by x h ∼ f h and the corresponding validation loss samples are x h theorem 4. suppose that ˆfn is a (1 − δ/|h|)-cdf-lcb. then p (∀h ∈ h : f h ⪰ ˆf h LINEBREAK theorem 4 implies that we can simultaneously produce a lower confidence bound on each predictor’s loss function with probability at least 1 − δ, given that ˆfn is a (1 − δ/|h|)-cdf-lcb. from the set of predictors h, our framework selects h∗ LINEBREAK ψ with respect to a target weighting function ψ(p) as ≜ arg min h∈h LINEBREAK rψ( ˆf h LINEBREAK n ). LINEBREAK h∗ ψ LINEBREAK ψ ) ≤ rψ′( ˆf LINEBREAK by theorem 1, p (rψ′(f h∗ able to bound any quantile-based risk metric, even if it was not targeted during optimization. remark 1. one of our main contributions concerns novel goodness-of-fit statistics. we introduce two forms of a truncated berk-jones statistic that are useful for targeting specific ranges of quantiles. these are discussed in detail in appendix c. LINEBREAK h∗ n )) ≥ 1 − δ, including ψ′ ̸= ψ. this means that we are ψ LINEBREAK experiments LINEBREAK we perform experiments to investigate our quantile risk control framework as well as our particular novel bounds. first, we test the value of the flexibility offered by qrc by studying the consequences of optimizing for a given target metric when selecting a predictor. this motivates the need for strong bounds on a rich set of qbrms, and thus we next examine the strength of our novel truncated berk-jones method for bounding quantities like the var interval and cvar. finally, we present experimental results across the complete canonical set of metrics (mean, var, interval, and cvar) in order to understand the effects of applying the full quantitative risk control framework. LINEBREAK our comparisons are made using the point-wise methods: learn then test-hoeffding bentkus (ltthb); rcps with a waudby-smith-ramdas bound (rcpswsr); dkw; and order statistics (order stats). we also compare goodness of fit-based methods: kolmogorov-smirnov (ks); berkjones (bj); and truncated berk-jones (one-sided bj, two-sided bj); all as described in previous sections. our experiments span a diverse selection of real-world datasets and tasks. first, we investigate our framework in the context of common image tasks using state of the art computer vision models and the ms-coco (lin et al., 2014) and cifar-100 (krizhevsky, 2009) datasets. ms-coco is a multi-label object detection dataset, where the presence of 80 object classes are detected and more than one class may be present in a single instance. cifar-100 is a single-label image recognition task, which we perform in the challenging zero-shot classification setting using clip (radford et al., 2021). in addition, we conduct a natural language processing experiment using the go emotions (demszky et al., 2020) dataset and a fine-tuned bert model (devlin et al., 2018), where the goal is to recognize emotion in text and a single instance may have multiple labels. finally, we evaluate the interaction between our method and subgroup fairness using the uci nursery dataset (dua & graff, 2017), where applicants are ranked for admissions to school. while all methods are theoretically guaranteed, bounds on the true cdf or risk may be violated with some probability given by δ. we analyze how these violations occur in appendix e.6.4. full details for all datasets, models, and experiments can be found in appendix e. all experiments focus on producing prediction sets, as is typical in the distribution-free uncertainty quantification (dfuq) setting (vovk et al., 2005; shafer & vovk, 2008; bates et al., 2021; angelopoulos et al., 2021), and are run for 1000 random trials with δ = 0.05. code for our experiments is publicly available1. LINEBREAK value of optimizing for target metric LINEBREAK a main feature of the qrc framework is the flexibility to target a range of metrics, including: expected-value (mean); β-var (var); [βmin, βmax]-var-interval (var-interval); and cvar. the results presented here demonstrate the importance of that flexibility by showing that in order to produce the best bound on a given risk measure, it is important to optimize for that metric when selecting a predictor. LINEBREAK using the ms-coco, cifar-100, and go emotions classification tasks, we record the guaranteed mean, var, var interval, and cvar given by the berk-jones bound when targeting each of these risk measures to choose a predictor. the bound is applied on top of a pre-trained model that produces a per-class score, i.e. w = ϕ(z), where w ∈ rk and k is the number of classes. a prediction set is formed by selecting all classes with a score at least some value t: ˆy = {k : wk ≥ t}. therefore a predictor is described by its corresponding threshold, and our algorithms choose the predictor that minimizes the target metric according to the bound produced by a given method. see appendix e.7 for more details on the predictor space. performance is measured using a balanced accuracy metric, which evenly combines sensitivity and specificity measures, where sensitivity encourages larger prediction set sizes and specificity encourages smaller set sizes (see appendix e.2 for an exact description). refer to table 2 for ms-coco results and appendix table 5 for cifar-100 and go LINEBREAK 1https://github.com/jakesnell/quantile-risk-control LINEBREAK figure 3: results for bounding the quantities of the var for various methods. the average test loss over all trials is plotted in red. LINEBREAK emotions results. targeting a given metric in predictor selection gives the tightest bounds on that metric in all experiments. this highlights the significance of our qrc framework, which produces bounds over predictors for a diverse set of targeted risk measures such as the var interval or cvar. LINEBREAK dataset LINEBREAK target LINEBREAK mean LINEBREAK var LINEBREAK interval LINEBREAK cvar LINEBREAK ms-coco mean LINEBREAK var interval cvar LINEBREAK table 2: results on ms-coco illustrating trade-offs between targeting different metrics in predictor selection and the guarantees that can be issued for each metric given by the selected bound. we use the berk-jones bound, and bold results are best for a given metric. LINEBREAK truncated berk-jones vs. existing methods LINEBREAK next, we compare the strength of our truncated berk-jones bounds for the var-interval and cvar to existing methods for bounding these quantities for hypothesis selection. as opposed to the previous experiment, here we fix a single threshold prior to running the experiment, in order to isolate the strength of the bounds from the randomness induced by multiple predictors. results are shown in figure 3, appendix figure 5, and figure 4, with further explanation below. the truncated berkjones method consistently gives the best bounds, especially on the cvar. LINEBREAK image and text classification. our novel truncated berk-jones bounds can be used to control the loss for a diverse range of tasks, datasets, and loss functions. here we examine the strength of these bounds for bounding quantities of the var on multi-label image (ms-coco) and text (go emotions) classification tasks, as well as single-label zero-shot image classification (cifar-100). for ms-coco object detection, var-interval is evaluated in [0.85, 0.95], and cvar is calculated with β = 0.9. for zero-shot classification on cifar-100 and emotion recognition in go emotions, the var-interval is bounded in [0.6, 0.9]. results are shown in figure 3 and appendix figure 5. across all tasks and datasets, the modified berk-jones bound consistently gives a loss guarantee that is lowest, and thus closest to the actual loss for this fixed predictor. LINEBREAK fair classification. williamson & menon (2019) proposed cvar as a notion of fairness that can be viewed as the worst-case mean loss for subgroups of a particular size. thus we consider a fairness problem, and show how our framework can be applied to generate a predictor that optimizes cvar, or worst-case outcomes, individually with respect to each group according to some protected attribute. we employ the uci nursery dataset (dua & graff, 2017), a multi-class classification problem where categorical features about families are used to assign a predicted rank to an applicant y ∈ {1, ..., 5} ranging from “not recommended” (y = 1) to “special priority” (y = 5). we measure a class-dependent weighted accuracy loss. our sensitive attribute is a family’s financial status. applicants are separated based on this sensitive attribute, and we apply the methods to and evaluate each group (“convenient” and “inconvenient”) separately. exact specifications of the loss function, dataset, and other experiments details can be found in appendix e.5. results for the fair classification experiment are reported in figure 4, where group 1 have convenient financial standing and group 2 have inconvenient. applying the truncated berk-jones bound individually to each group leads to the best cvar among all methods for both groups. LINEBREAK figure 4: results for bounding the cvar for each group in nursery with β = 0.9. LINEBREAK ms-coco experiments on all risk measures LINEBREAK for our final experiment we compare the performance of various bounding methods across the full canonical set of metrics (mean, var, interval, and cvar) when selecting a predictor. we perform this experiment using ms-coco and a balanced accuracy risk measure, and apply a bonferroni correction to δ according to the size of the predictor space. LINEBREAK results bounding the cvar and var interval are reported in table 3, while all results are shown in appendix table 6. tables include the target metric used to choose a predictor, bounding method, guarantee returned on the validation set, and loss quantity observed on the test set. as expected, rcpswsr gives the tightest bound on the mean, while the point-wise order statistics method outperforms the gof-based methods on bounding a single var metric. when bounding a var-interval or the cvar, which is a focus of our work, the truncated berk-jones bounds achieves the lowest loss guarantee. in general, the best guarantees have best actual loss, although the difference can be small (or none) as all methods may choose the same or similar predictors around that which minimizes the target risk measure on the validation set. LINEBREAK method LINEBREAK guarantee LINEBREAK actual LINEBREAK method LINEBREAK guarantee LINEBREAK actual LINEBREAK dkw orderstats ks bj one-sided bj LINEBREAK l a v r e t n i LINEBREAK r a v c LINEBREAK dkw orderstats ks bj one-sided bj two-sided bj LINEBREAK table 3: results for experiments with ms-coco object detection bounding cvar and the var interval. best results are in bold. LINEBREAK discussion LINEBREAK our experimental results (see section 5 and appendix e.6) show that: (1) in order to achieve a tight bound on a target risk measure, a predictor should be selected based on that risk measure; and (2) the truncated berk-jones bounds are more effective than previous methods for bounding the varinterval and cvar. while methods that focus on the mean or a particular β-var value can give a tighter bound when that target metric is known beforehand, a key advantage of quantile risk control comes from the flexibility to change the target metric post hoc, within some range, and still maintain a valid bound. though there are some ways to convert between these classes (e.g., mean to quantile with markov’s inequality; cvar is directly an upper bound on var), these are weak as shown by our experiments. this makes qrc well-suited to scenarios in which a stakeholder may want to issue a guarantee or several guarantees from a single predictor, or when an external auditor may change system reporting requirements. a natural extension of this work is to consider returning multiple predictors with our algorithm. in this case, while the target metric may not be known beforehand, we could produce multiple predictors that optimally bound specific points in the range, instead of a single predictor that gives the best bound on average over the range. LINEBREAK ethics statement LINEBREAK some care needs to be taken to ensure that the guarantees under our framework are clear, in that they do not apply to every individual in the test distribution and only hold if test examples are drawn from the same distribution as validation examples. LINEBREAK reproducibility statement LINEBREAK our code is publicly available on github. for all experiments, datasets and splits are specified, and we use publicly available pre-trained models for feature extraction when possible. LINEBREAK acknowledgments LINEBREAK the authors would like to thank marc-etienne brunet, anastasios angelopoulos, and anonymous reviewers for their useful comments. resources used in preparing this research were provided, in part, by the province of ontario, the government of canada through cifar, and companies sponsoring the vector institute (https://vectorinstitute.ai/partners/). this project is also supported by nserc and simons foundation collaborative research grant 733782. LINEBREAK references LINEBREAK carlo acerbi. spectral measures of risk: a coherent representation of subjective risk aversion. LINEBREAK theodore w. anderson and donald a. darling. asymptotic theory of certain “goodness of fit” criteria based on stochastic processes. the annals of mathematical statistics, pp. 193–212, 1952. LINEBREAK anastasios n. angelopoulos and stephen bates. a gentle introduction to conformal prediction and LINEBREAK distribution-free uncertainty quantification. arxiv:2107.07511, january 2022. LINEBREAK anastasios n. angelopoulos, stephen bates, emmanuel j. cand`es, michael i. jordan, and lihua lei. learn then test: calibrating predictive algorithms to achieve risk control. arxiv:2110.01052, november 2021. LINEBREAK stephen bates, anastasios angelopoulos, lihua lei, jitendra malik, and michael jordan. distribution-free, risk-controlling prediction sets. j. acm, 68(6), sep 2021. issn 0004-5411. doi: 10.1145/3478535. url https://doi.org/10.1145/3478535. LINEBREAK robert h. berk and douglas h. jones. goodness-of-fit test statistics that dominate the kolmogorov statistics. zeitschrift f¨ur wahrscheinlichkeitstheorie und verwandte gebiete, 47(1):47–59, 1979. LINEBREAK harald cram´er. on the composition of elementary errors: first paper: mathematical deductions. LINEBREAK scandinavian actuarial journal, 1928(1):13–74, january 1928. LINEBREAK dorottya demszky, dana movshovitz-attias, jeongwoo ko, alan cowen, gaurav nemade, and sujith ravi. goemotions: a dataset of fine-grained emotions. in proceedings of the 58th annual meeting of the association for computational linguistics, pp. 4040–4054. association for computational linguistics, july 2020. LINEBREAK jacob devlin, ming-wei chang, kenton lee, and kristina toutanova. bert: pre-training of deep LINEBREAK bidirectional transformers for language understanding. arxiv:1810.04805, 2018. LINEBREAK kevin dowd. using order statistics to estimate confidence intervals for quantile-based risk LINEBREAK measures. journal of derivatives, 17(3):9–14, 2010. LINEBREAK kevin dowd and david blake. after var: the theory, estimation, and insurance applications of LINEBREAK quantile-based risk measures. journal of risk & insurance, 73(2):193–229, june 2006. LINEBREAK dheeru dua and casey graff. uci machine learning repository, 2017. url http://archive. LINEBREAK ics.uci.edu/ml. LINEBREAK aryeh dvoretzky, jack kiefer, and jacob wolfowitz. asymptotic minimax character of the sample distribution function and of the classical multinomial estimator. the annals of mathematical statistics, pp. 642–669, 1956. LINEBREAK alex krizhevsky. learning multiple layers of features from tiny images. technical report, university LINEBREAK of toronto, department of computer science, 2009. LINEBREAK erik learned-miller and philip s. thomas. a new confidence interval for the mean of a bounded LINEBREAK erich l. lehmann and joseph p. romano. testing statistical hypotheses. springer texts in statis LINEBREAK tsung-yi lin, michael maire, serge belongie, james hays, pietro perona, deva ramanan, piotr doll´ar, and c. lawrence zitnick. microsoft coco: common objects in context. in david fleet, tomas pajdla, bernt schiele, and tinne tuytelaars (eds.), computer vision – eccv 2014, volume 8693, pp. 740–755. springer international publishing, 2014. LINEBREAK p. massart. the tight constant in the dvoretzky-kiefer-wolfowitz inequality. the annals of prob LINEBREAK frank j. massey, jr. the kolmogorov-smirnov test for goodness of fit. journal of the american LINEBREAK amit moscovich. fast calculation of p-values for one-sided kolmogorov-smirnov type statistics. LINEBREAK amit moscovich, boaz nadler, and clifford spiegelman. on the exact berk-jones statistics and LINEBREAK their p-value calculation. electronic journal of statistics, 10(2):2329–2354, 2016. LINEBREAK michael naaman. on the tight constant in the multivariate dvoretzky–kiefer–wolfowitz inequality. LINEBREAK alec radford, jong wook kim, chris hallacy, aditya ramesh, gabriel goh, sandhini agarwal, girish sastry, amanda askell, pamela mishkin, jack clark, gretchen krueger, and ilya sutskever. learning transferable visual models from natural language supervision. in marina meila and tong zhang (eds.), proceedings of the 38th international conference on machine learning, volume 139 of proceedings of machine learning research, pp. 8748–8763. pmlr, july 2021. LINEBREAK tal ridnik, hussam lawen, asaf noy, emanuel ben baruch, gilad sharir, and itamar friedman. tresnet: high performance gpu-dedicated architecture. in proceedings of the ieee/cvf winter conference on applications of computer vision (wacv), pp. 1400–1409, january 2021. LINEBREAK r. tyrrell rockafellar and stanislav uryasev. optimization of conditional value-at-risk. the journal LINEBREAK glenn shafer and vladimir vovk. a tutorial on conformal prediction. journal of machine learning LINEBREAK galen shorack. probability for statisticians. springer texts in statistics. springer-verlag, new LINEBREAK galen r. shorack and jon a. wellner. empirical processes with applications to statistics. society LINEBREAK for industrial and applied mathematics, january 2009. isbn 978-0-89871-684-9. LINEBREAK vladimir vovk, alex gammerman, and glenn shafer. algorithmic learning in a random world. LINEBREAK springer science & business media, 2005. LINEBREAK q. waymel, s. badr, x. demondion, a. cotten, and t. jacques. LINEBREAK impact of the rise of artificial intelligence in radiology: what do radiologists think? diagnostic and interventional imaging, 100(6):327–336, june 2019. LINEBREAK robert williamson and aditya menon. fairness risk measures. in kamalika chaudhuri and ruslan salakhutdinov (eds.), proceedings of the 36th international conference on machine learning, volume 97 of proceedings of machine learning research, pp. 6786–6797. pmlr, june 2019. LINEBREAK thomas wolf, lysandre debut, victor sanh, julien chaumond, clement delangue, anthony moi, pierric cistac, tim rault, r´emi louf, morgan funtowicz, joe davison, sam shleifer, patrick von platen, clara ma, yacine jernite, julien plu, canwen xu, teven le scao, sylvain gugger, mariama drame, quentin lhoest, and alexander m. rush. transformers: state-of-the-art natural language processing. in proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pp. 38–45. association for computational linguistics, october 2020. LINEBREAK a notation LINEBREAK symbol meaning LINEBREAK input space. target output space. prediction space. a predictor mapping from z to ˆy. data distribution over z × y. random variables representing input-target pairs drawn from d. LINEBREAK z y ˆy h d (z, y ) ℓ( ˆy , y ) loss incurred by predicting ˆy ∈ ˆy when the ground truth is y ∈ y. x h LINEBREAK random variable representing ℓ(h(z), y ). this is the loss incurred by applying predictor h to input z when the ground truth is y . the superscript h may be dropped when the predictor being referred to is clear from context. the cumulative distribution function (cdf) of x h, also referred to as the loss cdf, defined as f h(x) ≜ p (x h ≤ x). quantile function defined as f −1,h(p) ≜ inf{x : f h(x) ≥ p}. risk measure quantifying the risk associated with loss cdf f . weighting function defining a quantile-based risk measure (see definition 1). a sequence of loss random variables x1, . . . , xn. the i-th order statistic of x1:n. order statistics satisfy x(1) ≤ . . . ≤ x(n). f ⪰ g denotes f (x) ≥ g(x) for all x ∈ r. a lower confidence bound on f h as a function of x h the upper confidence bound on f −1,h corresponding to ˆf h n . LINEBREAK 1 , . . . , x h n . LINEBREAK f h LINEBREAK f −1,h r(f ) ψ x1:n x(i) ⪰ ˆf h n ˆf −1,h n LINEBREAK table 4: summary of the notation used in this paper. LINEBREAK b interpreting standard tests of uniformity as minimum-type LINEBREAK statistics s LINEBREAK several standard tests of uniformity may be viewed as instances of the minimum-type statistic s defined in equation 2. for example, the one-sided kolmogorov-smirnov (ks) statistic with the uniform (cid:17) as the null hypothesis can be expressed as d+ = − min1≤i≤n n − u(i) , n n = −s, where si(u) = u − i which can be viewed as d+ n . the berk-jones statistic achieves greater tail sensitivity by taking advantage of the fact that the marginal distribution of u(i) is beta(i, n − i + 1), which has lower variance in the tails. the one-sided berk-jones (bj) statis≜ min1≤i≤n iu(i) (i, n − i + 1), where ix(a, b) is the cdf of beta(a, b) tic is defined as m + n evaluated at x. this can be recognized as s where si(u) = iu(i, n − i + 1), the inverse of which can be efficiently computed using standard software packages. LINEBREAK ≜ max1≤i≤n LINEBREAK u(i) − i n LINEBREAK standard distribution-free one-sided confidence bounds for quantiles involve selecting the minimal order statistic that bounds the desired quantile level with high probability. we use the term order stats to refer to a modified berk-jones statistic where only a single order statistic is used. an analogous approach can be taken using the dkw inequality (see appendix e.1 for details). these methods can be adapted to handle a var interval by simultaneously bounding multiple quantile levels, e.g. using a grid over the interval [βmin, βmax], via bonferroni correction. LINEBREAK c novel truncated berk-jones statistics LINEBREAK one of our main contributions concerns novel goodness-of-fit statistics. here we introduce two forms of a truncated berk-jones statistic, targeting a range of quantiles. the first form targets a one-sided range of quantiles [βmin, 1). the key idea is to drop lower order statistics that do ≜ not affect the bound on f −1(βmin). we define the truncated one-sided berk-jones as m + n,k mink≤i≤n iu(i) (i, n − i + 1), which can be realized by using si(u) = iu(i, n − i + 1) for k ≤ i ≤ n LINEBREAK and si(u) = 1 otherwise. for a given βmin, define k∗(βmin) ≜ min{k : s−1 δ ) ≥ βmin}, where δ is the critical value of m + sk n,k. bisection search can be used to compute k∗ and thus the inversion of m + n,k∗(βmin) provides a cdf lower bound targeted at quantiles βmin and above. the truncated two-sided berk-jones variant targets a quantile interval [βmin, βmax] and is defined as ≜ mink≤i≤ℓ iu(i)(i, n − i + 1). it first computes k∗(βmin) as in the one-sided case and m + then removes higher order statistics using the upper endpoint of ℓ∗ ≜ min{ℓ : s−1 ) ≥ βmax}, where sk∗,ℓ LINEBREAK is the corresponding critical value. LINEBREAK ℓ (sk∗,ℓ LINEBREAK k (sk LINEBREAK n,k,ℓ LINEBREAK d proofs LINEBREAK d.1 proof of theorem 1 LINEBREAK proof. consider g−1(p). by the definition of the quantile function, g(g−1(p)) ≥ p. by the relationship between f and g, we therefore have f (g−1(p)) ≥ g(g−1(p)) ≥ p, where the first inequality follows from f ⪰ g. applying f −1 to both sides yields f −1(f (g−1(p))) ≥ f −1(p). but x ≥ f −1◦f (x) (see e.g. proposition 3 on p. 6 of shorack & wellner (2009)) and thus g−1(p) ≥ f −1(p). then we have rψ(f ) ≤ rψ(g) by definition 1. the event that f ⪰ ˆg(x1:n) implies that rψ(f ) ≤ rψ(g) by theorem 1. since the antecedent holds with probability at least 1 − δ, so must the consequent. LINEBREAK d.2 proof of theorem 2 LINEBREAK proof. for readability, we first discuss the case when the cdf f is continuous and strictly increasing. after that, we demonstrate how to extend our argument to a more general case. LINEBREAK continuous and strictly increasing f . if f is continuous and strictly increasing, we know f is bijective and the inverse function f −1(p) is well-defined. moreover, for x ∼ f , we have f (x) is of the same distribution as uniform random variable u . that is because LINEBREAK p (f (x) ≤ p) = p (x ≤ f −1(p)) = p. LINEBREAK in addition, by the monotonicity of f , f preserves ordering, which means f (x(i)) is of the same distribution of u(i) for all i ∈ [n]. so, we have LINEBREAK p (cid:0)∀i, f (x(i)) ≥ s−1 LINEBREAK i LINEBREAK (sδ)(cid:1) = p (cid:0)∀i, u(i) ≥ s−1 LINEBREAK i LINEBREAK (sδ)(cid:1) . LINEBREAK now recall that LINEBREAK s ≜ min 1≤i≤n LINEBREAK si(u(i)). LINEBREAK given the definition of sδ, we know that LINEBREAK p (s ≥ sδ) ≥ 1 − δ. LINEBREAK in addition, by the definition s−1 combined together, we have LINEBREAK i LINEBREAK , if s ≥ sδ, then we have that u(i) ≥ s−1 LINEBREAK i LINEBREAK (sδ) for all i ∈ {1, . . . , n}. LINEBREAK p (cid:0)∀i, f (x(i)) ≥ s−1 LINEBREAK i LINEBREAK (sδ)(cid:1) = p (cid:0)∀i, u(i) ≥ s−1 LINEBREAK i LINEBREAK (sδ)(cid:1) ≥ p (s ≥ sδ) ≥ 1 − δ. LINEBREAK general f . for general f , recall we define a generalized inverse function f −1(p) ≜ inf{x : f (x) ≥ p}. notice that for a generalized inverse function f −1, we have f −1(u ) is of the same distribution as x ∼ f . that is because LINEBREAK p (f −1(u ) ≤ c) = p (u ≤ f (c)) = f (c). LINEBREAK we want to remark that the above formula holds for general f and the first equality directly follows from the definition of the generalized inverse function f −1. moreover, f −1 preserves ordering (by definition of the quantile function), i.e. f −1(u(1)) ≤ . . . ≤ f −1(u(n)). thus, we have x(i) is of the same distribution as f −1(u(i)). LINEBREAK by proposition 1, eq. 24 on p.5 of shorack & wellner (2009), we have that LINEBREAK f ◦ f −1(t) ≥ t for any t ∈ [0, 1] and any cdf f (this is can obtained directly from the definition of f −1 also can go beyond cdf, but we here only restrict ourselves in the case that f is a cdf). therefore we have LINEBREAK f (f −1(u(i))) ≥ u(i) ≥ s−1 LINEBREAK i LINEBREAK (sδ). LINEBREAK combined with the fact that x(i) is of the same distribution as f −1(u(i)) for all i ∈ [n], we have LINEBREAK p (cid:0)∀i, f (x(i)) ≥ s−1 LINEBREAK i LINEBREAK (sδ)(cid:1) = p (cid:0)∀i, f (f −1(u(i)) ≥ s−1 = p (cid:0)∀i, u(i) ≥ s−1 ≥ 1 − δ. LINEBREAK i LINEBREAK i LINEBREAK (sδ)(cid:1) LINEBREAK (sδ)(cid:1) ≥ p (s ≥ sδ) LINEBREAK d.3 proof of theorem 3 LINEBREAK proof. when x < x1, f (x) ≥ 0. for any i ∈ {1, 2, · · · , n}, since f (xi) ≥ bi, thus, for x ∈ [xi, xi+1), f (x) ≥ f (xi) ≥ bi (xn+1 is considered as x+ here). lastly, if x ≥ x+, f (x) = 1. combined together, we have f (x) ≥ g(x,b)(x). LINEBREAK d.4 proof of corollary 1 LINEBREAK proof. notice that by theorem 3, if ∀i, f (x(i)) ≥ s−1 which implies LINEBREAK i LINEBREAK (sδ), then we have f (x) ≥ g(x(1:n)s−1 LINEBREAK p LINEBREAK f (x) ≥ g(x(1:n),s−1 LINEBREAK then, by theorem 2, p LINEBREAK ∀i, f (x(i)) ≥ s−1 LINEBREAK (sδ) LINEBREAK i LINEBREAK ≥ p LINEBREAK ∀i, f (x(i)) ≥ s−1 LINEBREAK i LINEBREAK (sδ) LINEBREAK d.5 proof of theorem 4 LINEBREAK proof. the claim follows by applying a union bound argument over h ∈ h: LINEBREAK p (∃h ∈ h : f h ⪰̸ ˆg(x h LINEBREAK p (f h ⪰̸ ˆg(x h LINEBREAK h∈h LINEBREAK e experimental details LINEBREAK e.1 dkw method for quantile distribution-free upper confidence bounds LINEBREAK a distribution upper confidence bound on f −1(β) can be constructed by using a one-sided version of the dkw inequality (dvoretzky et al., 1956; massart, 1990). define the empirical distribution function as fn(x) = 1 2n log 2, by the dkw inequality, n LINEBREAK i{xi ≤ x}. then for every ε ≥ (cid:26) LINEBREAK p LINEBREAK sup x∈r LINEBREAK fn(x) − f (x) > ε LINEBREAK if we let δ = exp(−2nε2), then we have ε = δ ≤ 1/2. proposition 1. let x(1) ≤ . . . ≤ x(n) denote the order statistics of x1, . . . , xn, where xi ∼ f δ ≤ 1 and δ ≤ 1/2, LINEBREAK δ and the above condition holds for any LINEBREAK for all i ∈ {1, . . . , n}. let k =
| 14
|
[
108,
81.3642556,
230.61791028,
91.3368182
] |
4UldFtZ_CVF.pdf
| 2,023
| 1
|
LINEBREAK joint edge-model sparse learning is provably efficient for graph neural networks LINEBREAK shuai zhang rensselaer polytechnic institute [email protected] LINEBREAK meng wang rensselaer polytechnic institute [email protected] LINEBREAK pin-yu chen ibm research [email protected] LINEBREAK sijia liu michigan state university [email protected] LINEBREAK songtao lu ibm research [email protected] LINEBREAK miao liu ibm research [email protected] LINEBREAK abstract LINEBREAK due to the significant computational challenge of training large-scale graph neural networks (gnns), various sparse learning techniques have been exploited to reduce memory and storage costs. examples include graph sparsification that samples a subgraph to reduce the amount of data aggregation and model sparsification that prunes the neural network to reduce the number of trainable weights. despite the empirical successes in reducing the training cost while maintaining the test accuracy, the theoretical generalization analysis of sparse learning for gnns remains elusive. to the best of our knowledge, this paper provides the first theoretical characterization of joint edge-model sparse learning from the perspective of sample complexity and convergence rate in achieving zero generalization error. it proves analytically that both sampling important nodes and pruning neurons with lowest-magnitude can reduce the sample complexity and improve convergence without compromising the test accuracy. although the analysis is centered on two-layer gnns with structural constraints on data, the insights are applicable to more general setups and justified by both synthetic and practical citation datasets. LINEBREAK introduction LINEBREAK graph neural networks (gnns) can represent graph structured data effectively and find applications in objective detection (shi & rajkumar, 2020; yan et al., 2018), recommendation system (ying et al., 2018; zheng et al., 2021), rational learning (schlichtkrull et al., 2018), and machine translation (wu et al., 2020; 2016). however, training gnns directly on large-scale graphs such as scientific citation networks (hull & king, 1987; hamilton et al., 2017; xu et al., 2018), social networks (kipf & welling, 2017; sandryhaila & moura, 2014; jackson, 2010), and symbolic networks (riegel et al., 2020) becomes computationally challenging or even infeasible, resulting from both the exponential aggregation of neighboring features and the excessive model complexity, e.g., training a two-layer gnn on reddit data (tailor et al., 2020) containing 232,965 nodes with an average degree of 492 can be twice as costly as resnet-50 on imagenet (canziani et al., 2016) in computation resources. LINEBREAK the approaches to accelerate gnn training can be categorized into two paradigms: (i) sparsifying the graph topology (hamilton et al., 2017; chen et al., 2018; perozzi et al., 2014; zou et al., 2019), and (ii) sparsifying the network model (chen et al., 2021b; you et al., 2022). sparsifying the graph topology means selecting a subgraph instead of the original graph to reduce the computation of neighborhood aggregation. one could either use a fixed subgraph (e.g., the graph typology (hübler et al., 2008), graph shift operator (adhikari et al., 2017; chakeri et al., 2016), or the degree distribution (leskovec & faloutsos, 2006; voudigari et al., 2016; eden et al., 2018) is preserved) or apply sampling algorithms, such as edge sparsification (hamilton et al., 2017), or node sparsification (chen et al., 2018; zou et al., 2019) to select a different subgraph in each iteration. sparsifying the network model means reducing the complexity of the neural network model, including removing the non-linear activation (wu et al., 2019; he et al., 2020), quantizing neuron weights (tailor et al., 2020; bahri et al., 2021) and output of the intermediate layer (liu et al., 2021), pruning network (frankle & carbin, 2019), or LINEBREAK knowledge distillation (yang et al., 2020; hinton et al., 2015; yao et al., 2020; jaiswal et al., 2021). both sparsification frameworks can be combined, such as joint edge sampling and network model pruning in (chen et al., 2021b; you et al., 2022). LINEBREAK despite many empirical successes in accelerating gnn training without sacrificing test accuracy, the theoretical evaluation of training gnns with sparsification techniques remains largely unexplored. most theoretical analyses are centered on the expressive power of sampled graphs (hamilton et al., 2017; cong et al., 2021; chen et al., 2018; zou et al., 2019; rong et al., 2019) or pruned networks (malach et al., 2020; zhang et al., 2021; da cunha et al., 2022). however, there is limited generalization analysis, i.e., whether the learned model performs well on testing data. most existing generalization analyses are limited to two-layer cases, even for the simplest form of feed-forward neural networks (nns), see, e.g., (zhang et al., 2020a; oymak & soltanolkotabi, 2020; huang et al., 2021; shi et al., 2022) as examples. to the best of our knowledge, only li et al. (2022); allen-zhu et al. (2019a) go beyond two layers by considering three-layer gnns and nns, respectively. however, li et al. (2022) requires a strong assumption, which cannot be justified empirically or theoretically, that the sampled graph indeed presents the mapping from data to labels. moreover, li et al. (2022); allen-zhu et al. (2019a) focus on a linearized model around the initialization, and the learned weights only stay near the initialization (allen-zhu & li, 2022). the linearized model cannot justify the advantages of using multi-layer (g)nns and network pruning. as far as we know, there is no finite-sample generalization analysis for the joint sparsification, even for two-layer gnns. LINEBREAK contributions. this paper provides the first theoretical generalization analysis of joint topologymodel sparsification in training gnns, including (1) explicit bounds of the required number of known labels, referred to as the sample complexity, and the convergence rate of stochastic gradient descent (sgd) to return a model that predicts the unknown labels accurately; (2) quantitative proof for that joint topology and model sparsification is a win-win strategy in improving the learning performance from the sample complexity and convergence rate perspectives. LINEBREAK we consider the following problem setup to establish our theoretical analysis: node classification on a one-hidden-layer gnn, assuming that some node features are class-relevant (shi et al., 2022), which determines the labels, while some node features are class-irrelevant, which contains only irrelevant information for labeling, and the labels of nodes are affected by the class-relevant features of their neighbors. the data model with this structural constraint characterizes the phenomenon that some nodes are more influential than other nodes, such as in social networks (chen et al., 2018; veliˇckovi´c et al., 2018), or the case where the graph contains redundancy information (zheng et al., 2020). LINEBREAK specifically, the sample complexity is quadratic in (1 − β)/α, where α in (0, 1] is the probability of sampling nodes of class-relevant features, and a larger α means class-relevant features are sampled more frequently. β in [0, 1) is the fraction of pruned neurons in the network model using the magnitude-based pruning method such as (frankle & carbin, 2019). the number of sgd iterations to reach a desirable model is linear in (1 − β)/α. therefore, our results formally prove that graph sampling reduces both the sample complexity and number of iterations more significantly provided that nodes with class-relevant features are sampled more frequently. the intuition is that importance sampling helps the algorithm learns the class-relevant features more efficiently and thus reduces the sample requirement and convergence time. the same learning improvement is also observed when the pruning rate increases as long as β does not exceed a threshold close to 1. LINEBREAK graph neural networks: formulation and algorithm
| 1
|
[
108.299,
199.7486768,
449.7374469,
211.7038768
] |
ZCStthyW-TD.pdf
| 2,023
| 0
|
LINEBREAK associative memory chronous learning for event-based perception LINEBREAK spatiotemporal LINEBREAK augmented LINEBREAK asynrepresentation LINEBREAK uday kamal∗, saurabh dash* school of electrical and computer engineering georgia institute of technology @gatech.edu, [email protected] ukamal6,saurabhdash } { LINEBREAK †& saibal mukhopadhyay LINEBREAK abstract LINEBREAK we propose eventformer– a computationally efficient event-based representation learning framework for asynchronously processing event camera data. eventformer treats sparse input events as a spatially unordered set and models their spatial interactions using self-attention mechanism. an associative memoryaugmented recurrent module is used to correlate with the stored representation computed from past events. a memory addressing mechanism is proposed to store and retrieve the latent states only where these events occur and update them only when they occur. the representation learning shift from input space to the latent memory space resulting in reduced computation cost for processing each event. we show that eventformer achieves 0.5% and 9% better accuracy with less computation compared to the state-of-the-art dense and 30000 event-based method, respectively, on event-based object recognition datasets. LINEBREAK introduction LINEBREAK ultra-low power, high dynamic range (> 120db), high temporal resolution, and low latency makes event-based cameras (brandli et al., 2014; suh et al., 2020; son et al., 2017; finateu et al., 2020) attractive for real-time machine vision applications such as robotics and autonomous driving (falanga et al., 2020; hagenaars et al., 2020; sun et al., 2021; zhu et al., 2018; gehrig et al., 2021). convolutional and recurrent neural network-based methods, originally developed for framebased cameras, have demonstrated good perception accuracy on event camera (gehrig et al., 2019; baldwin et al., 2022; cannici et al., 2020b). but they rely on temporal aggregation of the events to create a frame-like dense representation as input thereby discarding the inherent sparsity of event data and resulting in high computational cost (figure 2). recent works have explored event-based processing methods for object recognition to exploit data sparsity. examples of such methods include time-surface based representation relying on hand-crafted features (lagorce et al., 2016; sironi et al., 2018; ramesh et al., 2019), 3d space-time event-cloud (wang et al., 2019), and graphbased methods (li et al., 2021c; schaefer et al., 2022). these methods adopt event-based processing to achieve lower computational costs but do not achieve similar performance compared to the denserepresentation based methods (figure 2). this necessitates computationally efficient algorithms that exploit sparsity and achieve high accuracy. LINEBREAK we propose an associative memory-augmented asynchronous representation learning framework for event-based perception, hereafter referred to as eventformer, that enables computationally efficient event-based processing with high performance (figure 1). as events are triggered asynchronously, an event-based processing algorithm must generate and maintain a higher-order representation from the events, and efficiently update that representation to correlate a new event with the past events across space and time. one way to address this is to include a recurrent module at each pixel to track history of past events (cannici et al., 2020a). however, the associated processing and memory requirement of such a method increases exponentially with the number of pixels. motivated by recent works in memory augmented neural networks(kumar et al., 2016; ma et al., LINEBREAK ∗equal contribution LINEBREAK †author now at cohereai LINEBREAK figure 1: comparison with existing works. (a) event-based perception algorithms where perception latency k∆ is proportional to the event-generation rate(∆). (b) existing works include (left) dense processing that aggregates events into a frame and use cnn, event-based processing including (mid) gnn on spatiotemporal event-graph, or (right) pointnet like architectures treating events as point-cloud. these methods either re-process (frame and point cloud) or store the past events (graph) to spatiotemporally correlate with new events. (c) eventformer encodes the spatiotemporal interaction of the past events into a compact latent memory space to efficiently retrieve and correlate with the new events without requiring to store or re-process the past events. LINEBREAK 2018; karunaratne et al., 2021), we address the preceding challenge by maintaining a spatiotemporal representation associated with past events, occurring at various pixels, as the hidden states of an associative memory. as learning spatiotemporal correlation is shifted from the high-dimension input (pixel) space to a compact latent memory space, eventformer requires an order of magnitude lower floating point operations (flops) per event to update the memory. to the best of our knowledge, eventformer is the first associative memory-augmented spatiotemporal representation learning method for event-based perception. the key contributions of this paper are: LINEBREAK • eventformer maps the spatiotemporal representation of the incoming event stream into the hidden states of an associative memory and uses a lightweight perception head directly operating on these states to generate perception decisions. LINEBREAK • the spatiotemporal representation update mechanism activates only ‘when’ and only ‘where’ there is a new event using unstructured set-based processing without requiring to store and re-process the past events. LINEBREAK • we propose a new query-key association-based memory access mechanism to enable spatial location-aware memory access to retrieve the past states of the current event locations. LINEBREAK given a new event (or a set of events), our model generates a spatial representation by computing their spatial interaction through self-attention mechanism (vaswani et al., 2017)and retrieves the past spatiotemporal states related to that pixel location(s) from the memory. the retrieval process exploits a novel location-based query and content-based key-value association mechanism to extract correlations among the past events at neighboring pixels. once we get the past states, along with our present spatial representation, a recurrent module takes them as input and generates the refined state information. the associated hidden states of the memory are updated with the new information. we evaluate eventformer on object recognition task from event-camera data. in our experiments on existing benchmark datasets, n-caltech101 (orchard et al., 2015) and n-cars (sironi et al., 2018), eventformer shows an excellent computational advantage over the existing methods (both dense and event-based) while achieving performance comparable to the dense methods (figure 2). LINEBREAK related work: dense methods convert events to dense frame-like representation and process them with standard deep learning models such as cnns (maqueda et al., 2018; gehrig et al., 2019; cannici et al., 2020a). these methods are synchronous in nature as they generate dense inputs by binning and aggregating events in time and generate output only when the entire bin is processed. event-based methods update their representations with a new event and generate new output. methods such as (lagorce et al., 2016; sironi et al., 2018; ramesh et al., 2019) compute timeordered representation (also known as time-surface) in an event-based manner with fewer computations. however, their reliance on fixed, hand-tuned representation results in sub-optimal perfor LINEBREAK mance compared to the data-driven methods (gehrig et al., 2019). recently, graph-based methods (messikommer et al., 2020; li et al., 2021b; schaefer et al., 2022) have been considered that generate a spatiotemporal event graph and process them with gnn. for a new event, the graph is updated by removing nodes associated with past events and adding new ones. as these methods require subsampling the events to reduce the size of the graph (and hence, computation), performance is reduced as well. also, they need to store the past events inside the graph to correlate with the new event causing additional computation and memory overhead. point cloud-based methods can inherently process unstructured event camera data in a permutation invariant manner (wang et al., 2019; vemprala et al., 2021). however, they process over a sliding window of time τ and need to re-process the past events for every new event to establish correlations leading to redundant computations. memory augmented neural networks typically combine an external associative memory with a recurrent controller (kumar et al., 2016; ma et al., 2018; karunaratne et al., 2021) resulting in enhanced memory capacity compared to the vanilla recurrent module (cho et al., 2014). can(2020) propose a pixel-wise memory-based representation learning for event-camera nici et al. data that stores states at each pixel location (cannici et al., 2020a). however, it requires a computationally expensive feature extractor as spatiotemporal correlations among these states are not considered. event camera has also been applied for more complex tasks including egomotion, motion segmentation(parameshwara et al., 2021b), and depth prediction (hidalgo-carri´o et al., 2020). to broadly categorize, these methods either fall into dense frame-based representation where classical image processing (mitrokhin et al., 2018) and end-to-end learning-based methods (zhu et al., 2019; mitrokhin et al., 2019) have been applied or 3d-point cloud representation where gnns has been adopted(mitrokhin et al., 2020) to learn to perform these dense prediction tasks. while most of the existing works in this direction adopt a dense processing-based encoder-decoder structure, a spike-based asynchronous formulation has also been explored in (parameshwara et al., 2021a). LINEBREAK method LINEBREAK preliminaries and problem formulation: an event-based camera consists of sensors at every pixel location that can respond to the change of brightness asynchronously and independently (gallego et al., 2020). mathematically, a set of events produced at pixel locations (x, y)i y defined as a time-ordered sequence, (xi, yi, ti, pi) { denotes the event triggering timestamps, pi LINEBREAK ≤ h) during a time interval τ can be τ = where ti LINEBREAK τ, t = supi ti LINEBREAK ∈ as the polarity (relative change in 1, 1 {− } brightness), and t as the total time of observation. in this work, we consider the spatial locations of the events as the input, that is: . our goal is to learn a com LINEBREAK ti LINEBREAK x LINEBREAK e LINEBREAK e } pute efficient parametric mapping LINEBREAK (xi, yi) { LINEBREAK f LINEBREAK e rm LINEBREAK → τ that can convert the raw event sequence me d τ into a suitable representation × e d defines the dimension of the fea(where m ture space) with event-based processing capability. this implies that needs to have the capability to update its representation as soon as a new event(or a new event sequence) arrives without storing or recomputing the past events. LINEBREAK me LINEBREAK f LINEBREAK y c a r u c c a n o i t i n g o c e r LINEBREAK ours LINEBREAK (cannici et al., 2020b) LINEBREAK (gehrig et al., 2019) LINEBREAK (messikommer et al., 2020) LINEBREAK (schaefer et al., 2022) LINEBREAK (sironi et al., 2018) LINEBREAK event-based dense LINEBREAK computational complexity [mflops/event] LINEBREAK figure 2: recognition performance vs computation. on n-caltech101 dataset, eventformer has about 30000 lower compute cost than the sota dense method (cannici et al., 2020b) with 9% improvement in accuracy compared to the best performing event-based method (li et al., 2021c). LINEBREAK overview of the framework: eventformer consists of a positional encoder (li et al., 2021a) followed by a pairwise interaction module to compute the spatial interactions among the events (figure t as the current input state, and computes the spatiotem3). a recurrent module takes this output, 1 stored in an associative memory, poral representation t, which LINEBREAK . the output of this recurrent module is used to update the memory representation LINEBREAK t by retrieving the past hidden states LINEBREAK h LINEBREAK z LINEBREAK x LINEBREAK t LINEBREAK m LINEBREAK m LINEBREAK list of events LINEBREAK retrieve past states LINEBREAK associative memory LINEBREAK positional encoder LINEBREAK pairwise interaction LINEBREAK recurrent module LINEBREAK update new states LINEBREAK classification head LINEBREAK figure 3: eventformer architecture. eventformer generates positional embedding πt from a list of new events xt at time t, and calculates their pairwise interaction, t using self-attention. 1 associated with xt from an associative memory and a recurrent unit extracts the past states computes t to process future events. a linear layer uses LINEBREAK t as the current states. this is further encoded into the latent memory space, LINEBREAK t to predict the target class. LINEBREAK m LINEBREAK h LINEBREAK z LINEBREAK x LINEBREAK t LINEBREAK m LINEBREAK algorithm 1: compute the event-based representation through eventformer LINEBREAK input: a list of n 2-dimensional pixel coordinates of the events at time t: LINEBREAK i LINEBREAK xt = LINEBREAK rc where c denotes the number of classes. LINEBREAK n (xi, yi) } { output: prediction vector yt ∈ hyperparameter: the dimension of the representation vector d, row size of the memory m, number of stacks for the refine operator r. initialize the memory representation with the learned initializer, cos(xtw t p ) 1); LINEBREAK ; ⊲ read the past memory-representation LINEBREAK sin(xtw t p ) LINEBREAK rm LINEBREAK m LINEBREAK k LINEBREAK (cid:1) LINEBREAK d LINEBREAK π(xt) := 1 √d read(πt, r do LINEBREAK (cid:0) m LINEBREAK t LINEBREAK h LINEBREAK t LINEBREAK t LINEBREAK ∈ refiner(πt, πt); ← πt; ← z 1); t , ( h z ← r − write( 1, t ′t m ← sigmoid(erase( ← t = αt 1 + (1 m f lat 10 t ← m 11 yt ← 12 return yt. LINEBREAK m − reshape f lat t LINEBREAK ffpred( LINEBREAK t); x t m αt) LINEBREAK m LINEBREAK t LINEBREAK ⊲ compute event interactions LINEBREAK ⊲ compute the current states ⊲ compute new memory representation ⊲ compute the update factor ⊲ update the memory LINEBREAK ⊲ prediction at time t LINEBREAK t)); LINEBREAK − m LINEBREAK x ′t; LINEBREAK − t into a 1-dimensional vector; m ); LINEBREAK is used by a classification head for the recognition task. to facilitate these operations, eventformer has three unique operators: read to retrieve the past representation, write/erase to update the memory with new representation, and, refine to compute the spatial correlation among the events. both read and write/erase operators use multihead residual attention (vaswani et al., 2017) as a building block. the refine operator adopts an efficient version of this building block (shen et al., 2021) to address the quadratic memory and compute requirement (that can become computationally prohibitive for a very fast-moving object generating a large number of events at a given time) of the traditional dot-product attention mechanism (vaswani et al., 2017). algorithm 1 shows an implementation of the overall eventformer architecture. LINEBREAK d as input and maps them into operator details: an operator( the q (query), k (key), and v (value) space using a linear transformation. the attention mechanism maps the q to outputs as follows: LINEBREAK ) takes LINEBREAK d and LINEBREAK a ∈ LINEBREAK b ∈ LINEBREAK a LINEBREAK b LINEBREAK rm LINEBREAK rn LINEBREAK attn(q, k, v ; a) = a(qk ⊤)v LINEBREAK rn LINEBREAK m measures the pairwise similarity of the query and key vectors. a(qk ⊤)v LINEBREAK qk ⊤ × is a weighted sum of the value vectors where the weights are computed using scaled softmax activation a(.) = softmax(./√d). the multihead residual attention computes multiple attention by LINEBREAK rn LINEBREAK multihead residual attention LINEBREAK operator building block LINEBREAK memory operators LINEBREAK memory update LINEBREAK (a) LINEBREAK (b) LINEBREAK (c) LINEBREAK (d) LINEBREAK figure 4: details of the memory operations. (a) block diagram of the multihead residual atten), (c) read operator calculates query from positional tion, (b) composition of an operator( embedding πt and key-value pair from past memory representation, 1. the write and erase t t, and, (d) an update to the asoperator computes query from t sociative memory occurs with a linear combination of the new value to be added ′t and past 1 weighted by an elementwise scaling factor generated by the erase operator. representation LINEBREAK 1 and key-value pair from LINEBREAK m LINEBREAK m LINEBREAK m LINEBREAK a LINEBREAK x LINEBREAK b LINEBREAK t LINEBREAK m LINEBREAK projecting q, k, and v onto h separate d/h dimensional space, respectively. the output is a linear combination of h-different attentions (attn(., ., .; a)) applied to each of these h projections: LINEBREAK multihead(q, k, v ; w, a) = concatenate(o1, ..., oh)w o LINEBREAK w = residual block completes the operation and generates output, o as follows: LINEBREAK h i , w v i=1 ∈ i } LINEBREAK h and w o LINEBREAK i , w k LINEBREAK w q { LINEBREAK rd LINEBREAK d LINEBREAK where oi = attn(qw q LINEBREAK i , kw k rhdv LINEBREAK i ; ai) LINEBREAK i , v w v d are learnable parameters. a following LINEBREAK o = operator( LINEBREAK a LINEBREAK b LINEBREAK ) := layernorm(oh + ffo(oh)) LINEBREAK a layernorm is layer normalization function (ba et al., 2016). figure 4 illustrates these operations. LINEBREAK where oh = layernorm( LINEBREAK + multihead(q, k, v ; w, a)) LINEBREAK positional encoder: eventformer generates positional embedding by mapping the event sequence from a low-dimensional (2d) space to a higher-dimensional feature space. this is done by a learnable fourier feature-based positional encoder. at any given time t, the positional encoder, 2 maps a list of n 2-dimensional events, π : xt xt to a d-dimensional feature space, πt using the following equation: LINEBREAK d parameterized by wp LINEBREAK r d LINEBREAK rn LINEBREAK rn LINEBREAK πt LINEBREAK πt = π(xt) := LINEBREAK concatenate LINEBREAK cos(xtw t LINEBREAK p ), sin(xtw t p ) LINEBREAK (cid:0) LINEBREAK (cid:1)(cid:1) LINEBREAK spatial correlation: to compute a refined representation that considers spatial correlation among the events, we compute self-attention among the positional embedding πt by using the refine operator. the efficient attention mechanism modifies the equation 1 as follows: LINEBREAK efficientattn(q, k, v ; aq, ak) = aq (q) LINEBREAK ak LINEBREAK k ⊤ LINEBREAK v LINEBREAK (cid:0) LINEBREAK (cid:0) LINEBREAK (cid:1) LINEBREAK (cid:1) LINEBREAK o LINEBREAK (dn+d2) and LINEBREAK where aq and ak denote the row-wise and column-wise scaled softmax activation, respectively. a closer look at equation 7 reveals that the memory and computation complexity has been reduced to (d2n) respectively, which is linear with respect to the number of events, n. finally, × LINEBREAK o we stack multiple refine operators to compute LINEBREAK d as their higher-order interactions. LINEBREAK z associative memory augmented recurrent module: the proposed associative memory has a querykey association-based memory access architecture with a separate association mechanism for state d as the stored memory repreretrieval and update operation (figure 4). we define rn d using the sentation at time t. the read operator retrieves the past representation current event locations πt. it computes the query vectors from πt and key, value vectors using the past stored representation 1 LINEBREAK 1. the final retrieved state is a weighted sum of the projected LINEBREAK rm LINEBREAK rn LINEBREAK m LINEBREAK h LINEBREAK t LINEBREAK t LINEBREAK t LINEBREAK t LINEBREAK m LINEBREAK t LINEBREAK m LINEBREAK time progression LINEBREAK (a) LINEBREAK (b) LINEBREAK (c) LINEBREAK figure 5: temporal evolution of memory representation. (a) and (b) change in memory representation over time for samples from two different classes. (c) tsne plot of the memory representation for 10 randomly selected classes from n-caltech101 dataset. LINEBREAK t LINEBREAK m LINEBREAK , to compute the current spatiotemporal representation, LINEBREAK where the weights are computed through the association between the event locations (πt) and the 1). this implies that a particular memory abstract memory addresses (keys projected from representation gets more weight if its corresponding address (key) has a higher similarity with the 1 is used as the past hidden state of the recurquery (i.e., positional embedding). the retrieved d. we use gated rent module, recurrent unit (gru) as the recurrent module. the write and erase operator jointly update t m 1 and the keywith new information. the write operator computes the query vectors from t to query the location of the memory that needs to be updated and generate the value pair from d. the purpose of erase operator is to calculate a set of elementnew representation, ′t m d wise scaling factors, αt to control the amount of update at each memory 1 } location. additional details can be found in appendix i. finally, we update the memory using: LINEBREAK rm rm LINEBREAK rn LINEBREAK m LINEBREAK αt LINEBREAK r LINEBREAK h LINEBREAK x LINEBREAK x LINEBREAK t LINEBREAK t LINEBREAK t LINEBREAK t = αt LINEBREAK t LINEBREAK m LINEBREAK αt) LINEBREAK ′t LINEBREAK m LINEBREAK m LINEBREAK classification head: a single feedforward layer ffpred(.) that maps the flattened memory representation, LINEBREAK rc where c is the number of classes. LINEBREAK rmd to the prediction vector, yt LINEBREAK f lat t LINEBREAK m LINEBREAK experiments and results LINEBREAK datasets and metrics: we evaluate the performance of our method on standard event-based object recognition benchmarks: n-caltech101 and n-cars (see appendix d for details). we consider two metrics: recognition accuracy and the number of floating point operations required to update the representation for each new event (mflops/ev). LINEBREAK implementation: eventformer follows an end-to-end feed-forward layer-based implementation. we d) for n-caltech101 and n-cars dataset, reuse 32 spectively. unless otherwise specified, all the multihead residual attention blocks use h (number of heads) = 4, and the number of stacks for the refine operator, r = 2. additional details including training hyperparameters and time intervals can be found in appendix e. LINEBREAK 16 as memory dimensions (rm LINEBREAK representation learning in associative memory: we first visualize the evolution of the learned representation in the associative memory for different classes of n-caltech101 (figure 5). initially, the memory representation starts from the same initial state for all classes. as events are observed over time, the memory states start to form unique patterns for different classes. the tsne plot in LINEBREAK figure 6: memory representation dynamics over sequential class update. (a) change in prediction probability of the target class over time. (b) change in memory representation when class changes occur. (c) average memory update activity for a large-scale experiment similar to (a) and (b), and (d) their corresponding perception latency distribution. LINEBREAK figure 7: memory representation dynamics over sequential input transformation. (a) change in prediction probability of the target class over time. (b) change in memory representation when transformed input appears. (c) average memory update activity for a large-scale experiment similar to (a) and (b), and (d) their corresponding perception latency distribution. LINEBREAK figure 5(c) shows that the learned representations for various classes form a distinct cluster enabling separation of the class boundaries even with a relatively simple classifier head. LINEBREAK temporal update of the learned representation with class change: we study the temporal updates of the memory states when samples from two different classes are passed to eventformer in a streaming manner (figure 6). the memory updates its representation as the object class changes, enabling accurate classification results over time. we randomly take 3000 samples from the ncaltech101 dataset consisting of sequential class change (3000 unique class combinations). we plot the distribution of the number of events required for the target class output to reach a 0.6 confidence, hereafter referred to as the perception latency (figure 6 (d)). the median perception latency is 60 events for the initial and new class, respectively. the perception latency for the initial class (red) has a wider distribution since the memory has to adapt its representation from the initial state. we also plot the mean and standard deviation of the frobenius norm of the differk2, hereafter referred to as the ence between two successive memory representations memory update activity, for the same experiment (figure 6 (c)). higher memory update activity, observed when developing the representation of the initial class, stabilizes with more events of the same class. the change in the class also results in increased memory update activity but less than the initial case. this shows that eventformer can adapt to new representations in real-time and re-use important features already computed in the past thereby reducing perception latency. LINEBREAK − m LINEBREAK km LINEBREAK t LINEBREAK temporal update of learned representation with input transformation: we study the temporal update of the memory states over time while objects from the same class but with different transformations (rotation) are passed to eventformer in a streaming manner (figure 7). with the incoming events from the rotated sample, we observe degradation in prediction probability due to represen LINEBREAK (a) LINEBREAK positional encoder LINEBREAK positional encoder read read recurrent module recurrent module refine LINEBREAK refine LINEBREAK erase LINEBREAK write LINEBREAK (b) LINEBREAK n o i t a t u p m o c e v i t a l e r LINEBREAK ) d e z i l a m r o n ( LINEBREAK write/erase LINEBREAK refine LINEBREAK read LINEBREAK figure 8: flop analysis. (a) normalized flop contribution from the key components of eventformer (for n=1). (b) change in relative compute cost for the operators with increasing n. LINEBREAK experiment LINEBREAK (a) (b) (c) LINEBREAK (d) LINEBREAK associative memory ✗ ✓ ✓ LINEBREAK separate write and erase operator ✗ ✗ ✓ LINEBREAK refine operator ✓ ✓ ✗ LINEBREAK accuracy LINEBREAK mflops/ev LINEBREAK table 1: ablation study of various key components of eventformer on the n-caltech101 dataset. LINEBREAK tation update, which stabilizes over time. we consider 3000 random samples from n-caltech101 with combinations of two random rotations between 10 to 30 degrees. we observe that the memory update activity is less for input transformation of the same example (figure 7 (c)), compared to a completely new example (figure 6 (c)). this shows that eventformer can preserve learned representation for a class even under input transformation enabling less memory update activity. LINEBREAK computational complexity: we analytically derive the computational complexity model of eventformer (details in appendix c). we study the flop contributions from the key components in figure 8. for a single event (n=1), most of the flop costs are from the memory update block due (md2 + md + d2) compute complexity. the cost of memory update diminishes with a larger to its n while the read and refine operator starts to dominate (figure 8 (b)). LINEBREAK o LINEBREAK r LINEBREAK mflops/ev LINEBREAK hyperparameter accuracy LINEBREAK ablation study on the components: we consider the experiments where eventformer is implemented without (a): the associative memory, (b): separate write and erase operator, and (c): refine operator and compare the results with (d): the complete eventformer to analyze the impact of different components. for experiment (a), we pool the t to a 1dimensional vector (vemprala et al., 2021) to deal with the variable-sized sequence. also, we make the hidden size of the recurrent module d so that the ffpred receives the same-sized m × in experiment (b), we linearly project input. the output of the write operator into a rm 2d ′t and αt. the results are shown in table space and split it into two equal-sized vectors to get 1. merging the write and erase operation marginally reduces the mflops/ev, but at the expense of less flexibility during memory updates and hence, lower accuracy. without the refine operator, the model saves more computation but lacks the higher-order interaction modeling among the events, causing marginal accuracy loss. finally, absence of associative memory reduces maximum compu LINEBREAK table 2: performance of eventformer on ncaltech101 with different hyperparameters. LINEBREAK m(= d) LINEBREAK m LINEBREAK x LINEBREAK n-caltech101 LINEBREAK n-cars LINEBREAK methods LINEBREAK representation LINEBREAK async. accuracy LINEBREAK spike h-first spike gabor-snn time-surface hots time-surface hats time-surface dart est event-histogram matrix-lstm event-histogram yole asynet evs-s aegnn LINEBREAK voxel-grid voxel-grid graph graph LINEBREAK ours LINEBREAK unstructured set LINEBREAK mflops/ev LINEBREAK accuracy LINEBREAK mflops/ev LINEBREAK table 3: performance comparison with state-of-the-art event-based and dense methods. LINEBREAK tation but also causes the model to lose spatial information (due to the pooling operation) resulting in minimum performance. LINEBREAK effect of hyperparameters: we study the impact of hyperparameters r and m(= d) (table 2). we observe that increasing their values result in better performance but at the cost of higher mflops/ev. therefore, we follow our initial setting (r=2 and m(= d)=32) to have a better balance between accuracy and compute cost while comparing with the state-of-the-art methods. LINEBREAK comparison with the state-of-the-art (sota): we compare eventformer with sota dense and event-based methods on these two datasets (table 3). following the previous work (schaefer et al., 2022), we report the average mflops/ev on a window of 25000 events. methods utilizing hand-crafted features: h-first (orchard et al., 2015), gabor-snn (bovik et al., 1990), hots (lagorce et al., 2016), hats (sironi et al., 2018), dart (ramesh et al., 2019), require fewer mflops/ev while performing worse than the data-driven methods. est (gehrig et al., 2019) and matrix-lstm (cannici et al., 2020b) are synchronous methods that learn the optimal representation and achieve higher accuracy. however, they require compute-intensive feature extractors to work on the learned representations. whereas eventformer does not require any complex feature extractors since the learned representation in the memory captures both the spatial and temporal information. it can achieve similar performance with 30000 less computation. yole (cannici et al., 2019) and asynet (messikommer et al., 2020) modify the cnns to enable asynchronous, sparse processing to reduce the compute cost. however, they do not consider the temporal information in the events. evss (li et al., 2021c) and aegnn(schaefer et al., 2022) are graph-based methods with asynchronous and efficient graph nodes update. however, they use sub-sampling to restrict the graph size from growing prohibitively large, leading to suboptimal performance. our method, on the other hand, inherently learns to leverage useful events to update the memory without requiring any redundant computation (such as radius search). the memory mechanism enables learning better temporal correlation compared to the graph-based methods. as a result, our method achieves 9% better accuracy on n-caltech101 while being 200 LINEBREAK more efficient compared to (li et al., 2021c). LINEBREAK computation latency: the latency of eventformer implemented with pytorch on an nvidia rtx3090 is 4.5ms/event on n-caltech101 dataset which is 10 faster than the existing most efficient method (schaefer et al., 2022)(52ms/event). unlike their method, we do not require searching over a large graph to update the representation which reduces computational latency. LINEBREAK conclusion and future work LINEBREAK we propose a novel memory-augmented representation learning framework–eventformer, for asynchronous and efficient event-based perception. eventformer learns to store, retrieve and update its memory representation in the latent form of higher-order spatiotemporal dynamics of the events that allow it to achieve high performance with minimal compute cost. future works include eventformer on more complex tasks including object detection, depth estimation, and optical flow prediction. LINEBREAK references LINEBREAK jimmy lei ba, jamie ryan kiros, and geoffrey e hinton. layer normalization. arxiv preprint LINEBREAK raymond baldwin, ruixu liu, mohammed mutlaq almatrafi, vijayan k asari, and keigo hiieee transactions on LINEBREAK rakawa. time-ordered recent event (tore) volumes for event cameras. pattern analysis and machine intelligence, 2022. LINEBREAK alan c. bovik, marianna clark, and wilson s. geisler. multichannel texture analysis using localized ieee transactions on pattern analysis and machine intelligence, 12(1):55–73, LINEBREAK spatial filters. 1990. LINEBREAK christian brandli, raphael berner, minhao yang, shih-chii liu, and tobi delbruck. a 240 × 180 ieee journal of solid-state LINEBREAK marco cannici, marco ciccone, andrea romanoni, and matteo matteucci. asynchronous convolutional networks for object detection in neuromorphic cameras. in proceedings of the ieee/cvf conference on computer vision and pattern recognition workshops, pp. 0–0, 2019. LINEBREAK marco cannici, marco ciccone, andrea romanoni, and matteo matteucci. a differentiable recurrent surface for asynchronous event-based data. in european conference on computer vision, pp. 136–152. springer, 2020a. LINEBREAK marco cannici, marco ciccone, andrea romanoni, and matteo matteucci. matrix-lstm: a differentiable recurrent surface for asynchronous event-based data. in proceedings of the european conference on computer vision (eccv), glasgow, uk, pp. 23–28, 2020b. LINEBREAK kyunghyun cho, bart van merri¨enboer, caglar gulcehre, dzmitry bahdanau, fethi bougares, holger schwenk, and yoshua bengio. learning phrase representations using rnn encoder-decoder for statistical machine translation. arxiv preprint arxiv:1406.1078, 2014. LINEBREAK davide falanga, kevin kleber, and davide scaramuzza. dynamic obstacle avoidance for quadrotors LINEBREAK with event cameras. science robotics, 5(40):eaaz9712, 2020. LINEBREAK thomas finateu, atsumi niwa, daniel matolin, koya tsuchimoto, andrea mascheroni, etienne reynaud, pooria mostafalu, frederick brady, ludovic chotard, florian legoff, hirotsugu takahashi, hayato wakabayashi, yusuke oike, and christoph posch. 5.10 a 1280×720 backilluminated stacked temporal contrast event-based vision sensor with 4.86µm pixels, 1.066geps readout, programmable event-rate controller and compressive data-formatting pipeline. in 2020 ieee international solid- state circuits conference - (isscc), pp. 112–114, 2020. doi: 10.1109/isscc19947.2020.9063149. LINEBREAK guillermo gallego, tobi delbr¨uck, garrick orchard, chiara bartolozzi, brian taba, andrea censi, stefan leutenegger, andrew j davison, j¨org conradt, kostas daniilidis, et al. event-based vision: a survey. ieee transactions on pattern analysis and machine intelligence, 44(1):154–180, 2020. LINEBREAK daniel gehrig, antonio loquercio, konstantinos g derpanis, and davide scaramuzza. end-to-end learning of representations for asynchronous event-based data. in proceedings of the ieee/cvf international conference on computer vision, pp. 5633–5643, 2019. LINEBREAK mathias gehrig, willem aarents, daniel gehrig, and davide scaramuzza. dsec: a stereo event camera dataset for driving scenarios. ieee robotics and automation letters, 6(3):4947–4954, 2021. LINEBREAK jesse j hagenaars, federico paredes-vall´es, sander m boht´e, and guido che de croon. evolved ieee robotics and LINEBREAK neuromorphic control for high speed divergence-based landings of mavs. automation letters, 5(4):6239–6246, 2020. LINEBREAK javier hidalgo-carri´o, daniel gehrig, and davide scaramuzza. learning monocular dense depth from events. in 2020 international conference on 3d vision (3dv), pp. 534–542. ieee, 2020. LINEBREAK geethan karunaratne, manuel schmuck, manuel le gallo, giovanni cherubini, luca benini, abu sebastian, and abbas rahimi. robust high-dimensional memory-augmented neural networks. nature communications, 12(1):1–12, 2021. LINEBREAK ankit kumar, ozan irsoy, peter ondruska, mohit iyyer, james bradbury, ishaan gulrajani, victor zhong, romain paulus, and richard socher. ask me anything: dynamic memory networks for natural language processing. in international conference on machine learning, pp. 1378–1387. pmlr, 2016. LINEBREAK xavier lagorce, garrick orchard, francesco galluppi, bertram e shi, and ryad b benosman. hots: a hierarchy of event-based time-surfaces for pattern recognition. ieee transactions on pattern analysis and machine intelligence, 39(7):1346–1359, 2016. LINEBREAK yang li, si si, gang li, cho-jui hsieh, and samy bengio. learnable fourier features for multidimensional spatial positional encoding. advances in neural information processing systems, 34:15816–15829, 2021a. LINEBREAK yijin li, han zhou, bangbang yang, ye zhang, zhaopeng cui, hujun bao, and guofeng zhang. graph-based asynchronous event processing for rapid object recognition. in proceedings of the ieee/cvf international conference on computer vision (iccv), pp. 934–943, october 2021b. LINEBREAK yijin li, han zhou, bangbang yang, ye zhang, zhaopeng cui, hujun bao, and guofeng zhang. graph-based asynchronous event processing for rapid object recognition. in proceedings of the ieee/cvf international conference on computer vision, pp. 934–943, 2021c. LINEBREAK chao ma, chunhua shen, anthony dick, qi wu, peng wang, anton van den hengel, and ian reid. visual question answering with memory-augmented networks. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 6975–6984, 2018. LINEBREAK ana i maqueda, antonio loquercio, guillermo gallego, narciso garc´ıa, and davide scaramuzza. event-based vision meets deep learning on steering prediction for self-driving cars. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 5419–5427, 2018. LINEBREAK nico messikommer, daniel gehrig, antonio loquercio, and davide scaramuzza. event-based asynchronous sparse convolutional networks. in european conference on computer vision, pp. 415– 431. springer, 2020. LINEBREAK anton mitrokhin, cornelia ferm¨uller, chethan parameshwara, and yiannis aloimonos. event-based moving object detection and tracking. in 2018 ieee/rsj international conference on intelligent robots and systems (iros), pp. 1–9. ieee, 2018. LINEBREAK anton mitrokhin, chengxi ye, cornelia ferm¨uller, yiannis aloimonos, and tobi delbruck. evimo: motion segmentation dataset and learning pipeline for event cameras. in 2019 ieee/rsj international conference on intelligent robots and systems (iros), pp. 6105–6112. ieee, 2019. LINEBREAK anton mitrokhin, zhiyuan hua, cornelia fermuller, and yiannis aloimonos. learning visual motion segmentation using event surfaces. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 14414–14423, 2020. LINEBREAK garrick orchard, cedric meyer, ralph etienne-cummings, christoph posch, nitish thakor, and ryad benosman. hfirst: a temporal approach to object recognition. ieee transactions on pattern analysis and machine intelligence, 37(10):2028–2040, 2015. LINEBREAK chethan m parameshwara, simin li, cornelia ferm¨uller, nitin j sanket, matthew s evanusa, and yiannis aloimonos. spikems: deep spiking neural network for motion segmentation. in 2021 ieee/rsj international conference on intelligent robots and systems (iros), pp. 3414–3420. ieee, 2021a. LINEBREAK chethan m parameshwara, nitin j sanket, chahat deep singh, cornelia ferm¨uller, and yiannis aloimonos. 0-mms: zero-shot multi-motion segmentation with a monocular event camera. in 2021 ieee international conference on robotics and automation (icra), pp. 9594–9600. ieee, 2021b. LINEBREAK bharath ramesh, hong yang, garrick orchard, ngoc anh le thi, shihao zhang, and cheng xiang. dart: distribution aware retinal transform for event-based cameras. ieee transactions on pattern analysis and machine intelligence, 42(11):2767–2780, 2019. LINEBREAK simon schaefer, daniel gehrig, and davide scaramuzza. aegnn: asynchronous event-based graph neural networks. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 12371–12381, 2022. LINEBREAK zhuoran shen, mingyuan zhang, haiyu zhao, shuai yi, and hongsheng li. efficient attention: attention with linear complexities. in proceedings of the ieee/cvf winter conference on applications of computer vision, pp. 3531–3539, 2021. LINEBREAK amos sironi, manuele brambilla, nicolas bourdis, xavier lagorce, and ryad benosman. hats: histograms of averaged time surfaces for robust event-based object classification. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 1731–1740, 2018. LINEBREAK bongki son, yunjae suh, sungho kim, heejae jung, jun-seok kim, changwoo shin, keunju park, kyoobin lee, jinman park, jooyeon woo, yohan roh, hyunku lee, yibing wang, ilia ovsiannikov, and hyunsurk ryu. 4.1 a 640×480 dynamic vision sensor with a 9µm pixel and 300meps address-event representation. in 2017 ieee international solid-state circuits conference (isscc), pp. 66–67, 2017. doi: 10.1109/isscc.2017.7870263. LINEBREAK yunjae suh, seungnam choi, masamichi ito, jeongseok kim, youngho lee, jongseok seo, heejae jung, dong-hee yeo, seol namgung, jongwoo bong, sehoon yoo, seung-hun shin, doowon kwon, pilkyu kang, seokho kim, hoonjoo na, kihyun hwang, changwoo shin, jun-seok kim, paul k. j. park, joonseok kim, hyunsurk ryu, and yongin park. a 1280×960 dynamic vision sensor with a 4.95-µm pixel pitch and motion artifact minimization. in 2020 ieee international symposium on circuits and systems (iscas), pp. 1–5, 2020. doi: 10.1109/iscas45731.2020. 9180436. LINEBREAK sihao sun, giovanni cioffi, coen de visser, and davide scaramuzza. autonomous quadrotor flight despite rotor failure with onboard vision sensors: frames vs. events. ieee robotics and automation letters, 6(2):580–587, 2021. LINEBREAK ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n gomez, łukasz kaiser, and illia polosukhin. attention is all you need. advances in neural information processing systems, 30, 2017. LINEBREAK sai vemprala, sami mian, and ashish kapoor. representation learning for event-based visuomotor policies. in m. ranzato, a. beygelzimer, y. dauphin, p.s. liang, and j. wortman vaughan (eds.), advances in neural information processing systems, volume 34, pp. 4712–4724. curran associates, inc., 2021. LINEBREAK qinyi wang, yexin zhang, junsong yuan, and yilong lu. space-time event clouds for gesture recognition: from rgb cameras to event cameras. in 2019 ieee winter conference on applications of computer vision (wacv), pp. 1826–1835. ieee, 2019. LINEBREAK alex zihao zhu, dinesh thakur, tolga ¨ozaslan, bernd pfrommer, vijay kumar, and kostas daniilidis. the multivehicle stereo event camera dataset: an event camera dataset for 3d perception. ieee robotics and automation letters, 3(3):2032–2039, 2018. LINEBREAK alex zihao zhu, liangzhe yuan, kenneth chaney, and kostas daniilidis. unsupervised event-based learning of optical flow, depth, and egomotion. in proceedings of the ieee/cvf conference on computer vision and pattern recognition, pp. 989–997, 2019. LINEBREAK supplement to “associative memory augmented asynchronous spatiotemporal representation learning for event-based perception” LINEBREAK a appendix LINEBREAK in this supplementary material, we provide experimental and additional details on eventformer. LINEBREAK b details of the notation used in this work LINEBREAK type LINEBREAK description LINEBREAK notation dimension LINEBREAK scaler parameters LINEBREAK functions LINEBREAK vector/matrix LINEBREAK number of events dimension of event-representation row size of the memory number of classes LINEBREAK positional encoder recurrent module classifier head LINEBREAK sequence of events at time t positional embedding associative memory representation at t retrieved state from the memory (past hidden state for the recurrent module) representation with higher order interaction among the events current spatiotemporal representation new memory representation at t scaling factors to control memory update prediction at time t LINEBREAK n d m c LINEBREAK π(.) (., .) ffpred(. ) LINEBREAK r LINEBREAK xt πt LINEBREAK m t h − LINEBREAK t LINEBREAK z LINEBREAK t LINEBREAK x ′t m αt yt LINEBREAK n n m n LINEBREAK n LINEBREAK n m m 1 LINEBREAK 2 d d d LINEBREAK d LINEBREAK d d d c LINEBREAK table 4: different notations used to describe the operations of eventformer LINEBREAK c derivation of computational complexity model of LINEBREAK eventformer LINEBREAK here we derive the computational complexity model of the proposed eventformer architecture. let us define n as the number of events to be processed within time-interval τ , d as the dimension of the representation, m as the number of rows in the memory, h be the number of heads in the residual attention blocks (we use the same h in all the blocks), r as the number of stacks for the refine operator, and c be the number of class for the recognition task. LINEBREAK (i) positional encoder: our positional encoder block consists of single matrix multiplication with the input, that is to compute xtw t 1) additions, so in total 3nd flops. LINEBREAK p , we need 2nd multiplications and nd(2 LINEBREAK (ii) read operator: read operator consists of a residual multihead attention block with h heads. to begin with, calculating the query matrix for each head, we need n( d 1) additions, so in total n d 1) flops. similarly for the key and value matrix, we need total 2m d 1) computation. similarly the product (qk ⊤)v requires n d 1) flops. upto now for each head, we require total flops: LINEBREAK 1) flops. then, to compute qk ⊤, we need an additional mn(2 d h (2m LINEBREAK h )2 multiplication and n d LINEBREAK h ( d LINEBREAK h − LINEBREAK h − LINEBREAK h − LINEBREAK h − LINEBREAK n LINEBREAK d h LINEBREAK d h − LINEBREAK d h LINEBREAK d h − LINEBREAK d h − LINEBREAK d h LINEBREAK therefore, for h heads, it becomes: LINEBREAK d h − LINEBREAK d h − LINEBREAK d h − LINEBREAK the following 2 residual connection involves pointwise addition of a n the out-projection involves an additional nd(2d read(πt, LINEBREAK t-1) becomes: LINEBREAK d dimensional matrix and 1) flops. finally, total flops count for the LINEBREAK m LINEBREAK d h − LINEBREAK d h − LINEBREAK d h − LINEBREAK (iii) recurrent module: our recurrent module is a gru that involves 3 matrix multiplication (update, reset, hidden) for the current input, πt and hidden state ht 1 each. therefore 6 matrix multiplication in total followed by 5 elementwise addition and 2 elementwise multiplication. therefore, the total computation becomes: LINEBREAK (iv) refine operator: unlike the read(. , . ) operator, it projects the same input, xt to query, key and value space. therefore, total computation for such project becomes 3n d 1), followed by additional ( d 1) flops for k ⊤v , and q(k ⊤v ) computation. therefore, for h heads and considering the additional cost for residual operations and out-projections, the final cost becomes: LINEBREAK 1) and n d LINEBREAK h − LINEBREAK h − LINEBREAK r LINEBREAK d h − LINEBREAK d h − LINEBREAK here r accounts for the number of stacks. LINEBREAK (iv) write and erase operator: similar to the read(. , . ) operator, we can calculate the total 1, zt) operation combined as follows: flops required for the write( LINEBREAK 1, zt) and erase( LINEBREAK t LINEBREAK t LINEBREAK m LINEBREAK m LINEBREAK d h − LINEBREAK d h − LINEBREAK d h − LINEBREAK here, the additional 3md accounts for the 2 pointwise addition and 1 multiplication in equation 8. LINEBREAK (iv) perception output: the final output is calculated by a vector( tiplication, which requires an additional c(2md LINEBREAK 1) flops. LINEBREAK rmd)-matrix( LINEBREAK rmd LINEBREAK c) mul LINEBREAK total flops: the total flops accounting all the above computation becomes: LINEBREAK d h − LINEBREAK d h − LINEBREAK d h − LINEBREAK positional encoder |{z} LINEBREAK − recurrent module {z LINEBREAK d h − LINEBREAK + r LINEBREAK d h − LINEBREAK d h − LINEBREAK read operation {z LINEBREAK | d h − LINEBREAK d h − LINEBREAK refine operator {z LINEBREAK memory update (includes both write and erase operation) {z LINEBREAK + c(2md LINEBREAK − output (9) {z LINEBREAK d details of the datasets LINEBREAK n-caltech101 (orchard et al., 2015) is converted to event space from standard frame-based dataset (caltech101). it has 8246 event sequences from 101 class categories following the original caltech101 dataset. n-caltech101 uses an event camera to record event streams generated by moving images displayed on a monitor. LINEBREAK n-cars (sironi et al., 2018) is a real-world event-camera dataset with 24039 event sequences from 2-class instances (car or background). n-cars utilizes an event camera mounted on a moving car recording its surroundings in a real-world setting. LINEBREAK e training details LINEBREAK data preparation: for both of the datasets, we use the official test set portion to report the result and split the remaining into 90% and 10% ratios for training and validation purposes. the event coordinates are normalized by dividing them by the height and width (180 240 for n-caltech101 and 100 120 for n-cars) of the frame resolution. we use a 50 ms long sequence for each sample to reduce training complexity. each sample is chunked by a 1ms window, resulting in 50-sequences for each sample. LINEBREAK optimization: we use the standard categorical cross-entropy as the loss function to train the network with adam (kingma & ba, 2014) with batch size 128 for n-cars and 64 for n-caltech101 with an 3 that decreases by a factor of 5 after every 25 epochs. the memory initial learning rate of 1e− d. we also use a dropout representation is initialized by a set of learnable parameters of 0.2 on the memory representation before passing them to the final classification layer. to avoid gradient explosion during training, we use gradient clipping with a maximum gradient norm of 100. LINEBREAK m′ ∈ LINEBREAK rm LINEBREAK f additional ablation experiment LINEBREAK impact of polarity: in our current formulation, we did not consider polarity information of the events during the event-encoding part. we conduct an additional experiment to evaluate the impact of polarity by taking them as an additional input alongside the positional coordinates of the events. in this formulation, we consider where pi denotes the polarity of the event at the } (xi, yi) location. at a given time t, while we use the same positional encoder, π to process xt, we 1 to map the list of n event polarities, pt use a separate mlp layer parameterized by wpol to a d-dimensional feature space, pot. finally, we add πt and pot together to generate a refined πt that now contains both the polarity and positional information. we keep the subsequent operations unchanged. following the same training and evaluation procedure on n-caltech101 dataset, this modified architecture achieved a slightly better accuracy of 0.849 (compared to the original 0.848) with negligible additional compute cost. LINEBREAK (xi, yi, pi) { LINEBREAK rd LINEBREAK e LINEBREAK figure 9: network architectures for dense prediction tasks. (a) convolution-based hierarchical encoder-decoder structure with skip connections in between. (b) possible adaptation of eventformer to work with existing decoder structure with no skip-connection. LINEBREAK g feasibility study of applying eventformer on complex task LINEBREAK iou LINEBREAK floor LINEBREAK boxes LINEBREAK method LINEBREAK mflops/ev (encoder) LINEBREAK ev-imo evdodgenet spikems LINEBREAK motion segmentation: our primary focus in this work was to develop an event-based spatiotemporal representation learning framework and we used classification as an example task to demonstrate the efficacy of our method. in this section, we further evaluate our method on a dense task–motion segmentation as an example of tasks more complex than classification. unlike the classification task, motion segmentation is a dense prediction task. existing works (mitrokhin et al., 2019; sanket et al., 2020; parameshwara et al., 2021) on such dense task leverage hierarchical encoder-decoder network architecture where the encoder encodes the high-dimensional space into a compact latentspace while the decoder decodes it back to its original shape. therefore, applying eventformer on such dense tasks requires its own decoder to reconstruct the dense output from its latent memory representation. while designing a novel decoder architecture is out of the scope of this work, we use the existing convolution-based decoder structure for this experiment. we reshape the memory representation b) to give it a 2dn positional bias and pass it to the decoder as shown in figure. 9 so that end-to-end training with the decoder enables it to learn the required 2d-latent representation in the encoded space. LINEBREAK table 5: comparison of preliminary eventformer adaptation with other methods on evimo dataset. LINEBREAK eventformer (m=64,d=32) eventformer (m=64,d=64) eventformer (m=256,d=32) LINEBREAK d (where m = a LINEBREAK d into
| 15
|
[
265.50898,
267.06404448,
288.6792817105,
278.4050546
] |
CrfhZAsJDsZ.pdf
| 2,023
| 0
|
LINEBREAK nonlinear reconstruction for operator learning of pdes with discontinuities LINEBREAK samuel lanthaler computing and mathematical science california institute of technology pasadena, ca, usa [email protected] LINEBREAK roberto molinaro, patrik hadorn & siddhartha mishra seminar for applied mathematics eth zurich zurich, switzerland {roberto.molinaro,siddhartha.mishra}@ethz.ch LINEBREAK abstract LINEBREAK a large class of hyperbolic and advection-dominated pdes can have solutions with discontinuities. this paper investigates, both theoretically and empirically, the operator learning of pdes with discontinuous solutions. we rigorously prove, in terms of lower approximation bounds, that methods which entail a linear reconstruction step (e.g. deeponet or pca-net) fail to efficiently approximate the solution operator of such pdes. in contrast, we show that certain methods employing a nonlinear reconstruction mechanism can overcome these fundamental lower bounds and approximate the underlying operator efficiently. the latter class includes fourier neural operators and a novel extension of deeponet termed shift-deeponet. our theoretical findings are confirmed by empirical results for advection equation, inviscid burgers’ equation and compressible euler equations of aerodynamics. LINEBREAK introduction LINEBREAK many interesting phenomena in physics and engineering are described by partial differential equations (pdes) with discontinuous solutions. the most common types of such pdes are nonlinear hyperbolic systems of conservation laws (dafermos, 2005), such as the euler equations of aerodynamics, the shallow-water equations of oceanography and mhd equations of plasma physics. it is well-known that solutions of these pdes develop finite-time discontinuities such as shock waves, even when the initial and boundary data are smooth. other examples include the propagation of waves with jumps in linear transport and wave equations, crack and fracture propagation in materials (sun & jin, 2012), moving interfaces in multiphase flows (drew & passman, 1998) and motion of very sharp gradients as propagating fronts and traveling wave solutions for reaction-diffusion equations (smoller, 2012). approximating such (propagating) discontinuities in pdes is considered to be extremely challenging for traditional numerical methods (hesthaven, 2018) as resolving them could require very small grid sizes. although bespoke numerical methods such as high-resolution finitevolume methods, discontinuous galerkin finite-element and spectral viscosity methods (hesthaven, 2018) have successfully been used in this context, their very high computational cost prohibits their extensive use, particularly for many-query problems such as uq, optimal control and (bayesian) inverse problems (lye et al., 2020), necessitating the design of fast machine learning-based surrogates. LINEBREAK as the task at hand in this context is to learn the underlying solution operator that maps input functions (initial and boundary data) to output functions (solution at a given time), recently developed operator learning methods can be employed in this infinite-dimensional setting (higgins, 2021). these methods include operator networks (chen & chen, 1995) and their deep version, deeponet (lu et al., 2019; 2021), where two sets of neural networks (branch and trunk nets) are combined in a LINEBREAK linear reconstruction procedure to obtain an infinite-dimensional output. deeponets have been very successfully used for different pdes (lu et al., 2021; mao et al., 2020b; cai et al., 2021; lin et al., 2021). an alternative framework is provided by neural operators (kovachki et al., 2021a), wherein the affine functions within dnn hidden layers are generalized to infinite-dimensions by replacing them with kernel integral operators as in (li et al., 2020a; kovachki et al., 2021a; li et al., 2020b). a computationally efficient form of neural operators is the fourier neural operator (fno) (li et al., 2021a), where a translation invariant kernel is evaluated in fourier space, leading to many successful applications for pdes (li et al., 2021a;b; pathak et al., 2022). LINEBREAK currently available theoretical results for operator learning (e.g. lanthaler et al. (2022); kovachki et al. (2021a;b); de ryck & mishra (2022b); deng et al. (2022)) leverage the regularity (or smoothness) of solutions of the pde to prove that frameworks such as deeponet, fno and their variants approximate the underlying operator efficiently. although such regularity holds for many elliptic and parabolic pdes, it is obviously destroyed when discontinuities appear in the solutions of the pdes such as in the hyperbolic pdes mentioned above. thus, a priori, it is unclear if existing operator learning frameworks can efficiently approximate pdes with discontinuous solutions. this explains the paucity of theoretical and (to a lesser extent) empirical work on operator learning of pdes with discontinuous solutions and provides the rationale for the current paper where, LINEBREAK • using a lower bound, we rigorously prove approximation error estimates to show that operator learning architectures such as deeponet (lu et al., 2021) and pca-net (bhattacharya et al., 2021), which entail a linear reconstruction step, fail to efficiently approximate solution operators of prototypical pdes with discontinuities. in particular, the approximation error only decays, at best, linearly in network size. LINEBREAK • we rigorously prove that using a nonlinear reconstruction procedure within an operator learning architecture can lead to the efficient approximation of prototypical pdes with discontinuities. in particular, the approximation error can decay exponentially in network size, even after discontinuity formation. this result is shown for two types of architectures with nonlinear reconstruction, namely the widely used fourier neural operator (fno) of (li et al., 2021a) and for a novel variant of deeponet that we term as shift-deeponet. • we supplement the theoretical results with extensive experiments where fno and shiftdeeponet are shown to consistently outperform deeponet and other baselines for pdes with discontinuous solutions such as linear advection, inviscid burgers’ equation, and both the one- and two-dimensional versions of the compressible euler equations of gas dynamics. LINEBREAK methods LINEBREAK setting. given compact domains d ⊂ rd, u ⊂ rd′ , we consider the approximation of operators g : x → y, where x ⊂ l2(d) and y ⊂ l2(u ) are the input and output function spaces. in the following, we will focus on the case, where ¯u (cid:55)→ g(¯u) maps initial data ¯u to the solution at some time t > 0, of an underlying time-dependent pde. we assume the input ¯u to be sampled from a probability measure µ ∈ prob(x ). LINEBREAK deeponet. deeponet (lu et al., 2021) will be our prototype for operator learning frameworks with linear reconstruction. to define them, let x := (x1, . . . , xm) ∈ d be a fixed set of sensor points. given an input function ¯u ∈ x , we encode it by the point values e(¯u) = (¯u(x1), . . . , ¯u(xm)) ∈ rm. deeponet is formulated in terms of two neural networks: the first is the branch-net β, which maps the point values e(¯u) to coefficients β(e(¯u)) = (β1(e(¯u)), . . . , βp(e(¯u)), resulting in a mapping LINEBREAK (2.1) the second neural network is the so-called trunk-net τ (y) = (τ1(y), . . . , τp(y)), which is used to define a mapping LINEBREAK e(¯u) (cid:55)→ (β1(e(¯u)), . . . , βp(e(¯u)). LINEBREAK β : rm → rp, LINEBREAK τ : u → rp, LINEBREAK while the branch net provides the coefficients, the trunk net provides the “basis” functions in an expansion of the output function of the form p (cid:88) LINEBREAK n don(¯u)(y) = LINEBREAK βk(¯u)τk(y), LINEBREAK ¯u ∈ x , y ∈ u, LINEBREAK with βk(¯u) = βk(e(¯u)). the resulting mapping n don : x → y, ¯u (cid:55)→ n don(¯u) is a deeponet. LINEBREAK although deeponet were shown to be universal in the class of measurable operators (lanthaler et al., 2022), the following fundamental lower bound on the approximation error was also established, LINEBREAK proposition 2.1 (lanthaler et al. (2022, thm. 3.4)). let x be a separable banach space, y a separable hilbert space, and let µ be a probability measure on x . let g : x → y be a borel measurable operator with e¯u∼µ[∥g(¯u)∥2 y ] < ∞. then the following lower approximation bound holds for any deeponet n don with trunk-/branch-net dimension p: LINEBREAK e (n don) = e¯u∼µ LINEBREAK (cid:2)∥n don(¯u) − g(¯u)∥2 LINEBREAK y LINEBREAK ≥ eopt := LINEBREAK j>p LINEBREAK λj, LINEBREAK where the optimal error eopt is written in terms of the eigenvalues λ1 ≥ λ2 ≥ . . . of the covariance operator γg#µ := eu∼g#µ[(u ⊗ u)] of the push-forward measure g#µ. LINEBREAK we refer to sm a for relevant background on the underlying principal component analysis (pca) and covariance operators, as well as an example illustrating the connection between sharpness of gradients and the decay of the pca eigenvalues λj (sm a.1). the same lower bound (2.4) in fact holds for any operator approximation of the form n (¯u) = (cid:80)p k=1 βk(¯u)τk, where βk : x → r are arbitrary functionals. in particular, this bound continues to hold for e.g. the pca-net architecture of hesthaven & ubbiali (2018); bhattacharya et al. (2021). we will refer to any operator learning architecture of this form as a method with “linear reconstruction”, since the output function n (¯u) is restricted to the linear p-dimensional space spanned by the τ1, . . . , τp ∈ y. in particular, deeponet are based on linear reconstruction. to overcome the lower bound (2.4) which sets fundamental limitations on deeponets, the basis τ therefore needs to additionally depend on the input u. LINEBREAK shift-deeponet. the lower bound (2.4) shows that there are fundamental barriers to the expressive power of operator learning methods based on linear reconstruction. this is of particular relevance for problems in which the optimal lower bound eopt in (2.4) exhibits a slow decay in terms of the number of basis functions p, due to the slow decay of the eigenvalues λj of the covariance operator. it is well-known that even linear advection- or transport-dominated problems can suffer from such a slow decay of the eigenvalues (ohlberger & rave, 2013; dahmen et al., 2014; taddei et al., 2015; peherstorfer, 2020), which could hinder the application of linear-reconstruction based operator learning methods to this very important class of problems. in view of these observations, it is thus desirable to develop a nonlinear variant of deeponet which can overcome such a lower bound in the context of transport-dominated problems. we propose such an extension below. a shift-deeponet n sdon : x → y is an operator of the form LINEBREAK n sdon(¯u)(y) = LINEBREAK βk(¯u)τk LINEBREAK ak(¯u)y + γk(¯u) LINEBREAK where the input function ¯u is encoded by evaluation at the sensor points e(¯u) ∈ rm. we retain the deeponet branch- and trunk-nets β, τ defined in (2.1), (2.2), respectively, and we have introduced a scale-net a = (ak)p LINEBREAK k=1, consisting of matrix-valued functions ak : rm → rd′×d′ , LINEBREAK e(¯u) (cid:55)→ ak(¯u) := ak(e(¯u)), LINEBREAK and a shift-net γ = (γk)p LINEBREAK k=1, with γk : rm → rd′ LINEBREAK e(¯u) (cid:55)→ γk(¯u) := γk(e(¯u)), LINEBREAK all components of a shift-deeponet are represented by deep neural networks, potentially with different activation functions. LINEBREAK remark 2.2. the form of shift-deeponet (2.5) is very natural from a theoretical perspective. practical experimentation indicates that an extended architecture based on a trunk-net τ ∗ : rd′×p → rp, depending jointly on all values a1(¯u)y + γ1(¯u), . . . , ap(¯u)y + γp(¯u) and defining a mapping LINEBREAK n sdon∗ LINEBREAK (¯u)(y) := LINEBREAK βk(¯u)τ ∗ k LINEBREAK a(¯u)y + γ(¯u) LINEBREAK with concatenated input a(¯u)y + γ(¯u) := (cid:0)a1(¯u)y + γ1(¯u), . . . , ap(¯u)y + γp(¯u)(cid:1) achieves better accuracy. our numerical results will be reported for (2.6). we emphasize that all theoretical results in this work apply to both architectures, (2.5) and (2.6). LINEBREAK since shift-deeponets reduce to deeponets for the particular choice a ≡ 1 and γ ≡ 0, the universality of deeponets (theorem 3.1 of lanthaler et al. (2022)) is clearly inherited by shiftdeeponets. however, as shift-deeponets do not use a linear reconstruction (the trunk nets in (2.5) depend on the input through the scale and shift nets), the lower bound (2.4) does not directly apply, providing possible space for shift-deeponet to efficiently approximate transport-dominated problems, especially in the presence of discontinuities. LINEBREAK fourier neural operators (fno). an fno n fno (li et al., 2021a) is a composition LINEBREAK n fno : x (cid:55)→ y : n fno = q ◦ ll ◦ · · · ◦ l1 ◦ r, LINEBREAK consisting of a ”lifting operator” ¯u(x) (cid:55)→ r(¯u(x), x), where r is represented by a (shallow) neural network r : rdu × rd → rdv with du the number of components of the input function, d the dimension of the domain and dv the ”lifting dimension” (a hyperparameter), followed by l hidden layers lℓ : vℓ(x) (cid:55)→ vℓ+1(x) of the form LINEBREAK vℓ+1(x) = σ (cid:0)wℓ · vℓ(x) + bℓ(x) + (cid:0)kℓvℓ(cid:1) (x)(cid:1) , with wℓ ∈ rdv×dv a weight matrix (residual connection), x (cid:55)→ bℓ(x) ∈ rdv a bias function and with a convolution operator kℓvℓ(x) = td κℓ(x − y)vℓ(y) dy, expressed in terms of a (learnable) integral kernel x (cid:55)→ κℓ(x) ∈ rdv×dv . the output function is finally obtained by a linear projection layer vl+1(x) (cid:55)→ n fno(¯u)(x) = q · vl+1(x). LINEBREAK the convolution operators kℓ add the indispensable non-local dependence of the output on the input function. given values on an equidistant cartesian grid, the evaluation of kℓvℓ can be efficiently carried out in fourier space based on the discrete fourier transform (dft), leading to a representation LINEBREAK kℓvℓ = f −1 n LINEBREAK (cid:0)pℓ(k) · fn vℓ(k)(cid:1) , LINEBREAK where fn vℓ(k) denotes the fourier coefficients of the dft of vℓ(x), computed based on the given n grid values in each direction, pℓ(k) ∈ cdv×dv is a complex fourier multiplication matrix indexed by k ∈ zd, and f −1 n denotes the inverse dft. in practice, only a finite number of fourier modes can be computed, and hence we introduce a hyperparameter kmax ∈ n, such that the fourier coefficients of bℓ(x) as well as the fourier multipliers, (cid:98)bℓ(k) ≡ 0 and pℓ(k) ≡ 0, vanish whenever |k|∞ > kmax. in particular, with fixed kmax the dft and its inverse can be efficiently computed in o(((2kmax + 1)n )d) operations (i.e. linear in the total number of grid points). the output space of fno (2.7) is manifestly nonlinear as it is not spanned by a fixed number of basis functions. hence, fno constitute a nonlinear reconstruction method. LINEBREAK theoretical results. LINEBREAK context. our aim in this section is to rigorously prove that the nonlinear reconstruction methods (shift-deeponet, fno) efficiently approximate operators stemming from discontinuous solutions of pdes whereas linear reconstruction methods (deeponet, pca-net) fail to do so. to this end, we follow standard practice in numerical analysis of pdes (hesthaven, 2018) and choose two prototypical pdes that are widely used to analyze numerical methods for transport-dominated pdes. these are the linear transport or advection equation and the nonlinear inviscid burgers’ equation, which is the prototypical example for hyperbolic conservation laws. the exact operators and the corresponding approximation results with both linear and nonlinear reconstruction methods are described below. the computational complexity of the models is expressed in terms of hyperparameters such as the model size, which are described in detail in sm b. LINEBREAK linear advection equation. we consider the one-dimensional linear advection equation LINEBREAK ∂tu + a∂xu = 0, LINEBREAK u( · , t = 0) = ¯u LINEBREAK on a 2π-periodic domain d = t, with constant speed a ∈ r. the underlying operator is gadv : l1(t) ∩ l∞(t) → l1(t) ∩ l∞(t), ¯u (cid:55)→ gadv(¯u) := u( · , t ), obtained by solving the pde (3.1) with initial data ¯u up to any final time t = t . we note that x = l1(t) ∩ l∞(t) ⊂ l2(t). as input measure µ ∈ prob(x ), we consider random input functions ¯u ∼ µ given by the square (box) wave of height h, width w and centered at ξ, LINEBREAK ¯u(x) = h1[−w/2,+w/2](x − ξ), (3.2) where h ∈ [h, ¯h], w ∈ [w, ¯w] ξ ∈ [0, 2π] are independent and uniformly identically distributed. the constants 0 < h ≤ ¯h, 0 < w ≤ ¯w are fixed. LINEBREAK deeponet fails at approximating gadv efficiently. our first rigorous result is the following lower bound on the error incurred by deeponet (2.3) in approximating gadv, LINEBREAK theorem 3.1. let p, m ∈ n. there exists a constant c > 0, independent of m, p and t , such that for any deeponet n don (2.3), with sup¯u∼µ ∥n don(¯u)∥l∞ ≤ m < ∞, we have the lower bound (cid:2)∥gadv(¯u) − n don(¯u)∥l1 LINEBREAK e = e¯u∼µ LINEBREAK (cid:3) ≥ LINEBREAK c min(m, p) LINEBREAK consequently, to achieve e (n don) ≤ ϵ with deeponet, we need p, m ≳ ϵ−1 trunk and branch net basis functions and sensor points, respectively, entailing that size(n don) ≳ pm ≳ ϵ−2 (cp. sm b). LINEBREAK the detailed proof is presented in sm d.2. it relies on two facts. first, following lanthaler et al. (2022), one observes that translation invariance of the problem implies that the fourier basis is optimal for spanning the output space. as the underlying functions are discontinuous, the corresponding eigenvalues of the covariance operator for the push-forward measure decay, at most, quadratically in p. consequently, the lower bound (2.4) leads to a linear decay of error in terms of the number of trunk net basis functions. second, roughly speaking, the linear decay of error in terms of sensor points is a consequence of the fact that one needs sufficient number of sensor points to resolve the underlying discontinuous inputs. LINEBREAK shift-deeponet approximates gadv efficiently. next and in contrast to the previous result on deeponet, we have following efficient approximation result for shift-deeponet (2.5), LINEBREAK theorem 3.2. there exists a constant c > 0, independent of t , such that for any ϵ > 0 there exists a shift-deeponet n sdon LINEBREAK (cid:2)∥gadv(¯u) − n sdon with uniformly bounded p ≤ c, and with the number of sensor points m ≤ cϵ−1. furthermore, we have LINEBREAK (cid:3) ≤ ϵ, LINEBREAK (2.5) such that e = e¯u∼µ LINEBREAK width(n sdon LINEBREAK ) ≤ c, LINEBREAK depth(n sdon LINEBREAK size(n sdon ϵ LINEBREAK the detailed proof, presented in sm d.3, is based on the fact that for each input, the exact solution can be completely determined in terms of three variables, i.e., the height h, width w and shift ξ of the box wave (3.2). given an input ¯u, we explicitly construct neural networks for inferring each of these variables with high accuracy. these neural networks are then combined together to yield a shift-deeponet that approximates gadv, with the desired complexity. the nonlinear dependence of the trunk net in shift-deeponet (2.5) on the input is the key to encode the shift in the box-wave (3.2) and this demonstrates the necessity of nonlinear reconstruction in this context. LINEBREAK fno approximates gadv efficiently. finally, we state an efficient approximation result for gadv with fno (2.7) below, where the constant c > 0 is again independent of the final time t : LINEBREAK theorem 3.3. there exists c > 0, such that for any ϵ > 0, there exists an fno n fno LINEBREAK (cid:2)∥gadv(¯u) − n fno with grid size n ≤ cϵ−1, and with fourier cut-off kmax, lifting dimension dv, depth and size: ) ≤ c log(ϵ−1)2. LINEBREAK depth(n fno LINEBREAK size(n fno LINEBREAK (cid:3) ≤ ϵ, LINEBREAK e¯u∼µ LINEBREAK kmax = 1, LINEBREAK dv ≤ c, LINEBREAK a priori, one recognizes that gadv can be represented by fourier multipliers (see sm d.4). consequently, a single linear fno layer would in principle suffice in approximating gadv. however, the size of this fno would be exponentially larger than the bound in theorem 3.3. to obtain a more efficient approximation, one needs to leverage the nonlinear reconstruction within fno layers. this is provided in the proof, presented in sm d.4, where the underlying height, wave and shift of the box-wave inputs (3.2) are approximated with high accuracy by fno layers. these are then combined together with a novel representation formula for the solution to yield the desired fno. comparison. observing the complexity bounds in theorems 3.1, 3.2, 3.3, we note that the deeponet size scales at least quadratically, size ≳ ϵ−2, in terms of the error in approximating gadv, whereas for shift-deeponet and fno, this scaling is only linear and logarithmic, respectively. thus, we rigorously prove that for this problem, the nonlinear reconstruction methods (fno and shift-deeponet) can be more efficient than deeponet and other methods based on linear reconstruction. moreover, fno is shown to have a smaller approximation error than even shift-deeponet for similar model size. we provide two remarks on extensions of these results to the approximation of the time-evolution and to higher dimensions in sm c. LINEBREAK inviscid burgers’ equation. next, we consider the inviscid burgers’ equation in one-space dimension, which is considered the prototypical example of nonlinear hyperbolic conservation laws (dafermos, 2005): LINEBREAK ∂tu + ∂x LINEBREAK u( · , t = 0) = ¯u, LINEBREAK on the 2π-periodic domain d = t. it is well-known that discontinuities in the form of shock waves can appear in finite-time even for smooth ¯u. consequently, solutions of (3.4) are interpreted in the sense of distributions and entropy conditions are imposed to ensure uniqueness (dafermos, 2005). thus, the underlying solution operator is gburg : l1(t) ∩ l∞(t) → l1(t) ∩ l∞(t), ¯u (cid:55)→ gburg(¯u) := u( · , t ), with u being the entropy solution of (3.4) at final time t . given ξ ∼ unif([0, 2π]), we define the random field LINEBREAK ¯u(x) := − sin(x − ξ), (3.5) and we define the input measure µ ∈ prob(l1(t) ∩ l∞(t)) as the law of ¯u. we emphasize that the difficulty in approximating the underlying operator gburg arises even though the input functions are smooth, in fact analytic. this is in contrast to the linear advection equation. LINEBREAK deeponet fails at approximating gburg efficiently. first, we recall the following result, which follows directly from lanthaler et al. (2022) (theorem 4.19) and the lower bound (2.4), LINEBREAK theorem 3.4. assume that gburg = u( · , t ), for t > π and u is the entropy solution of (3.4) with initial data ¯u ∼ µ. there exists a constant c > 0, such that the l2-error for any deeponet n don with p trunk-/branch-net output functions is lower-bounded by LINEBREAK consequently, achieving an error e (n don LINEBREAK e (n don) = e¯u∼µ LINEBREAK (cid:2)∥gburg(¯u) − n don(¯u)∥l1 LINEBREAK c p ) ≲ ϵ requires at least size(n don LINEBREAK (cid:3) ≥ LINEBREAK shift-deeponet approximate gburg efficiently. in contrast to deeponet, we have the following result for efficient approximation of gburg with shift-deeponet, LINEBREAK theorem 3.5. assume that t > π. there is a constant c > 0, such that for any ϵ > 0, there exists a shift-deeponet n sdon LINEBREAK such that LINEBREAK (3.7) with a uniformly bounded number p ≤ c of trunk/branch net functions, the number of sensor points can be chosen m = 3, and we have LINEBREAK e (n sdon ϵ LINEBREAK ) = e¯u∼µ LINEBREAK (cid:2)∥gburg(¯u) − n sdon LINEBREAK (cid:3) ≤ ϵ, LINEBREAK width(n sdon LINEBREAK ) ≤ c, LINEBREAK depth(n sdon LINEBREAK size(n sdon ϵ LINEBREAK the proof, presented in sm d.5, relies on an explicit representation formula for gburg, obtained using the method of characteristics (even after shock formation). then, we leverage the analyticity of the underlying solutions away from the shock and use the nonlinear shift map in (2.5) to encode shock locations. careful inspection of the proof implies that the constant c is independent of t > π. LINEBREAK fno approximates gburg efficiently finally we prove (in sm d.6) the following theorem, LINEBREAK theorem 3.6. assume that t > π, then there exists a constant c (again independent of t ), such that for any ϵ > 0 and grid size n ≥ 3, there exists an fno n fno (cid:2)∥gburg(¯u) − n fno LINEBREAK (2.7), such that (cid:3) ≤ ϵ, (¯u)∥l1 LINEBREAK ) = e¯u∼µ and with fourier cut-off kmax, lifting dimension dv and depth satisfying, depth(n fno LINEBREAK size(n fno LINEBREAK e (n fno ϵ LINEBREAK kmax = 1, LINEBREAK dv ≤ c, LINEBREAK comparison. a perusal of the bounds in theorems 3.4, 3.5 and 3.6 reveals that after shock formation, the accuracy ϵ of the deeponet approximation of gburg scales at best as ϵ ∼ n−1, in terms of the total number of degrees of freedom n = size(n don) of the deeponet. in contrast, shiftdeeponet and fno based on a nonlinear reconstruction can achieve an exponential convergence rate ϵ ≲ exp(−cn1/2) in the total number of degrees of freedom n = size(n sdon), size(n fno), even after the formation of shocks. this again highlights the expressive power of nonlinear reconstruction methods in approximating operators of pdes with discontinuities. LINEBREAK resnet LINEBREAK fcnn LINEBREAK deeponet LINEBREAK shift - deeponet LINEBREAK fno LINEBREAK advection equation LINEBREAK burgers’ equation LINEBREAK shocktube problem LINEBREAK 2d riemann problem LINEBREAK table 1: relative median-l1 error computed over 128 testing samples for different benchmarks with different models. LINEBREAK experiments LINEBREAK in this section, we illustrate how different operator learning frameworks can approximate solution operators of pdes with discontinuities. to this end, we will compare deeponet (2.3) (a prototypical operator learning method with linear reconstruction) with (the extended) shift-deeponet (2.6) and fno (2.7) (as nonlinear reconstruction methods). moreover, two additional baselines (described in detail in sm e.1) are also used, namely the well-known resnet architecture of he et al. (2016) and a fully convolutional neural network (fcnn) of long et al. (2015). below, we present results for the best performing hyperparameter configuration, obtained after a grid search, for each model while postponing the description of details for the training procedures, hyperparameter configurations and model parameters to sm e.1. LINEBREAK linear advection. we start with the linear advection equation (3.1) in the domain [0, 1] with wave speed a = 0.5 and periodic boundary conditions. the initial data is given by (3.2) corresponding to square waves, with initial heights uniformly distributed between h = 0.2 and h = 0.8, widths between w = 0.05 and w = 0.3 and shifts between 0 and 0.5. we seek to approximate the solution operator gadv at final time t = 0.25. the training and test samples are generated by sampling the initial data and the underlying exact solution, given by translating the initial data by 0.125, sampled on a very high-resolution grid of 2048 points (to keep the discontinuities sharp), see sm figure 10 for examples of the input and output of gadv. the relative median test error for all the models are shown in table 1. we observe from this table that deeponet performs relatively poorly with a high test error of approximately 8%, although its outperforms the resnet and fcnn baselines handily. as suggested by the theoretical results of the previous section, shift-deeponet is significantly more accurate than deeponet (and the baselines), with at least a two-fold gain in accuracy. moreover, as predicted by the theory, fno significantly outperforms even shift-deeponet on this problem, with almost a five-fold gain in test accuracy and a thirteen-fold gain vis a vis deeponet. LINEBREAK inviscid burgers’ equation. next, we consider the inviscid burgers’ equation (3.4) in the domain d = [0, 1] and with periodic boundary conditions. the initial data is sampled from a gaussian random field i.e., a gaussian measure corresponding to the (periodization of) frequently used covariance kernel, LINEBREAK k(x, x′) = exp LINEBREAK with correlation length ℓ = 0.06. the solution operator gburg corresponds to evaluating the entropy solution at time t = 0.1. we generate the output data with a high-resolution finite volume scheme, implemented within the alsvinn code lye (2020), at a spatial mesh resolution of 1024 points. examples of input and output functions, shown in sm figure 11, illustrate how the smooth yet oscillatory initial datum evolves into many discontinuities in the form of shock waves, separated by lipschitz continuous rarefactions. given this complex structure of the entropy solution, the underlying solution operator is hard to learn. the relative median test error for all the models is presented in table 1 and shows that deeponet (and the baselines resnet and fcnn) have an unacceptably high error between 20 and 30%. in fact, deeponet performs worse than the two baselines. however, consistent with the theory of the previous section, this error is reduced more than three-fold with the nonlinear shift-deeponet. the error is reduced even further by fno and in this case, fno outperforms deeponet by a factor of almost 20 and learns the very complicated solution operator with an error of only 1.5% LINEBREAK compressible euler equations. the motion of an inviscid gas is described by the euler equations of aerodynamics. for definiteness, the euler equations in two space dimensions are, LINEBREAK ut + f(u)x + g(u)y = 0, u = LINEBREAK , f(u) = LINEBREAK , g(u) = LINEBREAK ρ ρu ρv e LINEBREAK ρu ρu2 + p ρuv (e + p)u LINEBREAK ρv ρuv ρv2 + p (e + p)v LINEBREAK (4.1) with ρ, u, v and p denoting the fluid density, velocities along x-and y-axis and pressure. e represents the total energy per unit volume LINEBREAK e = LINEBREAK where γ = cp/cv is the gas constant which equals 1.4 for a diatomic gas considered here. LINEBREAK shock tube. we start by restricting the euler equations (4.1) to the one-dimensional domain d = [−5, 5] by setting v = 0 in (4.1). the initial data corresponds to a shock tube of the form, LINEBREAK (cid:26)ul x ≤ x0 ur x > x0 LINEBREAK (cid:26)pl x ≤ x0 pr x > x0 LINEBREAK parameterized by the left and right states (ρl, ul, pl), (ρr, ur, pr), and the location of the initial discontinuity x0. as proposed in lye et al. (2020), these parameters are, in turn, drawn from the measure; ρl = 0.75 + 0.45g(z1), ρr = 0.4 + 0.3g(z2), ul = 0.5 + 0.5g(z3), ur = 0, pl = 2.5 + 1.6g(z4), pr = 0.375 + 0.325g(z5), x0 = 0.5g(z6), with z = [z1, z2, . . . z6] ∼ u (cid:0)[0, 1]6(cid:1) and g(z) := 2z − 1. we seek to approximate the operator g : [ρ0, ρ0u0, e0] (cid:55)→ e(1.5). the training (and test) output are generated with alsvinn code lye (2020), using a finite volume scheme, with a spatial mesh resolution of 2048 points and examples of input-output pairs, presented in sm figure 12 show that the initial jump discontinuities in density, velocity and pressure evolve into a complex pattern of (continuous) rarefactions, contact discontinuities and shock waves. the (relative) median test errors, presented in table 1, reveal that shift-deeponet and fno significantly outperform deeponet (and the other two baselines). fno is also better than shift-deeponet and approximates this complicated solution operator with a median error of ≈ 1.5%. LINEBREAK four-quadrant riemann problem. for the final numerical experiment, we consider the two-dimensional euler equations (4.1) with initial data, corresponding to a well-known four-quadrant riemann problem (mishra & tadmor, 2011) with u0(x, y) = usw, if x, y < 0, u0(x, y) = use, if x < 0, y > 0, u0(x, y) = unw, if x > 0, y < 0 and u0(x, y) = une, if x, y > 0, with states given by ρ0,ne = ρ0,sw = p0,ne = p0,sw = 1.1, ρ0,nw = ρ0,se = 0.5065, LINEBREAK [u0,se, u0,sw, v0,nw, v0,sw] LINEBREAK p0,nw = p0,se = 0.35 [u0,ne, u0,nw, v0,ne, v0,se] = 0.35[g(z1), g(z2), g(z3), g(z4)] 0.8939 + 0.35[g(z5), g(z6), g(z7), g(z48], with and z = [z1, z2, . . . z8] ∼ u (cid:0)[0, 1]8(cid:1) and g(z) = 2z − 1. we seek to approximate the operator g : [ρ0, ρ0u0, ρ0v0, e0] (cid:55)→ e(1.5). the training (and test) output are generated with the alsvinn code, on a spatial mesh resolution of 2562 points and examples of input-output pairs, presented in sm figure 13, show that the initial planar discontinuities in the state variable evolve into a very complex structure of the total energy at final time, with a mixture of curved and planar discontinuities, separated by smooth regions. the (relative) median test errors are presented in table 1. we observe from this table that the errors with all models are significantly lower in this test case, possibly on account of the lower initial variance and coarser mesh resolution at which the reference solution is sampled. however, the same trend, vis a vis model performance, is observed i.e., deeponet is significantly (more than seven-fold) worse than both shift-deeponet and fno. on the other hand, these two models approximate the underlying solution operator with a very low error of approximately 0.1%. LINEBREAK discussion LINEBREAK related work. although the learning of operators arising from pdes has attracted great interest in recent literature, there are very few attempts to extend the proposed architectures to pdes with discontinuous solutions. empirical results for some examples of discontinuities or sharp gradients were presented in mao et al. (2020b) (compressible navier-stokes equations with deeponets) kissas et al. (2022) (shallow-water equations with an attention based framework) and in seidman et al. (2022) (free-surface waves based on a “operator learning manifold hypothesis”). however, with the notable exception of lanthaler et al. (2022) where the approximation of scalar conservation laws with deeponets is analyzed, theoretical results for the operator approximation of pdes are not available. hence, this paper can be considered to be the first where a rigorous analysis of approximating operators arising in pdes with discontinuous solutions has been presented, particularly for fnos. on the other hand, there is considerably more work on the neural network approximation of parametric nonlinear hyperbolic pdes such as the theoretical results of de ryck & mishra (2022a) and empirical results of lye et al. (2020; 2021). also related are results with physics informed neural networks or pinns for nonlinear hyperbolic conservation laws such as de ryck et al. (2022); jagtap et al. (2022); mao et al. (2020a). however, in this setting, the input measure is assumed to be supported on a finite-dimensional subset of the underlying infinite-dimensional input function space, making them too restrictive for operator learning as described in this paper. LINEBREAK conclusions. LINEBREAK a priori, it could be difficult to approximate operators that arise in pdes with discontinuities. given this context, we have proved a rigorous lower bound to show that any operator learning architecture, based on linear reconstruction, may fail at approximating the underlying operator efficiently. in particular, this result holds for the popular deeponet architecture. LINEBREAK on the other hand, we rigorously prove that the incorporation of nonlinear reconstruction mechanisms can break this lower bound and pave the way for efficient learning of operators arising from pdes with discontinuities. we prove this result for an existing widely used architecture i.e., fno, and a novel variant of deeponet that we term as shift-deeponet. for instance, we show that while the approximation error for deeponets can decay, at best, linearly in terms of model size, the corresponding approximation errors for shift-deeponet and fno decays exponentially in terms of model size, even in the presence or spontaneous formation of discontinuities. LINEBREAK these theoretical results are backed by experimental results where we show that fno and shiftdeeponet consistently beat deeponet and other ml baselines by a wide margin, for a variety of pdes with discontinuities. LINEBREAK moreover, we also find theoretically (compare theorems 3.2 and 3.3) that fno is more efficient than even shift-deeponet. this fact is also empirically confirmed in our experiments. the non-local as well as nonlinear structure of fno is instrumental in ensuring its excellent performance in this context, see theorem 3.3 and sm e.2 for further demonstration of the role of nonlinear reconstruction for fnos. LINEBREAK references LINEBREAK kaushik bhattacharya, bamdad hosseini, nikola b kovachki, and andrew m stuart. model reduction and neural networks for parametric pdes. the smai journal of computational mathematics, 7:121–157, 2021. LINEBREAK shengze cai, zhicheng wang, lu lu, tamer a zaki, and george em karniadakis. deepm&mnet: inferring the electroconvection multiphysics fields based on operator approximation by neural networks. journal of computational physics, 436:110296, 2021. LINEBREAK tianping chen and hong chen. universal approximation to nonlinear operators by neural networks with arbitrary activation functions and its application to dynamical systems. ieee transactions on neural networks, 6(4):911–917, 1995. LINEBREAK c. m. dafermos. hyperbolic conservation laws in continuum physics (2nd ed.). springer verlag, LINEBREAK wolfgang dahmen, christian plesken, and gerrit welper. double greedy algorithms: reduced basis methods for transport dominated problems. esaim: mathematical modelling and numerical analysis, 48(3):623–663, 2014. LINEBREAK t. de ryck and s. mishra. error analysis for deep neural network approximations of parametric LINEBREAK hyperbolic conservation laws. arxiv preprint arxiv:2207.07362, 2022a. LINEBREAK t. de ryck, s. mishra, and r. molinaro. wpinns:weak physics informed neural networks for approximating entropy solutions of hyperbolic conservation laws. arxiv preprint arxiv:2207.08483, 2022. LINEBREAK tim de ryck and siddhartha a mishra. generic bounds on the approximation error for physicsin advances in neural information processing systems LINEBREAK informed (and) operator learning. (neurips), 2022b. LINEBREAK beichuan deng, yeonjong shin, lu lu, zhongqiang zhang, and george em karniadakis. approximation rates of deeponets for learning operators arising from advection–diffusion equations. neural networks, 153:411–426, 2022. issn 0893-6080. doi: https://doi.org/10.1016/j. neunet.2022.06.019. url https://www.sciencedirect.com/science/article/ pii/s0893608022002349. LINEBREAK d. a. drew and s. l. passman. theory of multicomponent fluids. springer verlag, new york, 1998. LINEBREAK dennis elbr¨achter, dmytro perekrestenko, philipp grohs, and helmut b¨olcskei. deep neural network LINEBREAK approximation theory. ieee transactions on information theory, 67(5):2581–2623, 2021. LINEBREAK ian goodfellow, yoshua bengio, and aaron courville. deep learning. mit press, 2016. LINEBREAK kaiming he, xiangyu zhang, shaoqing ren, and jian sun. deep residual learning for image recognition. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 770–778, 2016. LINEBREAK j. s. hesthaven. numerical methods for conservation laws: from analysis to algorithms. siam, LINEBREAK jan s hesthaven and stefano ubbiali. non-intrusive reduced order modeling of nonlinear problems LINEBREAK using neural networks. journal of computational physics, 363:55–78, 2018. LINEBREAK irina higgins. generalizing universal function approximators. nature machine intelligence, 3(3): LINEBREAK ameya d. jagtap, zhiping mao, nikolaus adams, and george em karniadakis. physics-informed neural networks for inverse problems in supersonic flows. journal of computational physics, 466:111402, october 2022. issn 0021-9991. doi: 10.1016/j.jcp.2022.111402. url https: //www.sciencedirect.com/science/article/pii/s0021999122004648. LINEBREAK georgios kissas, jacob h seidman, leonardo ferreira guilhoto, victor m preciado, george j pappas, and paris perdikaris. learning operators with coupled attention. journal of machine learning research, 23(215):1–63, 2022. LINEBREAK n. kovachki, z. li, b. liu, k. azizzadensheli, k. bhattacharya, a. stuart, and a. anandkumar. neural operator: learning maps between function spaces. arxiv preprint arxiv:2108.08481v3, 2021a. LINEBREAK nikola kovachki, samuel lanthaler, and siddhartha mishra. on universal approximation and error bounds for fourier neural operators. journal of machine learning research, 22:art–no, 2021b. LINEBREAK samuel lanthaler, siddhartha mishra, and george e karniadakis. error estimates for deeponets: a deep learning framework in infinite dimensions. transactions of mathematics and its applications, 6(1):tnac001, 2022. url https://academic.oup.com/imatrm/article-pdf/6/ 1/tnac001/42785544/tnac001.pdf. LINEBREAK zongyi li, nikola b kovachki, kamyar azizzadenesheli, burigede liu, kaushik bhattacharya, andrew m stuart, and anima anandkumar. neural operator: graph kernel network for partial differential equations. corr, abs/2003.03485, 2020a. LINEBREAK zongyi li, nikola b kovachki, kamyar azizzadenesheli, burigede liu, andrew m stuart, kaushik bhattacharya, and anima anandkumar. multipole graph neural operator for parametric partial differential equations. in h. larochelle, m. ranzato, r. hadsell, m. f. balcan, and h. lin (eds.), advances in neural information processing systems (neurips), volume 33, pp. 6755–6766. curran associates, inc., 2020b. LINEBREAK zongyi li, nikola borislavov kovachki, kamyar azizzadenesheli, burigede liu, kaushik bhattacharya, andrew stuart, and anima anandkumar. fourier neural operator for parametric partial differential equations. in international conference on learning representations, 2021a. url https://openreview.net/forum?id=c8p9nqvtmno. LINEBREAK zongyi li, hongkai zheng, nikola kovachki, david jin, haoxuan chen, burigede liu, kamyar azizzadenesheli, and anima anandkumar. physics-informed neural operator for learning partial differential equations. arxiv preprint arxiv:2111.03794, 2021b. LINEBREAK chensen lin, zhen li, lu lu, shengze cai, martin maxey, and george em karniadakis. operator learning for predicting multiscale bubble growth dynamics. the journal of chemical physics, 154 (10):104118, 2021. LINEBREAK jonathan long, evan shelhamer, and trevor darrell. fully convolutional networks for semantic segmentation. in proceedings of the ieee conference on computer vision and pattern recognition, pp. 3431–3440, 2015. LINEBREAK lu lu, pengzhan jin, and george em karniadakis. deeponet: learning nonlinear operators for identifying differential equations based on the universal approximation theorem of operators. arxiv preprint arxiv:1910.03193, 2019. LINEBREAK lu lu, pengzhan jin, guofei pang, zhongqiang zhang, and george em karniadakis. learning nonlinear operators via deeponet based on the universal approximation theorem of operators. nature machine intelligence, 3(3):218–229, 2021. LINEBREAK k. 0. lye. computation of statistical solutions of hyperbolic systems of conservation laws. eth LINEBREAK kjetil o lye, siddhartha mishra, and deep ray. deep learning observables in computational fluid LINEBREAK dynamics. journal of computational physics, pp. 109339, 2020. LINEBREAK kjetil o lye, siddhartha mishra, deep ray, and praveen chandrashekar. iterative surrogate model optimization (ismo): an active learning algorithm for pde constrained optimization with deep neural networks. computer methods in applied mechanics and engineering, 374:113575, 2021. LINEBREAK z. mao, a. d. jagtap, and g. e. karniadakis. physics-informed neural networks for high-speed flows. LINEBREAK computer methods in applied mechanics and engineering, 360:112789, 2020a. LINEBREAK z. mao, l. lu, o. marxen, t. zaki, and g. e. karniadakis. deepmandmnet for hypersonics: predicting the coupled flow and finite-rate chemistry behind a normal shock using neural-network approximation of operators. preprint, available from arxiv:2011.03349v1, 2020b. LINEBREAK siddhartha mishra and eitan tadmor. constraint preserving schemes using potential based fluxesii: genuinely multi-dimensional schemes for systems of conservation laws,. siam journal on numerical analysis, 49:1023–1045, 2011. LINEBREAK mario ohlberger and stephan rave. nonlinear reduced basis approximation of parameterized evolution equations via the method of freezing. comptes rendus mathematique, 351(23):901– 906, 2013. issn 1631-073x. doi: https://doi.org/10.1016/j.crma.2013.10.028. url https: //www.sciencedirect.com/science/article/pii/s1631073x13002847. LINEBREAK j. pathak, s. subramanian, p. harrington, s. raja, a. chattopadhyay, m. mardani, t. kurth, d. hall, z. li, k. azizzadenesheli, p. hassanzadeh, k. kashinath, and a. anandkumar. fourcastnet: a global data-driven high-resolution weather model using adaptive fourier neural operators. arxiv preprint arxiv:2202.11214, 2022. LINEBREAK benjamin peherstorfer. model reduction for transport-dominated problems via online adaptive bases LINEBREAK and adaptive sampling. siam journal on scientific computing, 42(5):a2803–a2836, 2020. LINEBREAK jacob h seidman, georgios kissas, paris perdikaris, and george j pappas. nomad: nonlinear LINEBREAK manifold decoders for operator learning. arxiv preprint arxiv:2206.03551, 2022. LINEBREAK j. smoller. shock waves and reaction-diffusion equations. springer, 2012. LINEBREAK c.t. sun and z-h. jin. fracture mechanics. elsevier, 2012. LINEBREAK tommaso taddei, simona perotto, and alfio quarteroni. reduced basis techniques for nonlinear conservation laws. esaim: mathematical modelling and numerical analysis, 49(3):787–814, 2015. LINEBREAK qingcan wang et al. exponential convergence of the deep neural network approximation for analytic LINEBREAK dmitry yarotsky. error bounds for approximations with deep relu networks. neural networks, 94: LINEBREAK supplementary material for: nonlinear reconstruction for operator learning of pdes with discontinuities. LINEBREAK a principal component analysis LINEBREAK principal component analysis (pca) provides a complete answer to the following problem (see e.g. bhattacharya et al. (2021); lanthaler et al. (2022) and references therein for relevant results in the infinite-dimensional context): given a probability measure ν ∈ prob(y) on a hilbert space y and given p ∈ n, we would like to characterize the optimal linear subspace (cid:98)vp ⊂ y of dimension p, which minimizes the average projection error LINEBREAK ew∼ν LINEBREAK ∥w − π LINEBREAK (cid:98)vp LINEBREAK = min LINEBREAK dim(vp)=p LINEBREAK ew∼ν LINEBREAK (cid:2)∥w − πvp w∥2 LINEBREAK y LINEBREAK (cid:3) , LINEBREAK where πvp denotes the orthogonal projection onto vp, and the minimum is taken over all pdimensional linear subspaces vp ⊂ x . LINEBREAK remark a.1. a characterization of the minimum in a.1 is of relevance to the present work, since the outputs of deeponet, and other operator learning frameworks based on linear reconstruction n (u) = (cid:80)p k=1 βk(u)τk, are restricted to the linear subspace vp := span{τ1, . . . , τp}. from this, it follows that (lanthaler et al. (2022)): (cid:2)∥g(u) − n (u)∥2 LINEBREAK (cid:2)∥g(u) − πvp g(u)∥2 is lower bounded by the minimizer in (a.1) with ν = g#µ the push-forward measure of µ under g. LINEBREAK (cid:2)∥w − πvp w∥2 LINEBREAK (cid:3) = ew∼g#µ LINEBREAK (cid:3) ≥ eu∼µ LINEBREAK eu∼µ LINEBREAK (cid:3) , LINEBREAK y LINEBREAK y LINEBREAK y LINEBREAK to characterize minimizers of (a.1), one introduces the covariance operator γν : y → y, by γν := ew∼ν [w ⊗ w], where ⊗ denotes the tensor product. by definition, γν satisfies the following relation LINEBREAK ⟨v′, γνv⟩y = ew∼ν [⟨v′, w⟩y ⟨w, v⟩y ] , LINEBREAK ∀ v, v′ ∈ y. LINEBREAK it is well-known that γν possesses a complete set of orthonormal eigenfunctions ϕ1, ϕ2, . . . , with corresponding eigenvalues λ1 ≥ λ2 ≥ · · · ≥ 0. we then have the following result (see e.g. (lanthaler et al., 2022, thm. 3.8)): LINEBREAK theorem a.2. a subspace (cid:98)vp ⊂ y is a minimizer of (a.1) if, and only if, (cid:98)vp = span{ϕ1, . . . , ϕp} can be written as the span of the first p eigenfunctions of an orthonormal eigenbasis ϕ1, ϕ2, . . . of the covariance operator γν, with decreasing eigenvalues λ1 ≥ λ2 ≥ . . . . furthermore, the minimum in (a.1) is given by LINEBREAK e 2 opt = min LINEBREAK dim(vp)=p LINEBREAK ew∼ν LINEBREAK (cid:2)∥w − πvp w∥2 LINEBREAK y LINEBREAK (cid:3) = LINEBREAK j>p LINEBREAK λj, LINEBREAK in terms of the decay of the eigenvalues of γν. LINEBREAK illustrative example LINEBREAK to illustrate the close connection between the decay of pca eigenvalues and the sharpness of gradients in that distribution, we consider the solution operator g : l2(t) → l2(t) of the advection equation ∂tu + a∂xu = 0 with a = 1, mapping the initial data ¯u (cid:55)→ g(¯u) = u(t = 1) to the solution at time t = 1. we consider the input probability measure µ(0) ∈ p(l2) which is defined as the law of random indicator functions ¯u = 1[−w/2,w/2](x − ξ) on the periodic torus t = [0, 2π], where w ∈ [π/4, 3π/4] and ξ ∈ [0, 2π] are drawn uniformly at random and independently. for δ > 0, we define a “smoothened” probability measure µ(δ) on input functions, whose law is obtained by mollifying random draws ¯u from µ(0) against a gaussian mollifier gδ(x) with fourier coefficients (cid:98)gδ(k) = exp(−δ2k2), i.e. LINEBREAK µ(δ) = law LINEBREAK (a) representative sample from ν(δ) LINEBREAK (b) decay of pca eigenvalues λ(δ) k LINEBREAK figure 1: sharper gradients (at length scale δ) can cause a slow decay of the corresponding pca eigenvalues λ(δ) k . LINEBREAK we denote by ν(δ) = g#µ(δ) the push-forward measure under the solution operator g. observing that ν(δ) is a translation-invariant probability measure, and following (lanthaler et al., 2022, proof of lemma 4.14), we note that the pca eigenbasis is given by the standard fourier basis, and the eigenvalue associated with the eigenfunction eikx is given by LINEBREAK w (k)|2 dw, ψ(δ) LINEBREAK w (x)e−ikx dx denotes the k-th fourier coefficient of ψ(δ) LINEBREAK where (cid:98)ψ(δ) w , and ∆w = π/2 is a normalizing factor. we approximate (cid:101)λ(δ) k numerically by a (trapezoidal) quadrature in w with nw = 4001 quadrature points. for each value of w, we approximate the fourier coefficients (cid:98)ψ(δ) w (k) via the fast fourier transform of ψ(δ) w (x) computed on a fine grid of n = 104 equidistant points. the approximate pca eigenvalues are finally obtained by sorting the so computed eigenvalues in decreasing order and retaining only the first 1000, which yields a decreasing sequence λ(δ) 1 ≥ 2 ≥ · · · ≥ λ(δ) λ(δ) figure 1 compares and contrasts the decay of the pca eigenvalues for the probability measures ν(δ) with gradients at different length scales δ ∈ {0, 0.05, 0.2, 0.5}. we note that the theoretically predicted asymptotic λk ∼ ck−2 decay is recovered for δ = 0. LINEBREAK b measures of complexity for (shift-)deeponet and fno LINEBREAK as pointed out in the main text, there are several hyperparameters which determine the complexity of deeponet/shift-deeponet and fno, respectively. table 2 summarizes quantities of major importance for (shift-)deeponet and their (rough) analogues for fno. these quantities are directly relevant to the expressive power and trainability of these operator learning architectures, and are described in further detail below. LINEBREAK spatial resolution “intrinsic” function space dim. # trainable parameters depth width LINEBREAK (shift-)deeponet m p size(n ) depth(n ) width(n ) LINEBREAK fno ∼ n d max · dv LINEBREAK ∼ kd LINEBREAK size(n ) depth(n ) ∼ kd max · dv LINEBREAK figure 2: approximate correspondence between measures of the complexity (d=dimension of the domain d ⊂ rd of input/output functions). LINEBREAK (shift-)deeponet: quantities of interest include the number of sensor points m, the number of trunk-/branch-net functions p and the width, depth and size of the operator network. we first recall the definition of the width and depth for deeponet, LINEBREAK width(n don) := width(β) + width(τ ), depth(n don) := max {depth(β), depth(τ )} , where the width and depth of the conventional neural networks on the right-hand side are defined in terms of the maximum hidden layer width (number of neurons) and the number of hidden layers, respectively. to ensure a fair comparison between deeponet, shift-deeponet and fno, we define the size of a deeponet assuming a fully connected (non-sparse) architecture, as LINEBREAK size(n don) := (m + p)width(n don) + width(n don)2depth(n don), where the second term measures the complexity of the hidden layers, and the first term takes into account the input and output layers. furthermore, all architectures we consider have a width which scales at least as width(n don) ≳ min(p, m), implying the following natural lower size bound, LINEBREAK size(n don) ≳ (m + p) min(p, m) + min(p, m)2depth(n don). LINEBREAK we also introduce the analogous notions for shift-deeponet: LINEBREAK width(n sdon) := width(β) + width(τ ) + width(a) + width(γ), depth(n sdon) := max {depth(β), depth(τ ), depth(a), depth(γ)} , LINEBREAK size(n sdon) := (m + p)width(n don) + width(n don)2depth(n don). LINEBREAK fno: quantities of interest for fno include the number of grid points in each direction n (for a total of o(n d) grid points), the fourier cut-off kmax (we retain a total of o(kd max) fourier coefficients in the convolution operator and bias), and the lifting dimension dv. we recall that the lifting dimension determines the number of components of the input/output functions of the hidden layers, and hence the “intrinsic” dimensionality of the corresponding function space in the hidden layers is proportional to dv. the essential informational content for each of these dv components is encoded in their fourier modes with wave numbers |k| ≤ kmax (a total of o(kd max) fourier modes per component), and hence the total intrinsic function space dimension of the hidden layers is arguably of order ∼ kd maxdv. the width of an fno layer is defined in analogy with conventional neural networks as the maximal width of the weight matrices and fourier multiplier matrices, which is of order ∼ kd max · dv. the depth is defined as the number of hidden layers l. finally, the size is by definition the total number of tunable parameters in the architecture. by definition, the fourier modes of the bias function bℓ(x) are restricted to wavenumbers |k| ≤ kmax (giving a total number of o(kd maxdv) parameters), and the fourier multiplier matrix is restricted to wave numbers |k| ≤ kmax (giving o(kd v) parameters). apriori, it is easily seen that if the lifting dimension dv is larger than the number of components of the input/output functions, then (kovachki et al., 2021b) LINEBREAK maxd2 LINEBREAK size(n fno) ≲ (cid:0)d2 LINEBREAK vkd LINEBREAK max + dvn d(cid:1) depth(n fno), LINEBREAK where the first term in parentheses corresponds to size(wℓ) = d2 v, the second term accounts for size(pℓ) = o(d2 max) and the third term counts the degrees of freedom of the bias, size(bℓ(xj)) = o(dvn d). the additional factor depth(n fno) takes into account that there are l = depth(n fno) such layers. LINEBREAK vkd LINEBREAK if the bias bℓ is constrained to have fourier coefficients (cid:98)bℓ(k) ≡ 0 for |k| > kmax (as we assumed in the main text), then the representation of bℓ only requires size((cid:98)bℓ(k)) = o(dvkd max) degrees of freedom. this is of relevance in the regime kmax ≪ n , reducing the total fno size from o(d2 vn dl) to LINEBREAK vkd practically, this amounts to adding the bias in the hidden layers in fourier k-space, rather than physical x-space. LINEBREAK maxdepth(n fno). LINEBREAK size(n fno) ≲ d2 LINEBREAK c extensions of theoretical results LINEBREAK in this section, we remark on two straight-forward extensions of our theoretical results in section 3. LINEBREAK c.1 time-evolution LINEBREAK we first consider the approximation of the time-evolution t (cid:55)→ u( · , t) for solutions of the linear advection equation LINEBREAK ∂tu + a∂xu = 0, LINEBREAK u( · , t = 0) = ¯u, LINEBREAK with ¯u drawn from the probability measure µ specified in (3.2) in the main text. LINEBREAK one way to apply neural operators to this time-evolution setting is by recursive application, where one fixes ∆t > 0, and learns an approximation n (¯u) ≈ s∆t(¯u) for the given time-step, with ¯u (cid:55)→ s∆t(¯u) given by the data-to-solution mapping ¯u (cid:55)→ u( · , ∆t) of the pde (c.1). given ¯u, an approximation of the time-evolution u( · , tj) at the discrete time-steps tj = j∆t for j = 1, . . . , nt with nt ∆t = t , is then obtained by iterative evaluations
| 15
|
[
108,
571.3560784,
505.24510325,
625.1546784
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.