id
stringlengths 33
34
| updated
timestamp[s] | published
timestamp[s] | title
stringlengths 9
212
| summary
stringlengths 75
2.46k
| author
sequence | arxiv:doi
stringlengths 0
71
| link
list | arxiv:journal_ref
sequence | arxiv:primary_category
dict | category
sequence | content
stringlengths 0
1.25M
|
---|---|---|---|---|---|---|---|---|---|---|---|
http://arxiv.org/abs/2302.12456v1 | 2023-02-24T05:14:27 | 2023-02-24T05:14:27 | Logarithmic Switching Cost in Reinforcement Learning beyond Linear MDPs | In many real-life reinforcement learning (RL) problems, deploying new
policies is costly. In those scenarios, algorithms must solve exploration
(which requires adaptivity) while switching the deployed policy sparsely (which
limits adaptivity). In this paper, we go beyond the existing state-of-the-art
on this problem that focused on linear Markov Decision Processes (MDPs) by
considering linear Bellman-complete MDPs with low inherent Bellman error. We
propose the ELEANOR-LowSwitching algorithm that achieves the near-optimal
regret with a switching cost logarithmic in the number of episodes and linear
in the time-horizon $H$ and feature dimension $d$. We also prove a lower bound
proportional to $dH$ among all algorithms with sublinear regret. In addition,
we show the ``doubling trick'' used in ELEANOR-LowSwitching can be further
leveraged for the generalized linear function approximation, under which we
design a sample-efficient algorithm with near-optimal switching cost. | [
"Dan Qiao",
"Ming Yin",
"Yu-Xiang Wang"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12456v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12456v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"stat.ML"
] | Logarithmic Switching Cost in Reinforcement Learning
beyond Linear MDPs
Dan Qiao1, Ming Yin1,2, and Yu-Xiang Wang1
1Department of Computer Science, UC Santa Barbara
2Department of Statistics and Applied Probability, UC Santa Barbara
danqiao,ming yin
}
{
@ucsb.edu, [email protected]
Abstract
In many real-life reinforcement learning (RL) problems, deploying new policies is costly. In
those scenarios, algorithms must solve exploration (which requires adaptivity) while switching
the deployed policy sparsely (which limits adaptivity). In this paper, we go beyond the existing
state-of-the-art on this problem that focused on linear Markov Decision Processes (MDPs) by
considering linear Bellman-complete MDPs with low inherent Bellman error. We propose the
ELEANOR-LowSwitching algorithm that achieves the near-optimal regret with a switching cost
logarithmic in the number of episodes and linear in the time-horizon H and feature dimension
d. We also prove a lower bound proportional to dH among all algorithms with sublinear regret.
In addition, we show the "doubling trick" used in ELEANOR-LowSwitching can be further
leveraged for the generalized linear function approximation, under which we design a sample-
efficient algorithm with near-optimal switching cost.
3
2
0
2
b
e
F
4
2
]
G
L
.
s
c
[
1
v
6
5
4
2
1
.
2
0
3
2
:
v
i
X
r
a
1
Contents
1 Introduction
1.1 Related works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Problem setup
2.1 Low inherent Bellman error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Main algorithm
4 Main results
3
5
5
7
8
10
5 Proof sketch
11
5.1 Upper bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 Lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Extension to generalized linear function approximation
13
6.1 Problem setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.2 Low switching algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.3 Main results of Algorithm 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7 Conclusion and future work
15
A Proof of Theorem 4.1
19
A.1 Proof of switching cost bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
A.2 Proof of regret bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
B Proof of Theorem 4.2
22
C Proof for Section 6
23
C.1 Proof of upper bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
C.2 Proof of lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
D Assisting technical lemmas
25
2
1
Introduction
In many real-world reinforcement learning (RL) tasks, limited computing resources make it chal-
lenging to apply fully adaptive algorithms that continually update the exploration policy. As a
surrogate, it is more cost-effective to collect data in large batches using the current policy and
make changes to the policy after the entire batch is completed. For example, in a recommenda-
tion system [Afsar et al., 2021], it is easier to gather new data quickly, but deploying a new policy
takes longer as it requires significant computing and human resources. Therefore, it's not feasible
to switch policies based on real-time data, as typical RL algorithms would require. A practical
solution is to run several experiments in parallel and make decisions on policy updates only after
the entire batch has been completed. Similar limitations occur in other RL based applications such
as healthcare [Yu et al., 2021], robotics [Kober et al., 2013], and new material design [Zhou et al.,
2019], where the agent must minimize the number of policy updates while still learning an effective
policy using a similar number of trajectories as fully-adaptive methods. On the theoretical side,
Bai et al. [2019] brought up the definition of switching cost, which measures the number of policy
updates. In this paper, we measure the adaptivity of online reinforcement learning algorithms via
global switching cost, and we leave the formal definition to Section 2.
In recent years, there has been a growing interest in designing online reinforcement learning algo-
rithms with low switching costs [Bai et al., 2019, Zhang et al., 2020, Qiao et al., 2022, Gao et al.,
2021, Wang et al., 2021, Kong et al., 2021, Velegkas et al., 2022]. While much progress has been
made in achieving near-optimal results, most of the research has focused on the tabular MDP
setting and the slightly more general linear MDP setting [Yang and Wang, 2019, Jin et al., 2020].
However, linear MDP is still a restrictive model, and subsequent works have proposed a variety
of more general settings, such as low inherent Bellman error [Zanette et al., 2020], generalized lin-
ear function approximation [Wang et al., 2019], low Bellman rank [Jiang et al., 2017], low rank
[Agarwal et al., 2020], and low Bellman eluder dimension [Jin et al., 2021]. Therefore, it is natural
to question whether reinforcement learning with low switching cost is achievable under these more
general MDP settings.
Our contributions. In this paper, we extend previous results under linear MDP to its two natural
extensions, linear Bellman-complete MDPs with low inherent Bellman error [Zanette et al., 2020]
and MDP with genaralized linear function approximation [Wang et al., 2019]. Under both settings,
we design algorithms with near optimal regret and switching cost. Our contributions are three-fold
and summarized as below.
• A new algorithm (Algorithm 1) based on "doubling trick" for regret minimization under the
H
h=1 dh log K)
H
h=1 dh√K +
, where dh is the dimension of feature map
is the inherent Bellman error and K is the number of episodes (Theorem
low inherent Bellman error setting that achieves global switching cost of O(
H
h=1 √dh
and regret of
for the h-th layer,
4.1). The regret bound is known to be minimax optimal [Zanette et al., 2020].
(cid:16)P
I
P
P
K
O
(cid:17)
e
I
• When the inherent Bellman error
= 0, we prove a nearly matching switching cost lower
H
bound (Theorem 4.2) Ω(
h=1 dh) for any algorithm with sub-linear regret bound, which
implies that the switching cost of our Algorithm 1 is optimal up to log K factor. When
applied to linear MDP, Algorithm 1 achieves the same switching cost and better regret bound
compared to the previous results [Gao et al., 2021, Wang et al., 2021].
P
I
3
Setting
Low IBE
GLM
Algorithms for regret minimization
Our Algorithm 1 (Theorem 4.1)†
Our Algorithm 2 (Theorem 6.4)⋆
Algorithm 1 of Gao et al. [2021]‡
Linear MDP
UCB-Advantage [Zhang et al., 2020] Tabular MDP
Tabular MDP
Low IBE
GLM
APEVE [Qiao et al., 2022]
Lower bound (Theorem 4.2)
Lower bound (Theorem 6.5)
(cid:17)
O
e
Regret bound
H
h=1 dh√K
(cid:16)P
H√d3K
O
O(√d3H 4K)
(cid:16)
(cid:17)
e
O(√H 3SAK)
e
O(√H 5S2AK)
e
If "no-regret"
e
If "no-regret"
Switching cost bound
H
h=1 dh log K)
O(
O(dH log K)
P
O(dH log K)
O(H 2SA log K)∗
O(HSA log log K)
H
h=1 dh)
Ω(
Ω(dH)
P
Table 1: Comparison of our results (in blue) to existing works regarding regret bound and (global)
switching cost bound. "Low IBE" is short for low inherent Bellman error while "GLM" represents
generalized linear function approximation, where both settings generalize linear MDP. For both
"Low IBE" and "GLM" settings, we assume the total reward is bounded by 1. In particular, we show
the regret bound for "Low IBE" assuming the inherent Bellman error is 0 while the detailed result
is shown in Theorem 4.1. We highlight that our switching cost upper bounds under both settings
match the corresponding lower bounds up to logarithmic factors. †: Here dh is the dimension of
feature map for the h-th layer and K is the number of episodes. When applied to linear MDP, there
will be an additional factor of H in the regret bound while dh = d for all h. Therefore, regret bound
O(√d2H 4K) and O(dH log K), respectively. ⋆: When applied to
and switching cost bound will be
linear MDP, there will be an additional factor of H in the regret bound, and the regret bound will
: This result is generalized by Wang et al. [2021] whose algorithm has a same
be
‡
: The switching cost here is local switching cost
switching cost bound under this regret bound.
∗
(defined in Bai et al. [2019]), which is specified to tabular MDP.
O(√d3H 4K).
e
e
4
• We leverage the "doubling trick" used in Algorithm 1 under the generalized linear function
approximation setting and propose Algorithm 2 which achieves switching cost of O(dH log K)
and regret of
, where d is the dimension of feature map (Theorem 6.4). We also
prove a nearly matching switching cost lower bound of Ω(dH) for any algorithm with sub-
linear regret bound (Theorem 6.5). The pair of results strictly generalize previous results
under linear MDP [Gao et al., 2021, Wang et al., 2021].
H√d3K
O
(cid:17)
(cid:16)
e
1.1 Related works
There is a large and growing body of literature on the statistical theory of reinforcement learn-
ing that we will not attempt to thoroughly review. Detailed comparisons with existing work on
reinforcement learning with low switching cost [Gao et al., 2021, Wang et al., 2021, Zhang et al.,
2020, Qiao et al., 2022] are given in Table 1. Notably, the settings we consider are more general
than the well studied tabular or linear MDP, while our results for regret and switching cost are
comparable or better than the best known results under linear MDP [Gao et al., 2021, Wang et al.,
2021]. While there are low adaptive algorithms under other more general settings than linear MDP,
they either consider only pure exploration (without regret guarantee) [Jiang et al., 2017, Sun et al.,
2019], or suffer from sub-optimal results comparing to our results [Kong et al., 2021, Velegkas et al.,
2022].
In addition to switching cost, there are other measurements of adaptivity. The closest measure-
ment is batched learning, which requires decisions about policy updates to be made at only a
few (often predefined) checkpoints but does not constrain the number of policy switches. Batched
learning has been considered both under bandits [Perchet et al., 2016, Gao et al., 2019] and RL
[Wang et al., 2021, Qiao et al., 2022, Zhang et al., 2022b] while the settings are restricted to tabu-
lar MDP or linear MDP. Meanwhile, Matsushima et al. [2020] proposed the notion of deployment
efficiency, which is similar to batched RL with additional requirement that each policy deployment
should have similar size. Deployment efficient RL is studied by some following works [Huang et al.,
2022, Qiao and Wang, 2022, Modi et al., 2021]. However, as pointed out by Qiao and Wang [2022],
deployment complexity is not a good measurement of adaptivity when studying regret minimiza-
tion.
Technically speaking, we directly base on ELEANOR [Zanette et al., 2020] and Algorithm 1 of
Wang et al. [2019], which admit fully adaptive structure. We apply "doubling trick" when deciding
In particular,
whether to update the exploration policy, in order to achieve low switching cost.
we show that the "information gain" used in previous works under linear MDP [Gao et al., 2021,
Wang et al., 2021]: the determinant of empirical covariance matrix can be extended to more general
MDPs with linear approximation. Therefore, we only update the exploration policy when the
"information gain" doubles, and the switching cost depends only logarithmically on the number of
episodes K.
2 Problem setup
kΛ = √x⊤Λx.
Notations. Throughout the paper, for n
∈
For matrix X
) denote the operator norm, determinant, smallest
), λmax(
), λmin(
k*k2, det(
*
*
*
eigenvalue and largest eigenvalue, respectively. In addition, we use standard notations such as O
. We denote
}
1, 2,
{
Rd×d,
Z+, [n] =
x
k
* * *
, n
∈
5
and Ω to absorb constants while
O and
Ω suppress logarithmic factors.
,
e
e
S
M
= (
Markov Decision Processes. We consider finite-horizon episodic Markov Decision Processes
, H, Ph, rh) [Sutton and Barto,
(MDP) with non-stationary transitions, denoted by a tuple
A
is the action space and H is the horizon. The non-stationary
is the state space,
1998], where
s, a) representing the probability
transition kernel has the form Ph :
|
of transition from state s, action a to next state s′ at time step h. In addition, rh(s, a)
∆([0, 1])
denotes the corresponding distribution of reward.1 Without loss of generality, we assume there is a
fixed initial state s1.2 A policy can be seen as a series of mapping π = (π1,
, πH), where each πh
maps each state s
[H]. A
h
∆(
to a probability distribution over actions, i.e. πh :
, sH , aH, rH , sH+1) is generated by the following rule: s1 is fixed,
random trajectory (s1, a1, r1,
sh), rh
[H]. For normalization, we assume that
ah
[0, 1] almost surely.
∈ S
* * *
rh(sh, ah), sh+1 ∼
S
[0, 1] with Ph(s′
A
S × A × S 7→
* * *
S →
sh, ah),
Ph(
A
∼
∈
∈
∈
),
h
∀
∀
*|
πh(
∼
H
h=1 rh
*|
∈
[H], the value function V π
Q-values, Bellman operator. Given a policy π and any h
) and Q-
h (
P
*
∈
H
H
h(s, a) = Eπ[
sh = s], Qπ
) are defined as: V π
value function Qπ
sh, ah =
t=h rt
t=h rt
,
h(
|
|
*
*
. Besides, the value function and Q-value function with respect to the optimal
s, a
s, a],
∈ S × A
) and Q⋆
policy π⋆ is denoted by V ⋆
h applied to Qh+1 is defined
,
h(
h (
*
*
as
). Then the Bellman operator
*
h (s) = Eπ[
P
P
∀
T
h(Qh+1)(s, a) = rh(s, a) + Es′∼Ph(*|s,a) max
a′ Qh+1(s′, a′).
T
Regret. We measure the performance of online reinforcement learning algorithms by the regret.
The regret of an algorithm over K episodes is defined as
Regret(K) :=
K
Xk=1
[V ⋆
1 (s1)
−
V πk
1 (s1)],
where πk is the policy it deploys at episode k. Besides, we denote the total number of steps by
T := KH.
Switching cost. We adopt the global switching cost [Bai et al., 2019], which simply measures how
many times the algorithm changes its policy:
Nswitch :=
K−1
Xk=1
1
πk
{
.
= πk+1}
Global switching cost is a widely applied measurement of the adaptivity of an online RL algorithm
both under the tabular setting [Bai et al., 2019, Zhang et al., 2020, Qiao et al., 2022] and the linear
MDP setting [Gao et al., 2021, Wang et al., 2021]. Similar to previous works, our algorithm also
uses deterministic policies only.
1We overload the notation r so that r also denotes the expected (immediate) reward function.
2The generalized case where the initial distribution is an arbitrary distribution can be recovered from this setting
by adding one layer to the MDP.
6
6
2.1 Low inherent Bellman error
In this part, we introduce the linear function approximation, the definition of inherent Bellman
error [Zanette et al., 2020] and the connection between the low inherent Bellman error setting and
the linear MDP setting [Jin et al., 2020].
, a common approach is to define
To encode linear function approximation of the state space
Rdh, which can be different across different timestep. Then the
a feature map φh :
Q-value functions are represented as linear functions of φh, i.e., Qh(s, a) = φh(s, a)⊤θh for some
θh
S × A →
Rdh.
S
∈
The feasible parameter class for timestep h is defined as
h :=
B
θh
{
∈
Rdh
φh(s, a)⊤θh
| |
1,
,
(s, a)
}
∀
| ≤
which is consistent with our assumption that Qπ
h(s, a)
1.
≤
For each feasible parameter θ
defined as
∈ B
h, the corresponding Q-value function and value function are
Qh(θ)(s, a) = φh(s, a)⊤θ, Vh(θ)(s) = max
a
φh(s, a)⊤θ.
Meanwhile, the associated function spaces are
h :=
Q
Qh(θh)
{
|
θh
h
,
}
∈ B
V
h :=
Vh(θh)
{
|
θh
h
.
}
∈ B
Similar to Zanette et al. [2020], we make the following normalization assumption, which is without
loss of generality.
φh(s, a)
k
k2 ≤
k2 ≤
θh
k
1,
∀
dh,
(h, s, a)
[H]
∈
[H], θh
h
∀
∈
.
× S × A
h.
∈ B
p
Inherent Bellman error. For provably efficient learning, completeness assumption is widely
adopted [Zanette et al., 2020, Wang et al., 2020, Jin et al., 2021]. In this paper, we characterize
the completeness by assuming an upper bound of the projection error when we project
hQh+1
(Qh+1 ∈ Q
Definition 2.1. The inherent Bellman error of an MDP with a known linear feature map
is defined as the maximum over the timesteps h
T
h. Formally, we have the following definition of inherent Bellman error.
,
φh(
*
{
h+1) to
[H] of
Q
)
}h∈[H]
*
∈
sup
θh+1∈Bh+1
inf
θh∈Bh
φh(s, a)⊤θh
sup
s,a |
(
T
.
hQh+1(θh+1))(s, a)
|
−
Similar to Zanette et al. [2020], we assume the inherent Bellman error of the MDP is upper bounded
by some (known) constant
0. Below we will show that this setting strictly generalizes the linear
I ≥
MDP setting [Jin et al., 2020].
Connections to linear MDP. Since linear MDP admits transition kernel and reward function
that is linear in a known feature map φ, for any function V (
) is a linear
) :
*
*
) [Jin et al., 2020]. Therefore, a linear MDP with feature map φ and dimension
function of φ(
,
*
*
= φH = φ and
d is a special case of the low inherent Bellman error setting with
,
hV (
*
= 0, φ1 =
S →
R,
T
I
* * *
7
* * *
= dH = d (if ignoring the scale of rewards). More importantly, it is shown that an MDP
d1 =
= 0) may not be a linear MDP [Zanette et al., 2020], which
with zero inherent Bellman error (
means that the setting in this paper is strictly more general and technically demanding than linear
MDP. For more discussions about the low inherent Bellman error setting and relavent comparisons,
please refer to Section 3 in Zanette et al. [2020].
I
3 Main algorithm
In this section, we propose our main algorithm: ELEANOR-LowSwitching (Algorithm 1) and the
low switching design for global optimism-based algorithms.
We begin with the standard LSVI technique. At the beginning of the k-th episode, assume the
parameter for the (h + 1)-th layer is fixed to be θh+1. Then LSVI minimizes the following objective
function with respect to θ:
k−1
(φτ
h)⊤θ
rτ
h −
−
Vh+1(θh+1)(sτ
h+1)
2
+ λ
θ
k
2
2,
k
(1)
τ =1 (cid:16)
X
h, aτ
h is short for φh(sτ
where φτ
The minimization problem (1) has a closed form solution:
h) and rτ
(cid:17)
h is the reward encountered at layer h of the τ -th episode.
k−1
θh = (Σk
h)−1
φτ
h
h + Vh+1(θh+1)(sτ
rτ
h+1)
,
(2)
where Σk
h =
k−1
τ =1 φτ
h(φτ
(cid:2)
h)⊤ + λIdh is the empirical covariance matrix.
b
(cid:3)
τ =1
X
P
Based on the standard LSVI, we introduce the global optimistic planning below, where an optimiza-
tion problem is solved to derive the most optimistic estimate of the Q-value function at the initial
state. At each episode where the policy is updated, Algorithm 1 solves the following problem.
Definition 3.1 (Optimistic planning).
{ ̄ξh}h∈[H],{b
max
θh}h∈[H],{ ̄θh}h∈[H]
max
a
k−1
φ1(s1, a)⊤ ̄θ1
subject to
θh = (Σk
h)−1
φτ
h
h + Vh+1( ̄θh+1)(sτ
rτ
h+1)
,
τ =1
X
b
̄θh =
θh + ̄ξh;
̄ξh
k
(cid:0)
kΣk
h ≤
q
(cid:1)
αk
h;
̄θh
h.
∈ B
Definition 3.1 optimizes over the perturbation ̄ξh added to the least square solution
constraint on ̄ξh is
θh. The
b
(3)
kΣk
h ≤
αk
h :=
O(
dh + dh+1) + √k
,
I
q
where the definition of
h will be specified in Appendix A.2. As will be shown in the analysis,
the first term accounts for the estimation error of the LSVI, while the second term accounts for
e
q
b
̄ξh
k
αk
p
8
is inherent Bellman error). Finally, with high probability,
the model misspecification (recall that
there will be a valid solution of the optimization problem (details in Appendix A.2), and therefore
Algorithm 1 is well posed.
I
About global optimism. We highlight that the optimization problem aims at being optimistic
only at the initial state instead of choosing a value function everywhere optimistic, as in LSVI-UCB
[Jin et al., 2020]. Such global optimism effectively keeps the linear structure of our function class
and reduces the dimension of the covering set, since we do not need to cover the quadratic bonus
as in Jin et al. [2020].
Algorithmic design. We present the whole learning process in Algorithm 1. For linear function
approximation, we characterize the "information gain" (the information we learned from interacting
with the MDP) through the determinant of the empirical covariance matrix Σk
h (line 5). To achieve
low switching cost, we only update the exploration policy when the "information gain" doubles for
some layer h
[H] (line 7), and each update means the information about some layer has doubled.
As will be shown later, such "doubling schedule" will lead to a switching cost depending only
logarithmically on K, in stark contrast to its fully adaptive counterpart: ELEANOR [Zanette et al.,
̄θh
2020]. When an update occurs, Algorithm 1 solves the optimization problem to derive
}h∈[H]
{
h (line 10) and
ensuring global optimism (line 9), takes the greedy policy with respect to φh(
,
*
updates the empirical covariance matrix (line 11).
)⊤ ̄θk
*
∈
Algorithm 1 ELEANOR-LowSwitching
1: Input: Number of episodes K, regularization λ = 1, feature map
,
φh(
*
{
}h∈[H], failure proba-
)
*
bility δ, initial state s1 and inherent Bellman error
.
I
h = λIdh, for all h
[H].
∈
2: Initialize: Σh = Σ0
3: for k = 1, 2,
4:
, K do
h, aτ
h)φh(sτ
h)⊤ + λIdh.
, H do
h, aτ
* * *
for h = 1, 2,
* * *
k−1
Σk
τ =1 φh(sτ
h =
end for
P
[H], det(Σk
2 det(Σh) then
if
h)
h
∈
∃
≥
H+1 = ̄ξk
Set ̄θk
θk
H+1 = 0.
H+1 =
Solve the optimization problem in Definition 3.1.
Set πk
b
Set Σh = Σk
h,
h(s) = arg maxa φh(s, a)⊤ ̄θk
h,
[H].
[H].
∈
h
h
∀
else
Set πk
∀
h = πk−1
h
∈
for all h
[H].
∈
end if
14:
15: Deploy policy πk = (πk
1 ,
16: end for
5:
6:
7:
8:
9:
10:
11:
12:
13:
, πk
H) and get trajectory (sk
1, ak
1, rk
1 ,
, sk
H+1).
* * *
* * *
Generalization over previous algorithms. If we remove the update rule in Algorithm 1 and
solve Definition 3.1 at all episodes, our Algorithm 1 will degenerate to ELEANOR [Zanette et al.,
2020]. Compared to ELEANOR, our Algorithm 1 achieves the same regret bound (shown later)
and near optimal switching cost. Meanwhile, Algorithm 1 also strictly generalizes the RARELY
SWITCHING OFUL algorithm [Abbasi-Yadkori et al., 2011] designed for linear bandits. Taking
H = 1, both our Algorithm 1 and our guarantees (for regret and switching cost) strictly subsumes
9
the RARELY SWITCHING OFUL. In conclusion, we show that low switching cost is possible for
RL algorithms with global optimism.
Computational efficiency. Although Algorithm 1 is shown to be near optimal both in regret
and switching cost, the implementation of the optimization problem is inefficient in general. This is
because the max operator breaks the quadratic structure of the constraints. Such issue also exists
for our fully adaptive counterpart: ELEANOR [Zanette et al., 2020], and other algorithms based
on global optimism [Jiang et al., 2017, Sun et al., 2019, Jin et al., 2021]. We leave the improvement
of computation as future work.
4 Main results
In this section, we present our main results. We begin with the upper bounds for regret and
switching cost. Recall that we assume
[0, 1] almost surely, while dh represents the
∈
dimension of the feature map for the h-th layer and
is inherent Bellman error.
H
h=1 rh
P
I
Theorem 4.1 (Main theorem). The global switching cost of Algorithm 1 is bounded by O(
log K). In addition, with probability 1
H
h=1 dh
*
δ, the regret of Algorithm 1 over K episodes is bounded by
−
P
Regret(K)
H
h=1
X
≤
O
e
H
dh√K +
h=1 p
X
dh
I
K
.
!
The proof of Theorem 4.1 is sketched in Section 5.1 with details in the Appendix, below we discuss
several interesting aspects of Theorem 4.1.
Near-optimal switching cost. Our algorithm achieves a switching cost that depends logarith-
mically on K, which improves the O(K) switching cost of ELEANOR [Zanette et al., 2020]. We
also prove the following information-theoretic limit which says that the switching cost of Algorithm
1 is optimal up to logarithmic factors. Since it is impossible to get sub-linear regret bound with
positive inherent Bellman error, we only consider the case where
= 0.
I
Theorem 4.2 (Lower bound for no-regret learning). Assume that the inherent Bellman error
and dh
is at least Ω(
= 0
[H], for any algorithm with sub-linear regret bound, the global switching cost
3 for all h
≥
I
∈
H
h=1 dh).
The proof of Theorem 4.2 is sketched in Section 5.2 with details in the Appendix.
P
Application to linear MDP. As discussed in Section 2.1, linear MDP with dimension d is a special
case of the low inherent Bellman error setting with
= dH = d. Therefore,
when applied to linear MDP, our Algorithm 1 will have switching cost bounded by O(dH log K)
O(√d2H 3T ), where T = KH.3 Compared to current algorithms achieving
and regret bounded by
low switching cost under linear MDP [Gao et al., 2021, Wang et al., 2021], we achieve the same
switching cost and a regret bound better by a factor of √d. The improvement on regret bound
results from global optimism and a smaller linear function class. More importantly, low inherent
Bellman error setting is indeed a harder setting than linear MDP. According to Theorem 2 in
= 0, d1 = d2 =
* * *
e
I
3When transferring Theorem 4.1 to linear MDP, we need to rescale the reward function by H, and therefore there
will be an additional factor of H in our regret bound.
10
Zanette et al. [2020], the regret of our Algorithm 1 is minimax optimal. Together with the lower
bound of switching cost (Theorem 4.2), Theorem 4.1 is generally not improvable both in regret and
global switching cost.
Application to misspecified linear bandits. Taking H = 1, an MDP with low inherent Bellman
error will become a linear bandit [Lattimore and Szepesv ́ari, 2020] with model misspecification. For
simplicity, we only consider the case where there is no misspecification (i.e.
= 0), as studied in
Abbasi-Yadkori et al. [2011]. Our result is summarized in the following corollary.
I
Corollary 4.3 (Results under linear bandit). Suppose H = 1 and
= 0, then the MDP reduces
to a linear bandit with dimension d. Our Algorithm 1 will reduce to the RARELY SWITCHING
OFUL algorithm (Figure 3 in Abbasi-Yadkori et al. [2011]) and is computationally efficient. The
O(d√K) with
global switching cost of Algorithm 1 is O(d log K), while the regret can be bounded by
high probability.
I
The above corollary is derived by directly plugging H = 1 and d1 = d in Theorem 4.1. Note that
our Corollary 4.3 matches the results in Abbasi-Yadkori et al. [2011], and our Algorithm 1 can be
applied under the more general case with model misspecification. Therefore, our results can be
seen as strict generalization of Abbasi-Yadkori et al. [2011].
e
5 Proof sketch
Due to the space constraint, we sketch the proof in this section while more details are deferred to
the Appendix. We begin with the proof overview of Theorem 4.1.
5.1 Upper bounds
Upper bound of switching cost. Let
updates the policy (N is the global switching cost), and we also define k0 = 0.
k1, k2,
{
, kN
* * *
}
be the episodes where the algorithm
According to the update rule (line 7 of Algorithm 1), every time the policy is updated, at least one
det(Σk
[N ]. This further
implies
h) doubles, which implies that ΠH
h=1 det(Σki+1
h=1 det(Σki
h ) for all i
2ΠH
∈
)
h
ΠH
h=1 det(ΣkN
h )
≥
≥
h=1 det(Σk0
2N ΠH
h ).
H
h=1 dh (details in Lemma D.2) and the
Since the left hand side can be upper bounded by KP
right hand side is just 2N (from definition), the global switching cost (i.e. N ) is bounded by
O(
H
h=1 dh log K).
P
Below we give a proof overview of the regret bound.
) = Qh( ̄θk
Upper bound of regret. We denote ̄Qk
) = φh(
h)(
,
h(
,
,
h is the solution
*
*
*
*
*
) = Vh( ̄θk
of Definition 3.1 at the k-th episode. Similarly, ̄V k
). In addition, let bk denote the
h)(
h (
*
*
[K].
last policy update before episode k, for all k
h, where ̄θk
)⊤ ̄θk
*
∈
Based on concentration inequalities of self-normalized processes, we can show that with high prob-
ability, the "best feasible" approximant parameter θ⋆ (Definition A.3) is a feasible solution of
Definition 3.1. Therefore, the ̄V k
1 (s1) (summarized
1 (s1) is always a nearly optimistic estimate of V ⋆
11
in Lemma A.5) and we only need to bound
K
Regret(K) =
V ⋆
1 (s1)
−
πbk
1
V
(s1)
(cid:17)
(4)
HK
+
I
≤
K
Xk=1 (cid:16)
̄V bk
1 (s1)
Xk=1 (cid:16)
−
πbk
1
V
(s1)
.
(cid:17)
Meanwhile, the pointwise Bellman error can be bounded as (this result is stated in Lemma A.6)
̄Qbk
h − T
h ̄Qbk
h+1
(s, a)
(cid:12)
(cid:16)
(cid:12)
(cid:12)
O(
+
(cid:17)
dh + dh+1).
(cid:12)
(cid:12)
(cid:12)
+ 2
k
≤ I
φh(s, a)
k(Σ
bk
h )−1
αbk
h ,
q
where
αk
h ≤
√K
I
q
As a result, applying regret decomposition accross different layers h
martingale difference by Azuma-Hoeffding inequality (Lemma D.1), we have
∈
e
p
[H] and bounding the
K
̄V bk
1 (s1)
Xk=1 (cid:16)
K
H
−
πbk
1
V
(s1)
+ 2
φh(sk
I
bk
h )−1
(Σ
αbk
h
Xh=1 (cid:18)
(cid:19)
Xk=1
+ Sum of bounded martingale difference
q
(cid:13)
(cid:13)
(cid:13)
(cid:17)
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
K
H
k=1
X
h=1
X
2
(cid:13)
(cid:13)
(cid:13)
φh(sk
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
(a)
bk
h )−1
(Σ
αbk
h
q
|
+HK
I
H
+
O(
{z
dhK).
}
≤
≤
e
Due to our update rule based on det(Σk
Xh=1 p
h), we have
(a)
≤
H
2
q
Xh=1
αK
K
h * v
u
u
t
K
2K
2
q
H
αK
h * v
u
u
t
k=1
X
(cid:13)
(cid:13)
2
(Σ
bk
h )−1
K
φh(sk
h, ak
h)
Xk=1
(cid:13)
(cid:13)
h, ak
φh(sk
h)
(cid:13)
(cid:13)
2
(Σk
h)−1
(cid:13)
(cid:13)
Kdh
p
!
(√K
Xh=1
H
+
dh + dh+1)
*
I
p
H
Xh=1 p
e
dhK
+
I
dh√K),
Xh=1
12
H
≤
h=1
X
O
≤
e
O(
≤
(5)
(6)
where the second inequality holds because of Lemma D.3 and our update rule. The third inequality
is from elliptical potential lemma (Lemma D.4).
Finally, the regret bound results from plugging (6) into (5).
5.2 Lower bound
In this part, we sketch the proof of Theorem 4.2.
= 0), which has deterministic
We construct a hard MDP case with zero inherent Bellman error (
transition kernel. Therefore, deploying some deterministic policy will lead to a deterministic tra-
jectory, like pulling an "arm" in the multi-armed bandits (MAB) setting. We further show that
H
h=1 dh). Together with the lower bounds of switching
the number of such "arms" is at least Ω(
H
cost in multi-armed bandits [Qiao et al., 2022], we can derive the Ω(
h=1 dh) lower bound under
the low inherent Bellman error setting.
P
I
P
6 Extension to generalized linear function approximation
In this section, we consider low adaptive reinforcement learning with generalized linear function
approximation [Wang et al., 2019]. We show that the same "doubling schedule" for updating
exploration policy (line 7 of Algorithm 1) can be leveraged under this setting, which enables the
design of provably efficient algorithms. We begin with the introduction of generalized linear function
approximation.
6.1 Problem setup
Different from the low inherent Bellman error setting which characterizes Q⋆ using linear functions,
we use a function class of generalized linear models (GLMs) to model Q⋆. We denote the dimension
of feature map by d and define Bd =
x
k
x
{
Definition 6.1 (GLM [Wang et al., 2019]). For a known feature map φ :
known link function f : [
φ(s, a), θ
f (
h
1, 1], the class of generalized linear models is
Bd and a
(s, a)
{
S × A →
=
) : θ
i
k2 ≤
.
1
}
Rd :
[
−
1, 1]
Bd
.
}
→
→
−
∈
∈
G
Similar to Wang et al. [2019], we make the following standard assumption which is without loss of
generality.
Assumption 6.2. f (
) is either monotonically increasing or decreasing. Furthermore, there exist
*
absolute constants 0 < κ1 < κ2 <
M , for
all
such that κ1 ≤ |
f ′′(z)
|
and M <
κ2 and
f ′(z)
| ≤
| ≤
∞
∞
1.
z
|
| ≤
This assumption is naturally satisfied by the identical map f (z) = z and also includes other non-
linear maps such as the logistic map f (z) = 1/(1 + e−z).
To characterize completeness under this function class, Wang et al. [2019] assumes the function
h (defined in Section 2). Similarly, we make
class is closed with respect to the Bellman operator
the same optimistic closure assumption below. Note that for a fixed constant Γ > 04, the enlarged
function class is defined as
T
4Γ will be set to depend polynomially on d and log K.
13
Gup =
(s, a)
{
θ
→
Bd, 0
φ(s, a), θ
1, f (
min
{
h
Γ, A < 0,
γ
∈
≤
≤
) + γ
i
φ(s, a)
A
k
k
k2 ≤
.
1
}
A
k
:
}
Then the optimistic closure assumption is stated below.
Assumption 6.3. For all h
[H] and g
up, we have
h(g)
T
.
∈ G
∈ G
∈
According to Proposition 1 of Wang et al. [2019], this assumption strictly generalizes the standard
linear MDP setting by allowing link functions with more expressivity.
6.2 Low switching algorithm
We present our Algorithm 2 below. Intuitively speaking, the algorithmic idea is to apply doubling
schedule to Algorithm 1 of Wang et al. [2019]. Similar to Algorithm 1, we only update the explo-
ration policy when the "information gain" with respect to some layer has doubled (line 7). When
the policy is updated, the LSVI step calculates an estimate of θ⋆ (the parameter w.r.t. the real
Q⋆ function) iteratively from the H-th layer to the first layer through minimizing (7). Then the
h )−1 to the empirical
optimistic Q value function is constructed by adding a bonus term γ
h) (line 11). Finally, the greedy policy is deployed for collecting data (line 12,
)
k(Σk
*
,
φ(
*
k
estimate f (φ(
,
*
18).
)⊤θk
*
6.3 Main results of Algorithm 2
In this part, we state the main results about Algorithm 2. We begin with the upper bounds for
regret and switching cost. Recall that we still assume
[0, 1] almost surely, while d
represents the dimension of the feature map.
H
h=1 rh
∈
P
Theorem 6.4 (Main results). The global switching cost of Algorithm 2 is bounded by O(dH
*
δ, the regret of Algorithm 2 over K episodes is bounded by
In addition, with probability 1
−
log K).
Regret(K)
≤
O
H√d3K
.
(cid:16)
(cid:17)
e
The proof of Theorem 6.4 is deferred to Appendix C due to space limit, below we discuss several
interesting aspects of Theorem 6.4.
Near-optimal switching cost. Our algorithm achieves a switching cost that depends logarithmi-
cally on K, which improves the O(K) switching cost of Algorithm 1 in Wang et al. [2019]. We also
prove the following information-theoretic limit which says that the switching cost of Algorithm 2
is optimal up to logarithmic factors.
Theorem 6.5 (Lower bound for no-regret learning). For any algorithm with sub-linear regret bound,
the global switching cost is at least Ω(dH).
Theorem 6.5 is adapted from the lower bound for global switching cost under linear MDP [Gao et al.,
2021], and we leave the proof to Appendix C.
14
Algorithm 2 Low-switching-cost LSVI-UCB with generalized linear function approximation
1: Input: Number of episodes K, feature map
,
φ(
*
{
, failure probability δ, parameters κ1, κ2, M ,
)
}
*
h = Id, for all h
∈
[H]. γ = Cκ2κ−1
1
1 + M + κ2 + d2 log( 1+κ2+Γ
δ
).
q
universal constant C.
2: Initialize: Σh = Σ0
3: for k = 1, 2,
4:
, K do
, H do
h, aτ
* * *
for h = 1, 2,
* * *
k−1
Σk
τ =1 φ(sτ
h =
end for
P
[H], det(Σk
if
h)
h
∃
∈
Set Qk
) = 0.
,
H+1(
*
*
for h = H,
* * *
, 1 do
h)φ(sτ
h, aτ
h)⊤ + Id.
2 det(Σh) then
≥
Solve the empirically optimal estimate of θ⋆.
θk
h = arg min
kθk2≤1
k−1
τ =1
X
φ(sτ
(f (
h
h, aτ
h), θ
)
i
−
rτ
h −
max
a′∈A
Qk
h+1(sτ
h+1, a′))2.
(7)
Construct the Q value function: Qk
,
h(
*
Set πk
Set Σh = Σk
h.
h(s) = arg maxa∈A Qk
h(s, a).
end for
else
,
1, f (φ(
) = min
*
{
*
)⊤θk
*
h) + γ
,
φ(
*
k
)
k(Σk
*
h )−1
.
}
Set πk
h = πk−1
h
for all h
[H].
∈
end if
17:
18: Deploy policy πk = (πk
1 ,
19: end for
, πk
H) and get trajectory (sk
1, ak
1, rk
1 ,
, sk
H+1).
* * *
* * *
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Generalization over previous results. The closest result to our Algorithm 2 is the fully adap-
tive Algorithm 1 of Wang et al. [2019], which achieves the same
regret bound. In
comparison, our Algorithm 2 favors near optimal global switching cost at the same time, which
saves computation and accelerates the learning process.
H√d3K
O
(cid:17)
(cid:16)
e
When applying our Algorithm 2 to the linear MDP case, our Theorem 6.4 will imply a regret bound
O(√d3H 3T )5 (T = KH) and a global switching cost of O(dH log K), which recovers the results
of
in Gao et al. [2021], Wang et al. [2021]. Therefore, our result can be considered as generalization
of these two results since GLMs allow more general function classes.
e
7 Conclusion and future work
This paper studied the well motivated problem of online reinforcement learning with low switch-
ing cost. Under linear Bellman-complete MDP with low inherent Bellman error, we designed an
and
algorithm (Algorithm 1) with near optimal regret bound of
K
O
H
h=1 dh√K +
H
h=1 √dh
5The identical link function corresponds to κ1 = κ2 = 1 and M = 0. In addition, due to rescaling of reward
P
functions, there will be an additional H factor in the regret bound of Theorem 6.4.
(cid:16)P
e
I
(cid:17)
15
log K). In addition, we prove a (nearly) matching global
global switching cost bound of O(
H
switching cost lower bound Ω(
h=1 dh) for any algorithm with sub-linear regret. At the same time,
P
we leverage the same "doubling trick" under the generalized linear function approximation setting,
and designed a sample-efficient algorithm (Algorithm 2) with near optimal switching cost.
P
*
H
h=1 dh
Although being more general than linear MDP, the two settings we consider are not the most general
ones. The low Bellman eluder dimension setting [Jin et al., 2021] and MDP with differentiable
function approximation [Zhang et al., 2022a] can be considered as generalization of the two settings
in this paper, respectively. Therefore, our results can be considered as a middle step towards low
switching reinforcement learning under more general MDP settings. For further extension, it will be
interesting to find out whether low switching cost RL is possible under more general MDP settings
(e.g., low Bellman eluder dimension [Jin et al., 2021], differentiable function class [Zhang et al.,
2022a, Yin et al., 2023]), and we leave these as future work.
Acknowledgments
The research is partially supported by NSF Award #2007117.
References
Yasin Abbasi-Yadkori, D ́avid P ́al, and Csaba Szepesv ́ari. Improved algorithms for linear stochastic
bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011.
M Mehdi Afsar, Trafford Crump, and Behrouz Far. Reinforcement learning based recommender
systems: A survey. arXiv preprint arXiv:2101.06286, 2021.
Alekh Agarwal, Sham Kakade, Akshay Krishnamurthy, and Wen Sun. Flambe: Structural com-
plexity and representation learning of low rank mdps. Advances in neural information processing
systems, 33:20095–20107, 2020.
Yu Bai, Tengyang Xie, Nan Jiang, and Yu-Xiang Wang. Provably efficient q-learning with low
switching cost. Advances in Neural Information Processing Systems, 32, 2019.
Minbo Gao, Tianle Xie, Simon S Du, and Lin F Yang. A provably efficient algorithm for linear
markov decision process with low switching cost. arXiv preprint arXiv:2101.00494, 2021.
Zijun Gao, Yanjun Han, Zhimei Ren, and Zhengqing Zhou. Batched multi-armed bandits problem.
Advances in Neural Information Processing Systems, 32, 2019.
Jiawei Huang, Jinglin Chen, Li Zhao, Tao Qin, Nan Jiang, and Tie-Yan Liu. Towards deployment-
efficient reinforcement learning: Lower bound and optimality. In International Conference on
Learning Representations, 2022.
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Con-
textual decision processes with low bellman rank are pac-learnable. In International Conference
on Machine Learning-Volume 70, pages 1704–1713, 2017.
Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement
16
learning with linear function approximation.
2143. PMLR, 2020.
In Conference on Learning Theory, pages 2137–
Chi Jin, Qinghua Liu, and Sobhan Miryoosefi. Bellman eluder dimension: New rich classes of rl
problems, and sample-efficient algorithms. Advances in neural information processing systems,
34:13406–13418, 2021.
Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The
International Journal of Robotics Research, 32(11):1238–1274, 2013.
Dingwen Kong, Ruslan Salakhutdinov, Ruosong Wang, and Lin F Yang. Online sub-sampling for
reinforcement learning with general function approximation. arXiv preprint arXiv:2106.07203,
2021.
Tor Lattimore and Csaba Szepesv ́ari. Bandit algorithms. Cambridge University Press, 2020.
Tatsuya Matsushima, Hiroki Furuta, Yutaka Matsuo, Ofir Nachum, and Shixiang Gu. Deployment-
efficient reinforcement learning via model-based offline optimization. In International Conference
on Learning Representations, 2020.
Aditya Modi, Jinglin Chen, Akshay Krishnamurthy, Nan Jiang, and Alekh Agarwal. Model-free
representation learning and exploration in low-rank mdps. arXiv preprint arXiv:2102.07035,
2021.
Vianney Perchet, Philippe Rigollet, Sylvain Chassang, and Erik Snowberg. Batched bandit prob-
lems. The Annals of Statistics, 44(2):660–681, 2016.
Dan Qiao and Yu-Xiang Wang. Near-optimal deployment efficiency in reward-free reinforcement
learning with linear function approximation. arXiv preprint arXiv:2210.00701, 2022.
Dan Qiao, Ming Yin, Ming Min, and Yu-Xiang Wang. Sample-efficient reinforcement learning with
loglog(T) switching cost. In International Conference on Machine Learning, pages 18031–18061.
PMLR, 2022.
Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based
rl in contextual decision processes: Pac bounds and exponential improvements over model-free
approaches. In Conference on learning theory, pages 2898–2933. PMLR, 2019.
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT
press Cambridge, 1998.
Grigoris Velegkas, Zhuoran Yang, and Amin Karbasi. The best of both worlds: Reinforcement
learning with logarithmic regret and policy switches. arXiv preprint arXiv:2203.01491, 2022.
Ruosong Wang, Russ R Salakhutdinov, and Lin Yang. Reinforcement learning with general value
function approximation: Provably efficient approach via bounded eluder dimension. Advances in
Neural Information Processing Systems, 33:6123–6135, 2020.
Tianhao Wang, Dongruo Zhou, and Quanquan Gu. Provably efficient reinforcement learning with
linear function approximation under adaptivity constraints. Advances in Neural Information
Processing Systems, 34, 2021.
17
Yining Wang, Ruosong Wang, Simon S Du, and Akshay Krishnamurthy. Optimism in reinforcement
learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019.
Lin Yang and Mengdi Wang. Sample-optimal parametric q-learning using linearly additive features.
In International Conference on Machine Learning, pages 6995–7004. PMLR, 2019.
Ming Yin, Mengdi Wang, and Yu-Xiang Wang. Offline reinforcement learning with differentiable
function approximation is provably efficient. International Conference on Learning Representa-
tions, 2023.
Chao Yu, Jiming Liu, Shamim Nemati, and Guosheng Yin. Reinforcement learning in healthcare:
A survey. ACM Computing Surveys (CSUR), 55(1):1–36, 2021.
Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near op-
timal policies with low inherent bellman error. In International Conference on Machine Learning,
pages 10978–10989. PMLR, 2020.
Ruiqi Zhang, Xuezhou Zhang, Chengzhuo Ni, and Mengdi Wang. Off-policy fitted q-evaluation
with differentiable function approximators: Z-estimation and inference theory. In International
Conference on Machine Learning, pages 26713–26749. PMLR, 2022a.
Zihan Zhang, Yuan Zhou, and Xiangyang Ji. Almost optimal model-free reinforcement learning
via reference-advantage decomposition. Advances in Neural Information Processing Systems, 33:
15198–15207, 2020.
Zihan Zhang, Yuhang Jiang, Yuan Zhou, and Xiangyang Ji. Near-optimal regret bounds for multi-
batch reinforcement learning. arXiv preprint arXiv:2210.08238, 2022b.
Zhenpeng Zhou, Steven Kearnes, Li Li, Richard N Zare, and Patrick Riley. Optimization of
molecules via deep reinforcement learning. Scientific reports, 9(1):1–10, 2019.
18
A Proof of Theorem 4.1
In this section, we prove our main theorem. We first restate Theorem 4.1 below, and then prove
the bounds for switching cost and regret in Section A.1 and Section A.2, respectively.
Theorem A.1 (Restate Theorem 4.1). The global switching cost of Algorithm 1 is bounded by
δ, the regret of Algorithm 1 over K episodes
O(
*
is bounded by
log K). In addition, with probability 1
H
h=1 dh
−
P
Regret(K)
O
≤
e
H
Xh=1
H
dh√K +
Xh=1 p
dh
I
K
.
!
A.1 Proof of switching cost bound
Proof of switching cost bound. Let
k1, k2,
{
the policy, and we also define k0 = 0.
, kN
}
* * *
be the episodes where the algorithm updates
According to the update rule (line 7 of Algorithm 1), for all i
such that
det(Σki+1
hi
)
≥
2 det(Σki
hi).
[N ], there exists some hi
[H]
∈
∈
In addition, for all h, i
[H]
×
∈
[N ], we have
det(Σ
ki+1
h
)
Combining these two results, we have for all i
∈
det(Σki
h ).
≥
[N ],
Therefore, it holds that
ΠH
h=1 det(Σ
ki+1
h
)
≥
2ΠH
h=1 det(Σki
h ).
H
h=1 dh
KP
ΠH
h=1 det(ΣkN
h )
≥
≥
2N ΠH
h=1 det(Σk0
h ) = 2N ,
(8)
(9)
where the first inequality is because of Lemma D.2 and our choice that λ = 1. The second inequality
is due to recursive application of (8). The last equation holds since we have Σk0
h = Idh for all h.
Solving (9), we have N
P
H
h=1 dh log K
log 2
≤
A.2 Proof of regret bound
= O(
H
h=1 dh log K), and therefore the proof is complete.
P
We first state some technical lemmas from Zanette et al. [2020]. We begin with the following bound
on failure probability.
Lemma A.2 (Lemma 2 of Zanette et al. [2020]). With probability at least 1
h
[H], Vh+1 ∈ V
∈
h+1,
δ/2, for all k
[K],
∈
−
φi
h
ri
h −
(cid:16)
rh(si
h, ai
h) + Vh+1(si
h+1)
E
−
s′∼Ph(*|si
h,ai
h)Vh+1(s′)
(cid:17)
βk
h,
(10)
(Σk
h)−1
≤
q
k−1
i=1
X
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
βk
h :=
where
dh log(1 + k/dh) + 2dh+1 log(1 + 4√kdh) + log( 2KH
δ
) + 1 =
q
q
19
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
O(
dh + dh+1).
p
e
Next, we define the "best" feasible parameters θ⋆ that well approximate the Q⋆ values, and such
parameters are going to be a feasible solution for the optimization problem (Definition 3.1). Then
we state the accuracy bound of θ⋆.
Definition A.3 (Best feasible approximant, Definition 4 of Zanette et al. [2020]). We recursively
define the best approximant parameter θ⋆
[H] as:
h for h
∈
with ties broken arbitrarily and θ⋆
θ⋆
h = arg min
θ∈Bh
sup
(s,a)
φh(s, a)⊤θ
(cid:12)
(cid:12)
(cid:12)
H+1 = 0.
(
T
−
hQh+1(θ⋆
h+1))(s, a)
(cid:12)
(cid:12)
(cid:12)
(11)
Lemma A.4 (Accuracy Bound of θ⋆, Lemma 6 of Zanette et al. [2020]). It holds that for all
h
[H]:
Q⋆
h(s, a)
sup
(s,a) |
φh(s, a)⊤θ⋆
h| ≤
−
(H
−
h + 1)
I
.
(12)
∈
For notational simplicity, for ̄θh which is the solution of Definition 3.1, we denote ̄Qh(
,
*
h) where ̄θk
h represents Qh( ̄θk
Qh( ̄θh)(
)⊤ ̄θh. Besides, ̄Qk
,
*
*
) = Vh( ̄θk
) = Vh( ̄θh)(
) and ̄V k
episode. Similarly, ̄Vh(
).
h)(
h (
*
*
*
*
[K].
policy update before episode k, for all k
) =
*
h is the solution at the k-th
In addition, let bk denote the last
,
) = φh(
*
*
∈
Lemma A.5 (Optimism, Lemma 7 of Zanette et al. [2020]). Under the high probability case in
+ √dh = √k
h, for
[H] is a feasible solution of the optimization problem (Definition 3.1). Therefore, for all
dh + dh+1), then ̄θh = θ⋆
βk
h + √k
h =
αk
O(
+
I
I
q
q
Lemma A.2, if we choose
all h
k
∈
∈
[K], the optimistic value function satisfies
p
e
In addition to optimism, we also have the following upper bound of Bellman error.
̄V bk
1 (s1)
V ⋆
1 (s1)
H
.
I
−
≥
(13)
Lemma A.6 (Bound of Bellman error, Lemma 1 of Zanette et al. [2020]). Under the high proba-
bility case in Lemma A.2, it holds that for all (k, h, s, a)
[K]
[H]
,
∈
×
× S × A
h − T
̄Qbk
(cid:12)
(cid:16)
(cid:12)
(cid:12)
h ̄Qbk
h+1
(s, a)
(cid:17)
(cid:12)
(cid:12)
(cid:12)
≤ I
=
I
+
φh(s, a)
k
k(Σ
bk
h )−1
+ 2
k
φh(s, a)
k(Σ
+
bk
I
αbk
h .
(cid:18)p
bk
h )−1
q
βbk
h +
dh +
αbk
h
q
p
q
(cid:19)
(14)
Now we are ready to present the regret analysis of Algorithm 1.
Proof of regret bound. We prove based on the high probability case in Lemma A.2.
20
First of all, the regret over K episodes can be decomposed as
Regret(K) =
=
=
K
Xk=1 (cid:16)
K
k=1 (cid:16)
X
V ⋆
1 (s1)
V ⋆
1 (s1)
−
−
HK
+
I
≤
K
Xk=1 (cid:16)
K
Xk=1
(V ⋆
1 (s1)
−
V πk
1 (s1))
πbk
1
V
(s1)
(cid:17)
K
̄V bk
1 (s1)
(cid:17)
̄V bk
1 (s1)
−
+
̄V bk
1 (s1)
k=1 (cid:16)
X
πbk
V
1
(s1)
,
(cid:17)
−
πbk
1
V
(s1)
(cid:17)
where the last inequality results from Lemma A.5.
Note that ̄V bk
h (sk
h) = ̄Qbk
h (sk
h, ak
h) due to our choice of πk, it holds that for all k, h
∈
̄V bk
h −
πbk
h
V
(sk
h) = ̄Qbk
h (sk
h, ak
h)
h ̄Qbk
h+1(sk
h, ak
h) +
T
− T
h ̄Qbk
(cid:16)
≤I
+ 2
φh(sk
(cid:17)
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
bk
h )−1
(Σ
q
αbk
h + E
s′∼Ph(*|sk
h,ak
h)
̄V bk
h+1 −
(cid:16)
V
where the inequality holds because of Lemma A.6.
Plugging (16) into (15), we have with probability 1
δ,
−
Regret(K)
HK
+
I
≤
HK
I
≤
H
+
K
H
+
k=1
X
K
h=1 (cid:18)
X
I
(cid:13)
(cid:13)
(cid:13)
h,ak
h)
E
s′∼Ph(*|sk
h=1
X
k=1 (cid:16)
X
K
H
HK
+
I
≤
+ 2
I
Xk=1
Xh=1 (cid:18)
H
=2HK
I
+
O(
dhK) +
K
̄V bk
1 (s1)
Xk=1 (cid:16)
−
πbk
1
V
(s1)
+ 2
φh(sk
bk
h )−1
(Σ
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
πbk
V
h+1
̄V bk
h+1 −
(cid:16)
(cid:17)
αbk
h
q
(cid:19)
φh(sk
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
2
H
K
(cid:13)
(cid:13)
(cid:13)
(s′)
(cid:17)
−
̄V bk
h+1 −
(cid:16)
αbk
h
+
O(
bk
h )−1
(Σ
q
(cid:19)
e
bk
h )−1
(Σ
Xh=1 p
αbk
h ,
q
φh(sk
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
Xh=1 p
Xk=1
Xh=1
e
(15)
[H],
(16)
[K]
×
(sk
h)
h, ak
h)
πbk
h
V
−
h+1(sk
πbk
h+1
(s′),
(cid:17)
πbk
h+1
V
(sk
h+1)
(cid:17)
H
(cid:17)
dhK)
(17)
where the second inequality is because of (16). The last inequality holds with high probability due
dh+1 for
to Azuma-Hoeffding inequality (Lemma D.1) and the fact that
any k
̄V bk
h+1k∞ ≤ k
k
̄θbk
h+1k2 ≤
[K].
p
∈
21
Finally, it holds that
Regret(K)
2HK
I
≤
H
H
K
H
+
O(
dhK) +
2
Xh=1 p
H
e
Xk=1
Xh=1
K
2HK
I
≤
+
O(
dhK) + 2
h=1 p
X
H
e
K
αK
h * v
u
u
t
h=1 q
X
H
k=1
X
K
(cid:13)
(cid:13)
αbk
h
bk
h )−1
q
(Σ
φh(sk
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
2
(Σ
h, ak
h)
(cid:13)
(cid:13)
(cid:13)
φh(sk
bk
h )−1
(cid:13)
(cid:13)
h, ak
h)
φh(sk
2
(Σk
h)−1
≤
≤
≤
≤
O(HK
e
O(HK
e
O(HK
+
+
+
I
I
I
H
e
O(
h=1 p
X
e
dhK) + 2
dhK) + 2
h=1
X
H
p
Xh=1 p
H
αK
h * v
u
u
t
h=1 q
X
H
K
2
k=1
X
αK
h *
Xh=1 q
2K
*
p
dhK) +
K log(1 + K)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2dh log(1 + K)
H
Xh=1 p
Kdh
+
I
p
dh(dh + dh+1)
!
O
*
e
(18)
Xh=1 p
H
dhK
+
I
h=1
X
p
dh√K),
where the second inequality holds according to Cauchy-Schwarz inequality and the fact that αk
non-decreasing in k. The third inequality results from Lemma D.3 and the fact that det((Σbk
det(Σbk
lemma (Lemma D.4). The fifth inequality is derived by the definition of αK
The last inequality comes from direct calculation.
h is
h )−1) =
h)−1). The forth inequality is because of elliptical potential
h (from Lemma A.5).
h)−1 = 2 det((Σk
2 det(Σk
h )−1
≤
The regret analysis is complete.
B Proof of Theorem 4.2
In this section, we prove our lower bound of switching cost.
Theorem B.1 (Restate Theorem 4.2). Assume that the inherent Bellman error
for all h
Ω(
3
[H], for any algorithm with sub-linear regret bound, the global switching cost is at least
= 0 and dh
≥
I
∈
H
h=1 dh).
P
=
We first briefly discuss about our assumptions. We assume zero inherent Bellman error (i.e.
0) since it is possible to derive sub-linear regret bounds only if
= 0, and we want to derive
lower bounds of switching cost for algorithms with sub-linear regret. Otherwise, the regret bound
will always be linear in K. Also, the assumption on dh
[H] is without loss of
generality.
3 for all h
≥
∈
I
I
Proof of Theorem B.1. We first construct an MDP with two states, the initial state s1 and the
absorbing state s2.
For absorbing state s2, the choice of action is only a0, while for initial state s1, the choice of actions
22
at layer h is
a1, a2,
{
* * *
, adh−1}
φh(s2, a0) = (1, 0, 0,
, 0), φh(s1, ai) = (0,
, 0, 1, 0,
),
* * *
* * *
* * *
. Then we define the dh-dimensional feature map for the h-th layer:
∈
−
[dh
1]), the (i + 1)-th element is 1 while all other elements are 0.
where for s1, ai (i
We now define the transition kernel and reward function as Ph(s2|
Ph(s1|
h
∈
inherent Bellman error (
Q-value functions.
s2, a0) = 1, rh(s2, a0) = 0,
s1, ai) = 1, rh(s1, ai) = rh,i for all
dh, where rh,i's are unknown non-zero values. Note that such MDP has zero
includes all possible
s1, a1) = 1, rh(s1, a1) = 0 for all h
[H]. Besides, Ph(s2|
= 0) since the function class
φh(s, a)⊤θh
{
[H] and 2
∈ B
θh
≤
≤
∈
I
}
i
h
|
−
1 steps, then at step h the agent takes action ai (i
Therefore, for any deterministic policy, the only possible case is that the agent takes action a1 and
stays at s1 for the first h
2) and transitions
to s2 with reward rh,i, later the agent always stays at s2 with no more reward. For this trajectory,
the total reward will be rh,i. Also, for any deterministic policy, the trajectory is fixed, like pulling
an "arm" in multi-armed bandits setting. Note that the total number of such "arms" with non-zero
H
3. Even
h=1 dh) due to our assumption that dh
unknown reward is at least
if the transition kernel is known to the agent, this MDP is still as difficult as a multi-armed bandits
P
problem with Ω(
H
h=1 dh) arms. Together will Lemma B.2 below, the proof is complete.
H
h=1(dh
2) = Ω(
P
≥
≥
−
Lemma B.2 (Lemma H.4 of Qiao et al. [2022]). For any algorithm with sub-linear regret bound
under K-armed bandit problem, the switching cost is at least Ω(K).
P
C Proof for Section 6
In this section, we prove the theorems regarding our Algorithm 2 under the generalized linear func-
tion approximation setting. We begin with the upper bounds for switching cost and regret.
C.1 Proof of upper bounds
Theorem C.1 (Restate Theorem 6.4). The global switching cost of Algorithm 2 is bounded by
O(dH
δ, the regret of Algorithm 2 over K episodes is
bounded by
log K). In addition, with probability 1
−
*
Regret(K)
≤
O
H√d3K
.
(cid:16)
(cid:17)
e
Bd =
, φ(s, a)
Proof of switching cost bound. Since the feature map in Algorithm 2 satisfies that for all s, a
, we have
1
}
x
S × A
{
Lemma D.2 still holds, with dh = d for all h
(line 7 of Algorithm 2) is identical to Algorithm 1, the O(dH
results from identical proof as in Section A.1, with all dh replaced by d.
∈
1. Therefore, the conclusion of
[H]. In addition, because our policy update rule
log K) upper bound of switching cost
φ(s, a)
k
k2 ≤
k2 ≤
Rd :
x
k
∈
∈
∈
*
Before we prove the upper bound of regret, we state some technical lemmas from Wang et al.
[2019].
23
Lemma C.2 (Corollary 3 of Wang et al. [2019]). We denote the estimated Q value function of
R+ such
layer h at the k-th episode by Qk
,
h(
*
[H]
that for all (k, h, s, a)
× S × A
Qk
h(s, a)
). Suppose there exists a function confk
*
h+1)(s, a) + confk
×
h(s, a)
S × A →
h(s, a),
h(Qk
(19)
[K]
Q⋆
h :
∈
,
≤
≤ T
h is Bellman operator) and the policy πk is the greedy policy with respect to Qk
h, then with
(where
probability at least 1
T
δ,
−
Regret(K)
K
H
≤
Xk=1
Xh=1
confk
h(sk
h, ak
h) + O(H
K log(1/δ)).
p
Lemma C.2 is a standard regret decomposition which will be used to bound the regret of Algorithm
2. Below we give a valid choice of the confidence bound confk
h. Note that we define bk to be the
last policy update before episode k, for all k
h for all k
Lemma C.3 (Adapted from Lemma 6 of Wang et al. [2019]). With probability 1
for all k, h, s, a
[K]. Therefore, Qk
δ, it holds that
h = Qbk
[K].
[K]
[H]
−
∈
∈
,
∈
×
× S × A
φ(s, a), θk
)
f (
hi
h
where γ is defined in Algorithm 2.
(cid:12)
(cid:12)
(cid:12)
− T
h(Qk
h+1)(s, a)
(cid:12)
(cid:12)
(cid:12)
γ
φ(s, a)
k
k(Σ
bk
h )−1,
≤
Therefore, optimism is straightforward.
Lemma C.4 (Corollary 5 of Wang et al. [2019]). Under the high probability case in Lemma C.3,
Q⋆
for all k, h, s, a
, Qk
[K]
[H]
∈
×
× S × A
h(s, a)
≥
h(s, a).
Combining optimism (Lemma C.4) with Lemma C.3, we have that Qk
condition (19) with confk
bk
h(s, a) = γ
h )−1. Below we bound the summation of bonus.
h in Algorithm 2 satisfies
φ(s, a)
k
k(Σ
Lemma C.5. Assume that confk
h(s, a) = γ
φ(s, a)
k
k(Σ
bk
h )−1, then it holds that
K
H
k=1
X
h=1
X
confk
h(sk
h, ak
h) =
K
H
γ
k=1
X
h=1
X
φ(sk
k
h, ak
h)
k(Σ
bk
h )−1 ≤
Hγ
4Kd log(1 + K).
(20)
p
Proof of Lemma C.5.
K
H
γ
h=1
X
k=1
X
H
φ(sk
k
h, ak
h)
k(Σ
H
K
bk
h )−1 ≤
K
γ
v
u
u
t
h=1
X
φ(sk
h, ak
h)
k=1
X
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2
(Σ
bk
h )−1
2
φ(sk
h, ak
h)
2
(Σk
h)−1
(21)
≤
K
γ
v
u
u
t
h=1
X
H
K
k=1
X
γ
2K
*
≤
Xh=1
=Hγ
p
4Kd log(1 + K),
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2d log(1 + K)
p
24
where the first inequality holds according to Cauchy-Schwarz inequality. The second inequality re-
sults from Lemma D.3 and the fact that det((Σbk
h)−1).
The third inequality is because of elliptical potential lemma (Lemma D.4).
h )−1) = det(Σbk
h)−1 = 2 det((Σk
2 det(Σk
h )−1
≤
Now we are ready to present the proof of the regret upper bound.
O(H√d3K) regret upper bound is derived by combining
Proof of regret upper bound. The final
Lemma C.2, Lemma C.5 and the definition that γ =
C.2 Proof of lower bound
Finally, we present the proof of the lower bound.
e
O(d).
e
Theorem C.6 (Restate Theorem 6.5). For any algorithm with sub-linear regret bound, the global
switching cost is at least Ω(dH).
Proof of Theorem C.6. Since linear MDP is a special case of generalized linear function approxima-
tion, the Ω(dH) lower bound of global switching cost in Gao et al. [2021] holds here.
D Assisting technical lemmas
Lemma D.1 (Azuma-Hoeffding inequality). Let Xi be a martingale difference sequence such that
Xi
A, A] for some A > 0. Then with probability at least 1
δ, it holds that:
[
−
∈
−
2A2n log(
1
δ
).
≤ r
n
Xi
(cid:12)
i=1
(cid:12)
X
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
Lemma D.2 (Lemma C.1 of Wang et al. [2021]). Let
[K], we have det(Σk
h)
1. Then for all h
[H] and k
∈
∈
Σk
h}(h,k)∈[H]×[K] be as defined in Algorithm
{
(λ + k−1
≤
dh )dh.
Lemma D.3 (Lemma 12 of Abbasi-Yadkori et al. [2011]). Suppose A, B
definite matrices satisfying that A < B, then for any x
Rd, we have
∈
det(A)
det(B)
.
x
k
x
k
2
A
k
2
B ≤
k
Rd×d are two positive
∈
Lemma D.4 (Elliptical Potential Lemma, Lemma 26 of Agarwal et al. [2020]). Consider a se-
1 and define
quence of d
M0 = I,
d positive semi-definite matrices X1,
×
, Mt = Mt−1 + Xt. Then
, XT with maxt T r(Xt)
* * *
≤
* * *
T r(XtM −1
t−1)
≤
2d log(1 +
T
d
).
T
t=1
X
25
|
|
http://arxiv.org/abs/2302.12453v1 | 2023-02-24T05:07:05 | 2023-02-24T05:07:05 | Inducing Neural Collapse in Deep Long-tailed Learning | Although deep neural networks achieve tremendous success on various
classification tasks, the generalization ability drops sheer when training
datasets exhibit long-tailed distributions. One of the reasons is that the
learned representations (i.e. features) from the imbalanced datasets are less
effective than those from balanced datasets. Specifically, the learned
representation under class-balanced distribution will present the Neural
Collapse (NC) phenomena. NC indicates the features from the same category are
close to each other and from different categories are maximally distant,
showing an optimal linear separable state of classification. However, the
pattern differs on imbalanced datasets and is partially responsible for the
reduced performance of the model. In this work, we propose two explicit feature
regularization terms to learn high-quality representation for class-imbalanced
data. With the proposed regularization, NC phenomena will appear under the
class-imbalanced distribution, and the generalization ability can be
significantly improved. Our method is easily implemented, highly effective, and
can be plugged into most existing methods. The extensive experimental results
on widely-used benchmarks show the effectiveness of our method | [
"Xuantong Liu",
"Jianfeng Zhang",
"Tianyang Hu",
"He Cao",
"Lujia Pan",
"Yuan Yao"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12453v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12453v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG"
] | Inducing Neural Collapse in Deep Long-tailed Learning
Xuantong Liu1,∗
Jianfeng Zhang2
1 The Hong Kong University of Science and Technology, 2Huawei Noah's Ark Lab
Tianyang Hu2
Lujia Pan2
He Cao1
Yuan Yao1,(cid:12)
3
2
0
2
b
e
F
4
2
]
G
L
.
s
c
[
1
v
3
5
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Although deep neural networks achieve tremen-
dous success on various classification tasks, the
generalization ability drops sheer when training
datasets exhibit long-tailed distributions. One of
the reasons is that the learned representations (i.e.
features) from the imbalanced datasets are less ef-
fective than those from balanced datasets. Specif-
ically, the learned representation under class-
balanced distribution will present the Neural Col-
lapse (N C) phenomena. N C indicates the fea-
tures from the same category are close to each
other and from different categories are maximally
distant, showing an optimal linear separable state
of classification. However, the pattern differs on
imbalanced datasets and is partially responsible
for the reduced performance of the model. In this
work, we propose two explicit feature regulariza-
tion terms to learn high-quality representation for
class-imbalanced data. With the proposed reg-
ularization, N C phenomena will appear under
the class-imbalanced distribution, and the gen-
eralization ability can be significantly improved.
Our method is easily implemented, highly effec-
tive, and can be plugged into most existing meth-
ods. The extensive experimental results on widely-
used benchmarks show the effectiveness of our
method.
1
INTRODUCTION
Modern deep neural networks have shown the ability to
outperform humans on many tasks, such as computer vi-
sion, natural language processing, playing games, etc., and
keep refreshing state-of-the-art performance for complex
classification tasks. However, when the training dataset is
class-imbalanced, such as a long-tailed distribution, where
(a)
(b)
(c)
Figure 1: Illustration of geometry configuration of the zero-
centered class means and classifier weights under (a) bal-
anced dataset, (b) imbalanced dataset, and (c) imbalanced
dataset with our method. The arrows represent classifier
weights and the stars are the class centers. The size of the
circle around the star reflects the variance of the feature
from the same class. In (b) and (c), red and blue represent
the majority and minority classes, respectively. Note that
under imbalanced label distribution, both the centered class
means and classifier weights form an asymmetric structure
and are no longer parallel.
a few majority classes occupy most of the training samples
while a large number of minority classes own very limited
samples, the performance of the model drops off a cliff
(Van Horn & Perona, 2017; Buda et al., 2018). These imbal-
anced distributions are ubiquitous in real-world applications,
e.g., fault diagnosis, face recognition, autonomous driving,
etc. Therefore, how to improve the discriminative ability
of the model trained on the imbalanced dataset has always
been a topic of considerable concern.
Some recent studies focus on learning more effective repre-
sentation to improve the long-tailed recognition ability. Su-
pervised contrastive loss (Khosla et al., 2020) is utilized to
learn compact within-class and maximally distant between-
class representation by introducing uniformly distributed
class centers, which leads to improvement in long-tailed per-
formance (Li et al., 2022; Cui et al., 2021; Zhu et al., 2022).
These characteristics of the feature representation are consis-
tent with those learned from balanced datasets (Graf et al.,
2021), where the classification models can spontaneously
learn tight and discriminative features. However, contrastive
Proceedings of the 26th International Conference on Artificial Intel-
ligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR:
Volume 206. Copyright 2023 by the author(s).
* This work is done when Xuantong Liu was doing her in-
ternship at Huawei Noah's Ark. (cid:12) Corresponding author email:
[email protected].
Inducing Neural Collapse in Deep Long-tailed Learning
learning is more computationally expensive and requires
more iterations to converge than the standard Cross-Entropy
(CE) loss.
Meanwhile, the learning behavior of deep classification
models in a balanced setting has been investigated both
empirically and theoretically (Papyan et al., 2020; Galanti
et al., 2021; Han et al., 2022). The Neural Collapse (N C)
phenomenon was uncovered by Papyan et al. (2020) when
investigating the last-layer embedding, i.e. the feature repre-
sentation, and the corresponding classifier weights in deep
classification models during training. N C shows that the
learned features (or embedded vectors) of the same class will
collapse to their class centers. Meanwhile, these class cen-
ters, after globally centered, as well as the classifier weights,
will form a simplex equiangular tight frame (ETF) during
the terminal phase of training (TPT), i.e. when the model
achieves zero training error. The ETF structure maximizes
the between-class variability so as the Fisher discriminant
ratio (Fisher, 1936), resulting in an optimal linear separable
state for classification. Subsequent studies have found more
characteristics of this phenomenon, including the global op-
timal property (Zhu et al., 2021) and generalization ability
(Galanti et al., 2021).
However, on imbalanced datasets, the deep neural networks
will exhibit different geometric structures, and some N C
phenomena will no longer occur (Fang et al., 2021; Thram-
poulidis et al., 2022). The last-layer features of the same
class still converge to their class means, but the class means,
as well as the classifier weights, are not in the form of ETFs
any more. Specifically, compared to majority classes, the
learned features of minority classes will have a larger norm,
and correspondingly the norm of classifier weights will be
smaller (Kang et al., 2019; Fang et al., 2021). Furthermore,
as the imbalance level increases, the phenomenon of Minor-
ity Collapse may arise, in which both the learned represen-
tations and the classifier weights on minority classes will
become indistinguishable (Fang et al., 2021). The absence
of some N C property partially explains the performance
gap between the balanced and imbalanced datasets.
In this paper, we first elaborate that the appearance of N C
can help to minimize the generalization error in the imbal-
anced problem. According to this property, we propose
two simple yet effective regularization terms to explicitly
induce all the N C phenomena in neural networks trained
on imbalanced datasets. The regularization terms can be
added to CE loss directly. Compared with supervised con-
trastive learning, these terms have lower computational cost.
Our proposed method not only helps the N C to occur faster
for models trained on the balanced datasets, but also drives
the N C phenomenon to occur on datasets with imbalanced
categories. The resulting model can also obtain better gen-
eralization ability and robustness without over-training as
in Papyan et al. (2020). Furthermore, our proposed method
is orthogonal to most existing methods dealing with long-
tailed problems. It thus can be easily plugged into the ob-
jective function to obtain further improvements.
In summary, our contributions can be listed below:
• We observe that when training data is imbalanced, the
class centers of minority classes move closer to those
of the majority classes, making their instances difficult
to distinguish.
• We demonstrate that, although some N C phenomena
do not naturally exist in an imbalanced case, we can
achieve lower generalization error when all N C propri-
eties hold. Thus we propose two simple yet effective
regularization terms to manually induce the N C during
imbalanced training.
• We experimentally show that our method can signifi-
cantly improve the performance in various long-tailed
tasks and boost most existing methods.
2 PROBLEM SETUP
2.1 Preliminaries
Let fφ ◦ gθ(*) denote a neural network classifier, where gθ(*)
is a feature extractor and fφ(*) is a linear classifier. We
define H = [h1, * * * , hn]T ∈ Rn×P to be the output of
gθ(*). Here P is the dimension of the latent feature, and n is
the training sample size. The weights of fφ are denoted by
W = [w1, * * * , wK] ∈ RP ×K, and the corresponding bias
vector is b = [b1, ..., bK], where K is the number of classes.
hi ∈ RP and yi ∈ {k}K
k=1 denote the feature and label of
the i-th sample. The label matrix is denoted by Y ∈ Rn×K.
In the training data, we have n = (cid:80)K
k=1 nk, where nk is
the sample size of class k. We use || * ||F and || * || to denote
the Frobenius norm of a matrix and the l2-norm of a vector.
Definition 1 (Simplex ETF). A simplex ETF is a collection
of equal-length and maximally-equiangular vectors. We call
a P × K matrix M an ETF if it satisfies
M TM = α
(cid:18) K
K − 1
I −
1
K − 1
1K1T
K
(cid:19)
(1)
for some non-zero scalar α. Where I is the identity matrix,
and 1K is an all-ones vector.
(cid:80)
Let μk = 1
yi=k hi be the center of class k and μC =
nk
(cid:80)K
1
k=1 μk be the arithmetic mean of the class centers.
K
In the balanced case, where we have nk = n
K for each
class, N C will appear during TPT. The phenomena can be
formally described by four properties:
• (N C1) Variability collapse. Intra-class variances col-
lapse to zero during the terminal phase of training, i.e.,
for any sample i from class k, we have
||hi − μk|| = 0
(2)
Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12)
• (N C2) Convergence to simplex ETF. The class cen-
ters (after zero-center normalization) converge to the
vertices of an ETF, i.e.
cos(μk − μC, μk(cid:48) − μC) = −
1
K − 1
,
||μk − μC|| = ||μk(cid:48) − μC||.
(3)
(4)
• (N C3) Convergence to self-duality. The weights of
linear classifiers are parallel to the corresponded zero-
centered class centers, i.e.
wk = α(μk − μC).
(5)
• (N C4) Simple decision rule. Given a feature, the last-
layer classifier's behavior is equivalent to the nearest
class center (NCC) decision rule, i.e.
arg max
k
(cid:104)wk, h(cid:105) = arg min
||h − μk||
(6)
k
2.2 Neural Collapse and Imbalanced Data
In this section, we first illustrate why N C disappears on
imbalanced datasets using mean squared error (MSE) loss.
Then we demonstrate that the N C properties will lead to a
lower generalization error bound thus we can benefit from
it under imbalanced distribution.
2.2.1 The Optimal Classifier Under Imbalanced
Distribution
Some recent studies have shown that the test performance
of neural networks trained with MSE loss is comparable to
those trained with CE loss in classification tasks (Demirkaya
et al., 2020; Fang et al., 2021; Hu et al., 2021; Han et al.,
2022). Thanks to its tractability, we can use MSE loss to
illustrate the absence of the N C phenomenon on imbalanced
datasets. For linear classifiers, the MSE loss is
L(H, W ) =
1
2n
||Y − (HW + 1nbT)||2
F .
(7)
(cid:80)n
Let ̄h = 1
i=1 hi be the global feature mean, ΣT =
n
̄h) be the total covariance matrix of
̄h)T(H − 1n
(H − 1n
H and ̇M = [μ1 − ̄h, ..., μK − ̄h] ∈ RP ×K. We can have
the closed form of the optimal W and b under the MSE loss
as follows.
Proposition 1. (Webb & Lowe, 1990). In general, for fixed
features H, the optimal weight matrix and the bias vector
that minimize L(H, W ) are
WLS = Σ†
T
̇M Λ,
bLS =
1
n
1T
n Y − μGWLS,
(8)
(9)
where † denotes the Moore-Penrose pseudoinverse, and Λ =
diag(n1, * * * , nK) is a diagonal matrix.
From Eq.(9), we can observe that the optimal weight matrix
depends on the features and is strongly affected by Λ, i.e.
the proportions of classes. Specifically, the classifier weights
of the majority classes will have larger norms. The N C
phenomena reflect the intimate connection between the last
layer features and the classifier weights. Thus, skewed
classifiers imply that the features are also biased, and many
studies have empirically investigated that the uneven label
distribution can lead to an imbalanced feature space (Kang
et al., 2020; Fang et al., 2021; Li et al., 2022).
Particularly, Fang et al. (2021) show the Minority Collapse
phenomenon that reveals the skewed classifier weights en-
countering an imbalanced label distribution where majority
classes own much more samples than the minority ones. In
addition, they theoretically prove that unbiased classifiers
can be obtained through over-sampling. However, empirical
results show a limited performance improvement or even
decline due to the over-fitting of the minority classes (Drum-
mond et al., 2003; Weiss et al., 2007). On the other hand, the
classifiers are always better tuned than the learned features
(Thrampoulidis et al., 2022). Therefore, in this work, we
mainly focus on regularizing the embeddings during train-
ing to get non-skewed and representative features. Then we
tune a balanced classifier based on our well-learned features.
2.2.2
Importance of N C on Imbalanced Datasets
As we already know that when the training set is class-
imbalanced, the geometric structure of the classifiers and
centered class means are not symmetric, which may intro-
duce some bias in the model and affect the performance
of the test set (Kang et al., 2019, 2020; Fang et al., 2021).
Recent work indicates that compact within-class represen-
tations along with evenly distributed class centers can help
learn high-quality representations, and substantial practice
confirms this (Li et al., 2022; Zhu et al., 2022; Cui et al.,
2022). These intuitions lead to similar situations with N C.
In this section, we explain why the N C can be considered
favorable representations and can provide reduced general-
ization errors under long-tailed distributions from the per-
spective of domain adaptation.
As a standard evaluation approach in long-tailed learning,
models are usually tested on balanced datasets. Since the
training set is imbalanced, we can regard this scenario as
a label shift domain adaptation problem, where the source
domain is imbalanced, and the target domain is balanced.
First, the following proposition shows that properties of
N C1 and N C2 can be approximately preserved in the target
domain.
Proposition 2. (Galanti et al., 2021) Let μS
k ) and
σS
k (resp. σT
k ) be the mean and variance of the representa-
tions of class k on the source domain (resp. target domain).
For any two different classes, k and k(cid:48), with probability at
k (resp. μT
Inducing Neural Collapse in Deep Long-tailed Learning
least 1 − δ over DS, we have
3.1 Feature Regularization
σT
k + σT
k(cid:48)
k − μT
2(cid:107)μT
k(cid:48)(cid:107)2
√
≤ (1 + A2)
(cid:18) σS
2(cid:107)μS
k + σS
k(cid:48)
k − μS
k(cid:48)(cid:107)2
√
(cid:19)
+ B
, (10)
where A =
O(
log(1/δ)/nk)
k −μT
k(cid:48) ||
||μT
, B =
O(
log(1/δ)/nk)
k −μS
k(cid:48) ||2
||μS
.
k −μT
The ETF geometry of {μk}K
k=1 indicates that the distance
(cid:107)μS
k − μS
k(cid:48)(cid:107) achieve maximum value for all k (cid:54)= k(cid:48). On the
other hand, (cid:107)μT
k(cid:48)(cid:107)
(Galanti et al., 2021). Hence, A and B are upper bounded
and diminish to zero as nk gets larger. Therefore, we can
roughly speak N C1 and N C2 can generalize to the target
domain.
k(cid:48)(cid:107) is also lower bounded by (cid:107)μS
k −μS
We then illustrate how the existence of N C1 and N C2 help
to reduce the generalization error. According to Ben-David
et al. (2006), for any classifier h, the error on target domain
(cid:15)T (h) will be bound by the empirical error on the source
domain and the divergence between source and target feature
domains plus a constant:
(cid:15)T (h) ≤ ˆ(cid:15)S(h) + dH(DZ
S , DZ
T ) + const,
(11)
S , DZ
where dH(DZ
T )1 measures some 'distance' between
source and target domains over the feature space Z. Al-
though not exactly the same, substituting dH with the
Jensen–Shannon distance dJS (Endres & Schindelin, 2003)
will not significantly change the result. Theoretically, min-
imizing dJS between source and target distributions will
reduce the right-hand side of Eq.(11) as well. Let DZ and
DY be the distributions defined over the latent feature space
and label space, respectively. As DY can be induced from
DZ from a generative perspective, according to Zhao et al.
(2019), we have
dJS(DZ
S , DZ
T ) ≥ dJS(DY
S , DY
T ),
(12)
S , DZ
T ) is the lower bounded by dJS(DY
i.e., dJS(DZ
T ),
which is a constant determined by source and target label
distributions.
S , DY
With N C1 and N C2, the distribution over Z collapses
to a K-component mixture Dirac distribution. More pre-
cisely, we have Pr(Z = h) = Pr(Y = y). In this case,
T ) attains its lower bound dJS(DY
dJS(DZ
T ), which
is the objective of some classical domain adaptation algo-
rithms (Long et al., 2015; Ganin et al., 2017),
S , DZ
S , DY
3 LEARNING REPRESENTATION VIA
INDUCING NEURAL COLLAPSE
The previous analysis inspires us to induce N C phenomena
to imbalanced training. We mainly focus on the core proper-
ties, N C1 and N C2, and come up with two corresponding
regularization terms.
1dH(DZ
S , DZ
T ) denotes the H-divergence between DZ
S and DZ
T ,
a precise definition is provided in Ben-David et al. (2010).
Compact within-class features. N C1 underlines that the
model is seeking to learn compact within-class features by
pushing the last-layer embedding to be close to their class
centers, which seems natural but actually hard to achieve in
practice. Han et al. (2022) decomposed the MSE loss and
discovered that the loss in the late training stages is domi-
nated by the (cid:96)2-distance between the feature and the corre-
sponding class center. This indicates that although N C1 is
the inevitable trend, it is quite difficult to realize. Therefore,
we add explicit regularization to make N C1 more inclined
to appear. Especially, for the class-imbalanced dataset, we
consider the inverse ratio of class sizes as weights to avoid
excessive force on the majority classes. This indicates the
difference between our N C1 regularization and the center
loss (Wen et al., 2016) that pushes all features equally to
their class center. Formally, we define the N C1 regular-
ization as the within-class feature distance, LW , with the
formula of
LW =
K
(cid:88)
(cid:88)
k=1
yi=k
1
nk
||hi − μk||2
2.
(13)
Distinct between-class features. N C2 shows that with
balanced class distribution, all pairs of centered class means
tend to form equal-sized angles, implying the maximally
separated between-class features. However, under the imbal-
anced distribution, the class centers of the minority classes
are close to the majority ones, leading to indistinguishable
features. Therefore, we propose N C2 regularization to mini-
mize the maximal pairwise cosine similarity between all the
centered class means, equivalent to maximizing the minimal
pairwise angle. Consider the angular version, the objective
of N C2 regularization is:
max min
k(cid:54)=k(cid:48)
arccos
(cid:104) ̇μk, ̇μk(cid:48)(cid:105)
|| ̇μk|| * || ̇μk(cid:48)||
,
(14)
where ̇μk = μk − μC. As noted in Wang et al. (2020), up-
dating the average of each vector's maximum cosine is more
efficient than just optimizing the global maximum cosine.
Therefore, we define the formula for the N C2 regularization
as
LB = −
1
K
K
(cid:88)
k=1
min
k(cid:48),k(cid:48)(cid:54)=k
arccos
(cid:104) ̇μk, ̇μk(cid:48)(cid:105)
|| ̇μk|| * || ̇μk(cid:48)||
.
(15)
In summary, our proposed feature regularization includes
two terms, LW and LB, corresponding to minimize the
within-class distance and maximize the between-class dis-
crepancy, respectively. They can be easily coupled with
supervised losses with a linear classifier to regularize the
penultimate layer embedding. Finally, we have the follow-
ing loss for training:
L = Lsup + λ1LW + λ2LB.
(16)
Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12)
where Lsup denotes the supervised loss, e.g. CE loss and
MSE loss. λ1 and λ2 are hyperparameters that control the
impact of LW and LB.
3.2 Occurrence of Neural Collapse
First, we illustrate that LB will lead all pairs of the K class
means to have the same cosine equals to − 1
K−1 , with the
following proposition.
Proposition 3. (Wang et al., 2020) The minimum of the
maximal pair-wise cosine similarity between n vectors is
−1
n−1 , which can be reached when the vectors have an equal-
sized pair-wise angle and zero mean.
Therefore, denote ˆM = [
̇μK
̇μ1
|| ̇μK || ]. Recall that the
|| ̇μ1|| , ...,
objective of LB is to minimize the maximal pair-wise cosine
similarity of the centered class means, thus with LB, we
have
ˆM T ˆM =
K
K − 1
I −
1
K − 1
1K1T
K.
(17)
According to Definition 1, ˆM form a simplex ETF. Fur-
thermore, although LW and LB do not explicitly enforce
the centered class means to have an equal norm, we em-
pirically observe this desired result (see the experimental
result in Section 4.2.1). Let || ̇μ1|| = * * * = || ̇μK|| = α and
̄M = [ ̇μ1, * * * , ̇μK], then we have
̄M T ̄M = α
(cid:18) K
K − 1
I −
1
K − 1
(cid:19)
,
1K1T
K
(18)
indicating the centered class means indeed from an ETF.
Therefore, with the proposed feature regularization terms
LW and LB, N C1 and N C2 can happen even when the
training set is imbalanced.
In addition, we can prove that with the existence of N C1
and N C2, retrain the classifier with class-balance sampling,
the classifier can become parallel with the centered feature
mean, indicating the self-duality (N C3). Ultimately, the
symmetric structure of the regularized class means brings
about an unbiased linear classifier.
Proposition 4. Proposition 1+N C1+N C2+class-balanced
sampling can lead to N C3.
Proof. With class-balanced sampling, the training label dis-
tribution can be regarded as balanced, and ̇M = ̄M . Then
the optimal re-trained classifier Wr is
n
K
with the existence of N C1, we have ΣT = ̇M ̇M T. Thus,
Wr =
̇M ,
Σ†
T
(19)
Wr =
=
=
n
K
n
K
n
K
( ̇M ̇M T)† ̇M
( ̇M ̇M T)† ̇M ̇M T( ̇M T)†
( ̇M T)†,
̇M form a simplex-ETF, thus,
with N C2 which implies that
( ̇M T)† = c ̇M for some constant c (Papyan et al., 2020),
then we can obtain Wr = α ̇M , demonstrating the asserted
self-duality (N C3).
In conclusion, with the proposed LW and LB, we can obtain
compact within-class and distinct between-class representa-
tions under imbalanced-class distribution. In line with linear
discriminant analysis (LDA) (Fisher, 1936), this provides
an optimal solution for the linear classifier.
4 EXPERIMENTS
4.1 Classification and long-tailed recognition
In this section, we conduct various experiments on image
classification tasks on both balanced and long-tailed datasets
to validate the effectiveness of our method. We denote
our approach as NC, indicating the occurrence of the N C
phenomena. By default, CE is adopted as Lsup.
4.1.1 Experiment Setup
Datasets. Two balanced datasets (CIFAR10 and CI-
FAR100) and three long-tailed datasets (CIFAR10-LT,
CIFAR100-LT, and ImageNet-LT) are used in our exper-
iments. Following Cao et al. (2019), CIFAR10/100-LT are
created by downsampling each class's samples to obey an
exponential decay with an imbalance ratio r = 100 and
10. Here r = max{nk}/ min{nk}.
ImageNet-LT (Liu
et al., 2019), including 115,846 samples and 1,000 cate-
gories with size ranging from 5 to 1,280, is generated from
the ImageNet-2012 (Deng et al., 2009) dataset using a Pareto
distribution with the power value α = 6.
Baselines.
In addition to the typical approaches for ad-
dressing imbalanced data, such as re-sampling (RS) and
re-weighting (RW) in inverse proportion to the class size,
the investigation of more conducive methods that decou-
ple representation learning and classifier training, as well
as relevant methods inspired by N C, are also carried out.
To be specific, we compare traditional supervised learning
methods with DRW (Cao et al., 2019), LWS (Kang et al.,
2019), and cRT (Kang et al., 2019), and two recent works,
namely BBN (Zhou et al., 2020) and MiSLAS (Zhong et al.,
2021). Our comparison also includes supervised contrastive
learning approaches, namely FCL (Kang et al., 2020), KCL
(Kang et al., 2020), and TSC (Li et al., 2022). In addition,
the comparison involves N C-inspired methods such as ETF
classifier+DR (Yang et al., 2022) and ARB-Loss (Xie et al.,
2023).
Implementation details. We mainly follow the common
training protocol. In all experiments, we adopt SGD opti-
mizer with the momentum of 0.9, weight decay of 0.005,
Inducing Neural Collapse in Deep Long-tailed Learning
and train the model for 200 epochs following Alshammari
et al. (2022). We utilize mix-up (Zhang et al., 2018) dur-
ing the representation learning stage for all datasets. For
CIFAR10/100(-LT), we use ResNet-32 (He et al., 2016)
as the backbone and a multi-step schedule that decays the
learning rate as its 0.1 at the 160-th and 180-th epochs with
initialization of 0.1. We use 4 GeForce GTX 2080Ti GPUs
with a batch size of 128. For ImageNet-LT, we use ResNeXt-
50 (Xie et al., 2017) as the backbone and cosine schedule
that gradually decays the learning rate from 0.05 to 0. We
use 4 Tesla V100 GPUs to train the models with a batch
size of 256. We also adopt Randaugment (Cubuk et al.,
2020) for ImageNet-LT. We report the average results of
three independent trials with different random seeds. Our
code is available at https://github.com/Pepper-lll/NCfeature.
The hyperparameters λ1 and λ2 need to be adjusted ac-
cording to the complexity of the datasets. In general, sim-
ple datasets with few categories require a small magnitude
of feature regularization, while for complex datasets with
plenty of categories, we need larger λ1 and λ2. Besides,
similar to Li et al. (2022), we also find that it is better to reg-
ularize the feature learning from half of the training process
for large-scale datasets, i.e., CIFAR100 and ImageNet-LT.
Our hyperparameter settings and the epoch number to start
feature regularization are summarized in Table 1.
The class centers {μk}K
k=1 are updated in each mini-batch,
instead of in the entire training set, which has been proved
not efficient in large-scale datasets (Wen et al., 2016). Be-
sides, our regularization terms are better to combine with
re-balancing strategies to ensure the matching between clas-
sifier weights and class centers. The combination can lead to
a remarkable improvement. In our experiments, we choose
DRW and cRT as the re-balancing strategies.
cluding Many-shot (>100 samples), Medium-shot (20∼100
samples), and Few-shot (<20 samples). The results show
that our method can substantially improve the accuracy of
the Medium- and Few-shot categories with almost no impact
on the accuracy of the Many-shot categories compared to
the plain training with CE.
Table 2: Top-1 test accuracy (%) on the balanced datasets.
Method CIFAR10 CIFAR100
CE
+NC
MSE
+NC
93.4
93.3
91.1
91.7
71.8
72.1
70.7
71.9
Table 3: Top-1 test accuracy (%) on CIFAR10-LT and
CIFAR100-LT. The results of the compared methods are
obtained from their respective original papers. The best and
second-best results are marked in bold and underlined.
Method
CIFAR10-LT CIFAR100-LT
imbalance ratio
CE
CE-RS
CE-RW
CE-DRW
LDAM-DRW
BBNm
MiSLAS
KCL
TSC
100
70.4
72.8
74.4
75.1
77.0
79.9
82.1
77.6
79.7
ETF classifier+ DR 76.5
83.3
ARB-Loss
NC-DRW
NC-DRW-cRT
81.9
82.6
10
86.4
87.8
87.9
86.4
88.2
88.4
90.0
88.0
88.7
87.7
90.2
89.8
90.2
100
38.4
36.7
32.5
42.5
43.5
42.6
47.0
42.8
43.8
45.3
47.2
48.6
48.7
10
55.7
57.7
58.2
56.2
58.7
59.2
63.2
57.6
59.0
-
62.1
63.1
63.6
Table 1: Hyperparameter setting.
Dateset
CIFAR10(-LT)
CIFAR100(-LT)
ImageNet-LT
λ1
0.01
0.01
0.05
λ2
0.1
0.5
1.0
start epoch
0
100
100
4.1.2 Results
Balanced data. As we mentioned before, our method is
applicable to both balanced and imbalanced datasets. First,
we conduct experiments to validate our model on balanced
CIFAR10 and CIFAR100 datasets. Table 2 shows that our
method can reduce the generalization error with both CE
and MSE loss.
Imbalanced data. Table 3 and 4 present our results on
CIFAR10-LT, CIFAR100-LT, and ImageNet-LT. We can
find that our method surpasses existing methods on all three
datasets. For ImageNet-LT, we further test the accuracy
on three groups of classes according to the sample size, in-
Combine with existing approaches. Our regularization
terms can be easily plugged into most of the existing algo-
rithms. To validate the effectiveness, in Table 5, we add
the proposed regularization terms to three different types
of algorithms. We follow their original experiment set-
tings to compare the performance differences before and
after adding regularization terms. The results show that our
regularization terms can increase the accuracy in all three
algorithms.
4.2 Discussions
In this section, to verify the correctness and further explore
the properties of our method, we show the learned repre-
sentations, performance robustness, and ablation study on
various combinations of loss and regularizations.
4.2.1 Representation Analysis
We extensively analyze the representations learned with our
method to explain the advantages relative to the baseline.
Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12)
Table 4: Top-1 test accuracy (%) on ImageNet-LT.
features learned by our method are more generalizable.
Methods
CE
CE-RS
CE-RW
CE-DRW
CE-cRT
CE-LWS
MiSLAS
FCL
KCL
TSC
ETF classifier+ DR
ARB-Loss
NC-DRW
NC-DRW-cRT
Many Medium Few
All
68.2
64.6
52.0
52.6
58.8
57.1
61.7
61.4
62.4
63.5
-
60.2
67.1
65.6
38.1
42.6
41.4
45.7
33.0
45.2
51.3
47.0
49.0
49.7
-
51.8
49.7
51.2
5.82
17.8
19.8
31.5
26.1
29.3
35.8
28.2
29.5
30.4
-
38.3
29.0
35.4
45.3
47.8
42.5
46.4
47.3
47.7
52.7
49.8
51.5
52.4
44.7
52.8
53.6
54.2
Table 5: Top-1 test accuracy (%) on real-world long-tail
datasets of our methods combined with others. Note that we
replicated experiments of RIDE with data distributed paral-
lel training and got results with slight differences from Wang
et al. (2021). c10, c100 and iNet are short for CIFAR10,
CIFAR100 and ImageNet respectively.
Method
c10-LT
c100-LT
iNet-LT
LDAM-DRW
+NC
Logit Adjust
+NC
RIDE (2 experts)
RIDE (3 experts)
RIDE (4 experts)
+NC (2 experts)
+NC (3 experts)
+NC (4 experts)
77.0
77.1(0.1↑)
77.4
78.8(1.4↑)
-
-
-
-
-
-
42.0
43.2(1.2↑)
43.9
44.6(0.7↑)
46.5
47.5
48.8
46.8(0.3↑)
48.1(0.6↑)
49.1(0.3↑)
48.8
49.5(0.7↑)
51.1
53.2(2.1↑)
51.9
54.2
55.2
52.2(0.3↑)
54.8(0.6↑)
56.0(0.8↑)
As for the corresponding analysis of classifiers, we obtained
consistent findings with previous studies (Kang et al., 2019)
and therefore do not repeat them here.
Maximally separated class centers. We compare the
pair-wise angles of the centered class means learned on
CIFAR10-LT with vanilla training, re-sampling (RS), re-
weighting (RW), and the proposed regularization terms in
Figure 2. We arrange the class indexes in descending order
based on their sizes. Under a long-tailed distribution, the
minority class centers move closer to the majority with plain
model. In Figure 2(a), the angles between class 8 and 0,
class 9 and 1, and class 5 and 3 are around 50◦ which is
far lower than the optimal angle of 96◦. RS and RW can
assist in the acquisition of more distinguishable features,
as demonstrated Figure 2(b) and 2(c)). However, with our
regularization terms (Figure 2(d)), we can observe that the
pair-wise angles between all the class centers remain consis-
tently close to the optimum value. In addition, the significant
improvement on the experimental results indicates that the
Zero-centered class means with the equal norm. Al-
though neither LW nor LB forces the class center to be
of equal norm, we can observe it in our experiments, as
shown in Figure 3. This result strongly indicates that we
can successfully induce N C in imbalanced data.
4.2.2 Robustness
We test the robustness of our method against random noise
with different neural networks on CIFAR10/100 and their
long-tailed version where the imbalance ratio r = 100.
Here Resnet-32 and ResNet-18 are employed. ResNet-18
is a wider network with the last-layer feature dimension of
512, while ResNet-32 is 64. The models are all trained with
DRW. The results are reported in Table 6. We can observe
that our regularization terms can improve the robustness for
different model capacities.
4.2.3 Ablation Study
We conduct experiments to examine the effectiveness of
two regularization terms separately over CE loss and the
comparison with center loss. The results, presented in Ta-
ble 7, demonstrate that each term can significantly improve
accuracy individually, and that their combination produces
the best results. Meanwhile, LW consistently produces bet-
ter results than center loss, suggesting that modifying the
coefficient is crucial. We can also find that N C2 property is
more useful, implying the importance of sufficiently distant
class centers for the long-tail recognition task.
5 RELATED WORK
5.1 Long-tailed recognition
Long-tailed distribution is ubiquitous in the real world,
which brings big challenges for most deep learning mod-
els. Classical methods dealing with this problem include
data re-sampling and loss re-weighting. The former refers
to re-sampling the instances to achieve relatively balanced
training data, basically including over-sampling (Ando &
Huang, 2017; Shelke et al., 2017), under-sampling (Shelke
et al., 2017), and class-balanced sampling (Cui et al., 2019).
Instead of changing the original data distribution, loss re-
weighting uses cost-sensitive re-weighting strategies and as-
signs different weights to instances from different classes ac-
cording to the sample sizes (Lin et al., 2017; Cui et al., 2019).
However, although the re-sampling and re-weighting ap-
proaches can improve the performance of minority classes,
they may lead to overfitting (Li et al., 2022) and hurt the
representation learning (Kang et al., 2019).
Recent works also focus on representation learning under
long-tailed data distribution. This stream of study mainly
Inducing Neural Collapse in Deep Long-tailed Learning
Table 6: Random Noise Robustness Results. CE‡ denotes Cross-Entropy loss with the feature regularization LW + LB.
Gaussian noise std
0.00
0.10
0.20
0.30
0.40
0.00
0.10
0.20
0.30
0.40
Dataset
CIFAR10
CIFAR10-LT
CIFAR100
CIFAR100-LT
Loss
CE
CE‡
CE
CE‡
CE
CE‡
CE
CE‡
ResNet-32
76.6
76.6
62.3
63.2
40.0
39.7
25.4
27.2
54.7
57.5
45.3
47.8
23.9
23.9
16.3
16.8
89.4
89.6
75.0
75.5
60.2
59.0
37.2
39.0
93.3
93.1
77.0
79.2
71.8
72.3
42.5
45.7
35.7
39.0
32.5
35.5
14.1
15.1
10.2
11.1
94.9
95.1
79.2
81.0
78.2
78.6
46.8
47.2
ResNet-18
79.2
78.9
63.5
66.5
44.2
46.9
31.6
31.6
56.9
57.1
47.2
51.4
25.0
28.2
23.6
23.3
91.5
91.8
75.7
77.5
65.9
67.8
41.1
41.6
35.9
37.4
33.8
37.9
14.3
16.6
17.6
16.3
(a) vanilla
(b) w/ RS
(c) w/ RW
(d) w/ LW and LB
Figure 2: Pair-wise angle degree between centered class means trained on CIFAR10-LT. Note that the optimal pair-wise
angle for 10 classes is arccos −1
10−1 ≈ 96.4◦.
Table 7: Ablation studies on the effectiveness of each reg-
ularization term on CIFAR10/100-LT. Note that we apply
DRW for all experiments here.
Method
CIFAR10-LT CIFAR100-LT
imbalance ratio
CE
+Centor Loss
+LW
+LB
+Centor Loss &LB
+LW &LB
100
75.1
78.7
79.1
80.1
77.5
81.9
10
86.4
89.1
88.1
88.6
89.2
89.8
100
42.4
46.3
46.9
47.6
46.5
48.6
10
56.2
61.2
61.3
61.7
61.4
63.1
follows a two-stage training scheme that decouples the rep-
resentation and classifier learning (Kang et al., 2019; Zhong
et al., 2021; Li et al., 2022; Kang et al., 2020; Zhu et al.,
2022). Kang et al. (2019) observed that a high-quality rep-
resentation requires fully utilizing the training instances
equally, while a re-balancing technique is crucial for an
unbiased classifier. On the other hand, some works take
advantage of the superior representation learning ability of
contrastive loss to extract the feature for deep long-tailed
learning; then train a classifier upon the feature extractor
with cost-sensitive loss or class-balanced sampling (Kang
et al., 2020; Li et al., 2022; Zhu et al., 2022). Supervised con-
trastive learning shows superiority in representation learning
under imbalanced distribution and achieves SOTA for long-
tailed recognition tasks (Li et al., 2022; Zhu et al., 2022;
Cui et al., 2022). However, these methods usually converge
(a) CIFAR10(-LT)
(b) CIFAR100(-LT)
Figure 3: The norm of centered class means on a balanced
dataset, long-tailed dataset w/ and w/o inducing NC is rep-
resented in different colors. Note that the class index is
inversely sorted by the sample size.
slowly and require complex network structures compared to
traditional supervised learning.
Researchers also explored methods based on the ensemble.
They usually utilize multiple models over different data
distributions (Wang et al., 2021) or perform representation
learning and classifier training with separate branches (Zhou
et al., 2020; Zhu et al., 2022). This kind of approach is
generally considered to be orthogonal to the single-model
approach described above.
5.2 Neural collapse
A recent study (Papyan et al., 2020) discovered the phe-
nomenon named Neural Collapse (N C), stating that the
last-layer embedding and classifiers will converge to a sym-
Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12)
metric geometry named simplex Equiangular Tight Frame
(ETF) for deep classifiers trained on balanced data. A more
precise description of the N C phenomena is delivered in
Section 2.1. Subsequent studies indicate that N C will even-
tually occur, independent of the loss function, the optimizer,
batch-normalization, and regularization, as long as the train-
ing data exhibits a balanced distribution (Zhu et al., 2021;
Han et al., 2022; Kothapalli et al., 2022). Meanwhile, the
intrinsic merit of N C has also been revealed, including
ensuring global optimality, stronger generalization and ro-
bustness, and transferability (Papyan et al., 2020; Zhu et al.,
2021; Galanti et al., 2021).
The investigation of N C has also been carried over to the
imbalanced data case, where different phenomena are un-
covered. Fang et al. (2021) demonstrated that the minority
classifiers have smaller pair-wise angles than the majority
ones and will even merge together as the imbalance level
increases, named Minority Collapse. This phenomenon pro-
vides some reason of the performance drop. Thrampoulidis
et al. (2022) provides a general frame that is equivalent to
ETF for balanced data, and reveals an asymmetric geometry
of the last-layer feature and classifiers for imbalanced dis-
tribution. Furthermore, the perfect alignment between the
class feature means and classifiers vanished under the im-
balanced distribution. However, Thrampoulidis et al. (2022)
illustrates the general geometry with a special encoding
framework and does not discuss whether this geometry with
an imbalanced dataset has merit or defect.
Inspired by the N C phenomenon, some researchers have
attempted to improve the model's classification ability en-
countering imbalanced distribution by eliminating Minority
Collapse, including fixing the classifier as an ETF (Yang
et al., 2022) and adjusting the CE loss (Xie et al., 2023).
Distinct from these works, our work analyzes that obtaining
high-quality features is the key to the improvement and thus
proposes regularization to guide learning representations.
6 CONCLUSIONS
In this paper, we argue that the existence of N C is crucial
for long-tailed recognition and propose two simple but ef-
fective regularization terms to induce the appearance of N C.
We empirically show that under the imbalanced data distri-
bution, the class centers of minority classes are close to the
majority ones, leading to the overlap among different classes
over the feature space and confusion of the classifier. With
our method, the deep classification models are able to learn
compact within-class and maximally distinct between-class
features. Extensive experiments confirm that our method
can enhance the generalization power of the deep classifica-
tion model, especially when the training set is imbalanced.
Our method is more efficient than contrastive loss based
methods, and we set new state-of-the-art performance for
single model based methods on widely used benchmarks.
Our proposed regularization guides the representation learn-
ing to be of 'optimal' geometry for classification, which
is particularly beneficial for training sets with imbalanced
labels. However, the learned geometry is validated empiri-
cally and lacks complete theoretical guarantees, leading to
manually tuning the related hyperparameters. In the future,
we plan to formally analyze the geometry obtained with our
regularization and provide some theoretical justification for
the choice of hyperparameters.
Acknowledgements
This work was supported in part by National Natu-
ral Science Foundation of China / Research Grants
Council (NSFC/RGC) Joint Research Scheme Grant
N HKUST635/20, Hong Kong Research Grant Council
(HKRGC) Grant 16308321, ITF UIM/390, as well as awards
from Smale Institute of Mathematics of Computation. This
research made use of the computing resources of the X-GPU
cluster supported by the HKRGC Collaborative Research
Fund C6021-19EF.
References
Alshammari, S., Wang, Y.-X., Ramanan, D., and Kong,
In
S. Long-tailed recognition via weight balancing.
Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition, pp. 6897–6907, 2022.
Ando, S. and Huang, C. Y. Deep over-sampling framework
for classifying imbalanced data. In Joint European Con-
ference on Machine Learning and Knowledge Discovery
in Databases, pp. 770–785. Springer, 2017.
Ben-David, S., Blitzer, J., Crammer, K., and Pereira, F. Anal-
ysis of representations for domain adaptation. Advances
in neural information processing systems, 19, 2006.
Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A.,
Pereira, F., and Vaughan, J. W. A theory of learning
from different domains. Machine learning, 79(1):151–
175, 2010.
Buda, M., Maki, A., and Mazurowski, M. A. A systematic
study of the class imbalance problem in convolutional
neural networks. Neural networks, 106:249–259, 2018.
Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma,
T. Learning imbalanced datasets with label-distribution-
aware margin loss. Advances in neural information pro-
cessing systems, 32, 2019.
Cubuk, E. D., Zoph, B., Shlens, J., and Le, Q. V. Ran-
daugment: Practical automated data augmentation with a
reduced search space. In Proceedings of the IEEE/CVF
conference on computer vision and pattern recognition
workshops, pp. 702–703, 2020.
Cui, J., Zhong, Z., Liu, S., Yu, B., and Jia, J. Parametric
contrastive learning. In Proceedings of the IEEE/CVF
Inducing Neural Collapse in Deep Long-tailed Learning
international conference on computer vision, pp. 715–
724, 2021.
conference on computer vision and pattern recognition,
pp. 770–778, 2016.
Cui, J., Zhong, Z., Tian, Z., Liu, S., Yu, B., and Jia, J. Gen-
eralized parametric contrastive learning. arXiv preprint
arXiv:2209.12400, 2022.
Hu, T., Wang, J., Wang, W., and Li, Z. Understanding
square loss in training overparametrized neural network
classifiers. arXiv preprint arXiv:2112.03657, 2021.
Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class-
balanced loss based on effective number of samples. In
Proceedings of the IEEE/CVF conference on computer
vision and pattern recognition, pp. 9268–9277, 2019.
Demirkaya, A., Chen, J., and Oymak, S. Exploring the role
of loss functions in multiclass classification. In 2020 54th
annual conference on information sciences and systems
(ciss), pp. 1–5. IEEE, 2020.
Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei,
L. Imagenet: A large-scale hierarchical image database.
In 2009 IEEE conference on computer vision and pattern
recognition, pp. 248–255. Ieee, 2009.
Drummond, C., Holte, R. C., et al. C4. 5, class imbal-
ance, and cost sensitivity: why under-sampling beats
In Workshop on learning from imbal-
over-sampling.
anced datasets II, volume 11, pp. 1–8. Citeseer, 2003.
Endres, D. M. and Schindelin, J. E. A new metric for prob-
ability distributions. IEEE Transactions on Information
theory, 49(7):1858–1860, 2003.
Fang, C., He, H., Long, Q., and Su, W. J. Exploring deep
neural networks via layer-peeled model: Minority col-
lapse in imbalanced training. Proceedings of the National
Academy of Sciences, 118(43):e2103091118, 2021.
Fisher, R. A. The use of multiple measurements in tax-
onomic problems. Annals of eugenics, 7(2):179–188,
1936.
Galanti, T., Gy ̈orgy, A., and Hutter, M. On the role of neural
collapse in transfer learning. In International Conference
on Learning Representations, 2021.
Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle,
H., Laviolette, F., Marchand, M., and Lempitsky, V. S.
Domain-adversarial training of neural networks.
In
Csurka, G. (ed.), Domain Adaptation in Computer Vi-
sion Applications, Advances in Computer Vision and
Pattern Recognition, pp. 189–209. Springer, 2017. doi:
10.1007/978-3-319-58347-1\ 10.
Graf, F., Hofer, C., Niethammer, M., and Kwitt, R. Dis-
In Interna-
secting supervised constrastive learning.
tional Conference on Machine Learning, pp. 3821–3830.
PMLR, 2021.
Han, X., Papyan, V., and Donoho, D. L. Neural collapse un-
der MSE loss: Proximity to and dynamics on the central
path. In International Conference on Learning Represen-
tations, 2022.
He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learn-
ing for image recognition. In Proceedings of the IEEE
Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng,
J., and Kalantidis, Y. Decoupling representation and
In International
classifier for long-tailed recognition.
Conference on Learning Representations, 2019.
Kang, B., Li, Y., Xie, S., Yuan, Z., and Feng, J. Exploring
balanced feature spaces for representation learning. In
International Conference on Learning Representations,
2020.
Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola,
P., Maschinot, A., Liu, C., and Krishnan, D. Supervised
contrastive learning. Advances in Neural Information
Processing Systems, 33:18661–18673, 2020.
Kothapalli, V., Rasromani, E., and Awatramani, V. Neural
collapse: A review on modelling principles and general-
ization. arXiv preprint arXiv:2206.04041, 2022.
Li, T., Cao, P., Yuan, Y., Fan, L., Yang, Y., Feris, R. S.,
Indyk, P., and Katabi, D. Targeted supervised contrastive
learning for long-tailed recognition. In Proceedings of the
IEEE/CVF Conference on Computer Vision and Pattern
Recognition, pp. 6918–6928, 2022.
Lin, T.-Y., Goyal, P., Girshick, R., He, K., and Doll ́ar, P.
Focal loss for dense object detection. In Proceedings of
the IEEE international conference on computer vision,
pp. 2980–2988, 2017.
Liu, Z., Miao, Z., Zhan, X., Wang, J., Gong, B., and Yu, S. X.
Large-scale long-tailed recognition in an open world. In
Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition, pp. 2537–2546, 2019.
Long, M., Cao, Y., Wang, J., and Jordan, M. Learning trans-
ferable features with deep adaptation networks. In Bach,
F. and Blei, D. (eds.), Proceedings of the 32nd Interna-
tional Conference on Machine Learning, volume 37 of
Proceedings of Machine Learning Research, pp. 97–105,
Lille, France, 07–09 Jul 2015. PMLR.
Papyan, V., Han, X., and Donoho, D. L. Prevalence of
neural collapse during the terminal phase of deep learn-
ing training. Proceedings of the National Academy of
Sciences, 117(40):24652–24663, 2020.
Shelke, M. S., Deshmukh, P. R., and Shandilya, V. K. A
review on imbalanced data handling using undersampling
and oversampling technique. Int. J. Recent Trends Eng.
Res, 3(4):444–449, 2017.
Thrampoulidis, C., Kini, G. R., Vakilian, V., and Behnia, T.
Imbalance trouble: Revisiting neural-collapse geometry.
arXiv preprint arXiv:2208.05512, 2022.
Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12)
Zhu, J., Wang, Z., Chen, J., Chen, Y.-P. P., and Jiang, Y.-
G. Balanced contrastive learning for long-tailed visual
recognition. In Proceedings of the IEEE/CVF Conference
on Computer Vision and Pattern Recognition, pp. 6908–
6917, 2022.
Zhu, Z., Ding, T., Zhou, J., Li, X., You, C., Sulam, J., and
Qu, Q. A geometric analysis of neural collapse with
unconstrained features. Advances in Neural Information
Processing Systems, 34:29820–29834, 2021.
Van Horn, G. and Perona, P. The devil is in the tails:
Fine-grained classification in the wild. arXiv preprint
arXiv:1709.01450, 2017.
Wang, X., Lian, L., Miao, Z., Liu, Z., and Yu, S. Long-tailed
recognition by routing diverse distribution-aware experts.
In International Conference on Learning Representations,
2021.
Wang, Z., Xiang, C., Zou, W., and Xu, C. Mma regu-
larization: Decorrelating weights of neural networks by
maximizing the minimal angles. Advances in Neural
Information Processing Systems, 33:19099–19110, 2020.
Webb, A. R. and Lowe, D. The optimised internal rep-
resentation of multilayer classifier networks performs
nonlinear discriminant analysis. Neural Networks, 3(4):
367–375, 1990.
Weiss, G. M., McCarthy, K., and Zabar, B. Cost-sensitive
learning vs. sampling: Which is best for handling unbal-
anced classes with unequal error costs? In Proceedings
of the 2007 International Conference on Data Mining
(DMIN), volume 7, pp. 35–41, Las Vegas, Nevada, USA,
2007.
Wen, Y., Zhang, K., Li, Z., and Qiao, Y. A discriminative
feature learning approach for deep face recognition. In
European conference on computer vision, pp. 499–515.
Springer, 2016.
Xie, L., Yang, Y., Cai, D., and He, X. Neural collapse in-
spired attraction-repulsion-balanced loss for imbalanced
learning. Neurocomputing, 2023.
Xie, S., Girshick, R., Doll ́ar, P., Tu, Z., and He, K. Aggre-
gated residual transformations for deep neural networks.
In Proceedings of the IEEE conference on computer vi-
sion and pattern recognition, pp. 1492–1500, 2017.
Yang, Y., Xie, L., Chen, S., Li, X., Lin, Z., and Tao, D. Do
we really need a learnable classifier at the end of deep
neural network? arXiv preprint arXiv:2203.09081, 2022.
Zhang, H., Cisse, M., Dauphin, Y. N., and Lopez-Paz, D.
mixup: Beyond empirical risk minimization. In Interna-
tional Conference on Learning Representations, 2018.
Zhao, H., Des Combes, R. T., Zhang, K., and Gordon, G. On
learning invariant representations for domain adaptation.
In International Conference on Machine Learning, pp.
7523–7532. PMLR, 2019.
Zhong, Z., Cui, J., Liu, S., and Jia, J. Improving calibra-
tion for long-tailed recognition. In Proceedings of the
IEEE/CVF conference on computer vision and pattern
recognition, pp. 16489–16498, 2021.
Zhou, B., Cui, Q., Wei, X.-S., and Chen, Z.-M. Bbn:
Bilateral-branch network with cumulative learning for
In Proceedings of the
long-tailed visual recognition.
IEEE/CVF conference on computer vision and pattern
recognition, pp. 9719–9728, 2020.
|
|
http://arxiv.org/abs/2302.12449v2 | 2023-08-15T08:11:16 | 2023-02-24T04:31:18 | SGL-PT: A Strong Graph Learner with Graph Prompt Tuning | Recently, much exertion has been paid to design graph self-supervised methods
to obtain generalized pre-trained models, and adapt pre-trained models onto
downstream tasks through fine-tuning. However, there exists an inherent gap
between pretext and downstream graph tasks, which insufficiently exerts the
ability of pre-trained models and even leads to negative transfer. Meanwhile,
prompt tuning has seen emerging success in natural language processing by
aligning pre-training and fine-tuning with consistent training objectives. In
this paper, we identify the challenges for graph prompt tuning: The first is
the lack of a strong and universal pre-training task across sundry pre-training
methods in graph domain. The second challenge lies in the difficulty of
designing a consistent training objective for both pre-training and downstream
tasks. To overcome above obstacles, we propose a novel framework named SGL-PT
which follows the learning strategy ``Pre-train, Prompt, and Predict''.
Specifically, we raise a strong and universal pre-training task coined as SGL
that acquires the complementary merits of generative and contrastive
self-supervised graph learning. And aiming for graph classification task, we
unify pre-training and fine-tuning by designing a novel verbalizer-free
prompting function, which reformulates the downstream task in a similar format
as pretext task. Empirical results show that our method surpasses other
baselines under unsupervised setting, and our prompt tuning method can greatly
facilitate models on biological datasets over fine-tuning methods. | [
"Yun Zhu",
"Jianhao Guo",
"Siliang Tang"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12449v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12449v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI",
"cs.CL"
] | SGL-PT: A Strong Graph Learner with Graph Prompt Tuning
Yun Zhu, Jianhao Guo, Siliang Tang,
Zhejiang University
{zhuyun dcd, guojianhao, siliang}@zju.edu.cn
3
2
0
2
g
u
A
5
1
]
G
L
.
s
c
[
2
v
9
4
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Recently, much exertion has been paid to design graph self-
supervised methods to obtain generalized pre-trained models,
and adapt pre-trained models onto downstream tasks through
standard fine-tuning. But the gap between pretext and down-
stream tasks can limit pre-trained models' potential, lead-
ing to negative transfer. Meanwhile, prompt tuning has seen
emerging success in natural language processing (NLP) by
aligning pre-training and fine-tuning with consistent training
objectives. In this paper, we identify the challenges for graph
prompt tuning: The first is the lack of a strong and universal
pre-training task across sundry pre-training methods in graph
domain. Such a task should be easily emulated by down-
stream tasks, akin to the Masked Language Modeling (MLM)
in the NLP domain. The second challenge lies in the diffi-
culty of designing a consistent training objective for both pre-
training and downstream tasks due to the inherent abstraction
of graph data. To overcome above obstacles, we propose a
novel framework named SGL-PT which follows the learn-
ing strategy "Pre-train, Prompt, and Predict". Specifically, we
raise a strong and universal pre-training task coined as SGL
that acquires the complementary merits of generative and
contrastive self-supervised graph learning. And motivated by
prompt design in NLP, we reformulate the downstream task
as maksed node prediction by designing a novel verbalizer-
free prompting function, resulting in unifying the objectives
of pre-text and downstream tasks. Empirical results show that
our pre-training method surpasses other baselines under un-
supervised setting, and our prompt tuning method can signif-
icantly facilitate models on biological datasets over standard
fine-tuning and other graph prompt methods.
Introduction
Graph self-supervised Learning methods (Hou et al. 2022;
You et al. 2020) have emerged to create generalized pre-
trained models without labels. To adapt these models for
downstream tasks, a "pre-train, fine-tune" approach is of-
ten used. However, there exists a gap between pre-training
and downstream tasks, that hinders knowledge transfer and
potentially leads to negative transfer (Zhang et al. 2022) or
overfitting (Zhu et al. 2021). For instance, edge prediction
(Hu et al. 2020) pre-trained on local node relations may
struggle to generalize to graph classification tasks requiring
global relations. This shift in representation can lead to neg-
ative transfer (Sun et al. 2022).
A feasible solution for mitigating this gap is to unify the
pre-training and fine-tuning models with consistent training
objectives by prompt technique (Liu et al. 2022). Though
already mature in NLP domain, graph prompt tuning is
still under exploration. We identify the main challenges of
graph prompt tuning: (1) The need for a strong and univer-
sal pre-training task: graph prompting method requires the
pre-training task to capture rich information (e.g., intra-data
and inter-data relations). Existing pre-training methods fail
to learn rich information in graph domain, because most of
them only focus on learning local relations (Hou et al. 2022)
or global relations (You et al. 2020) while neglecting the
inter-dependency of both. Furthermore, graph prompt meth-
ods mandate a pre-training task that can be readily emu-
lated, ensuring smooth integration into downstream tasks.
However, a pre-training task with these desired characteris-
tics is currently absent. (2) The difficulty of reformulating
the downstream task in the same format of the pre-training
task: unlike the cloze template in NLP domain, how to de-
sign meaningful prompt templates and verbalizers for graphs
remains an open problem due to the inherent abstraction of
graph data. Recently, some works made first attempts on
graph prompt tuning. GPPT (Sun et al. 2022) and Graph-
Prompt (Liu et al. 2023) unify the pretext and downstream
task in a similar format (i.e., edge prediction task). How-
ever, edge prediction is a trivial binary classification task,
which can not capture rich inter-data information and lose
its generality (not solving challenge 1). GPF (Fang et al.
2022) and Prompt Graph (ProG) (Sun et al. 2023) introduce
a learnable prompt feature and a learnable prompt graph into
the input space as plug-ins, which can be incorporated into
any pre-trained models. These methods are more likely new
transformation tricks added to input space, while they do not
holistically align the training objectives between pretext and
downstream tasks, hence not fully addressing challenge 2.
In short, the challenges we propose are waiting to be solved.
To overcome the above obstacles, we propose a novel
graph learning framework coined as SGL-PT that follows
the "Pre-train, Prompt and Predict" strategy. Specifically, for
challenge 1, we design a strong and universal graph self-
supervised method named Strong Graph Learner (SGL). It
combines generative and contrastive models for comple-
mentary strengths: the generative method has better robust-
ness and can ratiocinate the characters of nodes according
to neighbor through learning local (intra-data) relations, but
lacks discriminative representations; The contrastive method
focuses on learning qualified global (inter-data) representa-
tions through instance discrimination but may lose detailed
information on individual graphs. We effectively combine
these two self-supervised methods through asymmetric de-
sign and a dynamic queue to obtain a strong and univer-
sal self-supervised graph learner. Besides, this pre-training
task can be mimicked by the downstream task painlessly.
For challenge 2, we design a novel prompting function that
introduces a masked super node into individual graphs and
reformulates the downstream graph classification as masked
node prediction. We realize verbalizer-free class mapping by
introducing supervised graph prototypical contrastive learn-
ing to establish the mapping between reconstructed features
and semantic labels. In this way, we unify the training objec-
tives between pretext and downstream tasks. Results show
that our pre-training method surpasses other strong genera-
tive methods (Hou et al. 2022) and contrastive baselines (Xu
et al. 2021a). And our prompt tuning strategy can greatly fa-
cilitate models on biological datasets compared to standard
fine-tuning and other graph prompt methods.
Our contributions are summarized as follows:
• We identify the main challenges for graph prompting.
And we propose a novel framework following "Pre-train,
Prompt, and Predict" strategy to solve the challenges.
• We propose a strong and universal graph self-supervised
method SGL unifying generative and contrastive mer-
its through the asymmetric design. And we unify pre-
training and fine-tuning by designing a novel verbalizer-
free prompting function.
• Empirical results show that our method surpasses other
baselines under the unsupervised setting, and our prompt
tuning method can significantly facilitate models on bio-
logical datasets compared to fine-tuning methods.
Related Works
Graph Self-supervised Learning
Graph self-supervised methods can be classified into three
categories: Predictive, Generative and Contrastive (Wu et al.
2021). Predictive method self-generates labels by statistical
analysis and designs prediction-based pre-training tasks on
the generated labels (Jin et al. 2020).
Generative method focuses on learning local (intra-data)
relations based on pretext tasks such as feature/edge re-
construction (Kipf and Welling 2016; Hou et al. 2022).
Recently, the generative-based masked autoencoders (e.g.,
GraphMAE (Hou et al. 2022)) show their superior perfor-
mance across different tasks. Masked autoencoders learn
hidden representations by masking partial node features to
obtain high-level representations and then reconstructing
these masked node features through decoders. These meth-
ods focus on the local relations between nodes, which may
be incompetent for learning discriminative graph represen-
tations and deficient for graph classification task.
Contrastive method maximizes the agreement between
positive data pairs and pushes away the negative data pairs in
the representation space to learn the global (inter-data) rela-
tions between graphs (You et al. 2020; Zhu et al. 2022), but
may lose the detailed information within a single graph.
In our work, we combine the generative and contrastive
methods through asymmetric design and a dynamic queue
for complementary merits to obtain a strong and universal
pre-training method.
Prompt-based Learning
The training strategy "Pre-train and Fine-tune" is widely
used to adapt pre-trained models onto specific downstream
tasks. However, this strategy ignores the inherent represen-
tation gap between pre-training and downstream tasks and
leads to poor performance on few-shot problems.
Prompt-based learning (Liu et al. 2022) is a technique
arising from NLP to narrow the gap between pre-training
and downstream tasks. It reformulates the downstream task
to match the format of the pre-training task. This involves
designing a prompt template that converts the task into a
masked word prediction task. For instance, in sentiment
analysis, the label prediction task can be transformed into
a masked word prediction by the pre-defined template like
"[X]. It is a [MASK] movie" for the input sentence [X]="I
love this movie.", aligning with the pre-training mask lan-
guage model. The second aspect is the verbalizer design,
which maps the output word [MASK] to a specific label.
For example, words like 'good, great' may be associated
with the label '+', while 'bad, terrible' are associated with
the label '-'. The dot product of [MASK] for these tokens
provides confidence in assigning the sentence a label.
While prompt-based learning is well-established in NLP,
it's relatively new in the graph domain. Existing approaches
like GPPT (Sun et al. 2022) and GraphPrompt (Liu et al.
2023) rely on edge prediction as a pre-training task and re-
formulate the downstream task as edge prediction. But edge
prediction is a trivial binary classification task and focuses
on learning local (intra-data) relations which will be incom-
petent for graph classification. GPF (Fang et al. 2022) in-
troduces a universal prompt feature for various pre-trained
models, and ProG (Sun et al. 2023) extends GPF and intro-
duces a universal graph prompt (i.e., a set of prompt fea-
tures), but they do not unify the training objectives of the
pertaining and downstream tasks, limiting its potential.
In contrast to prior works (Sun et al. 2022; Liu et al.
2023), we address two challenges simultaneously. By con-
sidering graph-level task characteristics and the prompt tem-
plate's dependence on the pretext task, we redesign the pre-
training method and graph prompt template to mitigate rep-
resentation gaps. In the following section, we will demon-
strate how we overcome these obstacles.
Method
Preliminaries
This work focuses on graph classification task on a series
of graphs G = {G1, G2, ..., GK}. Gk = (Xk, Ak, yk) de-
notes a single graph, where Xk ∈ RNk×D is the raw node
features, Ak ∈ RNk×Nk is the adjacent matrix, and yk is
the graph label. For notations, Nk represents node number
of graph k, D represents the dimension of raw features, and
Ak(i, j) = 1 means there exists an edge between node i and
node j in graph k, otherwise 0. E(*) represent GNN encoder
and D(*) represents decoder. f (*) , and R(*) represent pro-
jection head and readout function respectively. Under unsu-
pervised training setting of this work, the label information
y is unavailable for each graph during pre-training.
Local
Branch
Mask Node Features
[MASK]
Online
Enc.
Node
Reps.
[MASK]
ReRe
Re-mask
Dec.
Recon.
Feat.
Recon.
Recon.
Loss
Loss
momentum
Data
Augmentation
Readout
Target
Enc.
Node
Reps.
outout
Readout
outout
ReReReReReReReReReReReReReReReReReReReReRe
Graph
Reps.
Graph
Reps.
Proj.
Proj. (cid:2366)
(cid:2869)
(cid:2870)
(cid:2366)
+
Contra.
Contra.
Loss
Loss
Queue
Global
Branch
Figure 1: The pre-training framework:Strong Graph Learner.
SGL: Strong Graph Learner for Pre-training
In this part, we will introduce our proposed pre-training
strategy depicted in Figure 1, which consists of
two
branches: local and global. For local branch, it focuses
on learning intra-data relations via a graph masked au-
toencoder. For global branch, it empowers the pre-training
model with instance-wise discriminative ability by graph
contrastive learning. Then we propose a non-trivial solution
to integrate these two branches effectively. Algorithm 1 in
Appendix A gives more details about the procedure.
Local Branch In this branch, firstly we mask partial
nodes' features and then obtain the high-level node repre-
sentations H(1) through online encoder Eo. Then, we re-
mask the node representations and reconstruct masked node
features through the decoder D, this is because Graph-
MAE (Hou et al. 2022) empirically found that re-masking
the node representations H(1) for decoding will bring per-
formance improvement. Finally, we use scaled cosine error
as the criterion. Our local branch loss is formulated as:
Llocal =
|
1
V| Xvi∈
e
V
e
γ
xT
i ̃xi
kxik * k ̃xik (cid:19)
1 −
(cid:18)
, γ ≥ 1,
(1)
where
V represents masked nodes' set and ̃x denotes recon-
structed masked node features. And γ is a scaling factor that
adjusts the contribution of each sample. This loss is averaged
V. In order to keep the notation un-
on the masked nodes' set
cluttered, we consider the batch size as 1 here.
e
In this way, local branch has better robustness and can
ratiocinate the characters of nodes according to neighbors.
However, this method mainly focuses on learning local re-
lations on individual graph, which is incompetent to learn
discriminative representations for graph classification.
e
Global Branch To complement the insufficiency of the
local branch and make the encoder capture global (inter-
data) discriminative information among graphs, we appeal to
graph contrastive learning. Even though data augmentation
is an essential part of contrastive learning (You et al. 2020;
Shi et al. 2020; Zhu et al. 2022), we empirically found sim-
ple augmentations like node feature masking and edge re-
moving are good enough to improve the representation abil-
ity of the proposed Strong Graph Learner.
The processes of the global branch can be concluded as:
firstly we obtain node representations H(1)
k by online
and target encoders. Then through a readout function (e.g.,
mean pooling), we obtain global representations gk as:
k , H(2)
gk =
1
Nk
Nk
Xi
Hk(i),
(2)
where Hk(i) represents the i-th node representation in
graph k. Following that, a projection head is added on top
of the encoder to map augmented representations to an-
other latent space where the contrastive loss is calculated.
Finally, we will contrast these representations z through
NT-Xent (the normalized temperature-scaled cross-entropy
loss (Chen et al. 2020)). The sample with its augmented view
is considered as a positive pair, and others are considered as
negative pairs. The formula of contrastive loss follows:
li = − log
exp
sim
(cid:16)
B
k=1 exp
/τ
(cid:16)
sim
z(1)
i
, z(2)
i
z(1)
i
(cid:16)
(cid:17)
, z(2)
k
,
(3)
(cid:17)
/τ
P
(cid:16)
where sim(u, v) = u⊤v/kukkvk computes the similarity
score between u and v, τ is temperature parameter, and B
denotes the size of mini-batch.
(cid:17)
(cid:17)
How to Integrate Local And Global Branches? Due to
consideration of efficiency and performance, the small batch
sizes (e.g., 8, 16) are used for training local branch, which
is insufficient for effective contrastive learning (Chen et al.
2020). Thus, direct integration of these branches is not fea-
sible. To address this, we employ a dynamic queue Q to in-
corporate more negative samples and enhance the integra-
tion of local and global branches. This dynamic queue holds
the first in first out property and we use the target representa-
tions H(2) to update this dynamic queue Q. In order to keep
the consistency of representations in the dynamic queue to
the utmost, we use exponential moving average to update
the target encoder Et and projection head ft. Formally, the
parameters in Et is updated by θt ← μθt + (1 − μ)θo.
Here m ∈ [0, 1) is a momentum coefficient that controls
the smoothness of evolving target parameters, we use a rela-
tively large momentum (e.g., 0.999) in our experiments em-
pirically. With dynamic queue Q, the loss in global branch:
li = − log
,z(2)
i (cid:17)/τ (cid:17)
i
e(cid:16)sim(cid:16)z(1)
,z(2)
k (cid:17)/τ (cid:17) +
B
k=1 e(cid:16)sim(cid:16)z(1)
i
Q
j=1 e(cid:16)sim(cid:16)z(1)
i
,qj (cid:17)/τ (cid:17)
P
(4)
where Q denotes the size of the dynamic queue. q represents
the sampled representations in the dynamic queue. The total
loss of the global branch is averaged over batch samples (i.e.,
Lglobal = 1
B
B
i li).
P
P
In summary, the overall pre-training loss is defined as
Lpre = λpre * Llocal + (1 − λpre) * Lglobal,
(5)
tokens related to labels. The supervised prototypical con-
trastive loss is given by:
where λpre ∈ [0, 1] controls the weight of local loss. For
most cases, we set λpre as 0.5 which means local and global
loss contributes equally.
Lproto =
−1
C2B2
log
Xc Xi,j
Verbalizer-free Graph Prompt Tuning
After obtaining the pre-trained model from SGL , we pro-
pose a novel graph prompt tuning technique that mitigates
the representation gap between pre-trained model and down-
stream tasks. Through prompt addition, we reformulate the
downstream task in the same format as the pre-training task.
And with the design of verbalizer-free prompt answer, we
get rid of the verbalizer which is hard to design in graph do-
main. The process of graph prompt tuning is shown in Fig-
ure 2. And Algorithm 2 in Appendix A offers procedures.
Mask Node Features
{(
,
,
)}
Prompt addition
(cid:1775)
(cid:1798)
2
1
5
(cid:1877)
3
4
S
1
[MASK]
2
[MASK]
3
4
[MASK]
5
Prompt answer
prototype contrastive learning
prototypes
super
node
Enc.
Re-mask
Dec.
(cid:2198)(cid:2868)
(cid:2198)(cid:2869)
(cid:2198)(cid:2870)
Node Reps.
Recon. Feat.
Contra.
Contra.
Loss
Loss
+
Recon.
Recon.
Loss
Loss
Figure 2: The framework of verbalizer-free prompt tuning.
Prompt Addition: Re-formulate downstream task
Prompt-based learning methods mitigate the representation
gap by reformulating the downstream task to the same for-
mat as the pre-training task, however, it is non-trivial to do
so in graph domain due to the inherent abstraction of graph
data. To solve the problem, we introduce a masked super
node, which connects to all nodes in the graph and therefore
has a global receptive field. Thus the representation of the
super node can be seen as the representation of the whole
graph. To reconstruct the features of the masked super node,
we transform the original classification task into masked
feature reconstruction, which corresponds to the task during
pre-training. This idea is motivated by the prompt tuning
in NLP domain, which adds a template with a task slot
(masked word) for input sentence and predicts the masked
word of the slot (Liu et al. 2022), remaining different to
previous graph prompt works (Sun et al. 2022).
Prompt Answer: Verbalizer-free Class Mapping We
have reformulated the downstream task as masked node fea-
ture reconstruction. Since there are no semantic and repre-
sentative input features related to labels for the masked su-
per nodes, it is hard to use verbalizer to establish mappings
between reconstructed features and their semantic labels.
In this work, we get rid of the verbalizer by introducing
the supervised prototypical contrastive learning (SPCL) (Li
et al. 2020; Cui et al. 2022) for class mapping. Specifically,
the prototypes represent essential features corresponding to
labels. As depicted in Figure 2, we will obtain class pro-
totypes pc by SPCL and use these prototypes as semantic
exp
(cid:0)
sim
i , zc
zc
/τ
j
(cid:1)
i , zc′
zc
j′
sim
(cid:0)
c′,j′ exp
(cid:16)
(cid:16)
P
exp (sim (zc
i , pc) /τ )
c′ exp (sim (zc
i , pc′) /τ )
(cid:1)
(cid:17)
,
/τ
(cid:17)
(6)
+
−1
C2B Xi,c
log
P
where the first part is instance-instance loss which draws
intra-class pairs close and pushes inter-class pairs away in
the representation space. And the second part represents
instance-prototype loss which makes the similarity scores
between instances of class c and prototype pc larger than
other prototypes. Class prototypes pc are learnable vectors,
which are updated by the second part loss. These two parts
both use NT-Xent which is the same as the global branch.
Prompt Tuning Through prompt
engineering (i.e.,
prompt addition and prompt answer), we reformulate the
downstream task in the same format as pre-training method,
which means the original classification task is transformed
into reconstructing the super node's representations. In
order to keep the training objective consistent with pre-
training and avoid catastrophic forgetting of the pre-trained
knowledge, we use Llocal as an auxiliary loss with a low
masking rate during prompt tuning. The overall loss of
prompt tuning is defined as:
Lprompt = λprompt * Llocal + (1 − λprompt) * Lproto,
(7)
where λprompt ∈ [0, 1] controls the contribution of each com-
ponent loss. We set λprompt as 0.1 for all datasets to focus on
learning class prototypes used for classification.
In this way, we implement verbalize-free graph prompt
tuning. This loss holds a similar format with Lpre.
Prediction
Similar to prompt tuning, we add a masked super node in
the original graph and hope to reconstruct its corresponding
class prototype. Specifically, by comparing the representa-
tion of the super node gsup with each class prototype pc, we
can get the predicted class probability:
P (yi|g) =
.
(8)
exp
C
j=1 exp
sim
(cid:0)
gsup, pi
(cid:0)
sim
(cid:0)
(cid:1)(cid:1)
gsup, pj
(cid:0)
(cid:1)(cid:1)
P
We will choose the highest score as our predicted class:
̃y = argmaxk P (yk|gsup).
(9)
Experiments
In this section, we will introduce the datasets and experi-
mental setups of graph classification that we used. Then we
evaluate the performance of the proposed self-supervised
pre-training method SGL. Thirdly, we prove the effective-
ness of our prompt tuning framework SGL-PT compared
with standard fine-tuning and other graph prompt methods
under semi-supervised and few-shot settings. After that, we
conduct ablation study to prove the necessity of the design.
Additionally, we perform sensitivity analysis on crucial
hyperparameters (e.g., dynamic queue size Q and loss
coefficient λ) in Appendix C. We substantiate the ro-
bustness and generality of our pre-training method with
supplementary experiments (e.g., molecule property pre-
diction (over 2 million graphs) and node classification)
in Appendix C, showcasing SOTA performance. Fur-
thermore, we empirically validate the effectiveness of
our prompt design in few-shot node-level tasks within
Appendix C. Moreover, we assess parameter efficiency
among various prompt methods to show SGL-PT's effi-
ciency in Appendix D.
Datasets
We perform experiments of graph-level tasks on widely used
12 datasets from TUDataset (Morris et al. 2020). The statis-
tics of the used datasets can be found in Table 1. They can
be classified into two categories: biological and social net-
works. More details of these datasets are in Appendix B.
Datasets
PROTEINS
DD
MUTAG
NCI1
NCI-H23
P388
MOLT-4
IMDB-B
IMDB-M
COLLAB
REDDIT-B
REDDIT-M12K
type
Biological
Biological
Biological
Biological
Biological
Biological
Biological
Social
Social
Social
Social
Social
# graphs Avg # nodes Avg # edges
1113
1178
188
4110
40353
41472
39765
1000
1500
5000
2000
11929
39.06
284.32
17.93
29.87
26.07
22.11
26.10
19.77
13.00
74.49
508.52
391.41
72.82
715.66
19.79
32.30
28.10
23.56
28.14
96.53
65.94
2457.78
594.87
456.89
Table 1: Statistics of graph classification datasets.
Evaluation of Proposed Pre-trained Method
In this section, we will evaluate our pre-training method
SGL under unsupervised setting.
Baselines Our baselines mainly consist of three cate-
gories: supervised methods, graph kernel methods, and
other unsupervised methods. Specifically, we compare with
three supervised baselines: GCN (Kipf and Welling 2017),
GIN (Xu et al. 2019) and DiffPool (Ying et al. 2018).
The SOTA graph kernel methods include graphlet ker-
nel (GL) (Shervashidze et al. 2009), Weisfeiler-Lehman
sub-tree kernel (WL) (Shervashidze et al. 2011) and deep
graph kernel (DGK) (Yanardag and Vishwanathan 2015).
We also compare with unsupervised representation learn-
ing methods including sub2vec (Adhikari et al. 2018),
graph2vec (Narayanan et al. 2017), EdgePred (Hu et al.
2020), InfoGraph (Sun et al. 2019), GraphCL (You et al.
2020), JOAO (You et al. 2021), SimGRACE (Xia et al.
2022), MVGRL (Hassani and Khasahmadi 2020), In-
foGCL (Xu et al. 2021a) and GraphMAE (Hou et al. 2022).
The introduction of baselines can be found in Appendix B.
Experiment Setup The quality of the pre-trained graph
encoder is then evaluated by the linear separability of the
final representations. Namely, an additional trainable linear
classifier is built on top of the frozen encoder following (Hou
et al. 2022; You et al. 2020). We adopt GIN (Xu et al. 2019)
as our encoder and decoder with the default setting in (Hou
et al. 2022). The complete hyper-parameters and more de-
tails are listed in Appendix B.
Analysis The results are listed in Table 2 and Table 3, from
which we can draw the conclusions:
SGL outperforms kernel methods on all datasets by a
large margin (e.g., 3.2% absolute improvement over the
SOTA graph kernel method DGK on PROTEINS). And our
method even outperforms the best supervised model (i.e.,
GIN) on eight out of twelve datasets, which closes the gap
between unsupervised methods and supervised methods.
Compared with other unsupervised methods, SGL
achieves SOTA results except on MUTAG. We suspect this
dataset is too small to inspire the full potential of our pre-
training method. On larger scale datasets in Table 3, our
method surpasses other methods by considerable margins
(e.g., around 1.3% absolute improvement over other meth-
ods on NCI-H23 dataset). The strong results show the supe-
riority of our proposed pre-training method SGL.
Evaluation of Proposed Prompt-tuning
In this section, we aim to investigate the effectiveness of
our proposed prompt method SGL-PT. And we will conduct
experiments under different settings (i.e., semi-supervised,
few-shot settings) to achieve this goal. Our prompt method
can be applied to other pre-training methods with a little
modifications which can be found in Appendix C.
Semi-supervised Setting
Experiments follow a semi-supervised setting with pre-
training & fine-tuning (Chen et al. 2020; You et al. 2020).
We don't fix the pre-trained model and tune all parameters
for downstream tasks. In more limited source scenarios like
the next section (few-shot setting), we will freeze the pre-
trained model and only train additional parameters for down-
stream tasks (e.g., classifier).
Baselines To thoroughly investigate the effectiveness of
the proposed SGL-PT, we compare it with methods of dif-
ferent training strategies.
Firstly all the baselines (except 'No pre-train.') are pre-
trained with pretext tasks. Then for fine-tuning methods, we
obtain the pre-trained models in advance and fine-tune them
with a linear classifier on downstream labeled data.
For GPPT, EdgePred serves as the pre-training method,
with downstream tasks reformulated into edge prediction
tasks following their prompt design. GraphPrompt, akin to
GPPT, employs EdgePred for pre-training and adapts down-
stream tasks into edge prediction, employing a simplified
prompt template featuring weighted summation readout.
GPF⋆ employs SGL as the pre-trained model, integrating a
learnable graph prompt feature onto node attributes. In the
case of ProG⋆, SGL is also the pre-trained model, incor-
porating a learnable prompt graph into the original graph.
In the context of SGL-PT, SGL serves as the pre-trained
model, and we reframe downstream tasks in a similar format
Supervised
Graph Kernels
Self-supervised
Methods
GCN
GIN
DiffPool
GL
WL
DGK
sub2vec
graph2vec
EdgePred
Infograph
GraphCL
JOAO
SimGRACE
MVGRL
InfoGCL
GraphMAE
SGL
PROTEINS
74.9±3.3
76.2±2.8
75.1±3.5
71.67±0.55
72.92±0.56
73.30±0.82
53.03±5.55
73.30±2.05
73.12±1.54
74.44±0.31
74.39±0.45
74.55±0.41
75.35±0.09
-
-
75.30±0.39
76.55±0.19
DD
75.9±2.5
75.3±2.9
-
72.54±3.83
79.78±0.36
73.50±1.01
54.33±2.44
70.32±2.32
72.34±1.04
72.85±1.78
78.62±0.40
77.32±0.54
77.44±1.11
-
-
79.42±0.42
80.54±0.65
NCI1
80.2±2.0
82.7±1.7
-
-
80.01±0.50
80.31±0.46
52.89±1.61
73.22±1.81
74.41±1.50
76.20±1.06
77.87±0.41
78.07±0.47
79.12±0.44
-
80.20±0.60
80.40±0.30
80.91±0.42
MUTAG
85.6±5.8
89.4±5.6
85.0±10.3
81.66±2.11
80.72±3.00
87.44±2.72
61.05±15.79
83.15±9.25
84.49±1.56
89.01±1.13
86.80±1.34
87.35±1.02
89.01±1.31
89.70±1.10
91.20±1.30
88.19±1.26
88.83±1.44
IMDB-B
70.4±3.4
75.1±5.1
72.6±3.9
65.87±0.98
72.30±3.44
66.96±0.56
55.26±1.54
71.10±0.54
68.48±1.11
73.03±0.87
71.14±0.44
70.21±3.08
71.30±0.77
74.20±0.70
75.10±0.90
75.52±0.66
75.88±0.47
IMDB-M
51.9±3.8
52.3±2.8
-
43.89±0.38
46.95±0.46
44.55±0.52
36.67±0.83
50.44±0.87
44.83±0.65
49.69±0.53
48.58±0.67
49.20±0.77
-
51.20±0.50
51.40±0.80
51.63±0.52
52.84±0.26
COLLAB
79.0±1.8
80.2±1.9
78.9±2.3
56.30±0.60
69.30±3.44
64.66±0.50
55.26±1.54
71.10±0.54
64.80±1.16
70.65±1.13
71.36±1.15
69.50±0.36
71.72±0.82
-
80.00±1.30
80.32±0.46
80.80±0.23
REDDIT-B
-
92.4±2.5
92.1±2.6
77.34±0.18
68.82±0.41
78.04±0.39
71.48±0.41
75.78±1.03
84.48±0.68
82.50±1.42
89.53±0.84
85.29±1.35
89.51±0.89
84.50±0.60
-
88.01±0.19
89.97±0.48
Table 2: Graph classification accuracies of supervised, kernel and unsupervised methods on small-scale datasets. The reported
results of baselines are from previous papers if available.
GIN
EdgePred
Infograph
GraphCL
JOAO
MVGRL
NCI-H23
78.41±0.36
72.49±0.72
78.69±0.69
76.37±1.08
76.69±1.13
78.08±0.46
GraphMAE 77.09±0.33
79.98±0.53
SGL
MOLT-4
72.40±1.07
70.53±1.98
71.29±0.53
73.26±1.14
72.49±0.74
74.63±0.32
73.91±0.51
75.10±0.52
P388
82.63±0.90
72.28±0.97
78.00±1.38
79.92±1.21
79.86±1.96
80.20±0.89
80.55±0.48
81.75±0.47
RDT-M12K
35.01±1.48
28.65±1.48
33.14±0.74
33.79±2.47
35.76±1.42
32.21±1.35
33.77±1.35
36.24±1.83
Table 3: Results of supervised GIN and self-supervised
methods on larger scale datasets. The baseline results are
obtained using their official implementations.
to the pre-training task. Furthermore, in order to demonstrate
the superiority our prompt method is not only dependent on
a superior pre-train model, we replace the EdgePred with
SGL in GPPT, GraphPrompt which are coined as GPPT⋆
and GraphPrompt⋆ respectively. We use grid search on im-
portant hyper-parameters to get the best performance.
Experimental Setup We ensure a fair comparison by us-
ing the same model configuration for all methods. The de-
tailed settings and hyper-parameters are in Appendix B.
Analysis Table 4 summarizes the results of different train-
ing strategies, and we can get the following information:
For fine-tuning-based methods, the order of performance
follows "EdgePred < GraphCL < GraphMAE < SGL",
which is similar to the results in previous unsupervised
learning. Our method SGL surpasses other fine-tuning-
based methods, which again testifies the effectiveness of our
pre-training method SGL. It is worth noting that EdgePred
even cannot outperform 'No pre-train.' on some datasets,
which indicates EdgePred method triggers negative transfer.
SGL-PT outperforms all fine-tuning-based methods and
surpasses SGL by a large margin (around 3% average im-
provement on all datasets), which proves the existence of
representation gap between pre-training and downstream
tasks and the urgency of minimizing such gap. It also
shows that SGL-PT outperforms GPPT and GraphPrompt
by a large margin (around 6% average improvement on
all datasets). The reason GPPT and GraphPrompt perform
poorly is that they only utilize limited learned knowledge
of the pre-trained model. And SGL-PT surpasses GPF⋆ and
ProG⋆ by a considerable margin (around 5% average im-
provement on all datasets), which proves the effectiveness
of unifying the training objectives.
We can find GPPT⋆, GPF⋆, ProG⋆ and GraphPrompt⋆
even perform worse than SGL due to catastrophic forgetting
from inconsistent objectives on some datasets (e.g., For DD
dataset, GPPT⋆, GPF⋆ and GraphPrompt⋆ lag 2.8%, 0.8%,
6.2% and 1.8% behind SGL⋆ respectively). This experiment
serves as proof that the effectiveness of our prompt tun-
ing method is not dependent on a superior pre-train model,
what matters is to establish consistent training objectives
that align with both pre-train and downstream tasks.
Few-shot Setting
In many real-world scenarios, it is challenging to collect
and label a large amount of data. Few-shot learning is a
well-known case of low-resource scenarios. We conduct ex-
periments in such a setting to prove the effectiveness of
our method in low-resource scenarios. Experiments on more
datasets can be found in Appendix C.
Experimental Setup In this section, we evaluate different
training strategies with more limited supervision in a few-
shot setting. This entails having only a small number of la-
beled graphs per class, denoted as k-shot classification. We
perform experiments with 1-shot and 3-shot graph classifica-
tion to evaluate all methods. The model setup remains con-
sistent with the previous section. Additionally, for prompt
methods, we freeze the pre-trained model and exclusively
train supplementary parameters for downstream tasks.
Analysis Table 5 summarizes the results of different train-
ing strategies, and we can obtain the following results:
In few-shot setting, prompt methods can achieve better
performance than standard fine-tuning-based methods (e.g.,
GPPT outperforms EdgePred, SGL-PT outperforms SGL.)
which proves the essential of unifying the pre-training and
downstream tasks.
FT
PT
10%L.R.
No pre-train.
EdgePred
GraphCL
GraphMAE
SGL⋆
GPPT
GPPT⋆
GraphPrompt
GraphPrompt⋆
GPF⋆
ProG⋆
SGL-PT⋆
PROTEINS
67.98±0.41
68.12±0.93
68.58±0.84
68.79±0.77
69.41±1.05
68.26±0.87
65.28±1.99
71.00±0.46
71.26±0.43
67.19±0.75
66.88±0.90
72.94±0.24
DD
68.32±0.39
66.77±0.68
68.60±0.49
68.70±0.31
68.81±0.40
66.53±0.85
66.04±0.72
65.24±1.26
67.07±0.50
67.97±0.50
67.76±0.80
75.37±0.16
NCI1
64.00±0.22
63.31±0.72
68.08±0.48
65.19±0.48
66.51±0.28
62.85±1.20
66.24±0.51
60.55±2.17
64.47±0.27
67.37±0.55
64.59±0.40
68.80±0.18
MUTAG
64.19±0.53
67.72±0.33
64.76±0.65
71.16±0.83
72.51±1.83
71.13±1.81
71.29±2.07
71.78±0.75
70.42±0.54
71.85±1.04
69.16±1.52
80.07±1.37
NCI-H23
55.14±1.29
63.44±1.32
65.77±0.52
64.25±1.44
64.18±1.29
53.44±0.81
51.86±0.70
55.39±0.85
60.61±2.51
63.24±1.51
68.33±0.60
69.71±0.15
IMDB-B
69.10±0.28
67.24±1.63
69.95±1.83
69.46±0.33
69.62±0.24
66.04±0.82
69.52±0.55
62.60±2.32
69.88±0.23
69.60±0.43
70.18±0.54
70.40±0.77
IMDB-M Imp(%)
43.25±0.34
0.00
41.57±0.38 +0.88
43.39±0.62 +2.45
44.09±0.49 +2.81
44.69±0.56 +3.39
38.64±1.40 −0.73
43.56±0.56 +0.26
40.33±0.60 −0.72
43.44±0.31 +2.16
43.44±0.43 +2.67
44.23±0.53 +2.73
45.28±0.41 +7.31
Table 4: Fine-tuning (FT) and prompt tuning (PT) results under semi-supervised setting. 10%L.R. denotes 10% label rate of
training data. 'No pre-train.' means GIN training from scratch. Imp(%) represents the average improvement of each method
over No pre-train. ⋆ means that we use SGL as their pre-trained models.
Few-shot
EdgePred
GraphCL
GraphMAE
SGL⋆
GPPT
GPPT⋆
GraphPrompt
GraphPrompt⋆
GPF⋆
ProG⋆
SGL-PT⋆
PROTEINS
DD
NCI1
MUATG
NCI-H23
1-shot
57.25±2.80
59.40±1.87
58.46±3.75
58.76±1.02
58.10±1.11
58.64±2.43
58.94±2.37
59.95±2.71
57.76±2.07
57.99±1.47
61.02±2.63
3-shot
58.36±2.06
59.91±2.88
59.29±1.62
59.73±2.65
58.63±0.81
60.02±1.66
62.01±1.47
62.93±1.37
59.32±2.43
60.99±0.96
64.47±2.10
1-shot
50.88±2.85
52.30±2.51
51.31±1.63
52.87±4.15
50.45±1.49
54.47±3.49
53.62±1.09
55.03±2.40
53.58±2.99
52.75±3.27
57.15±1.92
3-shot
52.02±1.21
53.39±2.87
54.14±1.15
54.51±2.91
51.50±2.04
56.92±2.20
53.38±1.37
58.21±0.95
54.24±2.15
54.32±1.57
61.12±2.42
1-shot
50.75±0.30
51.51±0.28
51.45±1.45
51.88±1.65
51.50±0.81
51.29±2.16
51.49±0.38
52.65±1.06
51.68±0.40
51.65±1.04
53.08±2.06
3-shot
50.94±0.56
51.72±0.55
52.67±1.86
53.22±2.11
51.25±0.47
52.10±2.37
51.64±0.58
52.50±1.21
51.91±0.88
52.03±0.35
55.24±1.28
1-shot
57.01±4.83
57.92±3.43
57.67±4.11
58.68±2.28
63.23±4.35
63.13±3.53
67.62±1.93
68.22±2.86
60.15±4.98
61.37±2.78
72.88±5.20
3-shot
58.71±4.04
62.39±1.53
60.92±3.54
62.47±2.51
66.06±2.55
65.86±1.65
70.03±2.18
71.40±3.12
61.93±3.03
62.42±1.70
78.60±1.81
1-shot
51.94±1.85
52.28±3.13
50.40±1.58
52.06±2.69
51.55±1.19
49.88±2.20
55.03±0.75
52.90±2.47
51.19±2.93
50.48±1.27
55.61±1.74
3-shot
52.45±2.35
54.85±2.14
53.72±1.61
55.67±1.08
51.84±1.14
50.03±1.96
56.97±1.25
52.57±1.89
54.20±3.77
52.66±1.94
58.76±2.09
FT
PT
Table 5: Fine-tuning&prompt tuning results under few-shot setting. ⋆ means that we use SGL as their pre-trained models.
Full
w/o local branch
w/o global branch
w/o dynamic queue
PROTEINS
76.55±0.19
74.68±0.50
75.18±0.40
74.85±0.43
DD
80.54±0.65
79.67±0.46
79.54±0.54
78.50±0.46
NCI1
80.91±0.42
79.12±0.35
80.18±0.28
80.37±0.15
MUTAG
88.83±1.44
85.22±1.25
86.81±2.12
85.23±1.13
IMDB-B
75.88±0.47
74.42±0.16
75.24±0.55
74.89±0.38
IMDB-M
52.84±0.26
50.59±0.32
51.63±0.52
51.06±0.71
COLLAB
80.80±0.23
78.19±0.12
80.33±0.38
80.51±0.29
REDDIT-B
89.97±0.48
86.67±0.37
87.83±0.11
86.70±0.50
Table 6: Ablation studies for SGL by masking local branch, global branch and dynamic queue under the unsupervised setting.
And SGL-PT can still outperform other methods which
proves the effectiveness of our prompt design even in low-
resource scenarios. (e.g., SGL-PT surpasses other methods
by over 7 % absolute improvement on the MUTAG of 5-
shot.)
Even with a stronger pre-trained model, GPPT⋆, GPF⋆,
ProG⋆ and GraphPrompt⋆ still perform moderately on most
datasets, highlighting the importance of unifying the training
objectives of pre-training and downstream tasks to fully ex-
ploit learned knowledge. These findings underscore the ne-
cessity to solve the challenges we proposed simultaneously.
Ablation Study
To prove the effectiveness of the design of our pre-training
method SGL, we conduct ablation experiments that mask
different components under the same model configuration.
SGL contains two branches (i.e., local and global), and we
mask them separately. 'w/o global branch' means that we
only use the local branch. 'w/o local branch' means that we
only use the contrastive learning method. And 'w/o dynamic
queue' represents that we do not use the dynamic queue to
provide adequate negative samples. From Table 6, the results
of 'w/o dynamic queue' lags far behind SGL, which demon-
strates the dynamic queue is essential to integrate these two
branches better. Disjunct single branches also lag behind
SGL, this means through efficient combination, we acquire
complementary strengths of both generative (local branch)
and contrastive (global branch) methods.
Conclusion
In this work, we identify the main challenges for graph
prompt tuning. To solve them, we propose a "Pre-train,
prompt and predict" framework coined as SGL-PT. This
framework unifies the pre-training and downstream task in
the same format and minimizes the training objective gap.
Specifically, we design a strong and universal pre-training
task that acquires the complementary strengths of generative
and contrastive methods. Based on this pre-training method,
we design a novel verbalizer-free prompting function to re-
formulate the downstream task in the same format as our
pre-training method. Empirical results show that our pre-
training method surpasses other baselines under the unsuper-
vised setting, and our prompt tuning method can greatly fa-
cilitate pre-trained models compared to standard fine-tuning
methods and other graph prompt tuning techniques.
References
Adhikari, B.; Zhang, Y.; Ramakrishnan, N.; and Prakash,
B. A. 2018. Sub2vec: Feature learning for subgraphs. In
Pacific-Asia Conference on Knowledge Discovery and Data
Mining, 170–182. Springer.
Alemi, A. A.; Fischer, I.; Dillon, J. V.; and Murphy, K. 2016.
arXiv preprint
Deep variational information bottleneck.
arXiv:1612.00410.
Chang, C.-C.; and Lin, C.-J. 2011. LIBSVM: A Library for
Support Vector Machines. ACM Trans. Intell. Syst. Technol.,
2(3).
Chen, T.; Kornblith, S.; Norouzi, M.; and Hinton, G. 2020.
A simple framework for contrastive learning of visual repre-
sentations. In International conference on machine learning,
1597–1607. PMLR.
Cui, G.; Hu, S.; Ding, N.; Huang, L.; and Liu, Z. 2022.
Prototypical Verbalizer for Prompt-based Few-shot Tuning.
In Proceedings of the 60th Annual Meeting of the Associa-
tion for Computational Linguistics (Volume 1: Long Papers),
7014–7024.
Davis, J.; and Goadrich, M. 2006. The relationship between
In Proceedings of the
Precision-Recall and ROC curves.
23rd international conference on Machine learning, 233–
240.
Fang, T.; Zhang, Y.; Yang, Y.; and Wang, C. 2022.
Prompt tuning for graph neural networks. arXiv preprint
arXiv:2209.15240.
Fey, M.; and Lenssen, J. E. 2019. Fast graph representation
learning with PyTorch Geometric. ArXiv preprint.
Hassani, K.; and Khasahmadi, A. H. 2020. Contrastive
In Inter-
multi-view representation learning on graphs.
national Conference on Machine Learning, 4116–4126.
PMLR.
Hjelm, R. D.; Fedorov, A.; Lavoie-Marchildon, S.; Grewal,
K.; Bachman, P.; Trischler, A.; and Bengio, Y. 2018. Learn-
ing deep representations by mutual information estimation
and maximization. In International Conference on Learning
Representations.
Hou, Z.; Liu, X.; Cen, Y.; Dong, Y.; Yang, H.; Wang, C.; and
Tang, J. 2022. Graphmae: Self-supervised masked graph au-
toencoders. In Proceedings of the 28th ACM SIGKDD Con-
ference on Knowledge Discovery and Data Mining, 594–
604.
Hu, W.; Liu, B.; Gomes, J.; Zitnik, M.; Liang, P.; Pande, V.;
and Leskovec, J. 2020. Strategies For Pre-training Graph
Neural Networks. In International Conference on Learning
Representations (ICLR).
Jin, W.; Derr, T.; Liu, H.; Wang, Y.; Wang, S.; Liu, Z.; and
Tang, J. 2020. Self-supervised learning on graphs: Deep in-
sights and new direction. arXiv preprint arXiv:2006.10141.
Kipf, T. N.; and Welling, M. 2016. Variational Graph Auto-
Encoders. NIPS Workshop on Bayesian Deep Learning.
Kipf, T. N.; and Welling, M. 2017. Semi-Supervised Clas-
sification with Graph Convolutional Networks. In Interna-
tional Conference on Learning Representations (ICLR).
Li, J.; Zhou, P.; Xiong, C.; and Hoi, S. 2020. Prototypical
Contrastive Learning of Unsupervised Representations. In
International Conference on Learning Representations.
Liu, P.; Yuan, W.; Fu, J.; Jiang, Z.; Hayashi, H.; and Neubig,
G. 2022. Pre-Train, Prompt, and Predict: A Systematic Sur-
vey of Prompting Methods in Natural Language Processing.
ACM Comput. Surv. Just Accepted.
Liu, Z.; Yu, X.; Fang, Y.; and Zhang, X. 2023. Graphprompt:
Unifying pre-training and downstream tasks for graph neural
networks. In Proceedings of the ACM Web Conference 2023,
417–428.
Morris, C.; Kriege, N. M.; Bause, F.; Kersting, K.; Mutzel,
P.; and Neumann, M. 2020. TUDataset: A collection of
benchmark datasets for learning with graphs. In ICML 2020
Workshop on Graph Representation Learning and Beyond
(GRL+ 2020).
Narayanan, A.; Chandramohan, M.; Venkatesan, R.; Chen,
L.; Liu, Y.; and Jaiswal, S. 2017.
graph2vec: Learn-
ing distributed representations of graphs. arXiv preprint
arXiv:1707.05005.
Oord, A. v. d.; Li, Y.; and Vinyals, O. 2018. Representation
learning with contrastive predictive coding. arXiv preprint
arXiv:1807.03748.
Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.;
Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.;
Desmaison, A.; K ̈opf, A.; Yang, E.; DeVito, Z.; Raison, M.;
Tejani, A.; Chilamkurthy, S.; Steiner, B.; Fang, L.; Bai, J.;
and Chintala, S. 2019. PyTorch: An Imperative Style, High-
Performance Deep Learning Library. In Proc. of NeurIPS.
Sen, P.; Namata, G.; Bilgic, M.; Getoor, L.; Galligher, B.;
and Eliassi-Rad, T. 2008. Collective classification in net-
work data. AI magazine, 29(3): 93–93.
Shervashidze, N.; Schweitzer, P.; Van Leeuwen, E. J.;
Mehlhorn, K.; and Borgwardt, K. M. 2011. Weisfeiler-
lehman graph kernels. Journal of Machine Learning Re-
search, 12(9).
Shervashidze, N.; Vishwanathan, S.; Petri, T.; Mehlhorn, K.;
and Borgwardt, K. 2009. Efficient graphlet kernels for large
graph comparison. In Artificial intelligence and statistics,
488–495. PMLR.
Shi, H.; Luo, D.; Tang, S.; Wang, J.; and Zhuang, Y. 2020.
Run away from your teacher: Understanding byol by a novel
self-supervised approach. arXiv preprint arXiv:2011.10944.
Sterling, T.; and Irwin, J. J. 2015. ZINC 15–ligand discovery
for everyone. Journal of chemical information and model-
ing, 55(11): 2324–2337.
Sun, F.-Y.; Hoffmann, J.; Verma, V.; and Tang, J. 2019. Info-
graph: Unsupervised and semi-supervised graph-level rep-
resentation learning via mutual information maximization.
arXiv preprint arXiv:1908.01000.
Sun, M.; Zhou, K.; He, X.; Wang, Y.; and Wang, X. 2022.
GPPT: Graph Pre-Training and Prompt Tuning to Generalize
Graph Neural Networks. In Proceedings of the 28th ACM
SIGKDD Conference on Knowledge Discovery and Data
Mining, KDD '22, 1717–1727. New York, NY, USA: Asso-
ciation for Computing Machinery. ISBN 9781450393850.
Zhu, Q.; Ponomareva, N.; Han, J.; and Perozzi, B. 2021.
Shift-robust gnns: Overcoming the limitations of localized
graph training data. Advances in Neural Information Pro-
cessing Systems, 34: 27965–27977.
Zhu, Y.; Guo, J.; Wu, F.; and Tang, S. 2022. RoSA: A Ro-
bust Self-Aligned Framework for Node-Node Graph Con-
trastive Learning. In Raedt, L. D., ed., Proceedings of the
Thirty-First International Joint Conference on Artificial In-
telligence, IJCAI-22, 3795–3801. International Joint Confer-
ences on Artificial Intelligence Organization. Main Track.
Sun, X.; Cheng, H.; Li, J.; Liu, B.; and Guan, J. 2023. All in
One: Multi-Task Prompting for Graph Neural Networks. In
Proceedings of the 26th ACM SIGKDD international con-
ference on knowledge discovery & data mining (KDD'23).
Wang, M.; Zheng, D.; Ye, Z.; Gan, Q.; Li, M.; Song, X.;
Zhou, J.; Ma, C.; Yu, L.; Gai, Y.; Xiao, T.; He, T.; Karypis,
G.; Li, J.; and Zhang, Z. 2019. Deep Graph Library: A
Graph-Centric, Highly-Performant Package for Graph Neu-
ral Networks. arXiv preprint arXiv:1909.01315.
Wu, L.; Lin, H.; Tan, C.; Gao, Z.; and Li, S. Z. 2021. Self-
supervised Learning on Graphs: Contrastive, Generative, or
Predictive. IEEE Transactions on Knowledge and Data En-
gineering.
Wu, Z.; Ramsundar, B.; Feinberg, E. N.; Gomes, J.; Ge-
niesse, C.; Pappu, A. S.; Leswing, K.; and Pande, V. 2018.
MoleculeNet: a benchmark for molecular machine learning.
Chemical science, 9(2): 513–530.
Xia, J.; Wu, L.; Chen, J.; Hu, B.; and Li, S. Z. 2022. Sim-
grace: A simple framework for graph contrastive learning
without data augmentation. In Proceedings of the ACM Web
Conference 2022, 1070–1079.
Xu, D.; Cheng, W.; Luo, D.; Chen, H.; and Zhang, X. 2021a.
InfoGCL: Information-Aware Graph Contrastive Learning.
In Ranzato, M.; Beygelzimer, A.; Dauphin, Y.; Liang, P.;
and Vaughan, J. W., eds., Advances in Neural Information
Processing Systems, volume 34, 30414–30425. Curran As-
sociates, Inc.
Xu, K.; Hu, W.; Leskovec, J.; and Jegelka, S. 2019. How
Powerful are Graph Neural Networks? In International Con-
ference on Learning Representations.
Xu, M.; Wang, H.; Ni, B.; Guo, H.; and Tang, J. 2021b.
Self-supervised graph-level representation learning with lo-
cal and global structure. In International Conference on Ma-
chine Learning, 11548–11558. PMLR.
Yan, X.; Cheng, H.; Han, J.; and Yu, P. S. 2008. Mining sig-
nificant graph patterns by leap search. In Proceedings of the
2008 ACM SIGMOD international conference on Manage-
ment of data, 433–444.
Yanardag, P.; and Vishwanathan, S. 2015. Deep graph ker-
In Proceedings of the 21th ACM SIGKDD interna-
nels.
tional conference on knowledge discovery and data mining,
1365–1374.
Ying, Z.; You, J.; Morris, C.; Ren, X.; Hamilton, W.; and
Leskovec, J. 2018. Hierarchical graph representation learn-
ing with differentiable pooling. Advances in neural infor-
mation processing systems, 31.
You, Y.; Chen, T.; Shen, Y.; and Wang, Z. 2021. Graph con-
trastive learning automated. In International Conference on
Machine Learning, 12121–12132. PMLR.
You, Y.; Chen, T.; Sui, Y.; Chen, T.; Wang, Z.; and Shen,
Y. 2020. Graph contrastive learning with augmentations.
Advances in Neural Information Processing Systems, 33:
5812–5823.
Zhang, W.; Deng, L.; Zhang, L.; and Wu, D. 2022. A sur-
vey on negative transfer. IEEE/CAA Journal of Automatica
Sinica, 1–25.
A. Algorithm
Algorithm of SGL
The overall processes of SGL can be described as Algo-
rithm 1. The input graphs will be fed into two branches
(i.e., local and global). In the local branch, we will mask
partial node features. Then through the online encoder Eo,
we will obtain fragmentary representations. Following (Hou
et al. 2022), we will re-mask node representations. And fi-
nally through a decoder, we restore the input features on
masked nodes. The reconstructed loss is computed by Equa-
tion 1.Meanwhile, in the global branch, we will augment
input graphs and feed them into target encoder Et, readout
function R and target projection head ft to obtain global
representations z(2), and we will make use of node repre-
sentation in local branch to obtain other view representations
z(1) through readout function and online projection head fo.
Finally, through Equation 5, we obtain the global loss in the
global branch. And the total loss is computed by a weighted
sum of Llocal, Lglobal. The online encoder, projection head
and decoder are updated by gradient descent. But the tar-
get encoder and projection head are updated by momentum
update.
Algorithm 1: Pretraining method: SGL
Input: Online and target encoders Eo, Et, online and
target projectors fo, ft, decoder D and
readout function R, feature mask function M
and augmentation function A, unlabeled
graph classification dataset G, training epochs
E.
Output: Optimal pre-trained encoder E ⋆
o
for i ← 1 to E do
// For Local branch
G(1) ← M(G), H(1) ← Eo(G(1)) ;
̃X(1) ← D(H(1)) ;
Calculate the loss Llocal of local branch according
to Equation 1;
// For global branch
G(2) ← A(G), H(2) ← Eo(G(2));
Summarize graph representation through readout
function g(1) ← R(H(1)), g(2) ← R(H(2)) ;
z(1) ← fo(g(1)), z(2) ← ft(g(2)) ;
Calculate the loss Lglobal of global branch
according to Equation 4;
Lpre = λpre * Llocal + (1 − λpre) * Lglobal ;
Update parameters of Eo, D and fo by applying
gradient descent to minimize Lpre ;
// Momentum update
t ← mθi−1
θi
t + (1 − m)θi
o ;
Using z(2) to update dynamic queue Q ;
end
Algorithm of Graph Prompt Tuning
The overall process of graph prompt tuning SGL-PT can be
concluded in Algorithm 2. Firstly, we will add a masked
super node on each downstream graph and reformulate the
downstream task as masked node prediction. We use proto-
type contrastive to get rid of the verbalizer, and additionally
we will mask partial node features and calculate reconstruc-
tion loss to avoid catastrophic forgetting. Lastly, the pro-
totype contrastive loss and reconstruction loss are linearly
combined through coefficient λprompt.
Algorithm 2: Graph Prompt Tuning
Input: Pretrained encoder E ⋆
o , prompt addition
function P, feature mask function M ,
labeled downstream dataset G, training
epochs E
for i ← 1 to E do
ˆG ← M ◦ P(G), H ← E ⋆
̃X ← D(H) ;
Calculate the reconstruction loss Llocal according
to Equation 1;
o ( ˆG) ;
Select the super node representation as graph
representation g ← H[0] ;
Calculate the prototype contrastive loss Lproto
according to Equation 6;
Lprompt = λprompt * Llocal + (1 − λprompt) * Lproto ;
Update parameters of E ⋆
descent to minimize Lprompt.
o by applying gradient
end
B. Experimental Details
Datasets
In this subsection, we give a more detailed description of
the datasets used in the main paper. More descriptions can
be found in (Yan et al. 2008; Yanardag and Vishwanathan
2015).
For bioinformatics datasets: 1. MUTAG: This dataset
consists of 188 mutagenic aromatic and heteroaromatic nitro
compounds. Each compound is represented as a graph, with
nodes corresponding to atoms and edges indicating bonds
between them. There are 7 discrete labels associated with
the mutagenic activity of the compounds.
2. PROTEINS: In this dataset, nodes represent secondary
structure elements (SSEs) in protein structures. An edge is
established between two nodes if the corresponding SSEs
are neighboring in the amino-acid sequence or in 3D space.
The dataset contains protein structures with 3 discrete labels,
representing helix, sheet, or turn.
3. DD: The dataset comprises 1178 protein structures,
each depicted as a graph wherein amino acids serve as
nodes, and edges connect two nodes if their spatial sepa-
ration is within 6 Angstroms. The objective of this predic-
tive endeavor is the categorization of the protein structures
as either enzymatic or non-enzymatic entities. Importantly,
it's worth noting that nodes are uniformly labeled across all
datasets.
4. NCI1: Derived from the National Cancer Institute
(NCI), this dataset is a subset of chemoinformatics datasets.
It contains chemical compounds that have been screened for
their ability to suppress or inhibit the growth of a panel of
human tumor cell lines. NCI1 has 37 discrete labels, repre-
senting different outcomes of the cell line growth inhibition
assay.
5. NCI-H23, MOLT-4 and P388: They offer insights into
the biological activities of small molecules, including bioas-
say records for anticancer screenings across various can-
cer cell lines, specifically categorized as 'Non-Small Cell
Lung', 'Leukemia' and 'Leukemia' respectively.
These datasets offer a diverse range of chemical and bi-
ological contexts, providing challenges for graph classifica-
tion tasks with varying numbers of labels and graph struc-
tures.
For social network datasets: 1. IMDB-BINARY and
IMDB-MULTI: These datasets are based on movie collab-
oration networks. Each graph represents the ego-network
of an actor or actress, where nodes correspond to individu-
als and an edge is present between two nodes if they have
collaborated in the same movie. IMDB-BINARY is a bi-
nary classification task where the goal is to classify each
graph into a specific movie genre. IMDB-MULTI is a multi-
class classification task with the objective of classifying the
graphs into various movie genres.
2. REDDIT-BINARY and REDDIT-M12K: These
datasets capture online discussion threads. Nodes in these
graphs represent users participating in discussions, and
edges are formed when users interact by responding to
each other's comments. REDDIT-BINARY involves bi-
nary classification, aiming to classify graphs into specific
community or subreddit labels. REDDIT-M12K extends
this to multi-class classification consisting of 11 different
subreddits, namely, "AskReddit, AdviceAnimals, atheism,
aww, IAmA, mildlyinteresting, Showerthoughts, videos,
todayilearned, worldnews, TrollXChromosomes." And the
goal is to predict which subreddit a given discussion graph
belongs to.
3. COLLAB: Derived from scientific collaboration data,
this dataset consists of ego-networks representing re-
searchers in different fields. Each graph focuses on re-
searchers from a specific scientific field, such as High En-
ergy Physics, Condensed Matter Physics, or Astrophysics.
The classification task involves assigning each graph to the
corresponding scientific field.
These datasets provide diverse scenarios for evaluating
graph classification algorithms, with each graph represent-
ing a unique context of collaboration or interaction, and the
classification tasks focusing on predicting genres, commu-
nities, or scientific fields.
It has to note that social networks do not contain raw node
attributes, we use node degrees as their attributes following
(Hou et al. 2022). As for biological graphs, we use their cat-
egorical node attributes.
Baselines
In this part, we will introduce the baselines used in our ex-
periments:
• Edge prediction (EdgePred) (Hu et al. 2020) treat ex-
isting links as training signals. Its training objective is
binary cross-entropy loss.
• Unsupervised And Semi-Supervised Graph-level Repre-
sentation Learning via Mutual Information Maximiza-
tion (InfoGraph) (Sun et al. 2019) takes a pair of global
representation and patch representation as input and em-
ploys a discriminator to determine if they belong to the
same graph based on Deep InfoMax (Hjelm et al. 2018).
This process generates all possible positive and negative
samples in a batch-wise manner.
• Graph Contrastive Learning with Augmentations
(GraphCL) (You et al. 2020) proposes various aug-
mentation techniques for graph data and investigates
their impacts on different types of datasets. Firstly, the
input graph will be fed into two random augmentation
functions to generate two graph views,
then these
augmented graphs will be fed into GNN encoder with
readout function to obtain graph representations. Finally,
these graph representations will be used to contrast with
InfoNCE loss (Oord, Li, and Vinyals 2018).
• Graph Contrastive Learning Automated (JOAO) (You
et al. 2021) introduces the concept of joint augmenta-
tion optimization, which formulates a bi-level optimiza-
tion problem by simultaneously optimizing the selection
of augmentations and the contrastive objective.
• A Simple Framework for Graph Contrastive Learning
without Data Augmentation (SimGRACE) (Xia et al.
2022) eliminates data augmentation while introducing
encoder perturbations to generate distinct views for graph
contrastive learning.
• Contrastive Multi-View Representation Learning on
Graphs (MVGRL) (Hassani and Khasahmadi 2020) uti-
lizes the information of multi-views for contrasting.
Firstly, it will use the edge diffusion function to gener-
ate an augmented graph. And asymmetric encoders will
be applied on the original graph and diffusion graph to
acquire node embeddings. Next, a readout function is
employed to derive graph-level representations. Original
node representations and augmented graph-level repre-
sentation are regarded positive pairs. Additionally, the
augmented node representations and original graph-level
representation are also considered as positive pairs. The
negative pairs are constructed through random shuffling.
Learning
(InfoGCL)
(Xu et al. 2021a) suggests minimizing
the mutual information between contrastive parts while
preserving task-relevant
information within both the
individual module and the overall framework. This
approach aims to minimize information loss during
graph representation learning, following the Information
Bottleneck principle (Alemi et al. 2016).
• Information-Aware Graph
Contrastive
• Self-Supervised Masked
Autoencoders
Graph
(GraphMAE)
(Hou et al. 2022) is a masked au-
toencoder. It will mask partial input node attributes
firstly and then the encoder will compress the masked
graph into latent space, finally a decoder aims to
reconstruct the masked attributes.
Evaluation Protocol
Unsupervised Representation Learning For small-scale
datasets, we follow (Hou et al. 2022; You et al. 2020) to
assess our SGL pre-training method. After pre-training, we
keep the model fixed to generate graph-level representa-
tions. These representations are then fed into a downstream
LIB-SVM (Chang and Lin 2011) classifier on small-scale
datasets. It's important to note that all self-supervised meth-
ods are trained using unsupervised data. The evaluation of
the pre-trained model involves training only a classifier with
supervised data from the downstream task. Reported results
include the mean accuracy from 10-fold cross-validation,
with standard deviation after 5 runs, on small-scale datasets.
larger-scale datasets (NCI-H23, MOLT-4, P388,
REDDIT-M12K), due to LIB-SVM's convergence issues,
we adopt a one-layer MLP as the downstream classifier.
Results are reported as the mean performance from 5-fold
cross-validation, using accuracy for REDDIT-M12K and
ROC-AUC (Davis and Goadrich 2006) for others.
For
Semi-supervised Setting To assess our proposed prompt
method, we carry out experiments in both semi-supervised
and few-shot settings. In the semi-supervised setup, we fix
the label rate at 10%, indicating that only 10% of the train-
ing data contains labels. We perform parameter tuning for
both encoders and additional downstream components (e.g.,
classifier) to optimize performance on downstream tasks.
Few-shot Setting In contrast to the previous section, we
introduce even scarcer supervised signals in this scenario
to simulate low-resource conditions. Specifically, each class
comprises only one or three instances for training data,
known as 1-shot and 3-shot graph classification. To address
concerns of overfitting and parameter efficiency, we solely
fine-tune the downstream parameters in the few-shot setting.
Hyper-parameters
All hyper-parameters used in unsupervised learning are
listed in Table 7. The coefficients in Equation 5 is 0.5 for
most datasets except COLLAB and NCI1 (0.9). For the lo-
cal branch, we adopt similar hyper-parameters in (Hou et al.
2022). And for the global branch, we do not use augmen-
tation in relatively large datasets (e.g., NCI1 and ZINC).
For other small datasets, we use grid search to obtain the
augmentation ratios. For the training hyper-parameters (e.g.,
batch size, epochs and etc), we adopt similar settings in (Hou
et al. 2022).
As for the hyper-parameters in the prompt tuning, Table 9
gives you the details. During prompt tuning, we still mask
partial nodes' features at a low rate mask (10%) to avoid
the catastrophic forgetting of the pre-training knowledge
and over-fitting. For all methods, we use the same hyper-
parameters for a fair comparison. You can increase the num-
ber of training epochs, the downstream performance may be
boosted further. All the pre-trained models are finetuned un-
der the same setting. Some hyper-parameters are searched
with grid search. The learning rate is searched in 0.01, 0.001,
0.0001 and the readout function is in mean, max, sum. And
we use the same batch size.
Computer Infrastructures Specifications
For hardware, most experiments are conducted on a com-
puter server with four GeForce RTX 2080Ti GPUs with
11GB memory and 48 Intel(R) Xeon(R) CPU E5-2678
v3 @ 2.50GHz. Besides, our models are implemented by
Pytorch Geometric 2.0.4 (Fey and Lenssen 2019), DGL
0.9.1 (Wang et al. 2019) and Pytorch 1.11.0 (Paszke et al.
2019). All the datasets used in our work are available in
DGL and PyTorch Geometric libraries. For molecular prop-
erty prediction, our implementation is based on the code in
https://github.com/snap-stanford/pretrain-gnns with Pytorch
Geometric 2.0.4 on GeForce RTX 3090.
C. Additional Experiments
Due to space constraints in the main content, this section will
encompass additional experiments involving molecule prop-
erty prediction and node classification. These endeavors aim
to demonstrate the robustness and versatility of our method.
Furthermore, we will delve into an analysis of important hy-
perparameters, specifically focusing on the dynamic queue
size (Q) and loss coefficient (λ). Lastly, we will evaluate our
graph prompting method on more datasets and apply it to
other pre-training methods.
Molecule Property Prediction
Besides the single-label graph classification task in the main
content, we also evaluate our pre-training method on an-
other graph-level task (i.e., molecular property prediction)
to predict chemical molecule properties. In this experiment,
a larger molecule dataset is employed to pre-train the model,
followed by fine-tuning on smaller downstream datasets.
This experiment serves to assess the ability of our pre-
training method to generalize across different distributions,
showcasing its potential for transfer learning.
Datasets ZINC dataset is used for pre-training which
consists of 2 million unlabeled molecules sampled from
ZINC15 (Sterling and Irwin 2015). Other eight datasets are
downstream datasets contained in MoleculeNet (Wu et al.
2018), input node features are atom number and chirality
tag, and edge features are bond type and direction. Scaffold-
split is used to splits graphs into train/val/test sets that mimic
real-world use cases. The statistics of these datasets can be
found in Table 10. These datasets are widely used for eval-
uating the transferability of pre-training methods (You et al.
2020; Sun et al. 2019; You et al. 2021).
Baselines We employ several baselines containing no
pre-trained GIN (i.e., directly fine-tune on downstream
dataset without self-supervised pre-training), as well as
GraphCL (You et al. 2020), JOAO (You et al. 2021),
GraphLoG (Xu et al. 2021b), GraphMAE (Hou et al. 2022)
and three different pre-training strategies (i.e., Infomax, At-
trMasking and ContextPred) proposed in (Hu et al. 2020)
which incorporates the domain knowledge heuristically that
correlates with the specific downstream datasets. All base-
lines (except No-pretrain) will firstly be pre-trained on ZINC
datasets and then adopt them on downstream datasets.
Model
configuration
Local branch
Global branch
Training
hidden size
num layer
activation
norm
scaling factor
masking rate
replace rate
Q
momentum
tempurate
feat mask1
feat mask2
drop edge1
drop edge2
batch size
epochs
learning rate
weight decay
optimizer
scheduler
PROTEINS
512
3
prelu
BN
1
0.5
0.0
1024
0.995
2
0.4
0.1
0.0
0.1
32
100
0.00015
0.0
Adam
False
DD
512
2
prelu
BN
1
0.1
0.1
1024
0.999
2
0.1
0.2
0
0
32
80
0.001
0.0
NCI1 MUTAG IMDB-B IMDB-M COLLAB REDDIT-B ZINC
300
512
5
2
relu
prelu
BN
BN
1
2
0.25
0.25
0.0
0.1
4096
1024
0.999
0.999
0.05
2
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
256
16
100
300
0.001
0.001
0.0
0.0
Adam
False
512
2
prelu
BN
1
20
0.001
1024
0.999
2
0.2
0.5
0.1
0.2
32
60
0.00015
0.0
Adam
False
512
3
prelu
BN
1
0.5
0.0
1024
0.995
2
0.0
0.2
0.0
0.4
32
50
0.00015
0.0
Adam
False
512
2
prelu
LN
1
0.75
0.1
1024
0.999
0.08
0.3
0.3
0.0
0.0
8
120
0.00015
0.0
Adam
False
256
2
relu
BN
1
0.75
0.0
1024
0.999
2
0.2
0.3
0.0
0.2
32
20
0.00015
0.0
Adam
True
32
5
prelu
BN
2
0.75
0.1
1024
0.999
2
0.2
0.5
0.0
0.3
64
22
0.0005
0.0
Adam
False
Adam Adam
True
True
Table 7: Hyper-parameters for pre-training method.
NCI-H23 MOLT-4
Model
Local
Global
Training
hidden size
num layer
activation
norm
scaling factor
masking rate
replace rate
Q
momentum
tempurate
feat mask1
feat mask2
drop edge1
drop edge2
batch size
epochs
learning rate
weight decay
optimizer
scheduler
128
3
prelu
BN
2
0.25
0.1
1024
0.999
2
0.0
0.2
0.0
0.0
16
100
0.0001
5e-4
Adam
True
128
3
prelu
BN
2
0.25
0.1
1024
0.999
2
0.1
0.1
0.0
0.0
32
100
0.0001
5e-4
Adam
True
P388
512
2
prelu
BN
2
0.25
0.1
1024
0.999
2
0.2
0.2
0.0
0.0
16
100
0.0001
5e-4
Adam
True
RDT-M12K
32
5
prelu
BN
2
0.75
0.1
1024
0.999
2
0.2
0.4
0.0
0.4
32
100
0.00015
0
Adam
True
Table 8: Hyper-parameters for pre-training method.
PROTEINS
DD
NCI1
MUTAG
NCI-H23
MOLT-4
P388
IMDB-B
IMDB-M
mask.
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
epochs
30
50
50
50
10
10
10
20
20
lr
0.01
0.0001
0.001
0.001
0.001
0.01
0.001
0.001
0.001
bs
32
32
16
64
32
32
32
32
32
optimizer
Adam
Adam
Adam
Adam
Adam
Adam
Adam
Adam
Adam
Table 9: Hyper-parameters for Prompt Tuning. 'mask.'
means masking rate, 'lr' represents learning rate and 'bs'
is batch size.
Experimental Setup We evaluate SGL under the trans-
fer learning setting as follows (Hou et al. 2022; You et al.
2020). Firstly, we pre-train the model with 2 million unla-
beled molecules sampled from the ZINC15(Sterling and Ir-
win 2015), and then we finetune the pre-trained models in
8 multi-label multi-class benchmark datasets contained in
MoleculeNet (Wu et al. 2018) with scaffold-split. In our ex-
periments, in the local branch, we will reconstruct node fea-
tures and not reconstruct edge features like (Hou et al. 2022).
In the global branch, we set dynamic queue size Q, tempera-
ture and momentum as 4096, 0.05 and 0.999 separately. And
for simplicity, we do not use additional augmentation here.
For evaluation, we run experiments 10 times and report the
mean and standard deviation of ROC-AUC scores(%) on 8
downstream datasets following (Hou et al. 2022; You et al.
2020).
Analysis From Table 11, you can find SGL surpasses other
methods and reaches SOTA performance on eight datasets. It
reaches around 8% improvement on No-pretrain GIN which
proves our pre-training method SGL is strong enough. And
it can enhance GraphMAE a lot on many datasets (e.g., 3.5%
and 2.3% gains on MUV and SIDER datasets) which further
shows the effectiveness of combining contrastive and gener-
ative methods.
Node Classification
Datasets We choose three commonly used citation
datasets, i.e., Cora, CiteSeer and PubMed (Sen et al. 2008),
in this part. These datasets consist of nodes representing dif-
ferent papers and edges signifying citation relationships be-
tween them. Each node is associated with a bag-of-words
representation of the corresponding paper, and the label cor-
responds to the academic topic of the paper. Further details
about the dataset statistics can be found in Table 12.
# graphs
# binary prediction tasks
Avg. # nodes
ZINC
2,000,000
-
26.6
BBBP Tox21 ToxCast
7,831
2,039
12
1
18.6
24.1
8,576
617
18.8
SIDER ClinTox MUV
93,087
1,477
1,427
17
2
27
24.2
26.2
33.6
HIV
41,127
1
24.5
BACE
1,513
1
34.1
Table 10: Data statistics of datasets used for molecular property prediction. ZINC dataset is used for pre-training.
No-pretrain
ContextPred
AttrMasking
Infomax
GraphCL
JOAO
GraphLoG
GraphMAE
SGL (Ours)
BBBP
65.5±1.8
64.3±2.8
64.3±2.8
68.8±0.8
69.7±0.7
70.2±1.0
72.5±0.8
72.0±0.6
72.6±0.4
Tox21
74.3±0.5
75.7±0.7
76.7±0.4
75.3±0.5
73.9±0.7
75.0±0.3
75.7±0.5
75.5±0.6
76.7±0.4
ToxCast
63.3±1.5
63.9±0.6
64.2±0.5
62.7±0.4
62.4±0.6
62.9±0.5
63.5±0.7
64.1±0.3
64.3±0.2
SIDER
57.2±0.7
60.9±0.6
61.0±0.7
58.4±0.8
60.5±0.9
60.0±0.8
61.2±1.1
60.3±1.1
62.6±0.4
ClinTox
58.2±2.8
65.9±3.8
71.8±4.1
69.9±3.0
76.0±2.7
81.3±2.5
76.7±3.3
82.3±1.2
83.3±0.9
MUV
71.7±2.3
75.8±1.7
74.7±1.4
75.3±2.5
69.8±2.7
71.7±1.4
76.0±1.1
76.3±2.4
79.8±1.3
HIV
75.4±1.5
77.3±1.0
77.2±1.1
76.0±0.7
78.5±1.2
76.7±1.2
77.8±0.8
77.2±1.0
78.7±0.4
BACE
70.0±2.5
79.6±1.2
79.3±1.6
75.9±1.6
75.4±1.4
77.3±0.5
83.5±1.2
83.1±0.9
84.3±0.4
Avg.
67.0
70.4
71.1
70.3
70.8
71.9
73.4
73.8
75.3
Table 11: Results on downstream molecular property prediction benchmarks. Avg represents the average performance of each
method.
Dataset
# N
# E
# F
# C
H
Cora
CiteSeer
PubMed
2078
3327
19717
5278
4676
44327
1433
3703
500
7
6
3
0.81
0.74
0.80
Table 12: Details of used datasets, where we substitute N
for Nodes, E for Edges, F for Features, C for Classes, H for
Homophily ratio.
Experimental Setup We follow the same experimental
setup in GraphMAE (Hou et al. 2022). After finishing unsu-
pervised pre-training, we will freeze the pre-trained model
and exclusively train a linear classifier using labeled train-
ing data for downstream tasks. The specific hyperparame-
ters are listed in Table 13. And we report the mean accuracy
with standard deviation after 20 runs. For simplicity, we only
compare with GraphMAE here because it is a strong base-
line.
Furthermore, in this section, we assess the performance
of our prompt method in a few-shot setting1. The model
configuration remains consistent with the above. For stan-
dard fine-tuning approaches, all parameters are fine-tuned
using downstream data. In contrast, for prompt methods,
pre-trained models are kept frozen, with only additional pa-
rameters for the downstream task will be tuned.
Analysis Table 14 shows the results of unsupervised rep-
resentation learning and illustrates the consistent superiority
of our SGL pre-training method across these three datasets,
which proves the effectiveness of combining contrastive and
1In order to achieve prompt tuning on node classification, we
will extract ego graphs for each target node and subsequently as-
sign ego graph labels based on the corresponding node labels. The
subsequent steps mirror the graph-level process.
type
hidden size
num head
num layer
activation
norm
scaling factor
masking rate
replace rate
Q
momentum
tempurate
feat mask1
feat mask2
drop edge1
drop edge2
loss coeff.
epochs
learning rate
weight decay
optimizer
scheduler
Cora
GAT
512
4
2
prelu
BN
3
0.5
0.05
1024
0.999
2
0.0
0.1
0.1
0.5
0.1
1500
0.001
2e-4
Adam
True
CiteSeer
GAT
512
2
2
prelu
BN
3
0.5
0.1
102400
0.999
2
0.1
0.5
0.0
0.1
0.08
300
0.001
2e-5
Adam
True
PubMed
GAT
1024
4
2
prelu
BN
3
0.75
0.0
1024
0.999
2
0.3
0.3
0.2
0.2
0.1
1000
0.001
1e-5
Adam
True
Model
Local
Global
Training
Table 13: Hyper-parameters for pre-training method.
generative methods.
Moreover, our prompt tuning approach for node classi-
fication also demonstrates its effectiveness, as seen in Ta-
ble 15. Notably, our prompt method achieves over 3% ab-
solute improvement compared to standard fine-tuning ap-
proaches and over 2.4 % absolute improvement compared
to another graph prompt method, GPPT, on 5-shot Cora
dataset. These results show the superiority of our prompt de-
sign even on node-level tasks.
Cora
CiteSeer
PubMed
GraphMAE 83.77±0.62
84.15±0.35
SGL
73.04±0.28
73.48±0.27
81.05±0.30
81.31±0.41
Table 14: The mean accuracy with standard deviation of
unsupervised representation learning for node classification
with 20 different random seeds.
Cora
PubMed
3-shot
5-shot
3-shot
5-shot
GraphMAE 68.50±1.67
SGL
70.32±0.74
72.48±1.08
74.14±0.82
68.80±0.36
68.98±0.62
73.08±0.56
73.72±0.77
GPPT
SGL-PT
72.14±2.64
73.84±1.89
74.80±1.76
77.26±0.98
69.52±0.80
70.08±1.71
72.50±0.93
75.50±0.90
Table 15: The mean accuracy with standard deviation of FT
& PT for node classification. GPPT uses SGL as its pre-
trained model in this table.
Evaluating SGL-PT on Other Graph-level Datasets
Due to space constraints, only partial results of prompt tun-
ing are presented in the main content. In this section, ad-
ditional experiments are exhibited in Table 16. The conclu-
sions align with those stated in the main paper.
MOLT-4
P388
1-shot
3-shot
1-shot
3-shot
GraphMAE 52.80±1.85
52.67±2.31
SGL
52.90±1.64
52.75±2.80
52.45±2.92
53.96±3.37
53.39±1.41
54.66±1.53
GPPT
SGL-PT
50.08±0.68
52.97±2.10
50.77±1.23
54.68±1.72
50.37±2.40
54.89±1.87
52.52±3.77
55.33±2.13
Table 16: The mean ROC-AUC with standard deviation of
FT & PT for graph classification on other datasets. GPPT
uses SGL as its pre-trained model in this table.
Applying SGL-PT on Other Pre-trained Methods
Our prompt method can also be applied to other contrastive
methods, because our prompt loss is Lprompt = λprompt *
Llocal +(1 − λprompt)*Lproto, by setting the coefficient λprompt
as 0, our prompt aligns the objectives of pre-text and down-
stream tasks (i.e., contrastive loss). To validate this asser-
tion, we substitute the pre-trained model with the GraphCL
model. The outcomes are detailed in Table 17. Our approach
Figure 3: Sensitivity analysis of the dynamic queue Q's size.
consistently outperforms standard fine-tuning by a signifi-
cant margin. For instance, on 3-shot DD dataset, SGL-PT
surpasses GraphCL by more than 6% absolute improvement,
and on 3-shot MUTAG dataset, it shows over 12% absolute
improvement. Furthermore, our prompt method achieves su-
perior results compared to other graph prompt methods, un-
derscoring the efficacy of our prompt design. This success
also validates the adaptability of our prompt approach to
other contrastive methods.
DD
MUTAG
1-shot
3-shot
1-shot
3-shot
GraphCL⋄
GPPT⋄
GPF⋄
SGL-PT⋄
52.30±2.51
53.39±2.87
57.92±3.43
62.39±1.53
54.11±2.09
55.66±2.20
57.15±1.53
58.31±2.40
58.30±1.26
59.49±1.25
65.46±5.02
59.43±3.40
68.58±5.49
69.51±2.56
64.07±2.38
74.47±2.32
Table 17: The mean accuracy with standard deviation of FT
& PT for graph classification. ⋄ means we use GraphCL as
their pre-trained models.
Sensitivity Analysis
Analysis on Q In the ablation study, we find that the dy-
namic queue is essential to integrate contrastive and gener-
ative methods better. In this section, we dig into the impact
of the size Q of the dynamic queue. The results are shown
in Figure 3, and we can find that the performance moves up
with the increase of Q and the gets best performance when
Q reaches 512 or 1024. This size is much larger than batch
size (e.g., 8, 16), which shows the necessity of the dynamic
queue to integrate the two branches.
Analysis on λ During pre-training, the model captures
both local and global
information, so we set λpre as
0.5. During prompt tuning, we focus on learning class
prototypes used for classification, so we lower the ra-
tio of Llocal (λprompt as 0.1). Empirically, we found the
performance of downstream tasks will drop with λprompt
(for DD, λprompt=0.0, 0.1, 0.3, 0.5, 0.7, 0.9.
increasing
Acc=74.30.5, 75.40.2, 74.50.5, 73.30.5, 73.20.4, 73.00.4).
So, we set λprompt as 0.1 for all datasets.
D. Parameter Efficiency
We compare trainable parameters with GIN, GPPT, GPF,
ProG and GraphPrompt and SGL-PT in Table 18. The 'GIN'
entry represents the number of parameters required to train
Method
GIN
GPPT
GPF
ProG
GraphPrompt
SGL-PT
DD
Params(K)
MUTAG
Params(K)
COLLAB
Params(K)
820
258
1.10
1.87
0.50
1
10
1
0.07
0.13
0.03
0.06
296
64
1.10
4.67
0.25
0.75
Table 18: Study of parameter efficiency.
a GIN model from scratch, which is significantly more than
other methods. For prompt methods, we will freeze the pre-
trained models and only calculate the downstream task-
specific parameters. GPPT requires task tokens (used for
classification) and a structure token involving attention mod-
ule (used for neighbor aggregation) to accomplish down-
stream tasks, resulting in significantly more trainable pa-
rameters than other prompt methods. For GPF, it needs to
initialize a learnable vector as well as a downstream classi-
fier. For ProG, it needs to initialize a learnable prompt graph
(i.e., a set of learnable vectors). For GraphPrompt, it intro-
duces a learnable weighted summation readout function but
needs to execute clustering to obtain class prototypes. As for
SGL-PT, we only require training class prototypes for clas-
sification.
GraphPrompt, while having the fewest trainable parame-
ters, does require additional computational time due to its
clustering process for obtaining class prototypes. This step
becomes increasingly time-consuming as the downstream
data expands. For example, in semi-supervised settings, ex-
ecuting GraphPrompt on NCI-H23 takes more than a day,
while other methods complete the task in just two hours.
To conclude, while GraphPrompt has fewer trainable pa-
rameters than SGL-PT, the efficiency and effectiveness of
SGL-PT surpass GraphPrompt.
|
|
http://arxiv.org/abs/2302.12448v1 | 2023-02-24T04:29:44 | 2023-02-24T04:29:44 | Subspace based Federated Unlearning | Federated learning (FL) enables multiple clients to train a machine learning
model collaboratively without exchanging their local data. Federated unlearning
is an inverse FL process that aims to remove a specified target client's
contribution in FL to satisfy the user's right to be forgotten. Most existing
federated unlearning algorithms require the server to store the history of the
parameter updates, which is not applicable in scenarios where the server
storage resource is constrained. In this paper, we propose a
simple-yet-effective subspace based federated unlearning method, dubbed SFU,
that lets the global model perform gradient ascent in the orthogonal space of
input gradient spaces formed by other clients to eliminate the target client's
contribution without requiring additional storage. Specifically, the server
first collects the gradients generated from the target client after performing
gradient ascent, and the input representation matrix is computed locally by the
remaining clients. We also design a differential privacy method to protect the
privacy of the representation matrix. Then the server merges those
representation matrices to get the input gradient subspace and updates the
global model in the orthogonal subspace of the input gradient subspace to
complete the forgetting task with minimal model performance degradation.
Experiments on MNIST, CIFAR10, and CIFAR100 show that SFU outperforms several
state-of-the-art (SOTA) federated unlearning algorithms by a large margin in
various settings. | [
"Guanghao Li",
"Li Shen",
"Yan Sun",
"Yue Hu",
"Han Hu",
"Dacheng Tao"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12448v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12448v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CR",
"cs.DC",
"math.OC"
] | Subspace based Federated Unlearning
Guanghao Li 1 Li Shen 2 Yan Sun 3 Yue Hu 1 Han Hu 4 Dacheng Tao 2 3
3
2
0
2
b
e
F
4
2
]
G
L
.
s
c
[
1
v
8
4
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
Federated learning (FL) enables multiple clients
to train a machine learning model collaboratively
without exchanging their local data. Federated
unlearning is an inverse FL process that aims to
remove a specified target client's contribution in
FL to satisfy the user's right to be forgotten. Most
existing federated unlearning algorithms require
the server to store the history of the parameter up-
dates, which is not applicable in scenarios where
the server storage resource is constrained. In this
paper, we propose a simple-yet-effective subspace
based federated unlearning method, dubbed SFU,
that lets the global model perform gradient ascent
in the orthogonal space of input gradient spaces
formed by other clients to eliminate the target
client's contribution without requiring additional
storage. Specifically, the server first collects the
gradients generated from the target client after per-
forming gradient ascent, and the input represen-
tation matrix is computed locally by the remain-
ing clients. We also design a differential privacy
method to protect the privacy of the representation
matrix. Then the server merges those representa-
tion matrices to get the input gradient subspace
and updates the global model in the orthogonal
subspace of the input gradient subspace to com-
plete the forgetting task with minimal model per-
formance degradation. Experiments on MNIST,
CIFAR10, and CIFAR100 show that SFU outper-
forms several state-of-the-art (SOTA) federated
unlearning algorithms by a large margin in various
settings.
1. Introduction
The traditional training approach of deep learning usually
brings together data from various participants. However,
1National University of Defense Technology, China 2JD Ex-
plore Academy, China 3The University of Sydney, Australia
4Beijing Institute of Technology, China. Correspondence to: Li
Shen <[email protected]>.
Preliminary work. Copyright 2023 by the author(s).
some data, e.g., medical records (Liu et al., 2017), cannot be
moved from the hospital due to data privacy and personal-
will concerns. Federated learning (FL) (McMahan et al.,
2017) is one of the most popular decentralized machine
learning methods to solve the above problems. It trains
a global model by transmitting the model parameters be-
tween clients and the server, which obviates the need of
transferring the underlying data (Li et al., 2022a; 2020a;b).
Recent privacy legislations (Bussche, 2017; Pardau, 2018;
Shastri et al., 2019) provide data owners the right to be
forgotten. In the machine learning context, the right to be
forgotten requires that (i) the user data is deleted from the
entity storing it and (ii) the influence of the data on the
model is removed (Halimi et al., 2022). Federated unlearn-
ing is the embodiment of the user's right to be forgotten in
the FL scenario, where the goal is to remove the contribu-
tion of specific clients' data from the global model while
maintaining the model's accuracy. Three challenges in FL
make the traditional machine unlearning approach unsuit-
able for federated unlearning: (1) Limited Access to the
dataset: The server in FL cannot directly access all data and
perform related operations, which makes forgetting tech-
niques that rely on dataset segmentation cannot be applied
to FL scenarios. (2) Model aggregation: The initial model
of each client in each training round depends on the model
aggregation of the clients that participated in the training in
the previous round. Removing the contribution of a client
will affect the model aggregation and affect the subsequent
training of other clients (Nasr et al., 2018; Melis et al., 2019;
Song et al., 2020). (3) Client selection: Since not all clients
can participate in the training process in each round, the
contribution of each client to the global model is not contin-
uous, and the contribution can only be made when the client
is selected.
There has been some current work on federated unlearning.
To remove the contribution of a specific target client in the
final global model, a naive idea is to retrain the model on the
remaining clients after removing the target one (Bourtoule
et al., 2021). However, some clients may only have lim-
ited storage, and they may delete data at any time after the
training process. It will make even the most naive way of re-
training the model from scratch impractical since the client
may not have the same data as that used in the training time.
Another idea in federated unlearning is to store the client's
Subspace based Federated Unlearning
historical updated gradient data in the server and use it to
roll back the trained global model (Wu et al., 2022). The
above unlearning methods all require the client or server to
retain some additional data or gradient information, which is
not possible in FL scenarios with limited storage resources.
In each FL training round, local training of each client is
a process that reduces the empirical loss (Rumelhart et al.,
1986). We argue that unlearning can be formulated as the
inverse process of learning, in the sense that the gradient
ascent on the target client can realize the forgetting of the
client data. However, the loss is unbounded and we need
to limit the gradient of training to ensure the quality of
the model after unlearning (Chen & Wainwright, 2015).
The whole process can be regarded as a constraint-solving
problem to maximize the empirical loss of the target client
within the constraints of the model performance. In this
paper, we propose a Subspace-based Federated Unlearning
method, dubbed SFU. SFU restricts the gradient of the target
client's gradient ascent to the orthogonal space of the input
space of the remaining clients to remove the target client's
contribution from the final trained global model. In SFU,
the server only needs the gradient information provided by
the target client and the representation matrix information
provided by other clients, without directly accessing the
original data of each client. On the other hand, SFU can be
used for models in any training phase without considering
the specific details of model training and model aggregation.
At the same time, SFU does not require the client or server
to store additional historical gradient information or data.
Specifically, SFU participants can be divided into three
kinds of roles: the target client to be forgotten, the remain-
ing clients, and the server. In SFU, the target client performs
gradient ascent locally based on the global model and sends
the gradient to the server; each remaining client selects a cer-
tain amount of local data to build a representation matrix and
send it to the server; the server receives the representation
matrix from each client and merges it to obtain the input sub-
space with Singular Value Decomposition (SVD) (Hoecker
& Kartvelishvili, 1996); the server finally projects the gra-
dient of the target client into the orthogonal subspace of
the input space and updates the global model with it. In
addition, we design a differential privacy method to protect
the privacy of clients in the process of sending the represen-
tation matrices (Li et al., 2021; Truex et al., 2019). It needs
each client to add random perturbation factors to each vec-
tor of the representation matrix to prevent possible privacy
leaks and those perturbation factors have no effect on the
input space search and the final model. Empirical results
show that SFU beats other SOTA baselines with 1%-10%
improvement in test sets.
In the end, we summarize the main contributions as follows:
• We first introduce subspace learning to federated un-
learning and propose a new federated unlearning al-
gorithm called SFU, which trains the global model by
gradient ascent in an orthogonal subspace perpendicu-
lar to the input space of the remaining clients to achieve
the forgetting goal without large performance loss and
additional storage costs.
• We design a differential privacy method to prevent the
possible privacy leakage caused by the transmission
of the client representation matrix during the process
of unlearning. This method adds random perturbation
factors to each vector of the representation matrix but
does not affect the unlearning process.
• We conduct extensive experiments to evaluate the ef-
fectiveness of SFU, which significantly outperforms
several SOTA baselines on various datasets including
MNIST, CIFAR10, and CIFAR100.
2. Related Work
Machine unlearning. The term "machine unlearning" is a
process to forget a piece of training data completely which
needs to revert the effects of the data on the extracted fea-
tures and models. Machine unlearning is first proposed by
Cao & Yang (2015), and they transform the statistical query
learning into a summation form and achieve unlearning
by updating a small part of the summation. However, this
algorithm only works for those transformable traditional
machine learning methods, machine unlearning for different
ML models has been explored. Ginart et al. (2019) formu-
late the problem and the concept of effective data deletion in
machine learning. They also propose two efficient deletion
solutions for the K-means clustering algorithm. Izzo et al.
(2021) focus on supervised linear regression and propose an
approximate data deletion method called projective residual
update (PRU) for linear and logistic models. The compu-
tational cost of PRU is linear in the feature dimension, but
PRU is not applicable for more complex models such as
neural networks. Baumhauer et al. (2022) introduce the
more general framework SISA to reduce the computational
overhead associated with forgetting. The main idea of SISA
is to split the training data into several disjoint fragments,
each of which trains a sub-model. To remove a specific
sample, the algorithm simply retrains the sub-model that
is learned from this sample. However, existing machine
learning works focus on ML models in traditional central-
ized settings, where training data is assumed to be globally
accessible, which is not suitable for learning in FL settings.
Federated unlearning. Compared with centralized learn-
ing, there are few works on unlearning in FL. Liu et al.
(2021) first introduce unlearning into the field of FL and
propose FedEraser. The main idea is to adjust the historical
parameter updates of federated clients through the retrain-
Subspace based Federated Unlearning
ing process in FL and reconstruct the unlearning model.
However, this process requires additional communication
between the client and the server. Recently, Wu et al. (2022)
develop a forgetting approach that removes historical pa-
rameter updates from the target client and recovers model
performance through a knowledge distillation process. Both
of these steps require the server to keep a history of all client
updates. In addition, the knowledge distillation approach
requires the server to have some additional unlabeled data.
In some application scenarios, meeting these requirements
may not be a matter of course. In contrast, our method does
not need the server to store historical updates or additional
unlabeled data and has better privacy. Our method mainly
solves the case where a client (referred to as the target client)
wants to remove its contribution from the global model. We
let the global model perform gradient ascent in the orthog-
onal subspace of the input space of remaining clients to
achieve federated unlearning. Different from these works
(and the one we propose), Wang et al. (2022) propose a for-
getting framework for forgetting a specific class or category
in FL.
Our approach is closely related to the federated unlearning
approach recently proposed by Halimi et al. (2022). They
formulate the unlearning problem as a constrained maxi-
mization problem by restricting to an (cid:96)2-norm ball around
a suitably chosen reference model and allowed the target
client to perform the unlearning by using the Projected Gra-
dient Descent (PGD) algorithm (Thudi et al., 2022). How-
ever, (cid:96)2-norm ball can not provide an effective guarantee for
the performance of the model after unlearning. We add con-
straints on the performance of the unlearning model. Our
method restricts the gradient ascent to a subspace orthogo-
nal to the input space of other clients, and this constrained
gradient update has minimal impact on the performance of
the model on other clients. We will quantitatively show that
our method has a performance guarantee.
3. Methodology
We propose a novel federated unlearning method, as shown
in Algorithm 1, that can eliminate the client's contribution
and vastly reduce the unlearning cost in the FL system. This
method does not require the server to keep the history of
parameter updates from each client or additional training.
The key idea is to use the restricted gradient information of
the target client to modify the final trained model.
3.1. Problem Setup
Algorithm 1 Subspace-based Federated Unlearning (SFU)
1: Input: The number of samples in each client p, the
global model w, local dataset Di of client i, random
factors λl
i for layer l in client i.
2: Target client CI :
3: gi ← −η(cid:96)i(w; (x, y));
4: Send gi to the server;
5: Other clients:
6: Representation matrix for layer l in client i: Rl
i =
ixl
2, ..., λl
ixl
p];
i to the server;
1, λl
ixl
[λl
7: Send Rl
8: server:
9: Rl = [Rl
N ];
10: Performing SVD on Rl = U lΣl(V l)T ;
11: Sl = span{ul
1,1, ul
̃gCI = proj(gCI , S);
12:
13: w = w − (gCI − ̃gCI )
CI +1..., Rl
CI +1, Rl
2,1, ..., ul
1, ..., Rl
k,1};
model w over the dataset D (cid:44) (cid:83)
i∈[N ] Di :
arg min
w
L(w) =
N
(cid:88)
i=1
|Di|
|D|
Li(w),
w∗ = arg min
L(w),
(1)
(2)
w
where Li(w) = E(x,y)∼Di[(cid:96)i(w; (x, y))] is the empirical
loss of Ci and during federated training, each client min-
imizes their empirical risk Li(w), w∗ is the final model
trained by the FL process.
Now we consider how to forget the contribution of the tar-
get client CI . A natural idea is to increase the empirical
risk LCI (w) of the target client CI , which is equivalent to
reversing the learning process. However, simply maximiz-
ing the loss can influence the effect of the model on other
clients. Federated unlearning needs to forget the contribu-
tion of the target client CI while ensuring the overall model
performance. Thus, the objective of federated unlearning is
defined below:
arg max
w
Li(w) = E(x,y)∼Di [(cid:96)i(w; (x, y))]
s.t.
Lul(w) − Lul(w∗) ≤ δ
(3)
where δ is a small change in the empirical loss, Lul() is the
empirical loss of the FL system after removing the target
client.
Suppose that there are N clients, denoted as C1, ..., CN ,
respectively. Client Ci has a local dataset Di. The goal of
traditional FL is to collaboratively learn a machine learning
Lul(w) =
(cid:88)
i∈[N \CI ]
|Di|
|Dun|
Li(w),
(4)
where Dun (cid:44) (cid:83)
removing the target client.
i∈[N \CI ] Di is the remaining data set after
3.2. Unlearning Metrics
output y:
Subspace based Federated Unlearning
Comparing the difference between the unlearned model and
the retrained model is one of the criteria used to measure the
effect of unlearning. Common dissimilarity metrics include
model test accuracy difference (Bourtoule et al., 2021), (cid:96)2-
distance (Wu et al., 2020) or, and Kullback-Leibler (KL)
divergence (Sekhari et al., 2021). However, in the FL sce-
nario, it is difficult to intuitively indicate whether the con-
tribution of a given client can be removed from the evalua-
tion method based on model differences. Other metrics in-
clude privacy leakage in the differential privacy framework
(Sekhari et al., 2021) and membership inference attacks
(Graves et al., 2021; Baumhauer et al., 2022). In this paper,
we use the backdoor triggers (Gu et al., 2017) as an effec-
tive way to evaluate the performance of unlearning methods,
similar to Wu et al. (2022). In particular, the target client
uses a dataset with a certain fraction of images that have
a backdoor trigger inserted in them. Thus, the global FL
model becomes susceptible to the backdoor trigger. Then, a
successful unlearning process should produce a model that
reduces the accuracy of the images with the backdoor trig-
ger, while maintaining good performance on regular (clean)
images. Note that we use the backdoor triggers as a way to
evaluate the performance of unlearning methods; we do not
consider any malicious client (Xie et al., 2020; Bagdasaryan
et al., 2020; Fung et al., 2020)
3.3. Subspace-based Federated Unlearning (SFU)
We introduce a novel Subspace-based federated unlearning
framework, named SFU. The main insight of the SFU is that
we constrain the gradients generated by the target client's
gradient ascent to the input subspace of the other clients to
remove the contribution of the target client from the global
model. As shown in Fig. 1, SFU participants can be divided
into three kinds of roles: the target client to be forgotten, the
remaining clients, and the server. The target client performs
gradient ascent to upload the gradient to the server. Other
clients compute the local representation matrix and upload it
to the server. The server is responsible for the computation
of other client input Spaces and the unlearning update of the
global model. Next, we will introduce the specific tasks of
the three participants respectively.
3.3.1. GRADIENT ASCENT ON THE TARGET CLIENT
To find a model with a large empirical loss in target client
CI , we can simply make several local passes of (mini-batch
stochastic) gradient ascent in client CI and add these gra-
dient updates to the global model. In order to satisfy the
constraints of Eq. (3), we need to consider a more reason-
able way to add the updated gradient of client CI to the
global model (Zhou et al., 2020; Qian et al., 2015).
W x = y1.
When this model accepts a gradient update ∆w, the output
becomes:
(5)
(W + ∆w)x = y2.
(6)
The difference between the two outputs is:
∆y = y2 − y1 = (W + ∆w)x − W x = ∆wx.
(7)
When ∆y is 0, the difference between the two outputs is
minimized, which requires the updated gradient ∆w to
be perpendicular to the original input gradient subspace
x. Therefore, we can project the updated gradient of the
target client CI into the orthogonal space of the gradient
subspace of Dun to minimize the degradation of the glob
model performance (Farajtabar et al., 2020).
3.3.2. COMPUTATION OF REPRESENTATION MATRIX
We first need to consider how to represent the input space
in Dun, the data of other clients. For an individual network,
we construct the gradient subspace by the following two
steps:
• For each layer l of the network, We first construct a
representation matrix, Rl = [xl
] concate-
nating ns representations along the column obtained
from forward pass of ns random samples from the
current training dataset through the network.
2, ..., xl
ns
1, xl
• Next, we perform SVD on Rl = U lΣl(V l)T fol-
1)k according to
lowed by its k-rank approximation (Rl
the following criteria for the given coefficient, (cid:15)l :
||(Rl))k||2
F ≥ (cid:15)l||Rl||2
F .
(8)
2,1, ..., ul
1,1, ul
Sl = span{ul
k,1}, spanned by the first
k vectors in U l
1 as the space of significant represen-
tation at layer l since it contains all the directions
with highest singular values in the representation (Saha
et al., 2021).
For FL scenarios, we need the data on each client to seek the
gradient subspace of the Dun. First, all clients excluding the
target client CI select the same number of representations
matrix of local samples for each layer Rl
i and send them to
the central server to construct the representation matrix.
To protect the privacy of the representation matrix, we de-
sign a differential privacy algorithm. We add random factors
λl
i to the representation of layer l from client i to avoid leak-
ing data information about the client data and it does not
affect the search process of the subspace because of the
nature of the orthogonal matrix.In Eq. (7), if
Given a neural network W and an input x we can obtain an
∆wx = 0,
(9)
Subspace based Federated Unlearning
• Step 3. The server perform SVD on the set of repre-
sentation R to get the set of input gradient subspace
S, project gCI onto S and removes the contribution of
the target client CI by updating the global model w as
Eq. 11.
In the end, we give several comments on the proposed SFU
algorithm. Note that subspace learning has been commonly
used to solve continual learning (Saha et al., 2021), meta
learning (Jiang et al., 2022), adversarial training (Li et al.,
2022c), and fast training of deep learning models (Li et al.,
2022b). However, SFU is the first work to use the orthogonal
space of input gradient space for federated unlearning. In
addition, SFU needs to seek subspace from dispersed stored
data and should consider the privacy leakage risk.
4. Experiments
In this section, we empirically evaluate the effectiveness of
SFU using different model architectures on three datasets.
We divide the unlearning process into two parts: the re-
moval of specific client contributions and the recovery of
model performance. The experimental results show that
our unlearning strategies can effectively remove the con-
tribution of the target client from the global model with
low-performance loss and can quickly recover the accuracy
of the model in a few rounds of training. We first intro-
duce the experimental setup and then present the evaluation
results.
4.1. Experimental Setup
Datasets: We evaluate SFU using three popular
datasets: MNIST(Xiao et al., 2017), CIFAR10, and CI-
FAR100 (Krizhevsky et al., 2009) as described below:
• MNIST: It is a dataset that contains a training set of
60,000 examples and a test set of 10,000 examples.
Each example is a 28×28 grayscale image associated
with a label from 10 classes.
• CIFAR10: It consists of 60,000 32 × 32 color images
in 10 classes, with 6000 images per class. There are
50,000 training images and 10,000 test images.
• CIFAR100: It has 100 classes. Each class has 600
color images of size 32 × 32, of which 5000 are used
as a training set, and 100 are used as a test set.
The training difficulty of the dataset is increasing from
MNIST, CIFAR10 to CIFAR100. We adopt two data dis-
tribution Settings, including IID (Independent-Identically-
Distributed) as well as Non-IID (Non Independent-
Identically-Distributed). The Non-IID setting that we adopt
is Dirichlet(β): Label distribution on each device follows the
Figure 1: The pipeline of the SFU.The whole process takes
place after the FL model has been trained. The orange
client represents the target client whose contribution is to be
removed; The blue ones represent other clients. The boxes
on the right of the image represent global model updates
that happen on the server.
we have
∆w(λx) = 0.
(10)
The final set of representation matrix in the server is R =
(cid:8)R1, R2, ..., RL(cid:9), and Rl = [λl
].
2xl
2, ..., λl
1,1, λl
1xl
N xl
ns
3.3.3. UPDATE OF THE GLOBAL MODEL ON THE SERVER
After several local passes of (mini-batch stochastic) gradient
ascent, client CI sends the updated gradient gCI to the
server. The server performs the update of the global model
w after collecting the set of representation matrix R and
the gradient gCI . The server first perform SVD (Rumelhart
et al., 1986) on R to get the set of input gradient subspace
S = (cid:8)S1, S2, ..., SL(cid:9). To achieve the goal of Equation 3,
we need to project gCI onto S and get projection ̃gCI . gCI −
̃gCI orthogonal to R and the server update the global model
w with gCI − ̃gCI :
w = w − (gCI − ̃gCI ).
(11)
The updated model w removes the contribution of the target
client CI and maintains a similar performance to the original
global model.
After a global model is trained, a complete SFU training
process mainly includes three steps as shown in Fig.1:
• Step 1. Besides target client CI , each client selects the
same number of samples to calculate the representation
matrix R1 for each layerl of the network and sends it
to the server after adding random factors λl
i.
• Step 2. The target client CI performs several local
passes of gradient ascent locally and sends the updated
gradient to the server.
Client 1Client CIClient N(target client). . .. . .ServerMatrix R1Gradient gCIMatrix R2Representation matrixgCIgCI - gCIgci~Gradient Subspace1123~Subspace based Federated Unlearning
Table 1: Accuracy results after unlearning (IID).
Dataset
MNIST
CIFAR10
CIFAR100
Dataset
MNIST
CIFAR10
CIFAR100
network
MLP
CNN
MLP
CNN
ResNet
MLP
CNN
ResNet
network
MLP
CNN
MLP
CNN
ResNet
MLP
CNN
ResNet
FedAvg
UL
GA
SFU
test acc
97.73
99.31
49.15
72.83
76.12
18.86
37.47
39.68
atk acc
93.26
91.29
89.66
99.36
98.27
9.93
97.77
90.38
test acc
77.19
42.36
26.17
18.75
43.75
2.24
2.51
7.38
atk acc
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
test acc
96.80
92.33
48.61
57.48
73.58
13.42
20.12
37.63
atk acc
0.0
19.28
0.01
0.37
65.98
0.00
1.41
6.73
test acc
97.66
99.29
49.08
57.75
44.60
18.70
36.31
26.84
atk acc
0.15
0.21
0.0
0.0
0.0
0.0
0.0
0.0
Table 2: Accuracy results after retraining (IID).
Retraining
test acc
97.88
99.48
48.77
74.86
76.95
18.47
38.25
40.15
atk acc
0.0
11.55
0.00
0.00
7.23
0.0
0.0
0.81
UL-Distillation
test acc
97.88
99.20
47.83
72.33
77.47
9.43
27.05
38.43
atk acc
0.0
0.31
0.0
0.51
9.68
0.0
0.0
0.79
GA-retraining
test acc
97.05
99.34
48.09
72.43
77.19
18.81
37.08
38.11
atk acc
9.30
37.13
20.36
26.47
81.06
2.46
51.36
61.91
SFU-retraining
test acc
97.91
99.37
48.81
72.87
76.84
18.46
37.81
40.93
atk acc
0.28
12.63
0.10
2.18
3.12
0.0
14.39
0.92
Dirichlet distribution, where β is a concentration parameter
(β > 0).
connected layers with 800 and 500 neurons and a Relu
layer.
Baselines. We chose three typical federated unlearning
algorithms as our baseline:
(1) Retraining: This method retrains the entire FL system
without the target client being forgotten, which is an effec-
tive but computationally and communicationally expensive
algorithm;
(2) "UL" Wu et al. (2022): This method forgets the target
client by subtracting historical parameter updates of the
target client from the global model. Then, "UL" uses the
knowledge distillation method to remedy the skew of the
unlearning model caused by the subtraction without using
any data from the target clients.
(3) "GA": GA uses gradient ascent information on the target
client to update the global model. Gradient ascent makes
the loss of the model increase, which is the inverse pro-
cess of learning and can achieve unlearning. However, the
loss of gradient ascent is unbounded so we set the gradient
clip norm when the global model is updated to reduce the
probability of producing a random model.
Models. We employ three neural network architectures in
our experiments.
• MLP: This is a fully-connected neural network archi-
tecture with 2 hidden layers. The number of neurons
in the layers is 200 and 100, respectively.
• CNN: This network architecture consists of 2 convolu-
tional layers with 64 5 × 5 filters followed by 2 fully
• ResNet: we use a smaller version of ResNet18 (He
et al., 2016), with three times fewer feature maps across
all layers.
We used two networks MLP and CNN for the MNIST
dataset, while we used the above three network structures
for the CIFAR10 and CIFAR100 datasets. We use Py-
Torch (Oord et al., 2018) to implement those models.
Evaluation metric. We use backdoor attacks in the target
client's updates to the global model as described before,
so that we can intuitively investigate the unlearning effect
based on the attack success rate of the unlearned global
model. In Tab. 1 and Tab. 2, we record the attack success
rate as "atk acc". A lower "atk acc" represents a cleaner
contribution removal from the target client. In our exper-
iments, we implement the backdoor attack using a "pixel
pattern" trigger of size 2 × 2 and change the label to "9".
Because of the prediction error of the model, We can con-
sider an error rate of less than 10% as successful forgetting
of the target client contribution. We also use the accuracy
metric on the clean test data to measure the performance
of the model after unlearning which is denoted "test acc"
in Tab. 1 and Tab. 2. A high accuracy indicates that un-
learning has little impact on the performance of the model.
Current unlearning methods usually adopt certain methods
to recover the model accuracy after unlearning, so we divide
our evaluation of the unlearning approach into two respects:
the removal of specific client contributions and the recovery
of model performance.
Subspace based Federated Unlearning
(a) MNIST
(b) CIFAR10
Figure 2: Model accuracy after execution of SFU and other baselines at various stages of FL model training.
(c) CIFAR100
(a) MNIST
(b) CIFAR10
Figure 3: Model accuracy after execution of SFU and other baselines under different degrees of data heterogeneity. The
original global model is obtained by training with 10 clients, including one target client.
(c) CIFAR100
Implementation details. We consider two scenarios: (i)
We have ten clients with one target client, and all clients
participate fully during each training round. (ii) We have
100 clients with one target client and only 10% of the clients
participate during each training round. In the experiment
of removal of specific client contributions, We conduct un-
learning experiments on the FL model after 100 rounds of
training; In the experiment of recovery of model perfor-
mance, We start FL training with the stochastic model for
full retraining. we start FL training on the unlearned local
model without the involvement of the target client for SFU
and GA. We use the knowledge of the public data on the
server for distillation learning to recover the model accuracy
for UL. Tab. 2 and Tab. 1 only show the results of scenario
(i). Results of scenario (ii) and other implementation details
are shown in Appendix A due to limited space.
4.2. Results of Contribution Removal
We conducted extensive experiments to determine the ad-
vantage of SFU in removing the contribution of a specific
client in the global model. In addition, we demonstrate
the robustness and superiority of SFU in different training
degrees of the model and different data heterogeneity. All
results are reported based on the global model after perform-
ing unlearning. The results show that SFU can effectively
remove the contribution of target clients under the premise
of ensuring model accuracy, and has strong robustness to
data heterogeneity and the training degree of the model.
Efficient forgetting by SFU. Tab. 1 reports the unlearn-
ing effects of SFU and the other baselines on different IID
datasets and model architectures. The results show that SFU
can efficiently complete the contribution removal of target
clients. We observe that SFU successfully eliminates the
contribution of target customers and achieves low precision
for backdoor data. For example, SFU can reduce the back-
door attack success rate to or close to 0% in all datasets.
Other baselines also can achieve similar results. This shows
that the current unlearning methods can effectively remove
the contribution of the target client.
High model accuracy for SFU. The results in Tab. 1 also
report the accuracy of the model on the clean test set data
after unlearning for each baseline. The results show that
SFU achieves the best results on various datasets and dif-
ferent model architectures. However, the UL method will
cause great damage to the performance of the model, and the
direct gradient ascent has a large probability of producing a
low-accuracy model. For example, on the CNN architecture
of the MNIST dataset, the accuracy of the UL model is only
42.76%, which is 56.55% lower than the accuracy of the
original FL model 99.31%. The accuracy of the model gen-
erated by GA is 92.33%, which is 7% lower than the 99.29%
accuracy of the model generated by SFU, which indicates
that restricting the gradient in the orthogonal subspace of
the input space can reduce the loss of the original model
Subspace based Federated Unlearning
(a) MNIST
(b) CIFAR10
Figure 4: Convergence plots for SFU and other baselines in different datasets with CNN.
(c) CIFAR100
performance.
Robustness of the original model maturity. Federated un-
learning can occur at any stage of FL, so it is possible that
the model does not converge when federated unlearning is
performed. We define the maturity of the model in terms
of the number of rounds of model training, where the more
rounds the model is trained, the more mature it is. Fig. 2
reports the effect of each baseline with unlearning at differ-
ent rounds of the FL model training. The results show that
SFU can ensure the performance of the model to the greatest
extent at any round of model training, and the accuracy of
SFU is similar to that of FL model training. UL is easy to
remove in the early stage of model training. However, as
the model continues to train, the integration degree of each
client model increases, simply subtracting the historical
weight of the client is easy to cause a significant decline in
the accuracy of the model. For example, the UL accuracy in
the MNIST dataset dropped from 97% to 66% as the model
trained. GA has similar results to SFU, but still has lower
accuracy than SFU, which indicates that SFU is robust to
the original model maturity.
Robustness on heterogeneous data. We test different un-
learning algorithms on MNIST datasets with different de-
grees of heterogeneity, and ten clients are selected to form
the FL system. Fig. 3 shows that enhancing data distribution
heterogeneity will reduce the effect of various unlearning
algorithms. It is because the aggregation of the global model
becomes more complex with the increase of model hetero-
geneity, which makes it more challenging to separate the
contributions of specific clients under the premise of ensur-
ing model accuracy. However, the accuracy of SFU is close
to that of the original FL model and the retrained model
in all Settings, which indicates that SFU is robust to data
heterogeneity.
4.3. Results of Model Accuracy Recovery
Below, we report the accuracy of the final model and the
recovery efficiency of different methods. All results are
reported based on the global model after unlearning.
High final accuracy of the SFU. Tab. 2 reports the model
performance of each algorithm after 10 rounds of accuracy
recovery training and after 100 rounds of full retraining.
We find that almost all methods can achieve a low success
rate of backdoor attacks except for GA. The reason why
GA has a high success rate of backdoor attacks is that the
algorithm after unlearning is still near the original model,
and it is easy to converge to the original model with high
accuracy and a high success rate of backdoor attacks. The
final accuracy of SFU is the highest among all the methods,
and sometimes it can even exceed the accuracy of retraining,
which proves that updating in the subspace will produce a
better-initialized model to achieve higher accuracy.
High-speed precision recovery for SFU. To compare the
model accuracy recovery speed of SFU with each baseline,
we calculate the accuracy and backdoor attack success rate
of different methods in terms of the number of FL training
rounds after unlearning, and the results are shown in Fig. 4.
We observe that SFU is able to achieve high accuracy after
one round of training, while other methods require 5 or
even more rounds of training to achieve. SFU is more
efficient in terms of computation and communication cost
on the retained clients than the baseline of retraining while
achieving comparable backdoor accuracy.
5. Conclusion
In this paper, we propose a novel federated unlearning ap-
proach that can successfully eliminate the contribution of
a specified client to the global model, which also can min-
imize the model accuracy loss by performing a gradient
ascent process within the subspace at any stage of model
training. Our approach only relies on the target client to
be forgotten from the federation without the server or any
other client keeping track of its history of parameter updates.
Our method also provides a differential privacy method to
protect the representation matrix information during train-
ing. We have used a backdoor attack to effectively evaluate
the performance of the proposed method. Our experimental
results demonstrate the efficiency and effectiveness of SFU.
Subspace based Federated Unlearning
References
Bagdasaryan, E., Veit, A., Hua, Y., Estrin, D., and
Shmatikov, V. How to backdoor federated learning. In
International Conference on Artificial Intelligence and
Statistics, pp. 2938–2948. PMLR, 2020.
Baumhauer, T., Sch ̈ottle, P., and Zeppelzauer, M. Machine
unlearning: Linear filtration for logit-based classifiers.
Machine Learning, 111(9):3203–3226, 2022.
Bourtoule, L., Chandrasekaran, V., Choquette-Choo, C. A.,
Jia, H., Travers, A., Zhang, B., Lie, D., and Papernot,
N. Machine unlearning. In 2021 IEEE Symposium on
Security and Privacy (SP), pp. 141–159. IEEE, 2021.
Bussche, A. The EU General Data Protection Regulation
(GDPR): A Practical Guide. Springer, 2017.
Cao, Y. and Yang, J. Towards making systems forget with
machine unlearning. In 2015 IEEE Symposium on Secu-
rity and Privacy, pp. 463–480. IEEE, 2015.
Chen, Y. and Wainwright, M. J. Fast low-rank estimation
by projected gradient descent: General statistical and
algorithmic guarantees. arXiv preprint arXiv:1509.03025,
2015.
Farajtabar, M., Azizan, N., Mott, A., and Li, A. Orthogonal
gradient descent for continual learning. In International
Conference on Artificial Intelligence and Statistics, pp.
3762–3773. PMLR, 2020.
Hoecker, A. and Kartvelishvili, V. Svd approach to data
unfolding. Nuclear Instruments and Methods in Physics
Research Section A: Accelerators, Spectrometers, Detec-
tors and Associated Equipment, 372(3):469–481, 1996.
Izzo, Z., Smart, M. A., Chaudhuri, K., and Zou, J. Approx-
imate data deletion from machine learning models. In
International Conference on Artificial Intelligence and
Statistics, pp. 2008–2016. PMLR, 2021.
Jiang, W., Kwok, J., and Zhang, Y. Subspace learning for
effective meta-learning. In International Conference on
Machine Learning, pp. 10177–10194. PMLR, 2022.
Krizhevsky, A., Hinton, G., et al. Learning multiple layers
of features from tiny images. 2009.
Li, G., Hu, Y., Zhang, M., Liu, J., Yin, Q., Peng, Y., and
Dou, D. Fedhisyn: A hierarchical synchronous federated
learning framework for resource and data heterogeneity.
In Proceedings of the 51st International Conference on
Parallel Processing, pp. 1–11, 2022a.
Li, L., Fan, Y., Tse, M., and Lin, K.-Y. A review of appli-
cations in federated learning. Computers & Industrial
Engineering, 149:106854, 2020a.
Li, Q., Wen, Z., Wu, Z., Hu, S., Wang, N., Li, Y., Liu,
X., and He, B. A survey on federated learning systems:
vision, hype and reality for data privacy and protection.
IEEE Transactions on Knowledge and Data Engineering,
2021.
Fung, C., Yoon, C. J., and Beschastnikh, I. The limitations
of federated learning in sybil settings. In RAID, pp. 301–
316, 2020.
Li, T., Sahu, A. K., Talwalkar, A., and Smith, V. Feder-
ated learning: Challenges, methods, and future directions.
IEEE signal processing magazine, 37(3):50–60, 2020b.
Ginart, A., Guan, M., Valiant, G., and Zou, J. Y. Making ai
forget you: Data deletion in machine learning. Advances
in neural information processing systems, 32, 2019.
Graves, L., Nagisetty, V., and Ganesh, V. Amnesiac ma-
chine learning. In Proceedings of the AAAI Conference
on Artificial Intelligence, volume 35, pp. 11516–11524,
2021.
Gu, T., Dolan-Gavitt, B., and Garg, S. Badnets: Identify-
ing vulnerabilities in the machine learning model supply
chain. arXiv preprint arXiv:1708.06733, 2017.
Halimi, A., Kadhe, S., Rawat, A., and Baracaldo, N. Fed-
erated unlearning: How to efficiently erase a client in fl?
arXiv preprint arXiv:2207.05521, 2022.
He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learn-
ing for image recognition. In Proceedings of the IEEE
conference on computer vision and pattern recognition,
pp. 770–778, 2016.
Li, T., Tan, L., Huang, Z., Tao, Q., Liu, Y., and Huang,
X. Low dimensional trajectory hypothesis is true: Dnns
can be trained in tiny subspaces. IEEE Transactions on
Pattern Analysis and Machine Intelligence, 2022b.
Li, T., Wu, Y., Chen, S., Fang, K., and Huang, X. Subspace
adversarial training. In Proceedings of the IEEE/CVF
Conference on Computer Vision and Pattern Recognition,
pp. 13409–13418, 2022c.
Liu, G., Ma, X., Yang, Y., Wang, C., and Liu, J. Fed-
eraser: Enabling efficient client-level data removal from
federated learning models. In 2021 IEEE/ACM 29th In-
ternational Symposium on Quality of Service (IWQOS),
pp. 1–10. IEEE, 2021.
Liu, Y., Gadepalli, K., Norouzi, M., Dahl, G. E., Kohlberger,
T., Boyko, A., Venugopalan, S., Timofeev, A., Nelson,
P. Q., Corrado, G. S., et al. Detecting cancer metas-
tases on gigapixel pathology images. arXiv preprint
arXiv:1703.02442, 2017.
Subspace based Federated Unlearning
Truex, S., Baracaldo, N., Anwar, A., Steinke, T., Ludwig,
H., Zhang, R., and Zhou, Y. A hybrid approach to privacy-
preserving federated learning. In Proceedings of the 12th
ACM workshop on artificial intelligence and security, pp.
1–11, 2019.
Wang, J., Guo, S., Xie, X., and Qi, H. Federated unlearning
via class-discriminative pruning. In Proceedings of the
ACM Web Conference 2022, pp. 622–632, 2022.
Wu, C., Zhu, S., and Mitra, P. Federated unlearning with
knowledge distillation. arXiv preprint arXiv:2201.09441,
2022.
Wu, Y., Dobriban, E., and Davidson, S. Deltagrad: Rapid re-
training of machine learning models. In International
Conference on Machine Learning, pp. 10355–10366.
PMLR, 2020.
Xiao, H., Rasul, K., and Vollgraf, R. Fashion-mnist: a
novel image dataset for benchmarking machine learning
algorithms. arXiv preprint arXiv:1708.07747, 2017.
Xie, C., Huang, K., Chen, P.-Y., and Li, B. Dba: Distributed
backdoor attacks against federated learning. In Interna-
tional conference on learning representations, 2020.
Zhou, Y., Wu, Z. S., and Banerjee, A. Bypassing the ambient
dimension: Private sgd with gradient subspace identifica-
tion. arXiv preprint arXiv:2007.03813, 2020.
McMahan, B., Moore, E., Ramage, D., Hampson, S., and
y Arcas, B. A. Communication-efficient learning of deep
networks from decentralized data. In Artificial intelli-
gence and statistics, pp. 1273–1282. PMLR, 2017.
Melis, L., Song, C., De Cristofaro, E., and Shmatikov, V.
Exploiting unintended feature leakage in collaborative
learning. In 2019 IEEE symposium on security and pri-
vacy (SP), pp. 691–706. IEEE, 2019.
Nasr, M., Shokri, R., and Houmansadr, A. Comprehensive
privacy analysis of deep learning. In Proceedings of the
2019 IEEE Symposium on Security and Privacy (SP), pp.
1–15, 2018.
Oord, A. v. d., Li, Y., and Vinyals, O. Representation learn-
ing with contrastive predictive coding. arXiv preprint
arXiv:1807.03748, 2018.
Pardau, S. L. The california consumer privacy act: Towards
a european-style privacy regime in the united states. J.
Tech. L. & Pol'y, 23:68, 2018.
Qian, Q., Jin, R., Yi, J., Zhang, L., and Zhu, S. Efficient
distance metric learning by adaptive sampling and mini-
batch stochastic gradient descent (sgd). Machine Learn-
ing, 99:353–372, 2015.
Rumelhart, D. E., Hinton, G. E., and Williams, R. J. Learn-
ing representations by back-propagating errors. nature,
323(6088):533–536, 1986.
Saha, G., Garg, I., and Roy, K. Gradient projection memory
for continual learning. arXiv preprint arXiv:2103.09762,
2021.
Sekhari, A., Acharya, J., Kamath, G., and Suresh, A. T. Re-
member what you want to forget: Algorithms for machine
unlearning. Advances in Neural Information Processing
Systems, 34:18075–18086, 2021.
Shastri, S., Wasserman, M., and Chidambaram, V. The
seven sins of {Personal-Data} processing systems under
{GDPR}. In 11th USENIX Workshop on Hot Topics in
Cloud Computing (HotCloud 19), 2019.
Song, M., Wang, Z., Zhang, Z., Song, Y., Wang, Q., Ren,
J., and Qi, H. Analyzing user-level privacy attack against
federated learning. IEEE Journal on Selected Areas in
Communications, 38(10):2430–2444, 2020.
Thudi, A., Deza, G., Chandrasekaran, V., and Papernot,
N. Unrolling sgd: Understanding factors influencing ma-
chine unlearning. In 2022 IEEE 7th European Symposium
on Security and Privacy (EuroS&P), pp. 303–319. IEEE,
2022.
A. Appendix: More Experiment Results
Subspace based Federated Unlearning
We run experiments on the true world datasets of including MNIST, CIFAR10, and CIFAR100. We consider two scenarios:
(i) We have ten clients with one target client, and all clients participate fully during each training round. (ii) We have 100
clients with one target client and only 10% of the clients participate during each training round. We detailed describe the
experiment settings and the experimental results of scenario (ii) in the following.
A.1. Setups
Dataset. We adopt real-world datasets including MNIST, CIFAR10, and CIFAR100. MNIST(Xiao et al., 2017) dataset
contains 60,000 training data and 10,000 test data in 10 classes. Each data sample is a 28×28 grayscale image. CIFAR10
dataset contains 50,000 training data and 10,000 test data in 10 classes. Each data sample is a 3×32×32 color image.
CIFAR100 (Krizhevsky et al., 2009) includes 50,000 training data and 10,000 test data in 100 classes as 500 training samples
per class, as shown in Table 3. For MNIST and CIFAR10/100, we normalize the pixel value within a specific mean and std
value in our code, which are [0.5, 0.5, 0.5] for mean and [0.5, 0.5, 0.5] for std.
Table 3: The similarity between predicted and real data distribution
Datasets
Training Data Test Data Class
Size
MNIST
CIFAR-10
CIFAR-100
60000
50,000
50,000
10,000
10,000
10,000
10
10
100
28 × 28
3 × 32 × 32
3 × 32 × 32
(a) IID
(b) Dir 0.3
Figure 5: Heat maps for each client with CIFAR10 dataset under different data partitions. The color bar denotes the number
of data samples. Each rectangle represents the number of data samples of a specific class in a party.
Dataset Partitions.
To fairly compare with the other baselines, we introduce the heterogeneity by splitting the total
dataset by sampling the label ratios from the Dirichlet distribution. An additional parameter is used to control the level of
heterogeneity of the entire data partition. In order to visualize the distribution of heterogeneous data, we make the heat maps
of the label distribution in different datasets, as shown in Fig. 5. It could be seen that for heterogeneity weight equals to 0.3
in Dirichlet distribution, about 10% to 20% of the categories dominate on each client, which is the blue block in Fig. 2. The
IID dataset is totally averaged in each client, which is the blue block in Fig. 2.
Baselines.
• Retraining the entire FL system without the target client being forgotten;
Subspace based Federated Unlearning
Table 4: Accuracy results after unlearning (100 clients).
Dataset
MNIST
CIFAR10
CIFAR100
Dataset
MNIST
CIFAR10
CIFAR100
network
MLP
CNN
MLP
CNN
ResNet
MLP
CNN
ResNet
network
MLP
CNN
MLP
CNN
ResNet
MLP
CNN
ResNet
FedAvg
UL
GA
SFU
test acc
94.41
98.47
40.04
55.11
48.38
13.5
16.59
15.05
atk acc
0.02
0.0
0.0
0.0
2.83
0.0
0.0
0.25
test acc
94.41
98.47
40.04
55.11
48.38
13.5
16.59
15.05
atk acc
0.02
0.0
0.0
0.0
2.83
0.0
0.0
0.25
test acc
94.38
98.26
39.81
54.95
47.79
13.47
16.57
15.32
atk acc
0.02
0.0
0.01
0.37
0.57
0.0
0.0
0.0
test acc
94.51
98.44
40.04
55.04
47.47
13.51
16.62
14.93
atk acc
0.0
0.0
0.0
0.0
0.27
0.0
0.0
0.0
Table 5: Accuracy results after retraining (100 clients).
Retraining
test acc
94.44
98.45
40.13
55.11
47.33
13.14
16.97
15.39
atk acc
0.02
0.0
0.0
0.00
3.51
0.0
0.0
0.12
UL-Distillation
test acc
94.44
98.41
40.13
55.27
50.93
13.42
16.57
15.01
atk acc
0.02
0.0
0.0
0.0
2.52
0.0
0.0
0.25
GA-retraining
test acc
94.43
98.43
39.95
55.36
48.36
13.17
16.57
14.92
atk acc
0.02
0.0
20.36
0.0
1.63
0.0
0.0
0.14
SFU-retraining
test acc
94.98
98.44
41.49
56.13
49.93
13.30
17.51
16.09
atk acc
0.0
12.63
0.10
0.0
0.94
0.0
0.0
0.09
• Forgetting the target client based on the knowledge distillation Wu et al. (2022). This method subtracts historical
parameter updates of the target client from the global model. Then, it uses the knowledge distillation method to remedy
the skew of the unlearning model caused by the subtraction. We use "UL" to denote this kind of algorithm in our
experiments;
• The global model is updated using gradient ascent information on the target client. To reduce the probability of
producing a random model, we set the gradient clip norm when the global model is updated. We refer to this approach
as "GA" in our experiments.
Implementation Details.
In the experiment of removal of specific client contributions, We conduct unlearning experi-
ments on the FL model after 100 rounds of training, where the hyperparameter Settings of each method are as follows: For
SFU, we set the learning rate as 0.01, epoch as 1, and mini-batch size as 64 for gradient ascent on the target client, and each
client selects 10 samples to solve the local expression matrix. The random factor in differential privacy is generated by
sampling from a uniform distribution of[0.5 − 1]. For SVD parameters we followed the setting of Saha et al. (2021). For
UL and GA, we set the same learning rate and mini-batch as SFU, and the public data set of UL on the server is formed by
randomly sampling one-tenth of the total data. In the experiment of recovery of model performance, We start FL training
with the stochastic model for full retraining. we start FL training on the unlearned local model without the involvement of
the target client for SFU and GA. We use the knowledge of the public data on the server for distillation learning to recover
the model accuracy for UL.
A.2. Experimental results for scenario (ii).
We compare the performance of SFU and other baselines on the setting of scenario (ii).Tab. 4 and Tab. 5 show that the
success rate of backdoor attacks in scenario (ii) are lower than it in Tab. 1 and Tab. 2. When the client has a certain
probability of being selected in the FL system, the target client has little contribution to the final model. However, the
discussion about forgetting accuracy is still consistent with the interpretation in Sec. 4.2 and Sec. 4.3.
|
|
http://arxiv.org/abs/2302.13854v1 | 2023-02-24T04:28:46 | 2023-02-24T04:28:46 | A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm | We developed a fast and modular deep learning algorithm to search for
lookalike signals of interest in radio spectrogram data. First, we trained an
autoencoder on filtered data returned by an energy detection algorithm. We then
adapted a positional embedding layer from classical Transformer architecture to
a frequency-based embedding. Next we used the encoder component of the
autoencoder to extract features from small (~ 715,Hz with a resolution of
2.79Hz per frequency bin) windows in the radio spectrogram. We used our
algorithm to conduct a search for a given query (encoded signal of interest) on
a set of signals (encoded features of searched items) to produce the top
candidates with similar features. We successfully demonstrate that the
algorithm retrieves signals with similar appearance, given only the original
radio spectrogram data. | [
"Peter Xiangyuan Ma",
"Steve Croft",
"Andrew P. V. Siemion"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.13854v1",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.13854v1",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "eess.SP",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"eess.SP",
"astro-ph.IM",
"cs.LG",
"cs.SD",
"eess.AS"
] | RASTI 000, 1–8 (2023)
Preprint 28 February 2023
Compiled using rasti LATEX style file v3.0
3
2
0
2
b
e
F
4
2
]
P
S
.
s
s
e
e
[
1
v
4
5
8
3
1
.
2
0
3
2
:
v
i
X
r
a
A Deep Neural Network Based Reverse Radio Spectrogram Search
Algorithm
Peter Xiangyuan Ma,1★ Steve Croft,2,3 Andrew P. V. Siemion2,3,4,5
1Department of Mathematics, University of Toronto, 40 St. George Street, Toronto, ON M5S 2E4, Canada
2Radio Astronomy Laboratory, 501 Campbell Hall, University of California, Berkeley, CA 94720, USA
3SETI Institute, Mountain View, CA 94043, USA
4Jodrell Bank Centre for Astrophysics, The University of Manchester, M13 9PL, UK
5University of Malta, Institute of Space Sciences and Astronomy
Accepted XXX. Received YYY; in original form ZZZ
ABSTRACT
We developed a fast and modular deep learning algorithm to search for lookalike signals of interest in radio spectrogram data.
First, we trained an autoencoder on filtered data returned by an energy detection algorithm. We then adapted a positional
embedding layer from classical Transformer architecture to a frequency-based embedding. Next we used the encoder component
of the autoencoder to extract features from small (∼ 715 Hz with a resolution of 2.79 Hz per frequency bin) windows in the
radio spectrogram. We used our algorithm to conduct a search for a given query (encoded signal of interest) on a set of signals
(encoded features of searched items) to produce the top candidates with similar features. We successfully demonstrate that the
algorithm retrieves signals with similar appearance, given only the original radio spectrogram data.
Key words: Deep Learning – Machine Learning – Signal Processing – Radio Astronomy – Technosignatures
1 INTRODUCTION
1.2 Classical Reverse Image Search Algorithms
1.1 Interference Rejection in Radio Astronomy
The rejection of radio frequency interference (RFI) is a perennial
challenge for radio astronomy, particularly given the increase in satel-
lite constellations that transmit at a range of radio frequencies and
are detectable even at remote observing sites. RFI rejection is tradi-
tionally performed using statistical or machine learning techniques
that risk rejecting a potential signal of interest (SOI) in the process of
flagging RFI signals (Pinchuk & Margot 2022). This is a particular
problem when searching for astrophysical transients or for technosig-
natures, since the signal morphology may not be known ahead of time
and it may be rejected before a human has the opportunity to review
it. Novel deep learning algorithms have been successfully used to
address these kinds of problems (Ma et al. 2023).
An alternative approach, which is relatively unexplored, is to start
with the SOI, search through some database of signals (including
RFI), and if the signals match, to then decide whether to keep or
discard the SOI. This is of particular interest in technosignature
searches where the vetting of candidate signals (e.g. BLC1; Sheikh
et al. 2021) is rather onerous using existing methods. The ability to
find additional examples of a given SOI at different times or different
parts of the observed band can be invaluable in determining the nature
of the signal. The focus of this paper is to develop an algorithm that
allows us to reverse search a given SOI and return similar signals. We
take inspiration from well known reverse image search algorithms.
★ E-mail: [email protected]
© 2023 The Authors
Reverse image searches are commonly employed in search engines
and social media. These algorithms take an input image as a search
term and return the locations of the same or similar images from
across the web. These sites use algorithms like Scale-Invariant Fea-
ture Transforms (SIFT; Lowe 1999), Maximally Stable Extremal
Regions (MSER; Matas et al. 2004) or Bag of Words/Vocabulary
Tree (Csurka et al. 2004) to power their search. Here we will briefly
review some of these approaches and extend them to our work.
1.2.1 Scale-Invariant Feature Transforms
A Scale-Invariant Feature Transform (SIFT) is an algorithm that takes
an image, locates special "locally distinct points", and describes the
features around such points using measurements such as the gradient
in intensity or maximum intensity, etc. (Lowe 1999). This process
produces pairs of vectors: the coordinates of the locally distinct point,
and the corresponding descriptor vector that contains the features of
that point.
The locally distinct points are produced from a process of differ-
ence of Gaussians performed at varying resolutions of the images.
To compute the descriptor vector we measure the gradients in pixel
intensity over a region about the locally distinct points. Together this
builds a feature extractor. Finally, to perform a search, we match
the key points between images and check the similarity between the
descriptor vectors. More concretely we can use a technique called a
Vocabulary Tree, described in section 1.2.3.
2
P.X Ma et al.
1.2.2 Maximally stable extremal regions
The maximally stable extremal regions (MSER) algorithm, like SIFT,
attempts to find key points in the image. Specifically, it looks for ob-
jects called "blobs", defined as areas of an image that have connected
elements, contrasting backgrounds, and close-to-uniform pixel in-
tensities (Matas et al. 2004).
MSER works by taking various thresholds in the range (0, 255)
and blacking or whitening out pixels depending on this threshold.
The blacking and whitening of pixels create the "blobs". We perform
a connected component analysis and track how the blobs evolve as
we adjust the threshold. MSER helps pull out small regions of images
that contain distinctive boundaries which we can use to label distinct
points and compute descriptor vectors for each blob. These can then
be used to compare and match.
1.2.3 Bag of Words / Vocabulary Tree
The Vocabulary Tree approach in computer vision effectively im-
plements a Bag of Words (BoW) model to compare images to each
other (Csurka et al. 2004). We first run a local feature extractor like
SIFT (section 1.2.1). We then construct a "codebook" containing
codewords that describe several similar patches identified by SIFT.
One simple means of determining codewords is to use K-Means clus-
tering to produce centroids, which we denote as codewords. We can
then compare and contrast images by comparing the corresponding
codebooks using a variety of algorithms. However, a key limitation
in this approach is that SIFT ignores the spatial relationships between
local patches, which we know is incredibly important in describing
an image accurately. This leaves room for improvement.
1.3 Deep Learning for Computer Vision
Deep learning overcomes some of the shortcomings of the afore-
mentioned algorithms and has been proven to effectively solve a
wide range of image problems with the advent of Convolutional
Neural Networks (CNN; LeCun et al. 1999). CNN's are simple in
that they are a traditional neural network with the addition of con-
volutional layers. These layers operate by performing convolution
operations between input data and a kernel. These operations have
built-in inductive bias. For example, these operations are equivalent
to translations that the algorithm exploits as fundamental properties
in images. More concretely, this is because in images, small trans-
lations often do not change the prediction outcomes (Goodfellow
et al. 2016). For example, if we take a picture of a dog and move the
dog 5 pixels to the right, the image is still that of a dog. By using
a convolutional layer we are baking this assumption into the model
without getting the model to learn it from scratch. More formally this
allows us to restrict the priors on the weights thus reducing the size
of the model and allowing vast improvements in both performance
and scale. More specifically CNN's have been proven to be efficient
feature extractors of both local and global features which address
the shortcomings described in Section 1.2.3. Due to the exceptional
performance of CNN's on a wide range of image tasks, they have
been widely adopted in industry for a variety of computer vision
challenges (Krizhevsky et al. 2017; Koul et al. 2019) including for
reverse image search algorithms (Singh & Gowdar 2021).
1.3.1 Autoencoders
Autoencoders are special cases of CNN's, employing a symmetrical
CNN architecture that takes in an input and outputs a reconstruction
RASTI 000, 1–8 (2023)
of the original input. However, these models have a bottleneck that
constricts the flow of data (Baldi 2012). This bottleneck divides the
network into two: an encoder and a decoder. The encoder takes an
input image and compresses the data through the bottleneck and the
decoder attempts to reverse that process. Intuitively this builds an
efficient feature extractor since the encoder is attempting to reduce
the input into the most important features such that the decoder can
reconstruct the original input (Goodfellow et al. 2016). This kind of
automatic feature extraction technique will serve as the core of our
approach.
1.4 Problem Statement
Despite these algorithms being industry-standard, out-of-the-box so-
lutions fail to satisfy our needs. Firstly, these traditional (not deep
learning) techniques disregard large-scale spatial features, as de-
scribed in section 1.2.3. Traditional algorithms fail to capture com-
plex structures within the data. This is partially the reason why tra-
ditional computer vision techniques are being superseded by deep
learning in tackling computer vision problems. Secondly, under cer-
tain circumstances, we want to bias our model towards particular
features, for example, frequency. Currently, there is no encoding of
information on the radio frequency of the signal in any of these
methods.
During our search process, sometimes we wish to match signals
that not only appear similar to each other, but also are located in
similar regions of the frequency band. On the surface, this appears to
be a trivial problem: simply filter out the candidates after the search is
completed. However, there exists a trade-off between visually similar
signals and signals that are just close by in frequency. Thus if one
wants to search for both similar appearing signals and signals close by
in frequency we need to "bake in" the information about the frequency
into the search process rather than apply it as a secondary filter.
Classical search algorithms do not have an out-of-the-box solution
to embedding complex features such as signal frequency.
The central questions we want to answer are: Given a signal in a
radio spectrogram, can we find all lookalike signals? Can we also
find similar signals in similar regions of the frequency band? Can
we make these approaches modular?
2 METHODS
We begin by outlining the structure of our approach. First, we build
a feature extractor using an autoencoder. To do so we describe our
data source in section 2.1, the cleaning of the data in section 2.2, and
data preprocessing in section 2.3. We then move to build the model
in 2.4. We train and test the model in section 2.5. We extend the
model capabilities using a modular frequency embedding strategy
discussed in 2.6, and finally assemble the algorithm in section 2.7.
2.1 Data Source
The training, validation, and testing dataset are derived from real
observations from Breakthrough Listen's Green Bank Telescope
1.8 − 2.9 GHz dataset, sourced from several different observational
campaigns (Enriquez et al. 2017; Price et al. 2018; Price et al. 2020;
Price et al. 2021). We used the high-frequency resolution data product
where each frequency bin is 2.79 Hz wide (Lebofsky et al. 2019b),
since our goal is to tackle data that contains RFI, and RFI can have
A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm
3
fine resolution in the frequency domain. The data is open source and
are available from the Breakthrough Listen Open Data Archive1.
2.2 Data Filtering Energy Detection
Since we are working with real data, we need to balance the training
features. Large regions of the spectrograms consist of Gaussian noise,
so if we did not filter the data to extract signals, then the resulting
model would be biased towards generating noise rather than real
signals. To perform this filtering we apply a simple energy detection
process2.
First we perform a simple bandpass filtering on the entire obser-
vation. This removes the polyphase filterbank shape imposed by the
first of a two-stage channelization procedure (Lebofsky et al. 2019a).
This is done by collapsing the spectrogram in the time dimension and
fitting a piece-wise polynomial spline to each ∼ 3 MHz-wide coarse
channel. We subtract the fitted polynomial from the data. Finally,
we iterate through windows of size 715 Hz and search for excess
energy above the expectations of Gaussian random noise. We chose
an S-score threshold of 512 (D'Agostino & Pearson 1973).
We also perform a complementary energy detection process where
we select regions consistent with Gaussian noise by inverting the
threshold condition. When constructing the training set we use an
equal number of "signal" and "noise" regions, thus balancing the
dataset.
2.3 Data and Preprocessing
To create the training set we randomly draw 30 observations from a
total of 12,000, and draw an additional six observations for the test
set (excluding those already selected as part of the training set). We
chose 30 and 6 to keep computing time reasonable. Running energy
detection required 30 minutes to process each file and with 30 exam-
ples it already provided more than 2 million training samples which
is more than enough to demonstrate our algorithm's capabilities.
The spectrograms have a time resolution of 18.25 s and a frequency
resolution of 2.79 Hz, giving the dataset 3 × 108 frequency channels.
We then split the band into ∼ 715 Hz "snippets". This resulted in
a training set of approximately 2 million snippets and a test set of
300,000 snippets. We then log normalize the data, add a constant
to make all the values positive, and scale the data to have a final
range within 0 and 1. Examples of the resulting snippets are shown
in Figure 1. Note that the normalization is done per snippet indepen-
dently of each other sample. These snippets are used as inputs to the
autoencoder, and the targets are the same snippets.
2.4 Autoencoder
As described in section 1.3.1, our autoencoder consists of an encoder
and a decoder (Baldi 2012). The encoder consists of five convolu-
tional layers (LeCun et al. 1999), with filter sizes of 16, 32, 32, 32,
and 32 respectively. In between each layer is a 2-D Maxpool layer
(Krizhevsky et al. 2017) of size (1,2). A batch normalization layer
(Ioffe & Szegedy 2015) is included between the final maxpool layer
and the convolutional layer. This is followed by three dense layers
of size 32, 16, and 5 respectively. All the activations used are ReLu
(Fukushima 1975) activations. The model was built using Tensorflow
(Abadi et al. 2015) and Keras (Chollet et al. 2015).
1 http://seti.berkeley.edu/opendata
2 https://github.com/FX196/SETI-Energy-Detection
The decoder is similar but in reverse order. We once again have
dense layers of size 16, and 32 where the output is then reshaped and
fed into a convolutional transpose (Baldi 2012) layer which upscales
the image back to the same dimension of the input. Between the five
convolutional layers, we have batch normalization and maxpool size
of (2,1). The model architecture is shown in Figure 2.
2.5 Training and Validation
The training scheme is standard. We fitted the model using the ADAM
(Kingma & Ba 2014) optimizer with a learning rate of 1 × 10−4, uti-
lizing an early stopping routine with the patience of 10 epochs trained
in batches of 16 samples, for 100 epochs. We then visually evaluated
how well the model reconstructed the original spectrogram. Figure 1
shows a few randomly drawn examples. The reconstruction achieves
our desired level of accuracy in that visually the reconstructions
appear similar to the inputs. We proceed with this model (Figure 3).
2.6 Frequency Embedding
Signal morphology varies with frequency, given that transmitters
of different types occupy different regions of the band. For exam-
ple, WiFi and Bluetooth signals are common in our spectra around
2.4 GHz. However, during our training phase and in the construction
of our model this frequency information is not preserved in the fea-
ture extractor. Should a user choose to search for signals that are also
similar in frequency this information would be lost. However, we can
add frequency information to the feature vector.
Initially, this appears trivial - one can simply extend the fea-
ture vector by a dimension and add the frequency information here.
However, this would mean that frequency is an orthogonal feature
to all the other extracted features. We know, however, that signal
morphology is correlated to some extent with frequency. Here we
borrow techniques from Natural Language Processing (specifically
transformer architectures) to encode frequency information in feature
vectors called Positional Embeddings (Vaswani et al. 2017).
Positional embeddings work by taking encoded feature vectors
and perturbing these vectors by small offsets based on their position
to obtain an ideal balance between correct adjustment and over-
adjustment which could lead to confusion with other signals. One
can imagine this as trying to build miniature clusters in some high-
dimensional feature space where each element of the cluster is unique
but the elements of the cluster don't intersect with other clusters.
The adjustment vector is found using Equation 1, adapted from
the paper "Attention Is All You Need" (Vaswani et al. 2017),
P(k, i) =
sin( k
n
cos(
),
i
d
k
i−1
d
n
i even
),
i odd
(1)
The variable k is the index in position, so if we have a sequence
of length L, we pick an integer k ∈ [0, L]. The index in the feature
vector is denoted i, and i ∈ [0, d] where d is the dimension of the
embedding space. The variable n is a tunable hyperparameter, where
Vaswani et al. choose n = 10, 000. These equations ought to satisfy
two conditions:
(i) The adjustments are unique for a given frequency index k.
(ii) The adjustments are bounded, in order to prevent the adjust-
ment vector from over-adjusting.
The functions are all bounded between [0, 1] satisfying condition
(ii). The sinusoidal functions are unique to each position, satisfying
RASTI 000, 1–8 (2023)
4
P.X Ma et al.
Figure 1. A random sample of training examples. A variety of RFI signals are seen in these snippets.
Figure 2. A representation of our autoencoder model. The encoder shows a progressive compression of data, forcing the network to decide the most important
features of the original spectrogram.
Figure 3. Eight randomly drawn real observations (top row) and their corresponding autoencoder reconstructions (bottom row). The autoencoder can reconstruct
the signals in the input data. We see that the reconstruction of the signal appears good, whereas the reconstruction of the noise is slightly poorer. This isn't a
concern since the main focus should be on the signal.
RASTI 000, 1–8 (2023)
0200010Time [18.25s]0200020002000200020002000200020002000200010Time [18.25s]0200020002000200020002000200020002000200010Time [18.25s]0200020002000200020002000200020002000200Frequency [2.79 Hz]010Time [18.25s]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0.20.30.40.50.6Power [normalized]EncoderLayer 18: DenseLayer 1: Conv 2D Layer 2: Maxpool 2D Layer 3: Batch Norm. Layer 4: Conv 2D Layer 5: Maxpool 2D Layer 6: Batch Norm. Layer 7: Conv 2D Layer 8: Maxpool 2D Layer 9: Batch Norm. Layer 10: Conv 2D Layer 11: Maxpool 2D Layer 12: Batch Norm. Layer 13: Conv 2D Layer 14: Maxpool 2D Layer 15: Batch Norm. Layer 16: FlattenLayer 17: DenseBottleneckInputLayer 20: DenseLayer 23: Conv 2D Layer 24: Maxpool 2D Layer 25: Batch Norm. Layer 22: ReshapeLayer 21: DenseLayer 26: Conv 2D Layer 27: Maxpool 2D Layer 28: Batch Norm. Layer 29: Conv 2D Layer 30: Maxpool 2D Layer 31: Batch Norm. Layer 32: Conv 2D Layer 34: Maxpool 2D Layer 35 Batch Norm. Layer 36: Conv 2D Layer 37: Maxpool 2D Layer 38: Batch Norm. OutputLayer 38: Conv 2D Decoder0100200051015 ReconstructionTime [18.25s]01002000100200010020001002000100200010020001002000100200Frequency [2.79 Hz]051015Time [18.25s]Real Obs0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0.20.30.40.50.6Power [normalized]A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm
5
those used as input, we select 10 filtered Energy Detection snippets
at random and perform a search using the same observation set as
used for the SOI observations. Images of the spectrograms used can
be found in our GitHub repository3.
In the first method, we use the classical SIFT + Bag of Words al-
gorithm described in section 1.2. We run SIFT through each window
of the spectrogram and generate a set of descriptor vectors for each
image. Then we use K-Means clustering with 800 centroids to build
a codebook. The codebook is built by taking the fitted centroids as
the codewords and then looping back in the descriptor vectors and
assigning them a codeword. Then for each image, we created a his-
togram of codewords, hence treating it as a BoW model. Finally,
we performed a match between the histogram of the SOI and the
histograms of each candidate signal. The matches use the K-Nearest
Neighbours approach (Cover & Hart 1967). Results are shown in
Figure 6. One downside to this approach is that the algorithm is very
slow. For each observation, we need to generate millions of descriptor
vectors and repeat the SIFT operation millions of times. Unlike deep
learning-based approaches, these feature vectors can be generated in
parallel on the GPU using much more efficient methods.
Next, we applied our algorithm without using frequency embed-
ding techniques (Figure 7). We see that this approach was able to
retrieve more convincing candidates than the classical SIFT+ BoW
approach. When we investigate where the candidates lie in frequency
space, we see that many are close to the frequency of the true signal
(Figure 7).
Finally, we applied our algorithm with frequency embedding (Fig-
ure 8). The resulting signals show even higher visual similarity to the
input signal. Additionally, the frequency distribution of the matches
is closer to the frequency of the input signal, showing that the fre-
quency embedding was successful.
4 DISCUSSION
Our algorithm is more successful than classical approaches in re-
turning similar candidates. The algorithm also runs approximately
20 times faster than our classical implementations at our data center
because our algorithm can take advantage of GPUs with deep learn-
ing hardware acceleration such as tensor cores. Traditional matching
techniques suffer an inability to generalize large-scale features as
discussed in Section 1.2. Furthermore, the addition of frequency em-
bedding results in candidates that have a better match in frequency
to the input signal, which is desirable under certain situations. In
addition, it appears that SIFT-based algorithms tend to match local
features and thus have a tendency to match noise (see Figure 6), un-
like the Deep Learning based approaches where models were able to
learn more global features resulting in better matches overall.
Looking forward we believe this algorithm has a wide range of
practical use in transient radio astronomy. One particularly exciting
use case is to help automate signal verification steps for candidate
technosignature signals such as BLC1 (Sheikh et al. 2021). By au-
tomatically searching for potential lookalikes based on signal mor-
phology, rather than relying on more low-level parameters of a signal,
such as drift rate, signal width, or signal-to-noise ratio, we can do a
better job of distinguishing between true anomalies, and RFI.
More generally, this technique can be used to build an RFI
database. Many RFI databases consist simply of frequency ranges
that are excluded (for example, the frequency ranges corresponding
Figure 4. A visualization of the patterns in the embedding confirms that they
are unique for each position we encode. We used a dimension of 512 and a
sequence length of 100 for demonstration purposes; in the actual algorithm,
we used a dimension of 4 and a sequence of 1000.
Figure 5. Visualization of the search process and the flow of data. We first
extract features from the SOI and the set of possible candidates. Then we
apply frequency embedding, and finally, we produce the similarity scores by
matrix multiplication.
condition (i). We can measure similarity in positions using metrics
such as cosine similarity or Euclidean distance. The embeddings are
visualized in Figure 4.
The choice of sequence length determines how many frequency
chunks the band is broken into. Our choice of 1000 bins (giving
∼ 1 MHz chunks) is a compromise between small chunks (which
increase computational resource intensity) and large chunks (which
reduce accuracy).
2.7 The Search Algorithm
We now combine the components of our algorithm and use them to
perform a search. The search has three elements. First, the feature
extractor, using the encoder of the Autoencoder, extracts features
from the spectrogram. Second, we index and construct the frequency
embedding for each of the extracted features and add those to the
encoded vectors. We repeat this process with the SOI. Finally, we
compute similarity scores between the SOI and the images in the
search list. This similarity score is the cosine similarity metric and
is computed efficiently by performing a matrix multiplication and
renormalizing by the respective vector norms. The procedure is vi-
sualized in Figure 5.
3 RESULTS
We perform three sets of tests. First, we apply the classical SIFT +
BoW algorithm to the problem discussed in Section 1.2. Second, we
apply our algorithm to the problem but without the frequency em-
bedding step. Lastly, we apply our algorithm with frequency embed-
dings to the problem and assess the results, in order to demonstrate
the modularity of our design.
To assess the ability of the algorithm to return similar signals to
3 https://github.com/PetchMa/Reverse_Radio_Search
RASTI 000, 1–8 (2023)
0100200300400500Feature Dimension020406080Position In Band0.50.00.51.0EncoderEncoded FeaturesEncoderFrequency EmbeddingsMatrix MultiplyAnd RenormalizeCandidatesSignal of InterestSimilarity ScoreElement-wise additionElement-wise addition6
P.X Ma et al.
Figure 6. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box], using the SIFT + BoW algorithm. The best candidate is
shown in the top right box. Note: that this method did not find itself because this uses a KNN matching algorithm that excludes the trivial case (b) Frequency
distribution of the top 10,000 most similar hits.
Figure 7. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box] for our deep learning algorithm with no frequency
embedding. The best match is unsurprisingly, the input signal [top right box]. (b) Frequency distribution of the top 10,000 most similar hits.
RASTI 000, 1–8 (2023)
True Target - 1961.27 MHzBest Match: 1946.5 [MHz]2675.36 [MHz]1931.76 [MHz]1960.81 [MHz]2329.24 [MHz]2659.12 [MHz]2443.12 [MHz]1960.83 [MHz]1960.84 [MHz]1951.91 [MHz]1931.71 [MHz]180020002200240026002800Frequency [MHz]0250050007500Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b)True Target - 1961.27 MHzBest Match: 1961.27 [MHz]1951.17 [MHz]1964.53 [MHz]1954.33 [MHz]1933.56 [MHz]1934.22 [MHz]1948.56 [MHz]1953.33 [MHz]1964.43 [MHz]1964.21 [MHz]1963.9 [MHz]180020002200240026002800Frequency [MHz]02000Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b)A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm
7
Figure 8. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box] for our deep learning algorithm with frequency embedding.
Again, the best match is the input signal [top right box]. (b) Frequency distribution of the top 10,000 most similar hits. The algorithm retrieves matches at
frequencies close to the input frequency while maintaining similar signal morphology to the input.
to GPS satellites). Our algorithm enables a finer-grained approach,
comparing signal morphologies without necessitating the exclusion
of large ranges in frequency, thus helping to make more efficient use
of the spectrum and expanding the power of the search.
Another use case is to perform template searches. For example,
one can build theoretical models that simulate some desired signal,
and search the recorded observations for signals that match.
The next step in the development of our algorithm is to modify it
to handle a wider range of data products. For example, developing a
model to handle arbitrary collections of spectrogram data (data from
different receivers or even telescopes). Or perhaps building a model
that can deal with cases where the spectral resolution varies (e.g.
combining data products with 3 Hz resolution and 1 Hz resolution).
We also plan to extend our approach to series (or cadences) of
multiple observations, which intersperse scans of the target star with
comparison scans of neighboring targets. Signals such as BLC1,
which appear only in scans of the primary target, are consistent
with being spatially localized on the sky. However, the dataset in
which BLC1 was discovered also contained "lookalike" signals at
other frequencies, indicating that they were likely due to particularly
pernicious RFI. By applying our new methodology to cadences of
data, we can much more easily locate lookalike signals at other
frequencies, or in scans of other targets, providing an additional
powerful means of screening technosignature candidates.
5 DATA RELEASE AND CODE AVAILABILITY
ACKNOWLEDGEMENTS
Breakthrough Listen is managed by the Breakthrough Initiatives,
sponsored by the Breakthrough Prize Foundation4. We are grateful
to the staff of the Green Bank Observatory for their help with in-
stallation and commissioning of the Breakthrough Listen backend
instrument and extensive support during Breakthrough Listen obser-
vations. We thank Yuhong Chen for his helpful discussion on the
Energy Detection Algorithm.
REFERENCES
Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado,
G. S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I.,
Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur,
M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D., Olah,
C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K., Tucker,
P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O., Warden, P.,
Wattenberg, M., Wicke, M., Yu, Y., & Zheng, X., 2015. TensorFlow:
Large-scale machine learning on heterogeneous systems, Software avail-
able from tensorflow.org.
Baldi, P., 2012. Autoencoders, unsupervised learning, and deep architectures,
in Proceedings of ICML workshop on unsupervised and transfer learning,
pp. 37–49, JMLR Workshop and Conference Proceedings.
Chollet, F. et al., 2015. Keras, https://keras.io.
Cover, T. & Hart, P., 1967. Nearest neighbor pattern classification, IEEE
Transactions on Information Theory, 13(1), 21–27.
Csurka, G., Dance, C., Fan, L., Willamowski, J., & Bray, C., 2004. Visual
categorization with bags of keypoints, in Workshop on statistical learning
in computer vision, ECCV, vol. 1, pp. 1–2, Prague.
All source code is released here and the data is publicly released
here.
4 http://www.breakthroughinitiatives.org
RASTI 000, 1–8 (2023)
True Target - 1961.27 MHzBest Match: 1961.27 [MHz]1951.17 [MHz]1964.53 [MHz]1954.33 [MHz]1933.56 [MHz]1934.22 [MHz]1948.56 [MHz]1953.33 [MHz]1964.43 [MHz]1964.21 [MHz]1963.9 [MHz]180020002200240026002800Frequency [MHz]0100020003000Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b)Czech, D., Gajjar, V., Siemion, A., Drew, J., Worden, S. P., Green, J. A.,
Craig, D., & Amy, S., 2021. Expanded Capability of the Breakthrough
Listen Parkes Data Recorder for Observations with the UWL Receiver,
Research Notes of the American Astronomical Society, 5, 114, ADS Bib-
code: 2021RNAAS...5..114P.
Sheikh, S. Z., Smith, S., Price, D. C., DeBoer, D., Lacki, B. C., Czech, D. J.,
Croft, S., Gajjar, V., Isaacson, H., Lebofsky, M., MacMahon, D. H. E.,
Ng, C., Perez, K. I., Siemion, A. P. V., Webb, C. I., Zic, A., Drew, J., &
Worden, S. P., 2021. Analysis of the breakthrough listen signal of interest
blc1 with a technosignature verification framework, Nature Astronomy,
5(11), 1153–1162.
Singh, P. N. & Gowdar, T. P., 2021. Reverse image search improved by deep
learning, in 2021 IEEE Mysore Sub Section International Conference
(MysuruCon), pp. 596–600.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N.,
Kaiser, L., & Polosukhin, I., 2017. Attention is all you need.
This paper has been typeset from a TEX/LATEX file prepared by the author.
8
P.X Ma et al.
D'Agostino, R. & Pearson, E. S., 1973. Tests for departure from normality.
b 1, Biometrika, 60(3),
empirical results for the distributions of b 2 and
613.
√
Enriquez, J. E., Siemion, A., Foster, G., Gajjar, V., Hellbourg, G., Hickish, J.,
Isaacson, H., Price, D. C., Croft, S., DeBoer, D., Lebofsky, M., MacMa-
hon, D. H. E., & Werthimer, D., 2017. The Breakthrough Listen Search
for Intelligent Life: 1.1–1.9 GHz Observations of 692 Nearby Stars, ApJ,
849(2), 104, Publisher: American Astronomical Society.
Fukushima, K., 1975. Cognitron: A self-organizing multilayered neural net-
work, Biological Cybernetics, 20(3-4), 121–136.
Goodfellow, I., Bengio, Y., & Courville, A., 2016. Deep Learning, MIT
Press, http://www.deeplearningbook.org.
Ioffe, S. & Szegedy, C., 2015. Batch normalization: Accelerating deep net-
work training by reducing internal covariate shift.
Kingma, D. P. & Ba, J., 2014. Adam: A method for stochastic optimization.
Koul, A., Ganju, & Kasam, M., 2019. Practical deep learning for cloud and
mobile, O'Reilly Media, Sebastopol, CA.
Krizhevsky, A., Sutskever, I., & Hinton, G. E., 2017. ImageNet classification
with deep convolutional neural networks, Commun. ACM, 60(6), 84–90.
Lebofsky, M., Croft, S., Siemion, A. P. V., Price, D. C., Enriquez, J. E.,
Isaacson, H., MacMahon, D. H. E., Anderson, D., Brzycki, B., Cobb, J.,
Czech, D., DeBoer, D., DeMarines, J., Drew, J., Foster, G., Gajjar, V.,
Gizani, N., Hellbourg, G., Korpela, E. J., Lacki, B., Sheikh, S., Werthimer,
D., Worden, P., Yu, A., & Zhang, Y. G., 2019a. The Breakthrough
Listen Search for Intelligent Life: Public Data, Formats, Reduction, and
Archiving, PASP, 131(1006), 124505, Publisher: IOP Publishing.
Lebofsky, M., Croft, S., Siemion, A. P. V., Price, D. C., Enriquez, J. E.,
Isaacson, H., MacMahon, D. H. E., Anderson, D., Brzycki, B., Cobb, J.,
Czech, D., DeBoer, D., DeMarines, J., Drew, J., Foster, G., Gajjar, V.,
Gizani, N., Hellbourg, G., Korpela, E. J., Lacki, B., Sheikh, S., Werthimer,
D., Worden, P., Yu, A., & Zhang, Y. G., 2019b. The Breakthrough
Listen Search for Intelligent Life: Public Data, Formats, Reduction, and
Archiving, PASP, 131(1006), 124505, Publisher: IOP Publishing.
LeCun, Y., Haffner, P., Bottou, L., & Bengio, Y., 1999. Object Recogni-
tion with Gradient-Based Learning, in Shape, Contour and Grouping in
Computer Vision, Lecture Notes in Computer Science, pp. 319–345, eds
Forsyth, D. A., Mundy, J. L., di Gesú, V., & Cipolla, R., Springer, Berlin,
Heidelberg.
Lowe, D., 1999. Object recognition from local scale-invariant features, in
Proceedings of the Seventh IEEE International Conference on Computer
Vision, IEEE.
Ma, P. X., Ng, C., Rizk, L., Croft, S., Siemion, A. P. V., Brzycki, B., Czech, D.,
Drew, J., Gajjar, V., Hoang, J., Isaacson, H., Lebofsky, M., MacMahon,
D. H. E., de Pater, I., Price, D. C., Sheikh, S. Z., & Worden, S. P., 2023. A
deep-learning search for technosignatures from 820 nearby stars, Nature
Astronomy.
Matas, J., Chum, O., Urban, M., & Pajdla, T., 2004. Robust wide-baseline
stereo from maximally stable extremal regions, Image and vision com-
puting, 22(10), 761–767.
Pinchuk, P. & Margot, J.-L., 2022. A machine learning–based direction-of-
origin filter for the identification of radio frequency interference in the
search for technosignatures, The Astronomical Journal, 163(2), 76.
Price, D. C., MacMahon, D. H. E., Lebofsky, M., Croft, S., DeBoer, D., En-
riquez, J. E., Foster, G. S., Gajjar, V., Gizani, N., Hellbourg, G., Isaacson,
H., Siemion, A. P. V., Werthimer, D., Green, J. A., Amy, S., Ball, L., Bock,
D. C.-J., Craig, D., Edwards, P. G., Jameson, A., Mader, S., Preisig, B.,
Smith, M., Reynolds, J., & Sarkissian, J., 2018. The Breakthrough Listen
search for intelligent life: Wide-bandwidth digital instrumentation for the
CSIRO Parkes 64-m telescope, Publications of the Astronomical Society
of Australia, 35, Publisher: Cambridge University Press.
Price, D. C., Enriquez, J. E., Brzycki, B., Croft, S., Czech, D., DeBoer, D.,
DeMarines, J., Foster, G., Gajjar, V., Gizani, N., Hellbourg, G., Isaacson,
H., Lacki, B., Lebofsky, M., MacMahon, D. H. E., Pater, I. d., Siemion,
A. P. V., Werthimer, D., Green, J. A., Kaczmarek, J. F., Maddalena,
R. J., Mader, S., Drew, J., & Worden, S. P., 2020. The Breakthrough
Listen Search for Intelligent Life: Observations of 1327 Nearby Stars
Over 1.10-3.45 GHz, AJ, 159(3), 86.
Price, D. C., MacMahon, D. H. E., Lebofsky, M., Isaacson, H., Sheikh, S.,
RASTI 000, 1–8 (2023)
|
|
http://arxiv.org/abs/2302.12445v2 | 2023-06-15T06:19:25 | 2023-02-24T04:11:18 | DeAR: Accelerating Distributed Deep Learning with Fine-Grained
All-Reduce Pipelining | Communication scheduling has been shown to be effective in accelerating
distributed training, which enables all-reduce communications to be overlapped
with backpropagation computations. This has been commonly adopted in popular
distributed deep learning frameworks. However, there exist two fundamental
problems: (1) excessive startup latency proportional to the number of workers
for each all-reduce operation; (2) it only achieves sub-optimal training
performance due to the dependency and synchronization requirement of the
feed-forward computation in the next iteration. We propose a novel scheduling
algorithm, DeAR, that decouples the all-reduce primitive into two continuous
operations, which overlaps with both backpropagation and feed-forward
computations without extra communications. We further design a practical tensor
fusion algorithm to improve the training performance. Experimental results with
five popular models show that DeAR achieves up to 83% and 15% training speedup
over the state-of-the-art solutions on a 64-GPU cluster with 10Gb/s Ethernet
and 100Gb/s InfiniBand interconnects, respectively. | [
"Lin Zhang",
"Shaohuai Shi",
"Xiaowen Chu",
"Wei Wang",
"Bo Li",
"Chengjian Liu"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12445v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12445v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.DC"
] | DeAR: Accelerating Distributed Deep Learning
with Fine-Grained All-Reduce Pipelining
Lin Zhang†, Shaohuai Shi‡∗, Xiaowen Chu§†, Wei Wang†, Bo Li†, Chengjian Liu¶
†The Hong Kong University of Science and Technology, ‡Harbin Institute of Technology, Shenzhen,
§The Hong Kong University of Science and Technology (Guangzhou), ¶Shenzhen Technology University
[email protected], [email protected], [email protected], {weiwa, bli}@cse.ust.hk, [email protected]
3
2
0
2
n
u
J
5
1
]
G
L
.
s
c
[
2
v
5
4
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Abstract-Communication scheduling has been shown to be
effective in accelerating distributed training, which enables all-
reduce communications to be overlapped with backpropagation
computations. This has been commonly adopted in popular
distributed deep learning frameworks. However, there exist two
fundamental problems: (1) excessive startup latency proportional
to the number of workers for each all-reduce operation; (2)
it only achieves sub-optimal training performance due to the
dependency and synchronization requirement of the feed-forward
computation in the next iteration. We propose a novel scheduling
algorithm, DeAR, that decouples the all-reduce primitive into
two continuous operations, which overlaps with both backprop-
agation and feed-forward computations without extra communi-
cations. We further design a practical tensor fusion algorithm
to improve the training performance. Experimental results with
five popular models show that DeAR achieves up to 83% and
15% training speedup over the state-of-the-art solutions on a
64-GPU cluster with 10Gb/s Ethernet and 100Gb/s InfiniBand
interconnects, respectively.
I. INTRODUCTION
Training a complex deep neural network (DNN) model
over a large data set requires a massive amount of compute
resources and is typically performed on a cluster of GPU
machines [1]–[3]. To accelerate distributed training, many dif-
ferent ways of parallelism have been proposed recently, such
as data-parallel [4], model-parallel [1], pipeline-parallel [5],
and the combination of the above [6]. Among them,
the
data-parallel synchronous stochastic gradient descent (S-SGD)
algorithms are the most popular when each worker machine
has sufficient GPU memory to hold the training model. In
S-SGD,
the training data is sharded across multiple GPU
workers. Each worker iteratively updates the training model
by aggregating the local gradients computed with local data
samples. To efficiently support gradient aggregation, current
training frameworks use the all-reduce architecture [2,4,7]–
[10], in which gradient aggregation is performed with an all-
reduce collective. The all-reduce architecture has been widely
adopted in practice to distributed training, according to the
MLPerf training benchmarks1.
As the model size and the number of workers increase,
gradient aggregation requires extensive data communications,
which easily become the bottleneck [11,12]. System-level
optimizations are thus needed to address this scalability issue.
*Corresponding author.
1https://mlcommons.org/en/training-normal-11/
One effective approach that exploits the layer-wise structure
of DNN models is to pipeline gradient calculation (computing
tasks) with gradient aggregation (communication tasks) in the
backpropagation stage, so as to hide the communication over-
head and thus improve the system throughput [13,14]. This
approach, known as wait-free backpropagation (WFBP) [13],
has been implemented as the default mechanism in mod-
ern deep learning (DL) frameworks such as TensorFlow,
PyTorch-DDP [15], and Horovod [16,17]. However, WFBP
only pipelines communications with gradient computations in
the backpropagation stage, which does not consider the feed-
forward stage, thus making it sub-optimal. It is worth pointing
out that feed-forward computations account for around one
third of the total computation time in each iteration [18], which
can be properly exploited to further accelerating the training
speed.
However, it is challenging to enable pipelining between the
communication tasks for gradient aggregation and the next
iteration's feed-forward computing tasks under the all-reduce
architecture, for two reasons. First, a tensor's gradient aggre-
gation is an all-reduce primitive, which can only begin after
its gradient has been calculated in backpropagation and should
be synchronized before the next iteration's feed-forward com-
putation. Thus, it only allows coarse-grained scheduling be-
the all-
tween communications and computations. Second,
reduce communication tasks are coming in a first-in, first-
out (FIFO) order with the dependency of backpropagation
computing tasks. Communication tasks can be re-ordered to
be pipelined with feed-forward computing tasks. Yet, different
workers execute the computing tasks concurrently, such a re-
ordering needs to be done collectively in a consistent manner
by all workers to ensure the correctness of all-reduce results.
Therefore, this requires synchronization among workers in
each iteration, which causes extra communication overheads.
To address the two challenges above, we propose a new
scheduling algorithm called DeAR2 that decouples the all-
reduce primitive to two operations, so as to enable fine-
grained scheduling without introducing extra communication
overhead. DeAR applies three novel techniques to distributed
training for the all-reduce architecture. To the best of our
knowledge, we are the first to decouple the all-reduce primitive
without introducing extra time costs so that communications
2Source code can be found in https://github.com/lzhangbv/dear pytorch.
become possible to be overlapped with feed-forward compu-
tations in distributed training.
parameter. Formally, the update formula at the ith iteration
can be represented as follows.
First,
though the all-reduce operation is a primitive in
distributed training, all-reduce implementations can be handled
as a combination of basic routines [19]–[22]. For example,
a classic implementation of the widely used ring-based all-
reduce is a combination of a reduce-scatter collective followed
by an all-gather collective [19,20]. Based on the nature of all-
reduce implementations, we decouple the all-reduce primitive
to two continuous collectives in distributed training, which
allows a fine-grained schedule of communication tasks.
Second, given that one all-reduce primitive is decoupled into
two operations, we propose to schedule the first operation to
be pipelined with backpropagation computing tasks, and the
second operation pipelined with feed-forward computing tasks.
By doing so, there is no need to re-order the communication
tasks while enabling the pipelining between the communica-
tion tasks and all the computing tasks without introducing any
extra communication overhead during training.
Third, due to the pipelining between the communication
tasks and feed-forward computing tasks, tensor fusion tech-
niques [16,23,24], which have been proven effective in reduc-
ing the latency overhead in WFBP [13], becomes impractical
in DeAR. The main challenge is how to determine which
tensor should (not) be fused. To this end, we propose a
dynamic tensor fusion algorithm using Bayesian optimization
in DeAR to judiciously determine which tensors should be
fused to improve the training efficiency, without any prior
knowledge about the model and cluster configurations.
We implemented DeAR atop PyTorch. Our implementation
provides an easy-to-use API such that users can integrate our
training algorithm by adding a few lines of code. Extensive
experiments are conducted with popular DNNs on a 64-
GPU cluster under various system configurations. Experi-
mental results show that, compared with the state-of-the-art
solutions, including PyTorch-DDP, Horovod, MG-WFBP [23],
and ByteScheduler [25], DeAR accelerates the model training
by up to 83% and 15% over 10Gb/s Ethernet and 100Gb/s
InfiniBand interconnects, respectively. In all experiments, the
training speedup enabled by DeAR reaches 72.3-99.2% of the
maximum possible.
II. BACKGROUND AND MOTIVATION
A. Mini-batch SGD
The training of DNN models is to minimize a designed
loss function L(w, X), where w is the model parameter and
X is the training data. In mini-batch SGD, the model param-
eters is updated iteratively based on its first-order gradient.
Specifically, at each iteration i, a mini-batch data (Xi) is
randomly sampled to calculate the loss through feed-forward
from the first
layer; and then the first-
order gradient w.r.t. the model parameter is calculated through
backpropagation. Then, the gradient is used to update the
layer to the last
wi+1 = wi − η∇L(wi, Xi),
(1)
where η is the learning rate, wi and Xi are the model
parameter and sampled data at iteration i, respectively. Thus,
in a single-GPU environment, the training time is mainly
consumed in the feed-forward and backpropagation computing
tasks.
B. S-SGD
When exploiting multiple workers (e.g., GPUs) to train a
single model, synchronous SGD (S-SGD) with data paral-
lelism is a de-facto approach for training as it preserves the
convergence properties of mini-batch SGD. In S-SGD, each
iteration's training data Xi is distributed to P workers as X p
i
at worker p, where p = 1, 2, ..., P on a P -worker cluster, and
all workers keep consistent parameters at every iteration. The
update rule of S-SGD is
wi+1 = wi − η
1
P
P
(cid:88)
p=1
∇L(wi, X p
i ).
(2)
It is seen that the distributed gradients should be aggregated
before updating the model parameter, which introduces com-
munication costs and limits the system scaling efficiency. In
practice, the gradient aggregation (GA) can be implemented
through a parameter server [26] or an all-reduce collective.
We focus on the all-reduce implementation in this work. In
summary,
the iteration time of S-SGD contains the feed-
forward computation time, the backpropagation computation
time, and the communication time of gradient aggregation.
Due to the layer-wise structure of DNN models, the com-
puting tasks and communication tasks can be organized as
a directed acyclic graph (DAG) as shown in Fig. 1(a). One
layer's communication (ARl) can only begin after its gradient
has been calculated (BPl), and its feed-forward computation
(FFl) should wait for the completion of ARl. According to the
DAG, it is possible to schedule the order of different tasks so
that they can be overlapped to shorten the iteration time.
C. Wait-free backpropagation
Gradient aggregation of some layers can be overlapped with
backpropagation using the wait-free backpropagation algo-
rithm (WFBP) [13,14], in which the gradient communication
can immediately begin after the gradient is calculated. Due
to the nature of backpropagation, where the gradients are
calculated from the last layer to the first layer, multiple layers
communications are scheduled with a first-in-first-out (FIFO)
order as shown in Fig. 1(b). In modern DNN models, there are
many layers which have a relatively small number of gradients
that need to be aggregated, thus WFBP requires tensor fusion
(e.g., MG-WFBP [23]) to alleviate the startup overhead in all-
reduce communications as shown in Fig. 1(c).
However, WFBP and its variant only allow the gradient
aggregation communication tasks to be pipelined with back-
propagation computing tasks as shown in Fig. 1(b)(c). That
learning frameworks. Instead, to enable some communication
tasks to be overlapped with feed-forward computing tasks,
ByteScheduler [25] re-orders the communication tasks and
issues the tasks in an "optimal" order by allowing large tensors
to be partitioned into multiple small
tensors as shown in
Fig. 1(d). First, the communication of the second layer (i.e.,
AR2), which can only begin after ARL to AR3 in a FIFO order,
is scheduled to be executed prior to ARL−1. Second, some
large tensors may be partitioned into multiple small tensors to
provide finer-grained scheduling. For example, the tensor of
layer 2's gradient is partitioned to two tensors which can be
separately completed with two all-reduce operations. The pri-
ority scheduling and tensor partitioning techniques in enabling
the communication tasks to be pipelined with feed-forward
computing tasks may work well in the PS architecture [25],
but it would have significant performance issues in the all-to-
all architecture due to the following two problems.
First, re-ordering the communication tasks requires all
workers, which execute computing tasks concurrently during
training, to have a consensus on communicating a particular
tensor. In other words, before aggregating the gradient of a
layer, all workers should negotiate with each other that the
layer is ready for communicating to ensure the correctness
of training. This would introduce extra communication over-
heads. Even though the negotiation only needs to communicate
several bytes of data, it may have significant latency with
the increasing number of workers, especially on high-latency
interconnects (e.g., 10Gb/s Ethernet).
Second, using tensor partitioning for a finer-grained sched-
ule may introduce extra startup overheads of communications.
the time cost of an all-reduce communication
Generally,
contains a startup overhead that is proportional to the number
of workers [20]–[23]. For example, in the widely used ring-
based all-reduce algorithm, which is a default in NCCL, the
startup time is linear to the number of GPUs [21]. Therefore,
partitioning a tensor to n smaller tensors to be communicated
separately would introduce extra n − 1 startup overheads.
For example, on a 64-GPU cluster with 10Gb/s Ethernet,
all-reducing a 1MB message takes around 4.5ms, while all-
reducing a 500KB message takes around 3.9ms.
In summary, existing scheduling techniques to enable the
pipelining between communication tasks and feed-forward
computing tasks are impractical for distributed training in
the all-to-all architecture. Pipelining the communication tasks
with feed-forward computing tasks is expected to save one
to third of the computation time, but the introduced extra
communication overhead in ByteScheduler may be larger
than the hidden computation time, resulting an even worse
performance.
(a) DAG of computing and communication tasks.
(b) WFBP.
(c) WFBP with tensor fusion.
(d) ByteScheduler: priority scheduling and tensor partitioning.
Fig. 1: (a) The DAG of computing and communication tasks in
an L-layer DNN, and (b-d) the timeline of S-SGD algorithms
with different schedules. (b) WFBP: Gradient communication
of each layer begins after that layer's gradients are calculated
and the communications are executed in a FIFO order. (c)
The gradients of nearby layers are fused to be communicated
together. (d) ByteScheduler: large tensors may be partitioned
into multiple smaller tensors and the order of communications
is based on their priorities but not FIFO.
is, the feed-forward computing tasks of the next iteration can
only begin after all the GA communication tasks of the current
iteration have been completed. Thus, the communication tasks
have no opportunity to be pipelined with the feed-forward
computing tasks, which is sub-optimal if the communication
time cannot be fully hidden by the backpropagation com-
putation time. The feed-forward computing tasks normally
consume around one to third of the total computation time
at each iteration [18]. If one can pipeline the communication
tasks with feed-forward computing tasks, the one to third
computation time could also be saved.
D. Priority scheduling and tensor partitioning
Though ByteScheduler regards the gradient aggregation as
a pair of (PUSH, PULL) in the PS architecture to enable
a finer-gained schedule,
it cannot use the (PUSH, PULL)
feature in all-reduce which is a primitive in existing deep
This motivates us to decouple the all-reduce primitive
based on its implementation nature to two operations for a
finer-grained schedule, and it does not introduce any extra
communication overhead.
BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2III. DEAR: DECOUPLING THE ALL-REDUCE PRIMITIVE
The design philosophy of our DeAR is to decouple the
all-reduce primitive to two continuous operations without
introducing extra communication overheads.
A. Decoupling all-reduce with zero overhead
According to the inherent feature of all-reduce primitive that
tries to maximally utilize the network bandwidth or minimally
reduce the latency [21,27], it should be implemented with
multiple rounds of communications, each of which has mul-
tiple workers participating in sending and receiving messages
simultaneously. Thus, it is very common that the all-reduce
algorithm is implemented with a combination of other basic
routines [20]. For example, the ring-based all-reduce algorithm
can be implemented by a ring-based reduce-scatter operation
followed by a ring-based all-gather operation [21]. Thus, the-
oretically, the all-reduce primitive can be decoupled into two
or more continuous operations whose total time equals to the
time cost of the all-reduce primitive. The decoupled operations
of a primitive will allow finer-grained tasks scheduling in
distributed training.
As our goal is to enable some communication tasks to be
pipelined with feed-forward computing tasks, we break down
the all-reduce operation OPar into two continuous communi-
cation operations, say OP1 and OP2. Note that the total time
of OP1 and OP2 equals to the time of OPar, which means
the decoupling is free. Therefore, OP1 of different layers
can still be pipelined with backpropagation computing tasks,
while OP2 can be pipelined with feed-forward computing
tasks. The DAG of computing and communication tasks in
DeAR is shown in Fig. 2(a). One layer's gradient aggregation
is composed of two continuous communication operations.
Compared to Fig. 1(a), the fine-grained DAG with decoupled
all-reduce allows us to schedule OP1 and OP2 communication
tasks separately, which offers great opportunities to pipeline
the communication tasks with feed-forward computing tasks
without tensor partitioning.
In this work, we use the ring-based all-reduce algorithm,
which is widely used in distributed training, as an example to
show how we decouple it with zero overhead. Note that the
key idea of DeAR can be applied in any all-reduce algorithms
as long as they can be decoupled into two operations without
introducing any extra overhead. In the ring-based algorithm on
a P -worker cluster, the d elements are divided to P chunks,
each of which has d/P elements. In the first step, each chunk
will be reduced to each worker via P − 1 communication
rounds, which is a reduce-scatter operation and it takes a time
complexity of
trs = (P − 1)(α +
d
P
β),
(3)
where α and β are the latency and transmission time per
element between two workers according to the α − β cost
model [28]. As we only focus on the communication time, we
omit the overhead of arithmetic operations of accumulating
elements in Eq. 3.
(a) DAG of computing and communication tasks in DeAR.
(b) Timeline of DeAR with an order of FIFO for communications.
(c) Timeline of DeAR with tensor fusion.
Fig. 2: (a) The DAG of computing and communication tasks
with an L-layer DNN in DeAR. (b) DeAR without tensor
fusion: the decomposed communications are executed in a
FIFO order. (c) DeAR with tensor fusion: Nearby gradients
could be merged to a single one for the decoupled operations.
In the second step, each reduced chunk at every worker is
broadcast to all other workers, which is an all-gather operation
and it also takes P −1 communication rounds in the ring-based
algorithm. The all-gather operation has a time complexity of
tag = (P − 1)(α +
d
P
β).
(4)
Putting Eq. 3 and Eq. 4 together, we achieve the time
complexity of an all-reduce operation as follows.
tar = 2(P − 1)α +
2(P − 1)d
P
β.
(5)
B. Pipelining communication tasks without re-ordering
By decoupling the all-reduce primitive to two continuous
it becomes possible to pipeline the first com-
operations,
munication operation with backpropagation computing tasks,
and pipeline the second communication operation with feed-
forward computing tasks as shown in 2(b). To guarantee data
dependencies between tasks at run-time, we propose 1) Back-
Pipe: starting the communication task of OP1 immediately
when the gradient of one layer is ready in the backward
pass, and 2) FeedPipe: waiting for the completion of the
communication task of OP2 of one layer before its feed-
forward computation, and starting the communication task of
OP2 of the next layer. Besides, we synchronize all the tasks
of OP1 at the end of BackPipe to ensure the dependencies
between OP1 and OP2.
In doing so, our DeAR can execute the communication tasks
asynchronously to support pipelining with both feed-forward
and backpropagation computing tasks, while preserving data
BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-2...FFLARL->OP2...AR1->OP2ARL-1,L-2->OP2FFL-1BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-2...FFLARL->OP2...AR1->OP2ARL-1,L-2->OP2FFL-1dependencies between tasks without any requirement to adjust
the order of communication tasks. That is, communication
tasks are issued among all workers consistently from the last
layer to the first layer during backpropagation and its reverse
order during feed-forward, respectively. Therefore, all workers
do not need the time-consuming negotiation with each other
to reach a consensus in which tensors should be aggregated.
In summary, compared with the WFBP [13,14] or its
variant [16,23] algorithms, DeAR is able to overlap the gradi-
ent aggregation communications with both feed-forward and
backpropagation computing tasks. Compared with ByteSched-
uler [25], DeAR enables a finer-grained tasks schedule in
distributed training without the requirement of partitioning
tensors and re-ordering the communication tasks.
Moreover, DeAR reserves the property of tensor fusion as
like WFBP, where the gradients in nearby layers can be merged
together to be communicated once to reduce the startup over-
head. Unlike ByteScheduler which exploits tensor partitioning
(a mutual operation with tensor fusion) to provide a fine-
grained schedule, DeAR schedules OP1 with backpropagation
computing tasks and OP2 with feed-forward computing tasks,
which means OP1 in different layers are possible to be merged
to be communicated together and it is similar to OP2. We
discuss the details about tensor fusion in the following section.
IV. TENSOR FUSION IN DEAR
Tensor fusion [16,23] has been proven to be a simple
yet effective approach to reducing the startup overheads
of all-reduce operations. It has become a default feature
in distributed DL frameworks like PyTorch-DDP [15] and
Horovod [16]. However, how to determine which layers should
be merged is quite challenging as merging any nearby layers
requires to wait for their backpropagation computing tasks to
be completed.
A. Preliminary of tensor fusion techniques
In the standard all-reduce primitive case (like PyTorch-
DDP and Horovod), where the communication tasks only
overlap with backpropagation computing tasks, a buffer with
a pre-defined size (e.g., 25MB in PyTorch-DDP and 64MB
in Horovod) is allocated to store the ready-to-communicate
tensors. When the total size of ready tensors reaches out of
the buffer size, the buffer is communicated for aggregation
with an all-reduce operation, which means multiple tensors
stored in the buffer only communicate once at each iteration.
The buffer data is then copied back to the original tensors
when the current all-reduce operation completes. Due to the
gradients in different layers become ready in a backward order,
fusing any two layers needs to wait for the completion of all
gradients in these two layers as shown in Fig. 1(c). Thus, it
is non-trivial to determine the optimal buffer size to achieve
minimal iteration time.
One can also measure the backpropagation computation
time of each layer and estimate the communication time of
all-reduce to dynamically determine whether the benefit of
merging any two nearby layers is larger than the sacrifice of
Fig. 3: Bayesian optimization example: 9 samples;
buffer size for training DenseNet-201.
tuning
the waiting time [23]. Yet, two main issues may make the
solution impractical [23]. First, the layer-wise backpropagation
time is quite difficult to be correctly measured as each layer
gradient may be computed asynchronously. Second, the variant
tensor sizes in a DNN model make it difficult to predict the
communication time accurately by a simple model.
Different from the previous works, DeAR pipelines some
communication tasks with feed-forward computing tasks,
which means that tensor fusion of any two layers may af-
fect the granularity of feed-forward pipelining as shown in
Fig. 2(c). Layer L − 1 and layer L − 2 are fused to be
communicated once using OP1 so that OP2 of these two
layers should also be invoked only once and it should be
synchronized before the feed-forward computation of layer
L − 2. In this case, OP2 of layer L − 1 cannot be overlapped
with the feed-forward computation of layer L − 2. As a result,
though DeAR reserves the property of tensor fusion, it is non-
trivial to determine which layers should be fused to achieve
minimal iteration time.
B. Bayesian optimization based tensor fusion
In DeAR, fusing the gradients of any two nearby layers has
two drawbacks. 1) It requires to wait for the completion of the
two layers' gradient computations to start the communication
of reduce-scatter, which means the current ready layer cannot
start communication immediately. 2) It reduces the opportunity
of overlapping all-gather of one layer with the feed-forward
computation of its previous layer. Thus, one should carefully
choose the tensor fusion strategy such that the overall iteration
time can be shortened. Due to the difficulty in formulating
the tensor fusion problem with heuristic or optimal solutions,
we choose to use Bayesian optimization (BO) [29,30], which
attempts to find good parameters of an unknown objective
function in as few number of trials as possible [16,25].
The target of BO used in DeAR is try to achieve maximum
training performance (measured as the system throughput, i.e.,
the number of training samples that can be processed per
second) during run-time in our system. We use P (x) to denote
the performance model of our system, which is unknown, and
x is the buffer size which is an input parameter used for tensor
fusion. Note that different x may generate different tensor
fusion solutions. Specifically, nearby layers are put into one
group if their total number of gradients does not exceed the
020406080100Buffer Size (MB)2.02.53.03.5Throughput (samples/sec)1e3SamplesPrediction95% confidence intervalsize x. Gradients in one group will have only one reduce-
scatter operation during backpropagation, and one all-gather
operation during feed-forward. We would like to update x
dynamically such that P (x) converges to a stable value.
BO is effective to find near-optimal tensor fusion solu-
tions for three reasons. First, BO uses the Gaussian process
regression in predicting the function value, so it has no
constraints on the objective function format and only relies
i.e., ˆP (x1), ˆP (x2), ..., ˆP (xn).
on the existing observations,
Second, BO usually needs a few number of trials to find good
solutions, which only requires very small search costs. This is
because BO suggests the next system configuration based on
a well-defined acquisition function [31]. In this work, we use
expected improvement (EI) acquisition function to pick the
next point that can maximize the expected improvement over
the current best result. Third, BO can tolerate uncertainty with
quantitative confidence interval. For example, by tuning the EI
hyper-parameter, we find BO can balance between exploitation
and exploration during the search process, which is helpful to
escape from a local optimum. In general, smaller EI hyper-
parameter prefers exploitation (i.e., most points are around
the peaks), while larger value prefers exploration (i.e., the
points are more spread out across the whole range) [31]. In
this problem, we set EI hyper-parameter as 0.1 to prefer buffer
size exploration, e.g., from 1MB to 100MB (see Fig. 3).
To support BO during training, we first use a default buffer
size x1 = 25MB to initialize the tensor fusion configuration
and measure the average system throughput (i.e., ˆP (x1)) over
multiple steps (e.g., 10 steps). Based on this measurement
ˆP (x1), BO fits the performance function and suggests the next
buffer size x2, which can be used to generate a new tensor
fusion solution. By repeating this process, BO can predict the
performance accurately with enough samples, and find a good
tensor fusion solution. For example, in Fig. 3, we use BO to
find the buffer size for training DenseNet-201 [32] in DeAR.
With only 9 samples, it returns a nearly optimal value at 35MB
with a good confidence. In practice, tens of trials are enough to
find a good solution for DeAR (see Figure 10), while the BO
tuner developed for Horovod is much more costly, as it needs
to search multiple system configurations including buffer size,
cycle time, response cache, and hierarchical collective algo-
rithms [16].
V. IMPLEMENTATION
We implement our prototype system, DeAR, based on
PyTorch and NCCL. In the system, we wrap a communication
library using C/C++ based on NCCL and expose APIs for
high-level scripts in Python. The overview of our DeAR
implementation is shown in Fig. 4. The blue components are
new in DeAR, but they are totally transparent to end users.
Users only need to change their code (normally with several
new inserted lines) to use DeAR.
A. Workflow of DeAR
We implement our DeAR as a middle layer between user
code and communication primitives. DeAR does not change
Fig. 4: Overview of our system (blue parts are new).
the original DAG constructed in PyTorch. A distributed opti-
mizer is implemented in DeAR to handle the gradient commu-
nications in hook functions provided by PyTorch APIs. Before
communicating gradients through reduce-scatter or all-gather,
gradients should be put in the tensor fusion controller which
determines whether the pushed tensor should be copied to the
buffer to be communicated together. When the buffer should
be aggregated among all workers, DeAR invokes the wrapped
NCCL APIs (e.g., ncclReduceScatter and ncclAllGather) in
communication package.
B. User usage
1 import dear # +++
2 dear.init() # +++
3 optim = torch.optim.SGD(model.parameters(), ...)
4 optim = dear.DistOptim(optim, model, ...) # +++
5 # Training
6 model.train()
7 for i in range(epochs):
8
for data, target in train_loader:
9
train_step(optim, data, target)
...
10
11 # Validation
12 optim.synchronize() # +++
13 optim.step() # +++
14 model.eval()
15 validation()
Listing 1: Code example of using DeAR
To make our DeAR be easily integrated with existing user
code, we design a distributed optimizer (DistOptim) that is
exposed to users. Users only need to wrap their original
PyTorch optimizer instances to our DistOptim and initialize
a new instance of the optimizer as the sample code shown in
Listing 1. The first two lines should be inserted to initialize the
run-time of DeAR. Then line 4 is inserted after the standard
optimizer instance and the training code remains unchanged.
As DeAR pipelines the communication tasks of current itera-
tion with the next iteration's feed-forward computing tasks,
the communication tasks should be forced to synchronize
GPUsEthernet or InfiniBandMPIHardwareCommunication PrimitivesNCCLCommunication PackageC/C++ WrapperPipeTrain CoreUser ScriptsPyTorch Distributed OptimizerCBO-based Tensor FusionDistributed optimizer_forward_pre_hook_backward_hookregister_forward_pre_hookregister_backward_hook Tensor fusion controller_generate_solution_fuse_tensorsCommunication PackageUser scriptsCoreGPUsEthernet or InfiniBandMPINCCLCommunication Primitivesto update the model parameters (lines 12 and 13) before
evaluating the model.
VI. EVALUATION
A. Experimental settings
Testbeds. We conduct experiments on a 16-node dense-
GPU cluster, which has 64 Nvidia GTX 2080Ti GPUs with
four GPUs per node. The cluster is connected with both
10Gb/s Ethernet (10GbE) and 100Gb/s InfiniBand (100GbIB).
Thus, we can choose two different network configurations
to test the scalability of different algorithms. Each node has
512GiB RAM and the same software configurations. Specif-
ically, each node is installed with Ubuntu18.04, CUDA-10.2,
cuDNN-7.6, NCCL-2.10, OpenMPI-4.0, and PyTorch-1.8. We
use NCCL APIs for all collective communications in our
experiments.
DNN models. We choose two popular types of DNNs.
They are image classification models, CNNs, on the ImageNet
dataset [33], and NLP pre-training models BERT [34]. The
detailed settings are shown in Table I. A training sample is an
image with a resolution of 224 × 224 × 3 for CNNs, and a
sentence with a length of 64 words for BERTs.
TABLE I: DNN details for experiments. "BS" denotes the
mini-batch size per GPU. "# Layers" represents the number
of learnable layers. "# Tensors" and "# Param." denote the
number of learnable parameter tensors and the number of
elements (million) in these tensors, respectively.
Application
Image
Classification
NLP
Pre-training
Model
ResNet-50 [35]
DenseNet-201 [32]
Inception-v4 [36]
BERT-Base [34]
BERT-Large [34]
BS # Layers # Tensors # Param. (M)
161
64
604
32
449
64
206
64
398
32
25.6
20.0
42.7
110.1
336.2
107
402
299
105
201
Baselines. We compare our system with existing state-
of-the-art systems including Horovod-0.21.3 [16], PyTorch-
DDP [15] (at PyTorch-1.8), ByteScheduler3, and MG-WFBP4.
All the systems are based on the DL framework PyTorch.
B. Verification of all-reduce breakdowns
To verify that
the decoupling of all-reduce has almost
zero overhead with different message sizes on dense-GPU
clusters, we measure the elapsed-time of all-reduce and its
decoupling methods (i.e., reduce-scatter, all-gather, and their
combination). We run experiments using nccl-tests5 on the 64-
GPU cluster connected with 10GbE. The results are shown
in Fig. 5, in which we can see that both reduce-scatter and
all-gather take around half of the time of all-reduce with
both small and large sizes messages. Thus, DeAR enables a
finer-grained schedule for the decoupled communication tasks
without introducing extra communication overheads.
3https://github.com/bytedance/byteps/tree/bytescheduler/bytescheduler (at
GitHub commit 33fe89). Note that ByteScheduler cannot support PyTorch-
1.8, so we configure PyTorch-1.4 when running ByteScheduler.
4https://github.com/HKBU-HPML/MG-WFBP
(at GitHub
commit
5b8ad5)
5https://github.com/NVIDIA/nccl-tests
(a) Small size: (1K, 1M)
(b) Large size: (1M, 100M)
Fig. 5: Performance comparison with different message aggre-
gation methods. "RSAG" represents the all-reduce algorithm
that is implemented with a reduce-scatter operation followed
by an all-gather operation.
(a) 64 GPUs with 10GbE
(b) 64 GPUs with 100GbIB
Fig. 6: Speedups without tensor fusion. The performance of
WFBP is used as the baseline. ByteScheduler runs out-of-
memory (OOM) in BERT-Large.
C. Speed comparison w/o tensor fusion
We first show the benefits of overlapping the communica-
tion tasks with feed-forward computing tasks in our DeAR
without any tensor fusion techniques. We compare DeAR with
existing scheduling algorithms without tensor fusion including
WFBP [13] and ByteScheduler [25]. For a fair comparison
with WFBP, we implement the all-reduce API with a reduce-
scatter operation followed by an all-gather operation. The
speedup results are shown in Fig. 6, using the performance
of WFBP as the baseline.
Compared with WFBP which only pipelines the commu-
nications with backpropagation computing tasks, our DeAR
achieves 6%-19% improvement
tested cases due to
our fine-grained schedule where the communication tasks
are pipelined with both feed-forward and backpropagation
computing tasks.
in all
ByteScheduler also pipelines the communications with both
it
feed-forward and backpropagation computing tasks, but
0.00.20.40.60.81.0Tensor size [bytes]1e602468Time [ms]Reduce-scatterAll-gatherRSAGAll-reduce0.00.20.40.60.81.0Tensor size [bytes]1e8050100150200Time [ms]Reduce-scatterAll-gatherRSAGAll-reduceResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.101.151.201.25Speedup<0.9<0.9OOMWFBPByteSchedulerDeARResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.10Speedup<0.9<0.9<0.9OOMuses tensor partitioning and task re-ordering to achieve finer-
grained scheduling of tasks. However, tensor partitioning and
re-ordering require extensive extra communication overheads
under the all-to-all architecture, ByteScheduler runs very slow
in most cases especially on CNNs, thus its bars in Fig. 6
are very low (e.g., < 0.9). DeAR significantly outperforms
ByteScheduler, especially on CNNs. In contrast, on BERT
models which have much larger tensor sizes, the performance
of ByteScheduler is relatively good since partitioning large
tensor sizes does not introduce dramatic extra startup over-
heads.
(a) 64 GPUs with 10GbE
(b) 64 GPUs with 100GbIB
Fig. 7: Speedups with tensor fusion. The performance of
Horovod is used as the baseline. MG-WFBP runs out-of-
memory (OOM) in training BERT-Large.
D. Speed comparison w/ tensor fusion
Due to the high latency of the all-to-all collectives, ten-
sor fusion has become a default feature to accelerate dis-
tributed training. Though DeAR decouples one all-reduce op-
eration to two operations for better communication scheduling,
we need to use tensor fusion for high latency collectives
(§IV). We compare our DeAR with existing state-of-the-
art algorithms including Horovod, PyTorch-DDP, and MG-
WFBP [23], which are all equipped with tensor fusion tech-
niques. For a fair comparison, we fix the buffer size of all
algorithms with 25MB, except MG-WFBP. The results are
shown in Fig. 7, where we use the performance of Horovod
as the baseline.
On the 10GbE cluster. On the 64-GPU cluster with a
relatively high-latency and low-bandwidth 10GbE network,
we can see that DeAR with tensor fusion always outperforms
all the other methods. Specifically, our DeAR achieves 6%-
83% (an average of 36%) improvement over existing methods
on the five tested models. DeAR achieves near-linear scaling
efficiency on 64 GPUs in CNNs whose number of parameters
is moderate (as shown in Table I). Though DeAR achieves sig-
nificant improvement over other methods on BERT models, the
scaling efficiency is still low due to the high communication-
to-computation ratio. It typically requires some algorithmic-
level optimizations like gradient compression [37]. We will
leave it as our future work to introduce gradient compression
techniques into our DeAR scheduling framework.
On the 100GbIB cluster. On the 64-GPU cluster with a
low-latency and high-bandwidth 100GbIB network, the startup
problem in distributed training is less significant. Even so,
the end-to-end performance improvement of our DeAR over
existing methods can be up to 15% (an average of 8%). In the
100GbIB network, the scalability of traditional methods like
Horovod and PyTorch-DDP is close to linear scale in CNNs.
For example,
in the 64-GPU case of running ResNet-50,
Horovod achieves 91% scaling efficiency leaving limited room
for further improvement. Therefore, the improvement of DeAR
in 100GbIB over other methods is less significant than that of
10GbE. Given the model size and network configurations, we
discuss their maximum speedups in the next subsection.
E. Maximum speedups on 64-GPU clusters
Intuitively, on a P -GPU cluster, the maximum speedup over
a single GPU should be P , i.e., linear scale. However, due
to the communication constraint, the maximum speedup may
be smaller than P . In DeAR, each training iteration time
is composed of four parts: feed-forward computation (tf f ),
backpropagation computation (tbp), gradient communication
of reduce-scatter (trs) and gradient communication of all-
gather (tag). The all-reduce time is tar = trs+tag. Given a DL
model with m gradient size and a cluster with P workers, the
communication time should be larger than the time when the
link bandwidth is fully utilized. For the ring-based all-reduce
algorithm, tar ≥ 2m/B according to Eq. 5, where B = 1/β is
the minimum link bandwidth between any two workers. Thus,
for any scheduling algorithms that pipeline communications
with computations, the speedup of the overall throughput on
the P -worker system over the single worker is limited by
Smax =
P × (tf f + tbp)
tf f + tbp + tar − min{trs, tbp} − min{tag, tf f }
,
(6)
where min{trs, tbp} and min{tag, tf f } are the overlapped
time during backpropagation and feed-forward, respectively.
Optimally, either computations or communications are fully
hidden. According to the link bandwidth of 10GbE and
100GbIB and the model size shown in Table I, we can compare
the achieved speedups of DeAR on the 64-GPU cluster over a
single GPU with the maximum speedups as shown in Table. II.
It is seen that given a high communication-to-computation
ratio, the linear scaling efficiency may not be reachable. For
example, on the 10GbE cluster, theoretically, running BERT
models on 64 GPUs can only achieve less than 25.5 times
speedup over a single GPU. In our DeAR which has two level
of pipelining between communications and computations, it
achieves an average of 93.6% and 83.9% of the theoretical
ResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.500.751.001.251.501.752.00SpeedupOOMHorovodPyTorch-DDPMG-WFBPDeARResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.101.151.20SpeedupOOMTABLE II: Comparison between the real speedup (S) of
DeAR on 64-GPU clusters over single GPU and the theoretical
maximal speedup (Smax).
Model
ResNet-50 DenseNet-201 Inception-v4 BERT-Base BERT-Large
59.8
56.5
94.5%
64
57.2
89.4%
64
52.8
82.5%
64
54.0
84.4%
25.5
23.9
93.9%
64
49.6
77.5%
12.1
11.8
98.0%
51.8
37.5
72.3%
61.6
61.1
99.2%
64
61.6
96.2%
10-
GbE
100-
GbIB
Smax
S
S
Smax
Smax
S
S
Smax
optimal speedup on 10GbE and 100GbIB interconnects, re-
spectively.
Thus, reduce-scatter has more communication tasks to be
overlapped with computing tasks than all-gather.
DeAR vs. Horovod. In the results on the breakdown of
the iteration time, we can see that DeAR has a smaller
non-overlapped communication time than Horovod. Though
our DeAR has a similar pipelining with Horovod during
backpropagation, DeAR has the opportunity to further pipeline
the communications with feed-forward computations, which
contributes to the performance improvement.
G. Studies of tensor fusion
Tensor fusion is an important technique to improve perfor-
mance as shown in Fig. 9. The tensor fusion version of DeAR
with BO (DeAR-BO) achieves 1.35×-4.54× and 1.29×-1.78×
improvement over the version w/o tensor fusion (DeAR w/o
TF) under 10GbE and 100GbIB interconnects, respectively.
1) Performance comparison between w/ BO and w/o BO
Fig. 8: Time breakdowns. The communication time excludes
the part hidden by computations.
F. Time breakdowns
To understand the improvement of DeAR over existing
methods clearer, we break down the iteration time into three
parts: feed-forward (FF) computation time, backpropagation
(BP) computation time, and gradient aggregation communica-
tion time (under the 10GbE network configuration) as shown
in Fig. 8. The blue bars are the non-overlapped communica-
tion time in one iteration, which means the hidden time by
computations is excluded. As both DeAR and Horovod use
the same back-end of PyTorch, the FF and BP computation
times are the same on the same model. In DeAR, there are
two parts of communication, reduce-scatter and all-gather. We
use RS-only to indicate that DeAR excludes the time of all-
gather, and AG-only to indicate that DeAR excludes the time
of reduce-scatter in Fig. 8.
RS-only vs. AG-only. In the decoupling of all-reduce,
reduce-scatter and all-gather operations have the same message
size for communication and they have the same communi-
cation complexity as shown in Eq. 3 and Eq. 4. In other
words,
the communication time of reduce-scatter and all-
gather operations should be the same without considering the
overlapping with computations. However, as shown in Fig. 8,
RS-only has a less communication overhead than AG-only.
The reason is that the reduce-scatter operations are overlapped
with backpropagation computing tasks which typically take
two times slower than feed-forward computing tasks [18].
(a) On the 10GbE cluster
(b) On the 100GbIB cluster
Fig. 9: Speed improvements with dynamic tensor fusion.
Determining which tensors should be fused is very impor-
tant in affecting the training performance. We compare our
BO-based tensor fusion method (DeAR-BO) with two naive
tensor fusion methods, a fixed number of four nearby layers
(DeAR-NL) and a fixed buffer size (5MB) threshold (DeAR-
FB), and BO-based Horovod. The results are shown in Fig. 9.
Horovod-BO vs. Horovod-FB. Horovod with BO
(Horovod-BO) achieves only slight improvement in ResNet-50
and DenseNet-201 over Horovod with a fixed buffer (Horovod-
FB) size (64MB by default), while Horovod-BO has no
improvement in BERT-Base over Horovod-FB. The results
indicate that Horovod-FB may be a good solution in tensor
fusion for WFBP and tuning the buffer size does not help
improve the performance.
DeAR-NL vs. DeAR-FB. By merging a fixed number
of consecutive layers, DeAR-NL is normally worse than
Horovod-FB or DeAR-FB in CNNs as CNNs have a very
imbalanced number of parameters in different layers. For the
model (BERT-Base) that has a very balanced distribution of
parameters in different layers, DeAR-NL performs better than
Horovod-FB and DeAR-FB.
DeAR-FB vs. Horovod-FB. With the opportunity of over-
lapping communications with both feed-forward and back-
propagation computing tasks, DeAR-FB normally outperforms
Horovod-FB. Since DeAR requires to pipeline tasks during
feed-forward, the configured buffer size is more sensitive to
the time performance than Horovod-FB. Thus, DeAR-FB only
achieves a marginal improvement over Horovod-FB.
ResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.00.51.01.52.02.53.0Time [s]RS-onlyRS-onlyRS-onlyRS-onlyRS-onlyAG-onlyAG-onlyAG-onlyAG-onlyAG-onlyDeARDeARDeARDeARDeARHorovodHorovodHorovodHorovodHorovodFF ComputationBP ComputationCommunicationResNet-50DenseNet-201BERT-Base0.00.51.01.52.0Throughput (samples/s)1e4Horovod-FBHorovod-BODeAR w/o TFDeAR-NLDeAR-FBDeAR-BOResNet-50DenseNet-201BERT-Base0.00.51.01.5Throughput (samples/s)1e4(a) On the 10GbE cluster
(b) On the 100GbIB cluster
Fig. 10: Tuning cost of different search algorithms. Error bars
show standard deviation.
(a) ResNet-50
(b) BERT-Base
Fig. 11: Speed comparison with different batch sizes.
DeAR-BO vs. others. Using BO in DeAR,
the buffer
size can be well adjusted during run-time. Hence, DeAR-
BO can improve the training speed over DeAR-FB, and
the evaluated
it achieves the best performance among all
methods. Specifically, DeAR-BO is around 22%-56% and 7%-
14% faster than Horovod-FB on 10GbE and 100GbIB 64-GPU
clusters, respectively.
2) Search cost comparison between BO and other methods
In DeAR, we use BO to find a good buffer size. Actually,
one can also use random search or grid search to find the
solution. However, both random search and grid search take a
much larger number of iterations to find a good solution. For
example, as shown in Fig.10, in training different models, BO
takes several trials to find a stable solution while random and
grid search take tens of trials. In DNN training, one cannot
consume too much number of iterations to tune their time
performance related parameters, otherwise it may result in a
longer end-to-end training time than the naive methods. The
average cost of BO is 0.207 seconds per trial over 20 trials.
H. Performance with different batch sizes
The local mini-batch size has a direct impact on the feed-
forward and backpropagation computation time, thus training
with different batch sizes has different communication-to-
computation ratios on the same model, which would affect
the opportunity for overlapping. We compare our DeAR with
the existing methods on the 10GbE cluster using ResNet-
50 and BERT-Base under different batch sizes as shown in
Fig. 11. The batch size is the local mini-batch size for each
GPU running on the 64-GPU clusters. Smaller batch size indi-
cates shorter computation time while the communication time
remains unchanged (if not overlapped). The results show that
our DeAR is robust to the mini-batch size and it outperforms
all other methods in all tested cases.
I. Potential improvement on larger-scale clusters
Due to the hardware limit, we are unable to perform exper-
iments on larger-scale GPU clusters to verify the performance
of DeAR. We provide some discussions here. According
to Fig. 7, we can see that the improvement of our DeAR
over existing methods on 100GbIB (an average of 8%) is
much smaller than on 10GbE (an average of 36%). In our
experiment environments, the two clusters are with the same
GPU hardware, which means the FF and BP computation time
remain unchanged while the network speed of 100GbIB is 10
times faster than 10GbE. That is, existing methods should be
better scaling efficiency with a higher network speed, which
makes the optimization room be smaller. For example, in
ResNet-50, Horovod achieves 58.2× speedup on 64 GPUs
with 100GbIB over the single GPU while the maximum
speedup is only 64× (Table II). Therefore, any optimization
cannot achieve improvement larger than 10% over Horovod.
We argue that with increasing size of the cluster and more
powerful GPUs, DeAR could have a higher improvement
over Horovod and PyTorch-DDP as the communication-to-
computation ratio becomes larger.
Formally, the theoretical optimal iteration time for DeAR
and baseline algorithms with perfect overlapping is given by
tDeAR = max{tf f , tag} + max{tbp, trs},
tbaseline = tf f + max{tbp, tar},
(7)
(8)
where tf f and tbp are feed-forward and back-propagation com-
putation time, trs, tag, and tar are reduce-scatter, all-gather,
and all-reduce communication time, respectively. Assume that
tar = 2trs = 2tag and tbp = 2tf f , we can derive that
tbaseline − tDeAR =
0,
tag − tf f ,
tf f ,
if tag ≤ tf f ,
if tf f < tag ≤ 2tf f ,
otherwise.
(9)
This implies that, if we implement DeAR properly to over-
lap communications with forward and backward computa-
tions, DeAR can always outperform baseline algorithms such
as Horovod and PyTorch-DDP. As the communication-to-
computation ratio becomes larger, the saved iteration time can
be at most one feed-forward computation cost of tf f .
VII. RELATED WORK
There are many studies in addressing the communication
problem of distributed training, like asynchronous training [38,
39] and gradient compression [40]–[43]. A more comprehen-
sive introduction can be found in recent survey papers [44,45].
Here we highlight some very related work from the systems
perspective in S-SGD.
ResNet-50DenseNet-201BERT-Base0102030# of TrialsRandomBOGrid SearchResNet-50DenseNet-201BERT-Base0102030# of Trials8163264Batch Size0.00.51.01.5Throughput (samples/s)1e4HorovodPyTorch-DDPMG-WFBPDeAR8163264Batch Size024Throughput (samples/s)1e3A. Efficient all-reduce design
As the all-reduce collective is very ubiquitous in distributed
deep learning, there are many works providing efficient al-
gorithms for different cluster configurations [2,7,8,14,37,46]–
[50]. For example, the double-binary trees algorithm [46] has
been integrated in NCCL to scale-out on extremely large-
scale GPU clusters. Some particular all-reduce algorithms
are also designed for different cluster topology, like [51] on
Torus networks, [8,48] on NVLink-based GPU servers, [37,47]
on public cloud clusters, and [50] on heterogeneous GPU
clusters. These designs are orthogonal to our DeAR as long as
these algorithms can be decoupled into two operations without
introducing extra overheads. For example, one can decompose
the double-binary tree-based all-reduce [46] into tree-based
reduce and tree-based broadcast, and decompose the hierar-
chical ring-based all-reduce [51] into intra-node and inter-
node reduce-scatter and all-gather. We leave decoupling more
all-reduce algorithms as our future work, and the decoupling
configuration can be automatically tuned using BO.
B. Communication scheduling
Due to the layer-wise structure of DNN models and even
tensor-wise in modern deep learning frameworks like PyTorch
and TensorFlow,
the computing and communication tasks
are generally organized as a directed acyclic graph (DAG).
Thus,
the tasks without any dependency can be executed
concurrently, making it possible to hide some communication
costs by overlapping them with computing tasks. The wait-
free backpropagation (WFPB) algorithm [13,14] was the early
scheduling method that pipelines the communication tasks of
gradient aggregation with gradient calculation during back-
propagation. Then some tensor fusion techniques (e.g., [17,23,
24,52,53]) were further proposed to address the high latency
problem in WFBP with all-reduce. As the communication of
some large tensors may block the execution of higher-priority
tensors, ByteScheduler [25] proposes tensor partitioning in
priority scheduling to provide a finer-grained schedule of
overlapping between computing and communication tasks.
ZeRO [54] decoupled all-reduce like DeAR, but it was to
shard parameters to optimize memory rather than optimizing
communication efficiency. To shard parameters, ZeRO requires
one all-gather for each forward pass and one extra all-gather
for each backward pass, which unfortunately has increased
the total communication overheads compared with DeAR. In
the recent PyTorch v1.13 release, FullyShardedDataParallel6
has combined the ideas of ZeRO's parameter sharding and
DeAR's FeedPipe to alleviate the memory and communication
it does not consider dynamic
overheads, respectively, but
tensor fusion to explore the optimal training performance.
VIII. CONCLUSION
In this work, we proposed a novel communication schedul-
ing algorithm named DeAR with fine-grained all-reduce
6https://pytorch.org/docs/stable/fsdp.html
pipelining. In DeAR, we first decoupled the all-reduce prim-
itive into two continuous communication operations without
introducing any extra communication overhead to enable a
fine-grained schedule of computations and communications.
Then we proposed to pipeline the backpropagation and feed-
forward computing tasks with the first operations and second
operations of the decoupled all-reduce primitives, respectively.
To integrate the effective tensor fusion technique, we proposed
a practical tensor fusion method using Bayesian optimization
in DeAR to further reduce the communication time with-
out considering the DNN model and network configuration.
Extensive experiments were conducted on a 64-GPU cluster
connected with two types of networks (10Gb/s Ethernet and
100Gb/s InfiniBand) on different applications including CNNs
and BERTs. Experimental results show that DeAR achieves up
to 83% improvement over existing state-of-the-art methods.
ACKNOWLEDGMENTS
The research was supported in part by a RGC RIF grant
under the contract R6021-20, RGC GRF grants under the
contracts 16209120, 16200221, 16207922, 16213120, the Na-
tional Natural Science Foundation of China (NSFC) (Grant
No. 62272122), and the National Natural Science Foundation
of China (NSFC) (Grant No. 62002240).
REFERENCES
[1] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, M. Ran-
zato, A. Senior, P. Tucker, K. Yang et al., "Large scale distributed deep
networks," in Proc. of NeurIPS, 2012, pp. 1223–1231.
[2] X. Jia, S. Song, S. Shi, W. He, Y. Wang, H. Rong, F. Zhou, L. Xie,
Z. Guo, Y. Yang, L. Yu, T. Chen, G. Hu, and X. Chu, "Highly scalable
deep learning training system with mixed-precision: Training ImageNet
in four minutes," in Proc. of Workshop on Systems for ML and Open
Source Software, collocated with NeurIPS 2018, 2018.
[3] Y. You, J. Li, S. Reddi, J. Hseu, S. Kumar, S. Bhojanapalli, X. Song,
J. Demmel, K. Keutzer, and C.-J. Hsieh, "Large batch optimization for
deep learning: Training bert in 76 minutes," in International Conference
on Learning Representations, 2020.
[4] P. Goyal, P. Doll ́ar, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola,
A. Tulloch, Y. Jia, and K. He, "Accurate, large minibatch SGD: Training
ImageNet in 1 hour," arXiv preprint arXiv:1706.02677, 2017.
[5] Y. Huang, Y. Cheng, A. Bapna, O. Firat, D. Chen, M. Chen, H. Lee,
J. Ngiam, Q. V. Le, Y. Wu et al., "GPipe: Efficient training of giant
neural networks using pipeline parallelism," Proc. of NeurIPS, vol. 32,
2019.
[6] D. Narayanan, M. Shoeybi, J. Casper, P. LeGresley, M. Patwary, V. Ko-
rthikanti, D. Vainbrand, P. Kashinkunti, J. Bernauer, B. Catanzaro et al.,
"Efficient large-scale language model training on GPU clusters using
megatron-LM," in Proc. of SC, 2021, pp. 1–15.
[7] A. A. Awan, K. Hamidouche, A. Venkatesh, and D. K. Panda, "Efficient
large message broadcast using NCCL and CUDA-aware MPI for deep
learning," in Proc. of The 23rd European MPI Users' Group Meeting,
2016, pp. 15–22.
[8] M. Cho, U. Finkler, and D. Kung, "Blueconnect: Novel hierarchical all-
reduce on multi-tired network for deep learning," in Proceedings of the
Conference on Systems and Machine Learning (SysML), 2019.
[9] C.-H. Chu, P. Kousha, A. A. Awan, K. S. Khorassani, H. Subramoni, and
D. K. Panda, "NV-group: link-efficient reduction for distributed deep
learning on modern dense GPU systems," in Proceedings of the 34th
ACM International Conference on Supercomputing, 2020, pp. 1–12.
[10] S. Shi, Z. Tang, X. Chu, C. Liu, W. Wang, and B. Li, "A quantitative
survey of communication optimizations in distributed deep learning,"
IEEE Network, vol. 35, no. 3, pp. 230–237, 2020.
[11] P. Xu, S. Shi, and X. Chu, "Performance evaluation of deep learning
tools in docker containers," in 2017 3rd International Conference on
Big Data Computing and Communications (BIGCOM).
IEEE, 2017,
pp. 395–403.
[12] S. Shi, W. Qiang, and X. Chu, "Performance modeling and evaluation
of distributed deep learning frameworks on GPUs," in Proc. of The
4th International Conference on Big Data Intelligence and Computing.
IEEE, 2018.
[13] H. Zhang, Z. Zheng, S. Xu, W. Dai, Q. Ho, X. Liang, Z. Hu, J. Wei,
P. Xie, and E. P. Xing, "Poseidon: An efficient communication archi-
tecture for distributed deep learning on GPU clusters," in 2017 USENIX
Annual Technical Conference (USENIX ATC 17), 2017, pp. 181–193.
[14] A. A. Awan, K. Hamidouche, J. M. Hashmi, and D. K. Panda, "S-
caffe: Co-designing MPI runtimes and Caffe for scalable deep learning
on modern GPU clusters," in Proceedings of the 22nd ACM SIGPLAN
Symposium on Principles and Practice of Parallel Programming, 2017,
pp. 193–205.
[15] S. Li, Y. Zhao, R. Varma et al., "Pytorch distributed: Experiences on
accelerating data parallel training," Proc. of VLDB, vol. 13, no. 12.
[16] A. Sergeev and M. D. Balso, "Horovod: fast and easy distributed deep
learning in TensorFlow," arXiv preprint arXiv:1802.05799, 2018.
[17] J. Romero, J. Yin, N. Laanait, B. Xie, M. T. Young, S. Treichler,
V. Starchenko, A. Borisevich, A. Sergeev, and M. Matheson, "Accel-
erating collective communication in data parallel training across deep
learning frameworks," in Proc. of NSDI, 2022, pp. 1027–1040.
[18] V. Sze, Y.-H. Chen, T.-J. Yang, and J. S. Emer, "Efficient processing of
deep neural networks: A tutorial and survey," Proceedings of the IEEE,
vol. 105, no. 12, pp. 2295–2329, 2017.
[19] M. Barnett, L. Shuler, R. van de Geijn, S. Gupta, D. Payne, and J. Watts,
"Interprocessor collective communication library (intercom)," in Pro-
ceedings of IEEE Scalable High Performance Computing Conference,
1994, pp. 357–364.
[20] R. Rabenseifner, "Optimization of collective reduction operations," in
Springer, 2004,
International Conference on Computational Science.
pp. 1–9.
[21] R. Thakur, R. Rabenseifner, and W. Gropp, "Optimization of collective
communication operations in MPICH," The International Journal of
High Performance Computing Applications, vol. 19, no. 1, pp. 49–66,
2005.
[22] T. Hoefler, W. Gropp, R. Thakur, and J. L. Tr ̈aff, "Toward performance
models of MPI implementations for understanding application scaling
issues," in European MPI Users' Group Meeting. Springer, 2010, pp.
21–30.
[23] S. Shi, X. Chu, and B. Li, "MG-WFBP: Efficient data communication
for distributed synchronous SGD algorithms," in IEEE INFOCOM 2019-
IEEE Conference on Computer Communications.
IEEE, 2019, pp. 172–
180.
[24] --, "MG-WFBP: Merging gradients wisely for efficient communica-
tion in distributed deep learning," IEEE Transactions on Parallel and
Distributed Systems, vol. 32, no. 8, pp. 1903–1917, 2021.
[25] Y. Peng, Y. Zhu, Y. Chen, Y. Bao, B. Yi, C. Lan, C. Wu, and C. Guo,
"A generic communication scheduler for distributed DNN training
acceleration," in Proc. of SOSP, 2019, pp. 16–29.
[26] M. Li, D. G. Andersen, J. W. Park, A. J. Smola, A. Ahmed, V. Josifovski,
J. Long, E. J. Shekita, and B.-Y. Su, "Scaling distributed machine
learning with the parameter server." in OSDI, vol. 14, 2014, pp. 583–
598.
[27] P. Patarasuk and X. Yuan, "Bandwidth optimal all-reduce algorithms for
clusters of workstations," Journal of Parallel and Distributed Comput-
ing, vol. 69, no. 2, pp. 117–124, 2009.
[28] R. Thakur and W. D. Gropp, "Improving the performance of collective
operations in MPICH," in European Parallel Virtual Machine/Message
Passing Interface Users' Group Meeting. Springer, 2003, pp. 257–267.
[29] J. Snoek, H. Larochelle, and R. P. Adams, "Practical bayesian optimiza-
tion of machine learning algorithms," Proc. of NeurIPS, vol. 25, 2012.
constrained
[Online]. Available:
"Bayesian Optimization: Open source
for Python," 2014–.
[30] F. Nogueira,
global optimization tool
https://github.com/fmfn/BayesianOptimization
[31] O. Alipourfard, H. H. Liu, J. Chen, S. Venkataraman, M. Yu, and
M. Zhang, "Cherrypick: Adaptively unearthing the best cloud config-
urations for big data analytics," in NSDI, 2017.
[32] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger, "Densely
connected convolutional networks," in Proceedings of the IEEE confer-
ence on computer vision and pattern recognition, 2017, pp. 4700–4708.
[33] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "ImageNet:
A large-scale hierarchical image database," in Proc. of CVPR, 2009, pp.
248–255.
[34] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, "BERT: Pre-
training of deep bidirectional transformers for language understanding,"
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), 2019, pp. 4171–4186.
[35] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image
recognition," in Proc. of CVPR, 2016, pp. 770–778.
[36] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. A. Alemi, "Inception-v4,
inception-resnet and the impact of residual connections on learning," in
Proc. of The 31st AAAI, 2017.
[37] S. Shi, X. Zhou, S. Song, X. Wang, Z. Zhu, X. Huang, X. Jiang, F. Zhou,
Z. Guo, L. Xie et al., "Towards scalable distributed training of deep
learning on public cloud clusters," Proceedings of Machine Learning
and Systems, vol. 3, pp. 401–412, 2021.
[38] S. Zheng, Q. Meng, T. Wang, W. Chen, N. Yu, Z.-M. Ma, and T.-Y. Liu,
"Asynchronous stochastic gradient descent with delay compensation," in
International Conference on Machine Learning, 2017, pp. 4120–4129.
[39] X. Lian, Y. Huang, Y. Li, and J. Liu, "Asynchronous parallel stochastic
gradient for nonconvex optimization," in Proc. of NeurIPS, 2015, pp.
2737–2745.
[40] D. Alistarh, D. Grubic, J. Li, R. Tomioka, and M. Vojnovic, "QSGD:
Communication-efficient SGD via gradient quantization and encoding,"
in Proc. of NeurIPS, 2017, pp. 1709–1720.
[41] Y. Lin, S. Han, H. Mao, Y. Wang, and W. J. Dally, "Deep gradient
compression: Reducing the communication bandwidth for distributed
training," in International Conference on Learning Representations,
2018.
[42] S. Shi, K. Zhao, Q. Wang, Z. Tang, and X. Chu, "A convergence analysis
of distributed SGD with communication-efficient gradient sparsifica-
tion." in IJCAI, 2019, pp. 3411–3417.
[43] D. Basu, D. Data, C. Karakus, and S. Diggavi, "Qsparse-local-SGD: Dis-
tributed SGD with quantization, sparsification and local computations,"
in Proc. of NeurIPS, 2019, pp. 14 695–14 706.
[44] Z. Tang, S. Shi, X. Chu, W. Wang, and B. Li, "Communication-efficient
distributed deep learning: A comprehensive survey," arXiv preprint
arXiv:2003.06307, 2020.
[45] T. Ben-Nun and T. Hoefler, "Demystifying parallel and distributed deep
learning: An in-depth concurrency analysis," ACM Computing Surveys
(CSUR), vol. 52, no. 4, pp. 1–43, 2019.
[46] P. Sanders, J. Speck, and J. L. Tr ̈aff, "Two-tree algorithms for full
bandwidth broadcast, reduction and scan," Parallel Computing, vol. 35,
no. 12, pp. 581–594, 2009.
[47] L. Luo, P. West, J. Nelson, A. Krishnamurthy, and L. Ceze, "PLink:
Discovering and exploiting locality for accelerated distributed training
on the public cloud," in Proceedings of Machine Learning and Systems
2020, 2020, pp. 82–97.
[48] G. Wang, S. Venkataraman, A. Phanishayee, N. Devanur, J. Thelin, and
I. Stoica, "Blink: Fast and generic collectives for distributed ML," in
Proceedings of Machine Learning and Systems 2020, 2020, pp. 172–
186.
[49] J. Dong, Z. Cao, T. Zhang, J. Ye, S. Wang, F. Feng, L. Zhao, X. Liu,
L. Song, L. Peng et al., "EFLOPS: Algorithm and system co-design
for a high performance distributed training platform," in 2020 IEEE
International Symposium on High Performance Computer Architecture
(HPCA).
IEEE, 2020, pp. 610–622.
[50] X. Miao, X. Nie, Y. Shao, Z. Yang, J. Jiang, L. Ma, and B. Cui,
"Heterogeneity-aware distributed machine learning training via partial
reduce," in Proceedings of the 2021 International Conference on Man-
agement of Data, 2021, pp. 2262–2270.
[51] H. Mikami, H. Suganuma, Y. Tanaka, Y. Kageyama et al., "Massively
distributed sgd: Imagenet/resnet-50 training in a flash," arXiv preprint
arXiv:1811.05233, 2018.
[52] Y. You, A. Buluc ̧, and J. Demmel, "Scaling deep learning on GPU and
knights landing clusters," in Proc. of SC, 2017, pp. 1–12.
[53] S. Shi, X. Chu, and B. Li, "Exploiting simultaneous communications to
accelerate data parallel distributed deep learning," in IEEE INFOCOM
2021-IEEE Conference on Computer Communications.
IEEE, 2021,
pp. 1–10.
[54] S. Rajbhandari, J. Rasley, O. Ruwase, and Y. He, "Zero: Memory
optimizations toward training trillion parameter models," in Proc. of
SC.
IEEE, 2020, pp. 1–16.
|
|
http://arxiv.org/abs/2302.12444v3 | 2023-08-14T05:22:10 | 2023-02-24T04:10:54 | On the Training Instability of Shuffling SGD with Batch Normalization | We uncover how SGD interacts with batch normalization and can exhibit
undesirable training dynamics such as divergence. More precisely, we study how
Single Shuffle (SS) and Random Reshuffle (RR) -- two widely used variants of
SGD -- interact surprisingly differently in the presence of batch
normalization: RR leads to much more stable evolution of training loss than SS.
As a concrete example, for regression using a linear network with batch
normalization, we prove that SS and RR converge to distinct global optima that
are "distorted" away from gradient descent. Thereafter, for classification we
characterize conditions under which training divergence for SS and RR can, and
cannot occur. We present explicit constructions to show how SS leads to
distorted optima in regression and divergence for classification, whereas RR
avoids both distortion and divergence. We validate our results by confirming
them empirically in realistic settings, and conclude that the separation
between SS and RR used with batch normalization is relevant in practice. | [
"David X. Wu",
"Chulhee Yun",
"Suvrit Sra"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12444v3",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12444v3",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"math.OC"
] | 3
2
0
2
g
u
A
4
1
]
G
L
.
s
c
[
3
v
4
4
4
2
1
.
2
0
3
2
:
v
i
X
r
a
On the Training Instability of Shuffling SGD with Batch
Normalization
David X. Wu
UC Berkeley, Berkeley, CA, USA 94720
Chulhee Yun
KAIST, Seoul, Korea, 02455
Suvrit Sra
Massachusetts Institute of Technology, Cambridge, MA, USA 02139
[email protected]
[email protected]
[email protected]
Abstract
We uncover how SGD interacts with batch normalization and can exhibit undesirable
training dynamics such as divergence. More precisely, we study how Single Shuffle (SS)
and Random Reshuffle (RR)-two widely used variants of SGD-interact surprisingly
differently in the presence of batch normalization: RR leads to much more stable evolution
of training loss than SS. As a concrete example, for regression using a linear network
with batch normalization, we prove that SS and RR converge to distinct global optima
that are "distorted" away from gradient descent. Thereafter, for classification we
characterize conditions under which training divergence for SS and RR can, and cannot
occur. We present explicit constructions to show how SS leads to distorted optima in
regression and divergence for classification, whereas RR avoids both distortion and
divergence. We validate our results by confirming them empirically in realistic settings,
and conclude that the separation between SS and RR used with batch normalization is
relevant in practice.
1 Introduction
Recent work in deep learning theory attempts to uncover how the choice of optimization algorithm
and architecture influence training stability and efficiency. On the optimization front, stochastic
gradient descent (SGD) is the de facto workhorse, and its importance has correspondingly led to
the development of many different variants that aim to increase the ease and speed of training,
such as AdaGrad (Duchi et al., 2011) and Adam (Kingma and Ba, 2014).
In reality, practitioners often do not use with-replacement sampling of gradients as required
by SGD. Instead they use without-replacement sampling, leading to two main variants of SGD:
single-shuffle (SS) and random-reshuffle. SS randomly samples and fixes a permutation at the
beginning of training, while RR randomly resamples permutations at each epoch. These shuffling
algorithms are often more practical and can have improved convergence rates (Cha et al., 2023;
Cho and Yun, 2023; Haochen and Sra, 2019; Safran and Shamir, 2020; Yun et al., 2021b; 2022).
Architecture design offers another avenue for practitioners to train networks more efficiently
and encode salient inductive biases. Normalizing layers such as BatchNorm (BN) (Ioffe and
Szegedy, 2015), LayerNorm (Ba et al., 2016), or InstanceNorm (Ulyanov et al., 2016) are often
1
(a) Depths 1, 2, and 3 linear+BN networks.
(b) Finetuned ResNet18.
Figure 1: Surprising training phenomena using SS/RR+BN.
used with SGD to accelerate convergence and stabilize training. Recent work studies how these
scale-invariant layers affect training through the effective learning rate (Li and Arora, 2019; Li
et al., 2020; Lyu et al., 2022; Wan et al., 2021).
Motivated by these practical choices, we study how SS and RR interact with batch normalization
at training time. Our experiments (Fig. 1) suggest that combining SS and BN can lead to surprising
and undesirable training phenomena:
(i) The training risk often diverges when using SS+BN to train linear networks (i.e. without
nonlinear activations) on real datasets (see Figure 1a), while using SS without BN does not
cause divergence (see Figure 10).
(ii) Divergence persists after tuning the learning rate and other hyperparameters (Section 4.3)
and also manifests more quickly in deeper linear networks (Figure 1a).
(iii) SS+BN usually converges slower than RR+BN in nonlinear architectures such as ResNet18
(see Figure 1b).
In light of these surprising experimental findings, we seek to develop a theoretical explanation.
1.1 Summary of our contributions
We develop a theoretical and experimental understanding of how shuffling SGD and BN collude
to create divergence and other undesirable training behavior. Since these phenomena manifest
themselves on the training risk, our results are not strictly coupled with generalization.
Put simply, the aberrant training dynamics stem from BN not being permutation invariant
across epochs. This simple property interacts with SS undesirably, although a priori it is not
obvious whether it should. More concretely, one expects SGD+BN to optimize the gradient
descent (GD) risk in expectation. However, due to BN's sensitivity to permutations, both SS+BN
and RR+BN implicitly train induced risks different from GD, and also from each other.
• In Section 3.2, we prove that the network f (X; Θ) = W ΓBN(X) converges to the optimum
for the distorted risk induced by SS and RR (Theorems 3.2.2 and 3.2.3); the diagonal matrix Γ
denotes the trainable scale parameters in the BN layer. Our proof requires a delicate analysis
of the evolution of gradients, the noise arising from SS, and the two-layer architecture. Due
to the presence of Γ, our results do not assume a fully-connected linear network, which
2
02004006008001000Epoch1.52.02.53.03.54.0GD train riskDepth123ShufflingRRSS01020304050Epoch104103102101100GD train riskLR0.0010.0030.010.03ShufflingRRSSdistinguishes them from prior convergence results. In Section 3.3, we present a toy dataset
for which SS is distorted away from GD with constant probability while RR averages out
the distortion to align with GD. We validate our theoretical findings on synthetic data in
Section 3.4.
• In Section 4.1, we connect properties of the distorted risks to divergence. With this step,
we provide insights into which regimes can lead to divergence of the training risk (The-
orems 4.1.3 and 4.1.4). We show that in certain regimes, SS+BN can suffer divergence,
whereas RR+BN provably avoids divergence. These results motivate our construction of a
toy dataset where SS leads to divergence with constant probability while RR avoids diver-
gence (Section 4.2). In Section 4.3, we empirically validate our results on deeper linear+BN
networks on a variety of datasets and hyperparameters. Our experiments also demonstrate
that SS trains more slowly than RR in more realistic nonlinear settings, including ReLU+BN
networks and ResNet18. In doing so, we extend the relevance of our theoretical results to
more complex and realistic settings.
1.2 Related work
Interplay between BN and SGD. Prior theoretical work primarily studied how BN interacts
with GD or with-replacement SGD (Arora et al., 2018; Cai et al., 2019; Li and Arora, 2019; Lyu
et al., 2022; Santurkar et al., 2018; Wan et al., 2021). Arora et al. (2018); Wan et al. (2021) assumed
global bounds on the smoothness with respect to network parameters and the SGD noise to
analyze convergence to stationary points. We instead prove convergence to the global minimum of
the SS distorted risk Lπ with no such assumptions (Theorem 3.2.2). Li and Arora (2019) assumed
the batch size is large enough to ignore SGD noise, whereas we explicitly exhibit and study
the separation between shuffling SGD and GD. For fully scale-invariant networks trained with
GD, Lyu et al. (2022) identified an oscillatory edge of stability behavior around a manifold of
minimizers. Our BN network has trainable scale-variant parameters W and Γ, and we train with
shuffling SGD instead of GD. Hence, the noise that leads to distorted risks is fundamentally
different.
BN's effect on risk function. Previous work identified the distortion of risk function due to
noisy batch statistics in BN. Yong et al. (2020) studied the asymptotic regularization effect of noisy
batch statistics in expectation for with-replacement SGD. In contrast, we characterize this noise
nonasymptotically w.h.p. over π for SS and a.s. with respect to the data for RR. Wu and Johnson
(2021) studied the difficulty of precisely estimating the population statistics at train time, especially
when using an exponential moving average. We avoid these issues altogether by evaluating directly
on the GD risk. Moreover, we prove concentration inequalities for without-replacement batch
statistics (Proposition C.2.4).
In the presence of BN, it is common practice to use ghost batch
Ghost batch normalization.
normalization, a scheme which break up large batches into virtual "ghost" batches, as this tends
to improve the generalization of the network (Hoffer et al., 2017; Shallue et al., 2019; Summers
and Dinneen, 2020). Minibatch statistics are calculated with respect to the ghost batches, and
each gradient step is computed by summing the gradient contributions from the ghost batches.
This algorithm is closely related to our method of analysis for SS+BN/RR+BN. Indeed, in our
3
setup we also break up the full batch into mini-batches, and our analysis reduces to showing that
SS+BN and RR+BN trajectories track those obtained by following the aggregate gradient signal
from summing over mini-batches. We comment more on the similarities between ghost BN and
our setup in Section 3.1.
Shuffling and optimization. Outside SGD, the effect of random shuffling has also been studied
for classical nonlinear optimization schemes such as coordinate gradient descent (CGD) and
ADMM (see Gürbüzbalaban et al. (2020); Sun et al. (2020) and references therein). On convex
quadratic optimization problems, they demonstrate separations in convergence rates between SS,
RR, and with-replacement sampling. Our main focus is the optimum that the algorithms converge
to rather than their convergence rates.
Implicit bias. Our work is also motivated by a burgeoning line of work which studies the
implicit bias of different optimization algorithms (Gunasekar et al., 2018; Jagadeesan et al., 2022;
Ji and Telgarsky, 2018; 2019; 2020; Soudry et al., 2018; Yun et al., 2021a). These results establish
how optimization algorithms such as gradient flow (GF), gradient descent (GD) or even with-
replacement SGD are biased towards certain optima. For example, in the interpolating regime,
GD converges to the min-norm solution (Gunasekar et al., 2018; Woodworth et al., 2020) for linear
regression and the max-margin classifier for classification (Nacson et al., 2019a;b; Soudry et al.,
2018).
Most directly related to our work is Cao et al. (2023); they establish that linear (CNN) models
ΓBN(W X) with BN as the final layer trained with GD converge to the (patchwise) uniform-margin
classifier with an explicit convergence rate faster than linear models without BN. Notably, their
techniques are able to control the training dynamics of the W inside of BN. In contrast, our
networks are of the form W ΓBN(X), so the network is no longer scale-invariant with respect to
W , which is essential to their analysis. Furthermore, we study the surprising interactions between
shuffling SGD and BN compared to full-batch GD and BN, whereas they use full-batch GD.
Finally, while our work does not focus on generalization, it is connected in spirit to implicit
bias. Indeed, our analysis centers the study of how the risk functions and optima are affected by
choices of the optimizer (SS/RR) and the architecture (BN).
2 Problem setup
For n ∈ Z+ we use the notation [n] ≜ {1, . . . , n}. We write π to denote a permutation of [n], and
Sn is the symmetric group of all such π. For any matrix A ∈ Rd×n, π ◦ A ∈ Rd×n is result of
shuffling the columns of A according to π. Also, ∥A∥2 and ∥A∥F refer to the spectral norm and
Frobenius norm, respectively. We write σmin(A) ≜ inf∥v∥=1 ∥Av∥ to denote minimum singular
value of A. According to our notation, σmin(A) > 0 only if A is tall or square. We use Span(A) to
denote the span of A's columns. The (coordinatewise) sign function sgn(*) : R → {−1, 0, 1} is
defined as sgn(x) = x/|x| for x ̸= 0 and sgn(0) = 0.
Data. Let Z = (X, Y ) be the given dataset, with X = (cid:2)x1
feature matrix and corresponding labels Y = (cid:2)y1
* * * yn
we will assume Y ∈ {±1}1×n.
* * * xn
(cid:3) ∈ Rd×n representing the
(cid:3) ∈ Rp×n. In the classification setting
4
* * * xq
Prediction model. A batch normalization (BN) layer can be separated into a normalizing
component BN and a scaling component Γ; we ignore the bias parameters for analysis. Given
any matrix B = (cid:2)x1
(cid:3) ∈ Rd×q (here, q ≥ 2 is arbitrary), the normalizing transform BN(*)
maps it to BN(B) ∈ Rd×q by operating coordinatewise on each xi in B. In particular, for the kth
coordinate of xi, denoted as xi,k, the transform BN sends xi,k (cid:55)→ xi,k−μk√
k are the
σ2
k +ε
batch empirical mean and variance of the kth coordinate, respectively, and ε is an arbitrary positive
constant used to avoid numerical instability. For technical reasons, we omit ε in our analysis.
The scaling matrix Γ ∈ Rd×d is a diagonal matrix which models the tunable coordinatewise scale
parameters inside the BN layer.
where μk and σ2
Throughout the paper, we consider neural networks of the form f (*; Θ) = W ΓBN(*)1. We use
Θ = (W , Γ) to denote the collection of all parameters in the network. With the presence of batch
normalization layers, the output of f is a function of the input datapoint as well as the batch it
belongs to. Even changing one point of a batch B can affect the batch statistics (i.e., μk's and σ2
k 's)
and in turn change the outputs of f for the entire batch. The collection of network outputs for B
reads f (B; Θ) = W ΓBN(B).
Loss functions. We study regression with squared loss l( ˆy, y) ≜ ∥ ˆy − y∥2 and binary classi-
fication with logistic loss l( ˆy, y) ≜ − log(ρ(y ˆy)), where ρ(t) = 1/(1 + e−t). Let ˆY , Y ∈ Rp×q
denote network outputs and true labels for a mini-batch of q datapoints, respectively. Define the
mini-batch risk as the columnwise sum
L( ˆY , Y ) ≜
q
∑
i=1
l( ˆY:,i, Y:,i),
where Y:,i denotes the ith column of Y .
Optimization methods. We consider shuffling-based variants of SGD, namely single-shuffle (SS)
and random-reshuffle (RR). These algorithms proceed in epochs, i.e., full passes through shuffled
dataset. As the names suggest, SS randomly samples a permutation π ∈ Sn at the beginning of
the first epoch and adheres to this permutation. RR randomly resamples permutations πk ∈ Sn at
each epoch k.
Throughout, the (mini-)batch size will be denoted as B. For simplicity, we assume that
the n datapoints can be divided into m batches of size B. With a permutation π ∈ Sn, the
dataset Z = (X, Y ) is thus perfectly partitioned into m batches (X 1
π ), where
X j
π ∈ Rd×B and Y j
π ∈ Rp×B consist of the (j(B − 1) + 1, . . . , jB)th columns of the shuffled π ◦ X
and π ◦ Y , respectively.
π ), . . . , (X m
π , Y m
π, Y 1
For a parameter Θ optimized with SS or RR, we denote the jth iterate on the kth epoch by Θk
j .
0 which is equal to the last iterate of the previous epoch
The starting iterate of the kth epoch is Θk
Θk−1
m . For each j ∈ [m], SS and RR perform a mini-batch SGD update with stepsize ηk > 0:
Θk
j ← Θk
j−1 − ηk∇ΘL( f (X j
πk ; Θk
j−1), Y j
πk ).
1We can readily generalize to arbitrary learned (but frozen) feature mappings under suitable changes to the
assumptions.
5
3 Main regression results: convergence to optima of distorted risks
In this section, we introduce the framework of distorted risks to elucidate the distinction between
SS+BN and RR+BN. This framework also applies to classification; we continue to study it in
Section 4. We then present our global convergence results (Theorems 3.2.2 and 3.2.3) for the
distorted risks induced by SS and RR for squared loss regression. In the one-dimensional case, we
uncover an averaging relationship between the SS and RR optima (Proposition 3.3.1) which can
help RR reduce distortion. We exemplify this averaging relationship with a simple example and
extend it to higher dimensions with experiments on synthetic data.
3.1 Framework: the idea of distorted risks
We now formally introduce the notion of a distorted risk. Distorted risks are crucial to our analysis,
as they encode the interaction between shuffling SGD and BN. We show that these distorted risks
Lπ and LRR are respectively induced by certain batch normalized datasets X π and X RR.
Recall that the network outputs for a batch depend on the entire batch. The undistorted risk we
actually want to minimize is the risk which corresponds to full-batch GD. Define the GD features
X GD
≜ BN(X), which induces this GD risk:
LGD(Θ) ≜ L( f (X; Θ), Y ) = L(W ΓX GD, Y ).
However, during epoch k, SS or RR optimizes a distorted risk dependent on πk. To see why,
define the SS dataset
X π ≜ BNπ(X) ≜ (cid:2)BN(X 1
π)
* * * Y m
π
Yπ ≜ (cid:2)Y 1
(cid:3),
* * * BN(X m
π )(cid:3)
π
for every permutation π ∈ Sn. Similarly, form the RR dataset (X RR, YRR) ∈ Rd×(n*n!) × Rp×(n*n!)
by concatenating the SS datasets (X π, Yπ) across all π.
Crucially, the SS data X π encodes the distortion due to the interaction between SS with
permutation π and BN; the RR data X RR does the same for RR and BN. Indeed, since SS uses
fixed π, it implicitly optimizes the SS distorted risk
Lπ(Θ) ≜
m
∑
j=1
L( f (X j
π; Θ), Y j
π) = L(W ΓX π, Yπ).
Likewise, by collapsing the epoch update into a noisy "SGD" update, we observe that RR over
epochs implicitly optimizes the RR distorted risk
LRR(Θ) ≜ 1
n!
∑
π∈Sn
Lπ(Θ) =
1
n!
L(W ΓX RR, YRR).
We reiterate that SS and RR distortions originate from using both shuffling and batch normal-
ization: shuffling alters the batch-dependent affine transforms that BN applies. With this notation,
the connection between SS+BN/RR+BN and ghost BN becomes more evident: one can view the
full batch as the batch in ghost BN and the mini-batches as the virtual ghost batches. Moreover,
the proofs of Theorems 3.2.2 and 3.2.3 demonstrate that ghost BN would witness the same type of
distortion as SS+BN/RR+BN.
To aid clarity, we adopt the convention that overlines connote batch normalization with some
batching, and vice versa. For example, the SS dataset X π ≜ BNπ(X) is normalized, while the
shuffled dataset Xπ = π ◦ X is not.
6
3.2 Convergence results for regression
We now present our main regression results: SS+BN and RR+BN converge to the global optima of
their respective distorted risks encoded by the SS dataset X π and the RR dataset X RR. We require
the following rank assumptions.
Assumption 1 (Full rank assumption).
(a) X π ∈ Rd×n satisfies rank(X π) ≥ d. In particular, σmin(X πX
(b) X RR ∈ Rd×(n*n!) satisfies rank(X RR) ≥ d. In particular, σmin(X RRX
⊤
π ) > 0.
⊤
RR) > 0.
It is natural to ask when Assumption 1 holds. We demonstrate that the following milder
assumption implies it; the assumption states that the feature matrix X is drawn from a joint
density on matrices in a potentially non-i.i.d. fashion.
Assumption 2. X is drawn from a density with respect to the Lebesgue measure on Rd×n.
Since BN centers the mini-batch features, we have rank(X π) ≤ min (cid:8)d, (B − 1) n
(cid:9) and
B)(cid:9).2 We now show that if B > 2 these upper bounds are achieved
rank(X RR) ≤ min (cid:8)d, (B − 1)(n
almost surely. Thus, we identify reasonable conditions under which Assumption 1 holds almost
surely over the draw of data, irrespective of shuffling.
Proposition 3.2.1. Assume Assumption 2 and B > 2. Then we have rank(X π) = min (cid:8)d, (B − 1) n
and rank(X RR) = min (cid:8)d, (B − 1)(n
for X π, and if (B − 1)(n
(cid:9)
B ≥ d, Assumption 1(a) holds a.s.
B)(cid:9) a.s.. Consequently, if (B − 1) n
B) ≥ d, Assumption 1(b) holds a.s. for X RR.
B
B
Although we could have just assumed Assumption 1, the nonlinearity introduced by BN
makes it nontrivial to identify mild sufficient conditions on the original features to control the
rank of SS and RR datasets. Furthermore, controlling the rank of these datasets is crucial to our
analysis of GD risk divergence in the classification setting (see Section 4).
Next, we present our main SS convergence result: SS converges for appropriate stepsizes. We
defer the proof and explicit convergence rates to Appendix A.1.
Theorem 3.2.2 (Convergence of SS). Let f (*; Θ) = W ΓBN(*) be a linear+BN network initialized at
Θ1
0) = (0, I). We train f using SS with permutation π and suppose that Assumption 1(a)
0 = (W 1
0 , Γ1
holds for this π. SS uses the following decreasing stepsize, which is well-defined:
ηk =
1
kβ
* min
(cid:16)
(cid:110)
O
1
σmin(X πX
⊤
π )
(cid:17)
,
(cid:112)
2β − 1 poly(σmin(X
poly(n, d, ∥Y ∥F)
⊤
π ))
(cid:111)
,
where 1/2 < β < 1. Then the risk Lπ(Θk
0) converges to the global minimum L∗
π as k → ∞.
Theorem 3.2.2 shows that using both SS and BN induces the network to converge to the global
optimum of the SS distorted risk instead of the usual GD risk. The proof proceeds by aggregating
the epoch-wise gradient updates on the collapsed matrix W Γ. The main difficulty lies in carefully
bounding the accumulation of various types of noise.
We now turn to RR convergence. For the sake of analysis, we make the following compact
iterates assumption which is common in the RR literature (Ahn et al., 2020; Haochen and Sra,
2019; Nagaraj et al., 2019; Rajput et al., 2020).
2Note that XRR contains many duplicate batches; only (n
B) of them are unique, up to permutations of B columns
inside a batch.
7
Assumption 3. For all (i, k), the iterates Θk
constant ARR.
i = (W k
i , Γk
i ) satisfy
(cid:13)
(cid:13)
(cid:13)W k
i
Γk
i
(cid:13)
(cid:13)
(cid:13)2
≤ ARR for some absolute
Finally, we can show that RR converges in expectation to the global optimum of the RR
distorted risk LRR. We defer the proof and explicit convergence rates to Appendix A.2.
Theorem 3.2.3 (Convergence of RR). Assume Assumption 1(b) and Assumption 3. Using the same f
and initialization as in Theorem 3.2.2. we train training f using RR with the following decreasing stepsize,
which is well-defined:
ηk =
1
kβ
* min
(cid:16)
(cid:110)
O
1
σmin(X RRX
⊤
RR)
(cid:17)
,
(cid:112)
2β − 1
poly(n, d, ∥Y ∥F, ARR)
(cid:111)
,
where 1/2 < β < 1. Then the risk LRR(Θk
k → ∞.
0) converges in expectation to the global minimum L∗
RR as
The proof of Theorem 3.2.3 is similar to the SS case; the main subtlety is using Assumption 3
to handle expectations.
The main takeaway of Theorems 3.2.2 and 3.2.3 is that SS+BN and RR+BN converge to the
optima of the SS and RR distorted risks, respectively. These distorted optima may differ from
optimum of the GD risk. Moreover, the required stepsize for convergence is usually smaller for SS
(where the requirement depends on π) compared to RR.
3.3 RR averages out SS distortion
Having shown that the two different algorithms drive the network parameters to global optima of
two different distorted risks, it behooves us to study these optima. By collapsing the final layers
W and Γ into a single matrix M = W Γ ∈ Rp×d, we can study the global optima M ∗
π and M ∗
RR
on the normalized datasets X π and X RR. These global optima naturally correspond to the global
optima of Lπ and LRR. In this section we illustrate how RR can average out SS distortion in the
one-dimensional case.
We first relate the SS optima M ∗
RR = ∑π YπX
⊤
π (∑π X πX
π to the RR optimum M ∗
RR. A simple gradient calcula-
⊤
π )−1. Since BN enforces the unit variance constraint,
⊤
π = n if d = 1. Simple algebraic manipulation then implies the following proposition.
tion reveals M ∗
X πX
Proposition 3.3.1. If d = 1, M ∗
RR = 1
n!
∑π∈Sn
M ∗
π.
Proposition 3.3.1 identifies an explicit averaging relationship between RR and SS in the one-
dimensional case. This motivates the following simple construction where RR's averaging behavior
removes SS distortion.
Dataset: SS distorted with constant probability, RR averages out distortion. We visualize our
toy dataset with 16n datapoints where d = p = 1, B = 2, and n = 3 in Figure 2a, along with
the possible SS optima M ∗
π. The dataset is comprised of four clusters of 4n points in the square
[−1, 1]2. By vertical symmetry of the clusters and Proposition 3.3.1, the RR and GD optima coincide
at zero. However, SS is distorted away from GD. An anticoncentration calculation shows M ∗
π ̸= 0
π| = Ω( 1√
with probability 1 − O( 1√
) with constant probability. The key insight is
n
n
linking SS distortion to breaking symmetry in the SS dataset (see Proposition E.1.1 for details).
) and |M ∗
8
3.4 Regression experiments
For our regression experiments, we used synthetic data with n = 100, B = 10, and d = 10. For
i ∈ [n], we sampled xi ∼ N(0, Id) and generated yi = Mtruexi + εi ∈ R with Mtrue ∼ U[−1, 1]d
and εi ∼ N(0, 1). We trained the network W ΓBN(X) using SS and RR with an inverse learning
rate schedule. We observed convergence to near optimal values on the SS and RR risks (Figure 7),
which supports the convergence results (Theorems 3.2.2 and 3.2.3).
We also extended the toy dataset to the synthetic setup described above. As Figure 2b makes
apparent, SS is consistently distorted away from the GD optimum, whereas RR averages out
this distortion effect. We generated 500 datasets and evaluated the distortion for each one with
the normalized distance d(M ) ≜ ∥M −M ∗
π) for 1000
∥MGD∗∥
random draws of π. For RR, we approximated d(M ∗
RR) as follows. We sampled 1000 fresh random
permutations to approximate the RR dataset X RR, which we then used to approximate M ∗
RR (since
it is intractable to average over all n! permutations).
. For SS, we computed the mean d(M ∗
GD∥
(a) Dataset with 48 datapoints demonstrating dis-
tortion of SS optima M ∗
π.
(b) Normalized distance to GD optimum d(M ) =
(cid:13)
(cid:13)M − M ∗
GD
(cid:13)
(cid:13)M ∗
GD
(cid:13)
(cid:13)/
(cid:13)
(cid:13).
Figure 2: Top: toy dataset for regression, showing how RR can average out the distortion of
SS. Bottom: histogram of distortion of SS and RR optima on synthetic data for d = 10. The SS
optima significantly deviate from the GD optima, whereas the RR optima are relatively close. This
supports the intuition that RR can nontrivially smooth out the bias of SS in higher dimensions.
4 Main classification results: divergence regimes based on distorted
risks
We now turn to analyzing linear+BN binary classifiers f (X; Θ) = sgn(W ΓBN(X)) trained with
the logistic risk. To characterize divergence, we identify salient properties of the distorted risks
first introduced in Section 3.1. These properties identify regimes where the SS+BN classifier can
9
1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00Cluster 1Cluster 2Cluster 3Cluster 4ZZ1Z2Z3Z4M*GDM*M*RR0.20.40.60.81.0050100150200Normalized distance to GD optimumRRSSdiverge on the GD risk (Theorem 4.1.3) yet the RR+BN classifier does not diverge (Theorem 4.1.4).
This motivates the construction of a toy dataset (Section 4.2) where the optimal SS classifier
diverges on the GD risk with constant probability. In Section 4.3 we extend our results to more
realistic networks and datasets, demonstrating that these phenomena are not an artifact of our
theoretical setup. Our theoretical results offer some justification for the empirical phenomenon of
divergence when SS SGD is combined with BN for classification.
We briefly remark on why we analyze divergence conditions instead of directional convergence.
The main difficulty lies in analyzing SGD instead of GD. One could hope to extend the techniques
for directional convergence for homogeneous networks in Lyu and Li (2019) to the stochastic
setting, but this is outside the scope of our paper. Furthermore, the analyses for deep linear
networks such as Ji and Telgarsky (2020) rely on invariants which do not hold for us due to the
diagonal Γ and the BN layers for deeper networks.
Throughout, we use v = (W Γ)⊤ ∈ Rd to refer to the vector that determines the decision
boundary of our classifier f . We remind the reader of the datasets which induce the different
≜ (X GD, YGD) =
distorted risks (Section 3.1). Given dataset Z = (X, Y ), the GD dataset is ZGD
(BN(X), Y ). Similarly define the SS dataset Z π ≜ (X π, Yπ) = (BNπ(X), π ◦ Y ) and the RR
≜ (X RR, YRR) by concatenating Z π over all permutations π. If the labels are clear
dataset ZRR
from context, we occasionally abuse terminology and refer to the features as the dataset.
4.1 Analysis of problem structure for classification
To analyze the optima of the distorted risks, we introduce relevant concepts from Ji and Telgarsky
(2019). Given a dataset Z = (X, Y ) = {(xi, yi)}n
i=1, with labels yi ∈ {±1}, greedily define a
maximal linearly separable subset SLS ≜ (X LS, Y LS) as follows. Include (xi, yi) in SLS if there exists
a classifier ui ∈ Rd with yiu⊤
i xj ≥ 0 for all j. For reasons that will be clear shortly,
denote the complement of SLS in Z by SSC ≜ (X SC, Y SC).
i xi > 0 and yju⊤
In particular, there exists a classifier u such that: (1) SLS is perfectly separated by u (2) the
datapoints X SC in SSC are orthogonal to u, so they are on the decision boundary. We can choose
u to be the max-margin classifier uMM on SLS. The notation SSC is chosen because the logistic risk
is strongly convex when restricted to bounded subsets of Span(X SC), meaning there is a unique
finite minimizer vSC in this subspace. Ji and Telgarsky (2019) show that linear classifiers trained
on the logistic risk with GD are implicitly biased towards the ray vSC + t * uMM for t > 0.
We now identify a salient property of the distorted risks.
Definition 1 (Separability decomposition). The separability decomposition of dataset Z refers to
Z = SLS ⊔ SSC.
If SLS = Z, we say Z is linearly separable (LS). If both SLS and SSC are nonempty, we say Z
is partially linearly separable (PLS). Finally, if SSC = Z, we slightly abuse terminology and say Z is
strongly convex (SC). 3
Because the logistic loss does not always have finite infima, we now introduce the notion of an
optimal direction.
3Here, PLS refers to the "general case" discussed in Ji and Telgarsky (2019), but we chose to use this alternative
terminology because we found the term "general" can lead to confusion.
10
Definition 2 (Optimal direction). Given dataset Z = (X, Y ), we say a sequence of iterates v(t)
infimizes L if L(v(t)⊤X, Y ) → infw∈Rd L(w⊤X, Y ). We call v ∈ Rd an optimal direction if there
exists u ∈ Rd such that {u + tv}t≥1 infimizes L.4
Definition 1 is motivated by the following results which identify how the separability decom-
position affects optimal directions. Their proofs are deferred to Appendix B.4.
Lemma 4.1.1. Let Z = SLS ⊔ SSC. If v is an optimal direction for L, then v⊤x = 0 for all x ∈
Span(X SC) and yiv⊤xi > 0 for every (xi, yi) ∈ SLS.
Combining the above lemma and the definitions yields the following proposition, which
characterizes SS and RR divergence using the separability decomposition.
π )⊥ converge in direction to some optimal direction v∗
Proposition 4.1.2. Suppose Assumption 1(a) holds, the iterates vπ(t) infimize Lπ, and their projections
onto Span(X SC
π for Lπ. Then the GD risk LGD
diverges if and only if Z π is PLS or LS and there exists some (xi, yi) ∈ ZGD such that yiv∗⊤
π xi < 0. The
analogous statement holds true for ZRR under Assumption 1(b). Furthermore, the "if" part holds true for
SS and RR without Assumption 1.
In particular, Proposition 4.1.2 implies that if the RR dataset is SC and rank d, the GD risk
does not diverge. Moreover, it naturally leads to the question of understanding ranks and
separability decompositions of the SS and RR datasets; the former question is already answered
by Proposition 3.2.1.
To analyze the separability decomposition with high probability or almost surely, we assume
the labels are balanced.
Assumption 4 (Balanced classes). The data Z either has
(a) an equal number of positive and negative examples; or
(b) at least B positive and B negative examples.
Finally, we informally state our main classification: SS+BN can diverge in some regimes (see
Theorem B.2.1 for details).
Theorem 4.1.3 (SS+BN can diverge (informal))). Assume Assumption 2, Assumption 4(a), and B > 2.
B , SS can diverge if B = Ω(log n) and ZGD's separability decomposition can change
If d ≤ (B − 1) n
with small perturbations. Otherwise, SS can diverge regardless of the batch size and the separability
decomposition of ZGD.
Whereas Theorem 4.1.3 establishes regimes where SS+BN can diverge, we can show that
RR+BN prevents divergence in a much larger regime (see Theorem B.3.1 for details).
Theorem 4.1.4 (RR+BN does not diverge (informal)). Assume Assumption 2, Assumption 4(b), and
B > 2. If d ≤ (B − 1)(n
B), RR does not diverge almost surely.
Theorem 4.1.3 implies that one cannot prevent SS divergence by simply increasing the batch
size B; it is also necessary for the GD dataset to be "robustly" LS or SC. Moreover, as soon as
d > (B − 1) n
B , SS can diverge. In stark contrast, Theorem 4.1.4 establishes that even for small B,
RR is almost surely robust to divergence as long as d ≤ (B − 1)(n
B). Although our theorems do not
prove that SS+BN necessarily diverges, they offer some theoretical explanation for why SS+BN
appears to be less stable than RR+BN for classification.
4This definition is catered towards the SC+full rank X or PLS/LS case. However, since Proposition 3.2.1 provides
sufficient conditions for full-rank data, this subtlety is unimportant.
11
4.2 RR prevents divergence while SS diverges
We present a toy dataset where SS drastically distorts the optimal direction, leading to divergence
with constant probability. Meanwhile, RR does not diverge on this dataset. We use d = B = 2 to
simplify the construction.5
(a) Toy classification dataset showing divergence of
SS with constant probability.
(b) 3 layer linear+BN networks trained with varying
stepsizes.
Figure 3: Left: Toy dataset demonstrating divergence of GD risk with constant probability. The
dashed lines trace out the convex hulls of the positive and negative points. Right: divergence of
GD risk for a variety of stepsizes on CIFAR10. Note that there was eventually a separation for
η = 10−4 (see Figure 8).
Dataset: SS diverges with contsant probability; RR does not. We describe our construction
(Figure 3a) at a high level; see Proposition E.2.1 for details. The GD dataset is PLS with unique
optimal direction v∗
GD (its decision boundary is the purple dash-dotted line). Moreover, with
constant probability the SS dataset is PLS with unique optimal direction v∗
π (green dotted line)
−
+
distorted away from v∗
err and X
π misclassifies points in the GD dataset (X
err). Under
the additional assumptions in Proposition 4.1.2, the GD risk diverges. Finally, since the RR dataset
is SC and rank d, RR does not diverge on the GD dataset.
GD. Also, v∗
4.3 Experiments on linear and nonlinear networks
We now verify our theoretical classification results on linear+BN and extend them to nonlinear
networks on a variety of real-world datasets. This demonstrates that the separation between
SS, RR, and GD is relevant in realistic settings and not merely an artifact of the linear setting.
We refer to the linear+BN network W ΓBN(X) as 1-layer linear network, and also consider
deeper linear networks with tunable parameters inside BN layers. We observe strikingly different
5Since B = 2, there is no contradiction with Theorem 4.1.3.
12
1.51.00.50.00.51.01.51.00.50.00.51.0X+errX+corXerrXcorXbdrXbdrZGDPosNeg(v*GD)x=0(v*)x=002004006008001000Epoch1.52.02.53.03.54.0GD train riskLR0.00010.0010.01ShufflingRRSS(a) ZGD = (BN(A0
0X), Y ) at initialization.
(b) ZGD = (BN(AT
0 X), Y ) after training.
(c) Z π = (BNπ(A0
0X), Yπ) at initialization.
(d) Z π = (BNπ(AT
0 X), Yπ) after training.
Figure 4: Snapshots of GD dataset ZGD and SS dataset Z π before and after running SS for T = 104
epochs with 32 positive and negative synthetic examples. While the GD dataset remains SC, the
SS dataset become LS. Here B = 16, η = 10−2, and ε = 10−5 for BN.
training behaviors in the shallow and deep linear networks. The networks are formally defined in
Appendix D; see https://github.com/davidxwu/sgd-batchnorm-icml for the experiment code.
Figure 5: 3 layer ReLU+BN MLP on (left to right): CIFAR10, CIFAR100, and MNIST. Note the
slower convergence for SS versus RR.
As a motivating example, we ran an experiment on synthetic data (Fig. 4) with the 2-layer
linear network f (X) = W ΓBN(AX). Note that the tunable matrix A acts before BN. Intriguingly,
13
2101221012PositiveNegative2101221012PositiveNegative21012321012PositiveNegative2101221012PositiveNegative02004006008001000Epoch104103102101100GD train risk02004006008001000Epoch103102101100GD train risk02004006008001000Epoch105104103102101100GD train riskLR0.00010.0010.01ShufflingRRSSFigure 6: ResNet18 finetuned on (left to right): CIFAR10, CIFAR100, and MNIST. Note the slower
convergence for SS versus RR across datasets. For the smallest learning rate η = 10−3, we observed
a separation after 200 epochs.
we observe that the SS dataset with features X π = BNπ(AX) is SC at initialization, but updating
A with SS makes it LS after training. Moreover, the batch size is large relative to n, so this dataset
satisfies the necessary conditions for divergence in Proposition 4.1.2 and Theorem 4.1.3.
More specifically, Figures 4a and 4c plot the 2-dimensional GD and SS datasets, respectively,
which are SC at initialization. However, after training with SS, we can see from Figures 4b
and 4d that SS updates A to make the SS dataset LS, whereas the GD dataset stays SC. Hence, by
Proposition 4.1.2, the GD risk diverges. This example partially explains the discrepancy in training
behavior between the 1-layer and deeper networks. Indeed, whereas the 1-layer architecture has
static Z π, the deeper networks have evolving weights inside BN which can push Z π to be LS/PLS.
To exhibit the above divergence on real data, we conducted experiments on the CIFAR10.
Using SS and RR, we trained linear+BN networks of depths up to 3 for T = 103 epochs using
stepsize η = 10−2, batch size B = 128, and 512 hidden units per layer (see Appendix D for precise
details).
As depicted in Figure 1a, we consistently observed SS divergence for the deeper networks
(see Figure 9 for more evidence of divergence). As predicted by Theorem 4.1.4, RR did not
exhibit divergence behavior. These phenomena persisted despite ablating the learning rate in
{0.01, 0.001, 0.0001}, momentum in {0, 0.9, 0.99}, and batch size in {32, 64, 128}. The learning rate
ablation is shown in Figure 3b; see Appendix D for the rest.
For the nonlinear experiments, we extended to the CIFAR10, MNIST, and CIFAR100 datasets.
We used SS and RR to train 3-layer 512 hidden unit MLPs with BN and ReLU activation for
T = 103 epochs, and also to finetune pretrained ResNet18 for T = 50 epochs. We consistently
observed that in the final stages of training (i.e., relatively small training risk), SS trained slower
than RR across all of the datasets, even after tuning the learning rate (see Figures 5 and 6).
5 Conclusion
This paper established that training BN networks with SS can lead to undesirable training behavior,
including slower convergence or even divergence of the GD risk. However, RR provably mitigates
this divergence behavior, and experimental evidence suggests that using RR usually converges
faster than SS. This separation in training behavior between SS, RR, and GD is because data
shuffling directly affects how BN operates on mini-batches. Our theoretical results establish a
separation for the special case where BN is applied to the input features. The more general
and realistic case where BN is applied to dynamically evolving layers is left as an important
14
01020304050Epoch104103102101100GD train risk01020304050Epoch103102101100GD train risk01020304050Epoch104103102101100GD train riskLR0.0010.0030.010.03ShufflingRRSSdirection for future work. We also observed in preliminary experiments that a similar separation
manifested for generalization, and we hope that adopting a similar perspective will prove fruitful
in pursuing this direction. One concrete path towards studying the implicit bias of shuffling
SGD and BN with dynamically evolving layers is to combine our techniques with those of
Cao et al. (2023). We remark that similar surprising phenomena may arise when using other
design choices that are implemented in a mini-batch fashion such as mixup (Zhang et al., 2017)
and Sharpness-Aware Minimization (SAM) (Foret et al., 2020). For these reasons, we generally
recommend that practitioners use RR instead of SS. Further future directions include establishing
directional convergence for homogeneous classifiers trained with shuffling SGD and theoretically
understanding conditions under which deeper networks diverge faster.
Acknowledgements
Part of the work was done while DW was an undergraduate at MIT. DW acknowledges support
from NSF Graduate Research Fellowship DGE-2146752. CY acknowledges support by Institute
of Information & communications Technology Planning & evaluation (IITP) grant (No. 2019-0-
00075, Artificial Intelligence Graduate School Program (KAIST)) funded by the Korea government
(MSIT). CY is also supported by the National Research Foundation of Korea (NRF) grants
(No. NRF-2019R1A5A1028324, RS-2023-00211352) funded by the Korea government (MSIT). CY
acknowledges support from a grant funded by Samsung Electronics Co., Ltd. SS acknowledge
support from an NSF CAREER grant (1846088), and NSF CCF-2112665 (TILOS AI Research
Institute). DW appreciates helpful discussions with Xiang Cheng, Sidhanth Mohanty, Erik Jenner,
Louis Golowich, Sam Gunn, and Thiago Bergamaschi.
References
Pankaj K. Agarwal, Leonidas J. Guibas, Sariel Har-Peled, Alexander Rabinovitch, and Micha
Sharir. Penetration depth of two convex polytopes in 3d. Nord. J. Comput., 7(3):227–240, 2000.
Kwangjun Ahn, Chulhee Yun, and Suvrit Sra. Sgd with shuffling: optimal rates without component
convexity and large epoch requirements. arXiv preprint arXiv:2006.06946, 2020.
Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch
normalization. arXiv preprint arXiv:1812.03981, 2018.
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint
arXiv:1607.06450, 2016.
Rémi Bardenet and Odalric-Ambrym Maillard. Concentration inequalities for sampling without
replacement. Bernoulli, 21:1361–1385, 2015.
Stephen Boyd, Stephen P Boyd, and Lieven Vandenberghe. Convex optimization. Cambridge
university press, 2004.
Yongqiang Cai, Qianxiao Li, and Zuowei Shen. A quantitative analysis of the effect of batch
normalization on gradient descent. In International Conference on Machine Learning, pages 882–890.
PMLR, 2019.
15
Yuan Cao, Difan Zou, Yuanzhi Li, and Quanquan Gu. The implicit bias of batch normal-
ization in linear models and two-layer linear convolutional neural networks. arXiv preprint
arXiv:2306.11680, 2023.
Jaeyoung Cha, Jaewook Lee, and Chulhee Yun. Tighter lower bounds for shuffling SGD: Random
permutations and beyond. arXiv preprint arXiv:2303.07160, 2023.
Hanseul Cho and Chulhee Yun. SGDA with shuffling: faster convergence for nonconvex-PŁ
minimax optimization. In International Conference on Learning Representations, 2023.
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning
and stochastic optimization. Journal of machine learning research, 12(7), 2011.
Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimiza-
tion for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020.
Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in
terms of optimization geometry. In International Conference on Machine Learning, pages 1832–1841.
PMLR, 2018.
Mert Gürbüzbalaban, Asuman Ozdaglar, Nuri Denizcan Vanli, and Stephen J Wright. Randomness
and permutations in coordinate descent methods. Mathematical Programming, 181:349–376, 2020.
Jeff Haochen and Suvrit Sra. Random shuffling beats sgd after finite epochs. In International
Conference on Machine Learning, pages 2624–2633. PMLR, 2019.
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the general-
ization gap in large batch training of neural networks. Advances in Neural Information Processing
Systems, 30, 2017.
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by
reducing internal covariate shift. In International conference on machine learning, pages 448–456.
PMLR, 2015.
Meena Jagadeesan, Ilya Razenshteyn, and Suriya Gunasekar. Inductive bias of multi-channel
linear convolutional networks with bounded weight norm. In Conference on Learning Theory,
pages 2276–2325. PMLR, 2022.
Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. arXiv
preprint arXiv:1810.02032, 2018.
Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In
Conference on Learning Theory, pages 1772–1798. PMLR, 2019.
Ziwei Ji and Matus Telgarsky. Directional convergence and alignment in deep learning. Advances
in Neural Information Processing Systems, 33:17176–17186, 2020.
Charles R Johnson. Matrix theory and applications, volume 40. American Mathematical Soc., 1990.
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint
arXiv:1412.6980, 2014.
16
Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. arXiv
preprint arXiv:1910.07454, 2019.
Zhiyuan Li, Kaifeng Lyu, and Sanjeev Arora. Reconciling modern deep learning with traditional
optimization analyses: The intrinsic learning rate. Advances in Neural Information Processing
Systems, 33:14544–14555, 2020.
Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks.
arXiv preprint arXiv:1906.05890, 2019.
Kaifeng Lyu, Zhiyuan Li, and Sanjeev Arora. Understanding the generalization benefit of
normalization layers: Sharpness reduction. Advances in Neural Information Processing Systems, 36,
2022.
Andreas Maurer. Concentration inequalities for functions of independent variables. Random
Structures & Algorithms, 29(2):121–138, 2006.
Boris Mityagin. The zero set of a real analytic function. arXiv preprint arXiv:1512.07276, 2015.
Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan
Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In Kama-
lika Chaudhuri and Masashi Sugiyama, editors, Proceedings of the Twenty-Second International
Conference on Artificial Intelligence and Statistics, volume 89 of Proceedings of Machine Learning
Research, pages 3420–3428. PMLR, 16–18 Apr 2019a. URL https://proceedings.mlr.press/
v89/nacson19b.html.
Mor Shpigel Nacson, Nathan Srebro, and Daniel Soudry. Stochastic gradient descent on separable
In Kamalika Chaudhuri and Masashi
data: Exact convergence with a fixed learning rate.
Sugiyama, editors, Proceedings of the Twenty-Second International Conference on Artificial Intelligence
and Statistics, volume 89 of Proceedings of Machine Learning Research, pages 3051–3059. PMLR,
16–18 Apr 2019b. URL https://proceedings.mlr.press/v89/nacson19a.html.
Dheeraj Nagaraj, Prateek Jain, and Praneeth Netrapalli. Sgd without replacement: Sharper rates
for general smooth convex functions. In International Conference on Machine Learning, pages
4703–4711. PMLR, 2019.
Lam M Nguyen, Quoc Tran-Dinh, Dzung T Phan, Phuong Ha Nguyen, and Marten van Dijk. A
unified convergence analysis for shuffling-type gradient methods. Journal of Machine Learning
Research, 22(207):1–44, 2021.
Shashank Rajput, Anant Gupta, and Dimitris Papailiopoulos. Closing the convergence gap of sgd
without replacement. In International Conference on Machine Learning, pages 7964–7973. PMLR,
2020.
Itay Safran and Ohad Shamir. How good is sgd with random shuffling? In Conference on Learning
Theory, pages 3250–3284. PMLR, 2020.
Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch
normalization help optimization? Advances in neural information processing systems, 31, 2018.
17
Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and
George E Dahl. Measuring the effects of data parallelism on neural network training. Journal of
Machine Learning Research, 20(112):1–49, 2019.
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.
Cecilia Summers and Michael J. Dinneen. Four things everyone should know to improve batch
In International Conference on Learning Representations, 2020. URL https://
normalization.
openreview.net/forum?id=HJx8HANFDH.
Ruoyu Sun, Zhi-Quan Luo, and Yinyu Ye. On the efficiency of random permutation for admm
and coordinate descent. Mathematics of Operations Research, 45(1):233–271, 2020.
MTCAJ Thomas and A Thomas Joy. Elements of information theory. Wiley-Interscience, 2006.
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing
ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
Ruosi Wan, Zhanxing Zhu, Xiangyu Zhang, and Jian Sun. Spherical motion dynamics: Learning
In A. Beygelzimer,
dynamics of normalized neural network using SGD and weight decay.
Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing
Systems, 2021. URL https://openreview.net/forum?id=RcbphT7qjTq.
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, pages 3635–3673. PMLR, 2020.
Lei Wu, Qingcan Wang, and Chao Ma. Global convergence of gradient descent for deep linear
residual networks. arXiv preprint arXiv:1911.00645, 2019.
Yuxin Wu and Justin Johnson. Rethinking" batch" in batchnorm. arXiv preprint arXiv:2105.07576,
2021.
Hongwei Yong, Jianqiang Huang, Deyu Meng, Xiansheng Hua, and Lei Zhang. Momentum batch
normalization for deep learning with small batch size. In European Conference on Computer Vision,
pages 224–240. Springer, 2020.
Chulhee Yun, Shankar Krishnan, and Hossein Mobahi. A unifying view on implicit bias in training
linear neural networks. In International Conference on Learning Representations, 2021a.
Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. Open problem: Can single-shuffle SGD be better than
reshuffling SGD and GD? In Conference on Learning Theory, pages 4653–4658. PMLR, 2021b.
Chulhee Yun, Shashank Rajput, and Suvrit Sra. Minibatch vs local sgd with shuffling: Tight
convergence bounds and beyond. In International Conference on Learning Representations, 2022.
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond
empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
Yi Zhou and Yingbin Liang. Characterization of gradient dominance and regularity conditions for
neural networks. arXiv preprint arXiv:1710.06910, 2017.
18
A Proofs for regression results
In this appendix, we provide the full details for the proof of convergence for SS and RR in the
regression case.
Additional notation. We introduce some additional notation which we will use throughout
the proof of Theorems 3.2.2 and 3.2.3. For a matrix A, we use Ai,: and A:,j to denote the ith
row and jth column of A, respectively. We also use Ai,j to denote the (i, j)th entry of A. The
Hadamard product of two matrices A, B ∈ Rm×n is denoted by A ⊙ B, with (A ⊙ B)i,j = Ai,jBi,j.
The diagonal operator diag : Rm×m → Rm×m is defined by diag(A) = I ⊙ A. We denote the
Frobenius inner product ⟨A, B⟩F = ∑i,j Ai,jBi,j and its induced norm by ∥A∥F.
i . For simplicity, we will often say the (i, k)th iterate to refer to Θk
Also recall from Section 2 that when Θ is optimized with SS or RR, the ith iterate on the kth
epoch is denoted by Θk
i . Denote
the collapsed parameter matrix defined in Section 3 by M ≜ W Γ. We will abuse notation and
≜ W k
sometimes denote the (i, k)th iterate by M k
i
i
Recall that the mini-batch risk used for updating the (i, k)th iterate of SS or RR is given by
(cid:13)
2
(cid:13)
(cid:13)
π ; Θk
L( f (X i+1
the kth epoch and X j
π ◦ X and π ◦ Y , respectively. Since this notation is a bit lengthy, we simplify it to L(X j
L( f (X j
M = W Γ, so we will sometimes abuse notation and write
Γk
i BN(X i+1
π )
where π denotes the permutation chosen for
π ∈ Rp×B consist of the (jB − B + 1, . . . , jB)th columns of
π; Θ) ≜
π) for any j ∈ [m]. Here, we can also view the mini-batch risk as a function of
) =
π ∈ Rd×B and Y j
π − W k
i
(cid:13)
(cid:13)Y i+1
(cid:13)
π; Θ), Y j
i ), Y i+1
Γk
i .
π
F
L(X j
(cid:13)
(cid:13)Y j
π; M ) ≜
(cid:13)
π; M ) ≜ −(Y j
(cid:13)
π − M BN(X j
(cid:13)
π)
(cid:13)
π))BN(X j
π − M BN(X j
F
2
,
π)⊤.
∇M L(X j
For SS, we work with a fixed permutation π ∈ Sn and input dataset (X, Y ). Recall that we
defined X π ≜ BNπ(X) from Section 3, i.e., the column-wise concatenation of all batches after
π )]. When the context of parameters Θ = (W , Γ)
batch normalization: X π = [BN(X 1
and permutation π ∈ Sn chosen by SS are clear, we denote the collection of outputs over the
dataset by ˆYπ ≜ W ΓX π. Also recall that the distorted SS risk Lπ(Θ) we set out to optimize is
defined to be Lπ(Θ) = Lπ(W , Γ) = (cid:13)
F. With M ≜ W Γ, we also abuse notation
and write
π) * * * BN(X m
(cid:13)Yπ − W ΓX π
(cid:13)
(cid:13)
2
Lπ(M ) ≜ (cid:13)
(cid:13)Yπ − M X π
(cid:13)
(cid:13)
2
F,
∇M Lπ(M ) ≜ −(Yπ − M X π)X
⊤
π .
We will use big–O notation throughout to simplify the presentation of the proofs. When we
(cid:13)
write O(ηt
(cid:13)F, and various
absolute constants defined explicitly below. These constants have at most polynomial dependence
on these parameters and absolute constants.
k) for some exponent t ≥ 1, we hide constants that depend on m,
(cid:13)
(cid:13)X π
A.1 Proof of convergence for SS
Let us first prove Theorem 3.2.2. First, we draw the reader's attention to some standard properties
in optimization theory that allow us to prove global convergence. We then sketch out the proof in
Appendix A.1.2 and flesh out the details in subsequent sections.
19
A.1.1 Optimization properties
It is profitable to keep in mind the general idea behind proving global convergence of SGD for
a function L(Θ), which has been exploited in Ahn, Yun, and Sra (2020); Nguyen, Tran-Dinh,
Phan, Nguyen, and van Dijk (2021); Zhou and Liang (2017). The following two properties of the
optimization problem are critical in such approaches:
Property 1 (Smoothness). G-smoothness of L, i.e., the gradients of L are G-Lipschitz. In particular,
it implies the following two standard properties:
(i) L(Θ) ≤ L(Θ′) + ⟨∇ΘL(Θ′), Θ − Θ′⟩ + G
2 ∥Θ′ − Θ∥2 for all Θ, Θ′ in the domain of L.
(ii) The Hessian H = ∇2
ΘL(Θ) satisfies ∥H∥2 ≤ G for all Θ in the domain of L.
Property 2 (PŁ condition). The loss function L satisfies the α-Polyak-Łojasiewicz condition, i.e.,
∥∇L(Θ)∥2 ≥ 2α(L(Θ) − L∗) for all Θ in the domain of L.
In our case, we can use global smoothness and strong convexity (which implies the PŁ
condition) of Lπ with respect to M = W Γ, but these global properties do not hold with respec
to our optimization variables Θ = (W , Γ). Importantly, unlike the analyses of Ahn, Yun, and
Sra (2020); Nguyen, Tran-Dinh, Phan, Nguyen, and van Dijk (2021), we cannot directly leverage
the global smoothness and strong convexity as is, because we do not directly perform gradient
updates on M . Instead, we effectively use a "dynamic" PŁ condition which depends on Γ. The
subtlety in the analysis is to show that such behavior can be controlled to ensure convergence in
the end.
Finally, a third property - which is often exploited to prove convergence results for linear
neural networks - is the notion of an (approximate) invariance property satisfied by the layers of
the neural network. Indeed, in the continuous time case, i.e., when we minimize Lπ(Θ(t)) with
gradient flow ̇Θ(t) = −∇ΘLπ(Θ(t)), such an invariance can be directly shown by the differential
equations, see Wu, Wang, and Ma (2019) for instance. To that end, define the following quantity
D ≜ I + diag(W ⊤W − Γ2),
(A.1)
which we refer to as the invariance matrix. For each iterate Θk
i can
also be naturally defined. In gradient flow, D(t) actually remains invariant with time t ∈ [0, ∞).
We quickly prove this property here, and later prove that an approximate version holds in the
discrete and stochastic case, although the bounds are messier.
i of SS, the corresponding Dk
Fact A.1.1. In the gradient flow formulation, we have d
and discrete time formulation, we have
dt D(t) = 0. Moreover, in both the gradient flow
Proof. For the proof, we write out the (full) gradients of Lπ with respect to W and Γ for reference:
diag(W ⊤∇W Lπ) = (∇ΓLπ)Γ.
(A.2)
∇W Lπ = −(Yπ − ˆYπ)X
∇ΓLπ = − diag(W ⊤(Yπ − ˆYπ)X
Γ,
⊤
π
⊤
π ).
(A.3)
(A.4)
A direct calculation shows that diag(W ⊤∇W Lπ) = (∇ΓLπ)Γ. Due to the gradient flow
Γ(t) = −∇ΓLπ, so it
dt W (t) = −∇W Lπ and d
dt
formulation ̇Θ(t) = −∇ΘLπ(Θ(t)) we have d
follows from Equation (A.2) that d
dt D(t) = 0.
20
We now formally state the smoothness and PŁ guarantees for our setup.
Lemma A.1.2 (Smoothness with respect to M ). The SS risk Lπ is Gπ–smooth with respect to
M = W Γ, where
Gπ ≜ (cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
2.
Proof. We directly check the Lipschitz gradient condition. Indeed, we have
(cid:13)∇M Lπ(M ) − ∇M Lπ(M ′)(cid:13)
(cid:13)
(cid:13)2
⊤
π − (Yπ − M ′X π)X
=
⊤
π
(cid:13)
(cid:13)
(cid:13)(Yπ − M X π)X
(cid:13)
(cid:13)(M − M ′)X πX
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
(cid:13)M − M ′(cid:13)
(cid:13)
(cid:13)2,
(cid:13)X π
≤ (cid:13)
⊤
π
(cid:13)
(cid:13)
=
2
2
(cid:13)
(cid:13)
(cid:13)2
Note that the same inequality holds (with the same value of Gπ) if we instead used the
Frobenius norm, due to the fact that ∥AB∥F ≤ ∥B∥2∥A∥F in the last line.
Lemma A.1.3 (Strong convexity with respect to M ). Under Assumption 1(a), SS risk Lπ is απ–strongly
convex with respect to M = W Γ, where
Hence, Lπ is also απ–PŁ with respect to M .
απ ≜ σmin(X πX
⊤
π ).
Proof. Take the Hessian of Lπ(M ) with respect to the vectorized version vec(M ) of M to
⊤
obtain ∇2
π ⊗ Ip, where ⊗ denotes the Kronecker product. Then evidently
vec(M )Lπ(M ) = X πX
⊤
π )Ip. Owing to Assumption 1(a), this proves the claim.
vec(M )Lπ(M ) ⪰ σmin(X πX
∇2
A.1.2 Proof sketch of convergence
Proof sketch of Theorem 3.2.2. The high level idea is this: we want to prove that Lπ(M k
π as
k → ∞. However, we will instead show the much stronger statement that Lπ(M k
π for all
i ∈ [m]. Our high level approach is heavily inspired by the proof strategies in Ahn et al. (2020);
Wu et al. (2019). Indeed, many of the technical lemmas in Appendix A.1.4 are analogous to ones
proved in Wu et al. (2019), and the motivation for unrolling shuffling mini-batch updates to an
epoch update with additional noise comes from Ahn et al. (2020).
i ) → L∗
0 ) → L∗
As a necessary ingredient of the proof, we will demonstrate that for sufficiently small chosen
ηk, we have an update equation that roughly looks like (modulo constants and noise terms)
Lπ(M k+1
i
) − L∗
π
≲ (1 − ηk)(Lπ(M k
i ) − L∗
π) + O(η2
k )
for all 0 ≤ i ≤ m − 1.
(A.5)
Remark A.1.4. Note that it is not necessarily the case that
Lπ(M k
i+1) − L∗
π
≲ (1 − ηk)(Lπ(M k
i ) − L∗
π) + O(η2
k )
That is, the SS excess risk Lπ does not necessarily "decrease" from one iterate to the next; however,
we can instead guarantee that the per-epoch progress bound (Equation (A.5)) holds for any fixed
iteration index i ∈ [m] after every epoch.
21
We impose an ordering relation on pairs (a, b) in the natural way: we say (a, b) ≤ (i, k) if k = b
and a ≤ i, or if b < k. This is just tracking whether the iteration index (a, b) (the ath iterate of the
bth epoch) is seen before the iterate (i, k). To complete the induction on an iterate (i, k + 1) we
need three inductive hypotheses L[a, b], D[a, b], and R[a, b] to hold for all (a, b) < (i, k + 1). We
define them formally below.
Hypothesis 1 (Loss stays bounded by an absolute constant). For all a, b satisfying 0 ≤ a ≤ m − 1
and b ≥ 1, the inductive property L[a, b] states Lπ(Θb
a) ≤ CL, for some appropriately chosen
absolute constant CL.
In particular, we can set CL ≜ max (cid:8)Lπ(Θ1
t ) : 0 ≤ t ≤ m − 1(cid:9). Since we only look at the loss
values for the first epoch, CL is indeed an absolute constant depending on π.
Hypothesis 2 (Loss satisfies one-epoch inequality). For all a, b satisfying 0 ≤ a ≤ m − 1 and b > 1,
the inductive property R[a, b] states that
Lπ(M b
a ) − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
(Lπ(M b−1
a
) − L∗
π) + O(η2
k ),
where the constant hidden in the O(η2
k ) does not depend on k.
Hypothesis 3 (Approximate invariances hold). For all a, b satisfying 0 ≤ a ≤ m − 1 and b ≥ 1, the
inductive property D[a, b] states that
(cid:40)
(cid:13)
(cid:13)Db
(cid:13)
a
(cid:13)
(cid:13)
(cid:13)2
≤
CD ∑b−1
CD ∑b
t=1 η2
t=1 η2
t ≤ 1
2
t ≤ 1
2
if a = 0,
otherwise,
where CD is an appropriately chosen absolute constant which does not depend on a or b.
Since the first iterate of the kth epoch Θk
0 is the same as the last iterate of the (k − 1)th epoch
m, the same convention applies to inductive hypotheses; for example, by L[m, k − 1] we mean
Θk
L[0, k].
In particular, the inductive hypotheses imply the following claims.
(i) By Corollary A.1.8, L[a, b] implies that
(cid:13)
(cid:13)M b
a
(cid:13)
(cid:13)2
≤ C1/2
L +∥Yπ∥F
⊤
π )
σmin(X
≜ ξ.
(ii) Also by Corollary A.1.8, D[a, b] and L[a, b] together imply that we have
2 + ξ)
2 + ξ). For the sake of notational convenience we will write Cw ≜
≤ d2( 1
(cid:13)
(cid:13)W b
a
(cid:13)
(cid:13)
2
2
and
(cid:113)
2
Γb
a
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2 + d2( 1
3
≤ 3
2 + d2( 1
2
2 + ξ), so that max
(cid:110)(cid:13)
(cid:13)W b
a
(cid:13)
(cid:13)2,
(cid:111)
(cid:13)
(cid:13)
(cid:13)
Γb
a
(cid:13)
(cid:13)
(cid:13)2
≤ Cw.
(iii) By Corollary A.1.13, D[a, b] implies that σmin(Γb
a)2 ≥ 1/2.
(iv) By Proposition A.1.23, if R[a, b] holds for all (a, b), then for appropriately chosen ηk, the risk
Lπ(M b
a ) converges to L∗
π at a sublinear rate.
We will explain at a high level how these statements together allow us to conclude that
L[i, k + 1], D[i, k + 1], and R[i, k + 1] hold. The idea, as in Ahn, Yun, and Sra (2020), is to
accumulate the gradient updates in each epoch and isolate the signal and noise components of
each gradient update. For clarity of exposition, we assume for now that i = 0. Here are a couple
subtleties which we spell out explicitly, including how to generalize to i > 0.
22
• We are not directly performing gradient updates on M ; we instead perform gradient updates
on W and Γ. Nevertheless, the effective gradient signal for M can still be extracted, and
we term the remaining noise the mismatched gradient noise. For every iterate (j, k), this will
formally be denoted by qk
j .
• We are not taking a full batch gradient step from M k
. Rather, we are taking
mini-batch updates which induce path dependency. Nevertheless, as previous works have
shown, even at iterate (j, k), we can still extract the full-batch gradient signal evaluated at
M k
0 , and we term the remaining noise the path dependent noise. For every iterate (j, k), this
will formally be denoted by ek
j .
0 to M k+1
0
• If i > 0, then the stepsize changes from ηk to ηk+1 in the middle of our pass through the
entire dataset. Nevertheless, it's not hard to see that this noise should be relatively small, of
k ), as ηk = Ω(1/k). We will call this the stepsize noise, the
order ηk+1 − ηk - which is O(η2
accumulation of which for an epoch update starting from iterate (i, k) to (i, k + 1) will be
denoted by s(i,k)
(i,k+1).
We can accumulate these noise terms across the update across epoch k to form a composite
0 will be denoted by ̃gk. We
0 ) because we only perform direct gradient updates on the
noise term rk. The full-batch update signal for M starting from M k
emphasize that ̃gk ̸= ∇M Lπ(M k
component layers W and Γ. Then as we will show in Appendix A.1.3, we can write
M k+1
0 = M k
0 − ηk ̃gk + η2
k rk.
(A.6)
Next, as seen in Lemma A.1.2, Lπ is globally Gπ–smooth with respect to M for some absolute
constant Gπ which depends on π. Thus, using the smoothness inequality as in Property 1, we
obtain
Lπ(M k+1
0
) − Lπ(M k
0 ) ≤
(cid:68)
∇M Lπ(M k
0 ), M k+1
0 − M k
0
(cid:69)
+
F
Gπ
2
(cid:13)
(cid:13)M k+1
(cid:13)
0 − M k
0
(cid:13)
(cid:13)
(cid:13)
2
F
.
The main idea is that we have the following inequality (proved in Lemma A.1.14) that shows
0 ), it is nonetheless correlated to the "correct" gradient update
that even though ̃gk ̸= ∇M Lπ(M k
∇M Lπ(M k
0 ):
(cid:68)
∇M Lπ(M k
0 ), ̃gk(cid:69)
F
≥ σmin(Γk
0)2(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
≥
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
,
1
2
due to the inductive hypothesis D[0, k].
For the stated stepsizes ηk, one can then plug in the gradient update Equation (A.6) and
massage the inequalities a bit to obtain that
Lπ(M k+1
0
) − Lπ(M k
0 ) ≤ −
ηk
4
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
+ O(η2
k ),
(A.7)
where the constant hidden by the big–O notation is poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
).
We now use απ-strong convexity of Lπ with respect to M (and hence απ-PŁ) shown in
Lemma A.1.3 to obtain
Lπ(M k+1
0
) − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
23
(Lπ(M k
0 ) − L∗
π) + O(η2
k ).
(A.8)
Note that this is precisely the statement of R[0, k + 1].
Provided that we can appropriately bound the noise terms rk to get the asserted O(η2
k ) term
above, this will imply R[0, k + 1]. For sufficiently small stepsizes ηk, we can also use Equation (A.8)
to prove L[0, k + 1].
≤
On the other hand, to prove D[0, k + 1], we can directly bound the update
k ) and combine this with the inductive hypothesis D[m − 1, k] using the triangle inequality. If
k < ∞, so the absolute constant CD can be
O(η2
the stepsize ηk = O(1/kβ) for 1/2 < β < 1, then ∑k≥1 η2
≤ 1
2 .
picked such that
0 − Dk
(cid:13)
(cid:13)Dk+1
(cid:13)
m−1
0
Hence, R[0, k], as stated in Equation (A.8), holds for all k by induction. We can thus unroll the
π under the stated stepsize assumptions, as
0 ) converges to L∗
(cid:13)
(cid:13)
(cid:13)2
inequality and conclude that Lπ(M k
desired.
(cid:13)
(cid:13)Dk+1
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
We now outline the structure of the proceeding sections, which fill in the details of the above
proof sketch. In Appendix A.1.3, we explicitly write out the accumulation of gradient updates
across an entire epoch, decomposing into signal and noise components. In Appendix A.1.4,
we prove some technical lemmas controlling the singular values and norms of various weight
matrices and gradients via the approximate invariance matrix D and the inductive hypotheses. In
Appendix A.1.5 we leverage the norm bounds developed in Appendix A.1.4 to demonstrate that
the accumulated noise terms defined in Appendix A.1.3 are negligible. Using these results, we
are able to establish the R[i, k + 1] and L[i, k + 1] in Appendix A.1.6. We then turn to bounding
the approximate invariances to establish D[i, k + 1] in Appendix A.1.7. The stray details of the
induction are spelled out in Appendix A.1.8.
A.1.3 Rewriting SS epoch gradient updates
To show that L[0, k + 1] holds, we need to accumulate gradients from M k
First, we look at a single iterate update. For every j < m we have
0 to M k+1
0
M k
j+1 = (W k
= M k
j − ηk∇W L(X j+1
j − ηkgk
j + η2
k qk
j ,
π ; Θk
j ))(Γk
j − ηk∇ΓL(X j+1
π ; Θk
j ))
where we have defined
gk
j
≜ ∇W L(X j+1
π ; Θk
j )Γk
j + W k
j ∇ΓL(X j+1
π ; Θk
j ),
.
(A.9)
(A.10)
(A.11)
which is the gradient of the (j + 1)th batch of X π evaluated on the jth iterate on epoch k, and
qk
j
≜ ∇W L(X j+1
π ; Θk
j )∇ΓL(X j+1
π ; Θk
j ),
(A.12)
which is the mismatched gradient noise term associated with the fact that we performed gradient
updates on W and Γ rather than M directly.
The key observation here is that
j = ∇M L(X j+1
gk
π ; M k
j )(Γk
j )2 + W k
j diag((W k
j )⊤∇M L(X j+1
π ; M k
j )).
In other words, gk
to M through the "interaction terms" Γk
j is correlated to the "true" mini-batch gradient ∇M L(X j+1
j and W k
j .
π ; M k
j ) with respect
24
We show in Lemma A.1.16 that we can control the size of the noise terms qk
j which arise
from the fact that we are not truly taking gradient updates with respect to M . More specifically,
Lemma A.1.16 implies that
= O(1).
(cid:13)
(cid:13)
(cid:13)qk
j
(cid:13)
(cid:13)
(cid:13)F
Next, we actually accumulate gradients. The main obstacle we have to deal with is that the
mini-batch updates prevent the gradient accumulation from being exactly equal to the full-batch
update starting at M k
0 . Inspired by the approach in Ahn et al. (2020, Theorem 1), we separate out
j into a signal term ̃gk
the gradient update gk
j . Specifically, we write
j and noise term ek
M k
j+1 = M k
j − ηk ̃gk
j + η2
k ek
j + η2
k qk
j ,
(A.13)
where
0)Γk
is the signal of the gradient update of the (j + 1)th batch evaluated with parameter values Θk
0
(instead of Θk
0 + W k
π ; Θk
π ; Θk
≜ ∇W L(X j+1
0 ∇ΓL(X j+1
(A.14)
0),
̃gk
j
j ) and
≜
ek
j
̃gk
j − gk
j
ηk
.
(A.15)
In particular, in Lemma A.1.18 below we show that
(cid:13)
(cid:13)
(cid:13)ek
j
is negligible with respect to the true gradient signal.
(cid:13)
(cid:13)
(cid:13)F
= O(1), so that indeed the noise term
Taking this as given for now, when we accumulate the gradient updates across epoch k, we see
that we can define
̃gk ≜
m−1
∑
j=0
so that the accumulation reads
j = ∇W Lπ(Θk
̃gk
0)Γk
0 + W k
0 ∇ΓLπ(Θk
0),
M k+1
0 = M k
0 − ηk ̃gk + η2
k
(ek
j + qk
j )
m−1
∑
j=0
k rk,
= M k
0 − ηk ̃gk + η2
where we have additionally defined the composite noise term:
rk ≜
m−1
∑
j=0
(ek
j + qk
j ),
(A.16)
(A.17)
(A.18)
(A.19)
Note that if we instead start from i > 0, then the composite noise term rk will have an additional
noise term s(i,k)
(i,k+1), which we will address in Appendix A.1.5. In particular, we show there that the
norm of s(i,k)
(i,k+1) is O(1). Combining this with Lemmas A.1.16 and A.1.18, we can conclude that
(cid:13)rk(cid:13)
(cid:13)
= O(1).
(cid:13)F
A.1.4 Norm and singular value bounds based on approximate invariances
In this section, we prove several helper lemmas which help us bound noise terms in Appendix A.1.5
and the approximate invariances in Appendix A.1.7.
25
Upper bounds on the norms of W and Γ. Much of Wu, Wang, and Ma (2019) is dedicated
towards showing that the approximate invariances control the weight norms. The trouble with
directly extending their strategy lies in the fact that in our setting the invariance D is diagonal,
which complicates the process of bounding various matrix norms. We first state the following
technical lemma which involves the operator norm of Hadamard products.
Lemma A.1.5 (3.1f in Johnson (1990)). Let A, B ∈ Rd×d be matrices such that A is positive definite.
Then ∥A ⊙ B∥2 ≤ ∥A∥2∥B∥2
We leverage Lemma A.1.5 to prove the following useful helper lemma that relates bounds on
(cid:13)I ⊙ W ⊤W (cid:13)
(cid:13)
(cid:13)2 to ∥W ∥2.
(cid:13)I ⊙ W ⊤W (cid:13)
(cid:13)
(cid:13)2
(cid:13)I ⊙ W ⊤W (cid:13)
(cid:13)
≤ β2.
(cid:13)2
≤ β, where W ∈ Rp×d. Then ∥W ∥2 ≤ (cid:112)dβ. Conversely, if
Lemma A.1.6. Suppose
∥W ∥2 ≤ β, then
:,2W:,2, . . . , W ⊤
Proof. Note that I ⊙ W ⊤W is a diagonal matrix with diagonal entries W ⊤
where W:,i denotes the ith column of W . Hence Tr(cid:0)I ⊙ W ⊤W (cid:1) = ∥W ∥2
F ≤ dβ
(or tighter by replacing d with the rank of W ), from which it follows that ∥W ∥2 ≤ (cid:112)dβ. For the
other direction, we set A = I and B = W ⊤W in Lemma A.1.5, so
2 ≤ β2,
as desired.
(cid:13)I ⊙ W ⊤W (cid:13)
(cid:13)
(cid:13)2
F. Hence ∥W ∥2
:,1W:,1, W ⊤
≤ ∥W ∥2
:,dW:,d,
With Lemma A.1.6 in hand, we prove the following technical lemma which gives a uniform
bound on the norms of Γ and W based on ξ = ∥W Γ∥2.
Lemma A.1.7. If ∥D∥2 ≤ ε < 1 and ∥W Γ∥2 ≤ ξ, we have
∥W ∥2 ≤ d
(cid:112)
1 − ε + ξ,
and
(cid:13)Γ2(cid:13)
(cid:13)
(cid:13)2
Proof. We have from ∥W Γ∥2 ≤ ξ that
≤ 1 + ε + d2(1 − ε + ξ).
Next, our hypothesis that ∥D∥2 = (cid:13)
(cid:13)
(cid:13)
≤ ξ2.
(cid:13)W Γ2W ⊤(cid:13)
(cid:13)
(cid:13)2
(cid:13)I + diag(W ⊤W ) − Γ2(cid:13)
(cid:13)2
≤ ε implies that
W Γ2W ⊤ ⪰ W ((1 − ε)I + diag(W ⊤W ))W ⊤.
Taking norms of both sides and applying the reverse triangle inequality, we obtain that
ξ2 ≥
(cid:13)
(cid:13)
(cid:13)W diag(W ⊤W )W ⊤(cid:13)
(cid:13)
(cid:13)2
− (1 − ε)∥W ∥2
2.
(cid:13)W diag(W ⊤W )W ⊤(cid:13)
(cid:13)
We now lower bound
Note here that diag(W ⊤W )i,i = ∥W:,i∥2
(cid:13)2. In particular, we expand out the matrix product.
2. Thus we can write W diag(W ⊤W )W ⊤ as
∥W:,1∥2
2
W:,1 W:,2
* * * W:,d
∥W:,2∥2
2
. . .
∥W:,d∥2
2
26
W ⊤
:,1
W ⊤
:,2
...
W ⊤
:,d
,
from which we observe that the ith diagonal entry of W diag(W ⊤W )W ⊤ is
(W diag(W ⊤W )W ⊤)i,i =
d
∑
j=1
(cid:13)
(cid:13)W:,j
(cid:13)
(cid:13)
2
2W2
i,j.
(cid:12)
It follows that Tr(cid:0)W diag(W ⊤W )W ⊤(cid:1) = ∑d
(cid:12) (the RHS
is also known as the max norm). For our case we set A = W diag(W ⊤W )W ⊤ and note that the
diagonal is nonnegative. So in fact in our case we obtain
4
2. Note that ∥A∥2 ≥ maxi,j
(cid:13)
(cid:13)W:,j
(cid:12)
(cid:12)Ai,j
j=1
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)W diag(W ⊤W )W ⊤(cid:13)
(cid:13)
(cid:13)2
≥
1
d
d
∑
j=1
(cid:13)
(cid:13)W:,j
(cid:13)
(cid:13)
4
2.
Now notice that ∑j
find that
(cid:13)
(cid:13)W:,j
(cid:13)
(cid:13)
4
2
= ∑j(∑i W2
i,j)2. Applying Cauchy-Schwarz to the outer sum we
(cid:13)
(cid:13)W:,j
(cid:13)
(cid:13)
4
2
≥
∑
j
i,j)2
(∑j ∑i W2
d
,
but the RHS is equal to ∥W ∥4
F. Since ∥W ∥F ≥ ∥W ∥2, we conclude that
(cid:13)W diag(W ⊤W )W ⊤(cid:13)
(cid:13)
(cid:13)2
∥W ∥4
2
d2
(cid:13)
(cid:13)
≥
.
In summary, we have
∥W ∥4
2
d2
− (1 − ε)∥W ∥2
2 − ξ2 ≤ 0.
Applying the quadratic formula, we find that
∥W ∥2 ≤ d
(cid:112)
1 − ε + ξ.
For the bound on ∥Γ∥2, we start from the definition of D and apply the reverse triangle
inequality to obtain
so we obtain
where we used
follows.
(cid:13)I ⊙ W ⊤W (cid:13)
(cid:13)
(cid:13)2
(cid:12)
(cid:12)
(cid:12)1 +
(cid:13)
(cid:13)diag(W ⊤W )
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
− (cid:13)
(cid:13)Γ2(cid:13)
(cid:13)2
(cid:12)
(cid:12)
(cid:12) ≤ ε,
(cid:13)Γ2(cid:13)
(cid:13)
(cid:13)2
≤ ∥W ∥2
≤ 1 + ε + ∥W ∥2
2,
2 from Lemma A.1.6. From this, the conclusion directly
Under the inductive hypotheses, Lemma A.1.7 implies that we can uniformly bound max
This is spelled out in the following corollary.
Corollary A.1.8 (Norms stay bounded). Suppose that L[j, k] and D[j, k] hold. Define
(cid:110)(cid:13)
(cid:13)
(cid:13)W k
j
(cid:13)
(cid:13)
(cid:13)2
,
(cid:13)
(cid:13)
(cid:13)
Γk
j
(cid:111)
.
(cid:13)
(cid:13)
(cid:13)2
Cw ≜
(cid:115)
3
2
+ d2
(cid:19)
,
+ ξ
(cid:18) 1
2
with
ξ ≜ C1/2
L + ∥Yπ∥F
σmin(X
⊤
π )
.
27
Here CL was defined in Hypothesis 1. Then
and
(cid:13)
(cid:13)M k
(cid:13)
j
(cid:13)
(cid:13)
(cid:13) ≤ ξ,
max
(cid:110)(cid:13)
(cid:13)W k
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
,
(cid:13)
(cid:13)
(cid:13)
Γk
j
(cid:13)
(cid:13)
(cid:13)2
(cid:111)
≤ Cw.
Proof. We have by triangle inequality that
(cid:13)
(cid:13)M k
(cid:13)
j X π
(cid:13)
(cid:13)
(cid:13)2
≤
(cid:13)
(cid:13)M k
(cid:13)
j X π
(cid:13)
(cid:13)
(cid:13)F
≤
(cid:13)
(cid:13)Yπ − M k
(cid:13)
j X π
(cid:13)
(cid:13)
(cid:13)F
+ ∥Yπ∥F ≤ Lπ(M k
j )1/2 + ∥Yπ∥F.
Since L[j, k] holds, we have have
(cid:13)
(cid:13)
(cid:13)M k
obtain
≥ σmin(X
(cid:13)
(cid:13)
(cid:13)M k
j X π
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)2
⊤
π )
j
(cid:13)
(cid:13)
(cid:13)Yπ − M k
j X π
(cid:13)
(cid:13)
(cid:13)
2
F
≤ CL. Furthermore, as n ≥ d, we know that
and by Item Assumption 1(a) we have σmin(X
⊤
π ) > 0. Hence we
(cid:13)
(cid:13)M k
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
≤
C1/2
⊤
π )
L + ∥Yπ∥F
σmin(X
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)M k
j
= ξ.
It follows that ξ works as a bound on
holds by assumption, this means that the hypothesis on Dk
all the hypotheses of Lemma A.1.7 are satisfied. We can thus conclude that
for the application of Lemma A.1.7. Since D[j, k]
j is satisfied with ε = 1/2. In summary,
max
(cid:110)(cid:13)
(cid:13)W k
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
,
(cid:13)
(cid:13)
(cid:13)
Γk
j
(cid:13)
(cid:13)
(cid:13)2
(cid:111)
≤ Cw,
as desired.
The importance of these upper bounds on weight norms is that they allow us to upper bound
the norms of gradients of L with respect to various parameters.
Upper bounding the norms of gradients. The following lemma gives an upper bound on the
norms of various gradients.
Lemma A.1.9. For any a ∈ [m] and Θ = (W , Γ) we have
∥∇W L(X a
∥∇ΓL(X a
∥∇M L(X a
π; Θ)∥2
π; Θ)∥2
π; M )∥2
F ≤ ∥Γ∥2
F ≤ ∥W ∥2
F ≤ ∥BN(X a
2∥BN(X a
2∥BN(X a
π)∥2
π)∥2
π)∥2
2L(X a
2L(X a
2L(X a
π; M )
π; Θ)
π; Θ)
Proof. First, we have by definition
L(X a
π; Θ) = ∥W ΓBN(X a
π) − Y a
π ∥2
F.
Hence, the mini-batch gradients can be computed explicitly as
∇M L(X a
∇W L(X a
∇ΓL(X a
π; M ) = −(Y a
π; Θ) = ∇M L(X a
π; Θ) = diag(W ⊤∇M L(X a
π − M BN(X a
π; M )Γ,
π; M )).
π))BN(X a
π)⊤,
(A.20)
(A.21)
(A.22)
28
Since L(X a
π; M ) = ∥Y a
π − M BN(X a
π)∥2
F and ∥AB∥F ≤ ∥A∥2∥B∥F, Equation (A.20) gives
∥∇M L(X a
π; M )∥2
F ≤ ∥BN(X a
π)∥2
2L(X a
π; M ).
It thus follows from Equation (A.21) that
∥∇W L(X a
π; Θ)∥2
F ≤ ∥Γ∥2
2∥∇M L(X a
π; Θ)∥2
F ≤ ∥Γ∥2
2∥BN(X a
π)∥2
2L(X a
π; Θ).
Similarly, inspecting Equation (A.22), since ∥diag(A)∥2
F ≤ ∥A∥2
F, we have
∥∇ΓL(X a
π; Θ)∥2
F ≤
(cid:13)
(cid:13)W ⊤∇M L(X a
(cid:13)
π; Θ)
(cid:13)
(cid:13)
(cid:13)
2
F
≤ ∥W ∥2
2∥BN(X a
π)∥2
2L(X a
π; Θ).
As a consequence of Corollary A.1.8, under the inductive hypotheses we can also bound the
gradient norms by absolute constants.
Corollary A.1.10. Assume D[j, k] and L[j, k] hold. Then, for any a ∈ [m], we have
(cid:13)
(cid:13)∇M L(X a
(cid:13)
(cid:13)
(cid:13)∇W L(X a
(cid:13)
(cid:13)
(cid:13)∇ΓL(X a
(cid:13)
π; M k
j )
π; Θk
j )
π; Θk
j )
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2
F
2
F
2
F
≤ CL∥BN(X a
π)∥2
2,
≤ C2
wCL∥BN(X a
π)∥2
2,
≤ C2
wCL∥BN(X a
π)∥2
2,
where Cw was previously defined in Corollary A.1.8.
We now turn from upper bounds to lower bounds. The crux here is to start with bounding
the minimum singular value of Γ away from zero. This in turns allows us to lower bound the
correlation between ̃gk and ∇M Lπ(M k
0 ) away from zero. As we will see, we can also show similar
correlation lower bounds for the cases i > 0.
Bounding the minimum singular value of Γ2.
i ) away from zero, we
need to show that the approximate invariances prevent Γ from vanishing on any coordinate. To
do so, we appeal to an alternate formulation of the Courant-Fisher theorem for singular values,
which we restate below for completeness.
In order to bound σmin(Γk
Theorem A.1.11 (Courant-Fisher). Let A, B ∈ Rm×n. Then |σk(A) − σk(B)| ≤ ∥A − B∥2 for
k ∈ [min{m, n}].
With this in mind, we formally prove that the minimum singular value of Γ2 is bounded away
from zero.
Lemma A.1.12. Suppose that ∥D∥2 = (cid:13)
(cid:13)I + diag(W ⊤W − Γ2)(cid:13)
(cid:13)2
≤ ε. Then we have
σmin(Γ2) ≥ 1 − ε.
29
Proof. Setting A ≜ I + diag(W ⊤W ) and B ≜ Γ2 in Courant-Fisher yields
(cid:12)
(cid:12)σd(I + diag(W ⊤W )) − σd(Γ2)
(cid:12)
(cid:12)
(cid:12)
(cid:12) ≤
(cid:13)
(cid:13)
(cid:13)I + diag(W ⊤W ) − Γ2(cid:13)
(cid:13)
(cid:13)2
.
Since the RHS is just D, we obtain that
σmin(Γ2) ≥ 1 + σmin(diag(W ⊤W )) − ∥D∥2.
The conclusion easily follows.
Under the inductive hypothesis D[i, k], i.e.
(cid:13)
(cid:13)Dk
2 , this immediately implies the following
i
corollary. We will see in the following section (in Corollary A.1.15) that this minimum singular
value bound for Γk
i can be interpreted in the following manner. Although the effective PŁ condition
evolves dynamically, the associated PŁ constant always stays bounded away from zero.
≤ 1
(cid:13)
(cid:13)2
Corollary A.1.13 (PŁ bounded away from zero). Assume D[i, k] holds. Then we have
σmin(Γk
i )2 ≥
1
2
.
The accumulated gradient signal is correlated with the full-batch gradient signal.
Lemma A.1.14 (Correlation of ̃gk and ∇M Lπ(M k
0 )). For all k, we have
(cid:68)
∇M Lπ(M k
0 ), ̃gk(cid:69)
F
Proof. Recall that we previously defined
≥ σmin(Γk
0)2(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
.
̃gk ≜ ∇W Lπ(Θk
0)Γk
0 + W k
0 ∇ΓLπ(Θk
0).
Note that if we have A, Λ ∈ Rn×n, with Λ = diag(λ1, . . . , λn) a diagonal matrix with nonnegative
entries, then
⟨A, AΛ⟩F =
(cid:68)
AΛ1/2, AΛ1/2(cid:69)
(cid:13)
(cid:13)
(cid:13)AΛ1/2(cid:13)
(cid:13)
(cid:13)
2
F
=
F
≥ min
i
λi∥A∥2
F.
Also, we have
⟨A, diag(A)⟩F = ⟨diag(A), diag(A)⟩F = ∥diag(A)∥2
Hence combining Equations (A.20) and (A.22) and the above inequalities, we have
F ≥ 0.
(cid:68)
∇M Lπ(M k
0 ), ̃gk(cid:69)
(cid:68)
=
F
(cid:68)
=
∇M Lπ(M k
0 ), ∇W Lπ(Θk
0)Γk
0
(cid:69)
(cid:68)
+
∇M Lπ(M k
∇M Lπ(M k
F
(cid:69)
0 ), W k
0 ), ∇M Lπ(M k
F
0 ∇ΓLπ(Θk
0)
0)2(cid:69)
F
0 )⊤∇M Lπ(M k
0 ), diag((W k
(cid:13)
2
(cid:13)
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
0 )(Γk
.
F
(cid:68)
+
(W k
0)2(cid:13)
≥ σmin(Γk
0 )⊤∇M Lπ(M k
0 ))
(cid:69)
F
30
We obtain the following corollary of the above lemma and Corollary A.1.13.
Corollary A.1.15. Assume D[0, k] holds. We have
0 ), ̃gk(cid:69)
∇M Lπ(M k
(cid:68)
F
≥
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
.
1
2
More generally, assume D[i, k] holds. We have
(cid:68)
∇M Lπ(M k
i ), ̃g(i,k)(cid:69)
≥
F
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
i )
(cid:13)
(cid:13)
(cid:13)
2
F
,
1
2
(A.23)
(A.24)
where ̃g(i,k) is the analogous quantity to ̃gk for accumulating gradients starting at iterate (i, k) rather than
(0, k). It is defined more formally in Eq. (A.26).
A.1.5 Bounding noise terms
We now turn to bounding the composite noise term rk. This is crucial to ensure the global
convergence via Equation (A.8) and also to control the approximate invariances.
Mismatched gradient noise is negligible. As promised, we show that the mismatched gradient
noise terms qk
j are negligible when we accumulate gradients from M k
0 to M k+1
.
0
Lemma A.1.16. Assume that L[j, k] and D[j, k] hold for j < m. Then we have
Furthermore, for any t < m we have
(cid:13)
(cid:13)qk
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)F
≤ C2
wCL
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
2
2
.
t
∑
j=0
(cid:13)
(cid:13)qk
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)F
≤ C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
Proof. Recall the definition of qk
j , reproduced here for reference:
qk
j
≜ ∇W L(X j+1
π ; Θk
j )∇ΓL(X j+1
π ; Θk
j ).
Since L[j, k] and D[j, k] hold for (j, k), we can apply Corollary A.1.10 to conclude that
(cid:13)
(cid:13)qk
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)F
≤ C2
wCL
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
2
2
.
Since the inductive hypotheses hold for every j < m, when we accumulate the noise terms
from (0, k) to (t, k), we can apply the above bound to conclude that
t
∑
j=0
(cid:13)
(cid:13)qk
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)F
≤
t
∑
j=0
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
2
2
C2
wCL
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
2
F
≤ C2
wCL
= C2
wCL
m−1
∑
j=0
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F,
where the last equality used the definition of X π.
31
Path dependent noise arising from mini-batch updates is negligible.
In order to bound the
noise term coming from mini-batch updates, we first prove the following auxiliary lemma that
shows that the iterates don't move far within an epoch.
Lemma A.1.17. Fix t ≤ m and assume D[j, k] and L[j, k] hold for all j < t. Then we have
(cid:13)
(cid:13)W k
(cid:13)
t − W k
0
(cid:13)
(cid:13)
(cid:13)2
≤
√
tηkCwC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F.
The same inequality holds true if we replace W with Γ.
We also have
(cid:13)
(cid:13)M k
(cid:13)
t − M k
0
(cid:13)
(cid:13)
(cid:13)2
√
≤ 2
tηkC2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
Proof. We have by definition that
+ η2
k C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
W k
t = W k
0 − ηk
t−1
∑
j=0
∇W l(X j+1
π ; Θk
j ).
Now, we have
(cid:13)
(cid:13)W k
(cid:13)
t − W k
0
(cid:13)
(cid:13)
(cid:13)2
≤ ηk
t−1
∑
j=0
(cid:13)
(cid:13)∇W l(X j+1
(cid:13)
π ; Θk
j )
(cid:13)
(cid:13)
(cid:13)2
≤ ηkCwC1/2
L
t
(cid:13)
∑
(cid:13)BN(X j+1
(cid:13)
π )
j=0
(cid:13)
(cid:13)
tηkCwC1/2
(cid:13)X π
(cid:13)F
L
(cid:13)
(cid:13)
(cid:13)2
√
≤
where in the first line we have applied the triangle inequality, in the second line we have applied
Corollary A.1.10, and in the last line we have applied Cauchy-Schwarz.
The same proof holds for Γ.
For M , Equation (A.10) gives
M k
t = M k
0 − ηk
t−1
∑
j=0
gk
j + η2
k
t−1
∑
j=0
qk
j .
Combining Eq. (A.11) and Corollaries A.1.8 and A.1.10 yields
(cid:13)
(cid:13)gk
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
≤
(cid:13)
(cid:13)
(cid:13)
Γk
j
≤ 2C2
(cid:13)
(cid:13)
(cid:13)2
wC1/2
L
(cid:13)
(cid:13)∇W L(X j+1
(cid:13)
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
π ; Θk
j )
(cid:13)
(cid:13)
(cid:13)2
.
(cid:13)
(cid:13)
(cid:13)2
+
(cid:13)
(cid:13)W k
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)∇ΓL(X j+1
(cid:13)
π ; Θk
j )
(cid:13)
(cid:13)
(cid:13)2
Hence, summing up over j, using Cauchy-Schwarz, and applying the noise bound Lemma A.1.16,
it follows that
(cid:13)
(cid:13)M k
(cid:13)
t − M k
0
(cid:13)
(cid:13)
(cid:13)2
√
≤ 2
tηkC2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
+ η2
k C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
Now we show that the noise term
(cid:13)
(cid:13)
(cid:13)ek
j
(cid:13)
(cid:13)
(cid:13)2
is O(1).
32
Lemma A.1.18. If L[j, k] and D[j, k] both hold for all j < m then we have for each j that
(cid:13)
(cid:13)ek
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
(cid:112)
≤ 4
jC2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
(C1/2
L + C2
w
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + O(ηk).
Hence, we also have
m−1
∑
i=0
(cid:13)
(cid:13)ek
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
≤ 4m3/2C2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
(C1/2
L + C2
w
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + O(ηk).
Proof. Inspecting the definition of ek
j (Eq. (A.15)), let us bound the quantity
ηkek
j = ∇W L(X j+1
π ; Θk
(cid:124)
π ; Θk
j )Γk
j
(cid:125)
0)Γk
0 − ∇W L(X j+1
(cid:123)(cid:122)
(I)
π ; Θk
0) − W k
(cid:123)(cid:122)
(II)
j ∇ΓL(X j+1
π ; Θk
j )
(cid:125)
.
0 ∇ΓL(X j+1
+ W k
(cid:124)
First, we have by triangle inequality and the identity Equation (A.21) that the norm of (I) is at
most
≤
(cid:13)
(cid:13)
(cid:13)
(cid:13)
0 − ∇W L(X j+1
(cid:13)∇W L(X j+1
π ; Θk
0)Γk
(cid:13)
(cid:13)
(cid:13)∇W L(X j+1
0)Γk
π ; Θk
(cid:13)
+
(cid:13)
(cid:13)∇M L(X j+1
j − Γk
0(Γk
Γk
(cid:13)
0)
(cid:13)
(cid:13)
(cid:13)
(cid:13)∇M L(X j+1
π ; M k
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)∇M L(X j+1
0(Γk
j − Γk
Γk
(cid:13)
0)
(cid:32)
(cid:13)
(cid:13)
(cid:13)2
π ; Θk
0)Γk
π ; Θk
j
j − ∇W L(X j+1
π ; M k
0 )
0 − ∇M L(X j+1
π ; M k
0 )
0 )Γk
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)2
j )Γk
Γk
j
(cid:13)
(cid:13)
(cid:13)
≤
+
j
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)∇M L(X j+1
(cid:13)
+
(cid:13)
(cid:13)
(cid:13)
Γk
j
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)2
π ; M k
0 )Γk
0 − ∇M L(X j+1
π ; M k
0 )Γk
j
(cid:13)
(cid:13)
(cid:13)2
π ; M k
j )Γk
j
(cid:13)
(cid:13)
(cid:13)2
j − ∇M L(X j+1
π ; M k
j )Γk
j
+
0 )Γk
π ; M k
(cid:13)
(cid:13)∇M L(X j+1
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)∇M L(X j+1
j − Γk
Γk
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)
2
(cid:13)∇M L(X j+1
0 ) − ∇M L(X j+1
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
π ; M k
(cid:13)
(cid:13)
(cid:13)2
Γk
j
)
0
π ; M k
0 )
(cid:13)
(cid:13)
(cid:13)2
π ; M k
j )
(cid:13)
(cid:13)
(cid:13)2
.
≤ (
(cid:13)
(cid:13)
(cid:13)
(cid:13)
Γk
(cid:13)
(cid:13)2
0
(cid:13)
Γk
(cid:13)
(cid:13)
j
+
+
(cid:13)
(cid:13)
(cid:13)
2
(cid:33)
(cid:13)
(cid:13)
(cid:13)2
Applying the weight bounds in Corollaries A.1.8 and A.1.10 and Lemma A.1.17 to the first term
yields an upper bound of
2Cw * ((cid:112)
jηkCwC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) * (
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)2
C1/2
L
) ≤ 2
(cid:112)
jηkC2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
Turning to the second term, we can apply the smoothness bound in Lemma A.1.2 and the
inductive bounds in Corollaries A.1.8 and A.1.10 and Lemma A.1.17 to obtain an upper bound of
C2
w
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
(cid:13)
(cid:13)M k
(cid:13)
j − M k
0
(cid:13)
(cid:13)
(cid:13)2
2
2
(cid:112)
≤ 2
jηkC4
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
3
F
33
+ η2
k C4
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
4
F.
Putting it together, we have
(I) ≤ 2
(cid:112)
jηkC2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
(C1/2
L + C2
w
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + η2
k C4
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
4
F.
Similarly, for (II) we have the exact same bound since we can apply Lemma A.1.5 to remove
(cid:13)
(cid:13)
(cid:13)2
the diagonal operator and uniformly bound
(cid:13)
(cid:13)
(cid:13)W k
by Cw.
(cid:13)
(cid:13)
(cid:13)2
and
Γk
j
(cid:13)
(cid:13)
(cid:13)
j
Finally, combining (I) and (II) and dividing through by ηk, we can conclude that
(cid:13)
(cid:13)ek
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
(cid:112)
≤ 4
jC2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
(C1/2
L + C2
w
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + O(ηk).
Summing up
(cid:13)
(cid:13)
(cid:13)ek
j
(cid:13)
(cid:13)
(cid:13)2
over all j and crudely bounding ∑m−1
j=0
(cid:112)j ≤ m3/2, we see that
m−1
∑
i=0
(cid:13)
(cid:13)ek
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
≤ 4m3/2C2
wC1/2
L
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
(C1/2
L + C2
w
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + O(ηk).
Stepsize noise is negligible for i > 0. We now quickly show that the effect of generalizing the
induction to i > 0 is negligible. In particular, we can carry out the same proof, except we will have
to redefine the per-epoch update so it can account for gradient updates starting at an arbitrary
iterate (i, k) rather than (0, k). We explicitly redefine these terms below by quickly revisiting the
signal-noise decomposition in Appendix A.1.3. Recall that a single-iterate update at iteration (a, b)
can be written as (Equation (A.10))
M b
a+1 = M b
a − ηbgb
a + η2
b qb
a,
where we defined
gb
a
qb
a
≜ ∇W L(X a+1
≜ ∇W L(X a+1
π ; Θb
π ; Θb
a)Γb
a + W b
a)∇ΓL(X a+1
a ∇ΓL(X a+1
π ; Θb
a).
π ; Θb
a),
Consider carrying out the same accumulation as in Appendix A.1.3, but this time choosing (i, k)
instead (0, k) as the "pivot." For this purpose, we will change our notational convention a little bit
and use superscripts to denote the pivot or the starting point (i, k). As the redefinitions of the
"signal" ̃gb
a (Equation (A.14)) and path dependent noise eb
a (Equation (A.15)), we define
π ; Θk
i )Γk
i + W k
i ∇ΓL(X a+1
π ; Θk
i ),
̃g(i,k)
a ≜ ∇W L(X a+1
≜ ̃g(i,k)
a − gb
a
ηk
e(i,k)
(a,b)
,
for indices (a, b) satisfying (i, k) ≤ (a, b) ≤ (i − 1, k + 1).
This way, the accumulation of updates on M from iteration (i, k) to (i − 1, k + 1) can be
34
represented as
M k+1
i = M k
i − ηk
m−1
∑
j=i
gk
j + η2
k
m−1
∑
j=i
qk
j − ηk+1
i−1
∑
j=0
gk+1
j + η2
k+1
i−1
∑
j=0
qk+1
j
= M k
i − ηk
(i−1,k+1)
∑
(a,b)=(i,k)
gb
a + η2
k
(i−1,k+1)
∑
(a,b)=(i,k)
qb
a
− (ηk+1 − ηk)
i−1
∑
j=0
gk+1
j + (η2
k+1 − η2
k )
i−1
∑
j=0
qk+1
j
= M k
i − ηk ̃g(i,k) + η2
k
(cid:16)
(i−1,k+1)
∑
(a,b)=(i,k)
(cid:17)
e(i,k)
(a,b) + qb
a
+ η2
k s(i,k)
(i,k+1)
(A.25)
where in the last equality we used gb
̃g(i,k) (a redefinition of ̃gk from Equation (A.16)) and the stepsize noise s(i,k)
a = ̃g(i,k)
a − ηke(i,k)
(a,b) and also defined the accumulated signal
(i,k+1) as
̃g(i,k) ≜
(i−1,k+1)
∑
(a,b)=(i,k)
̃g(i,k)
a = ∇W Lπ(Θk
i )Γk
i + W k
i ∇ΓLπ(Θk
i ),
s(i,k)
(i,k+1)
≜ −
ηk+1 − ηk
η2
k
i−1
∑
j=0
gk+1
j +
η2
k+1 − η2
k
η2
k
i−1
∑
j=0
qk+1
j
.
(A.26)
(A.27)
As a sanity check, we can quickly see that the stepsize noise s(i,k)
(i,k+1) is zero if i = 0.
Now notice that Equation (A.25) can be thought of as a generalization of the per-epoch update
(Equation (A.17)) originally obtained for i = 0. For now, suppose we ignore the last term of
Equation (A.25) involving the stepsize noise s(i,k)
(i,k+1). Then, if we carry out the above analysis
for bounding the remaining terms in Equation (A.25), there is no difference in the argument up
to reindexing; we can consider this as using ηk for the stepsize even for the iterates (a, b) where
b = k + 1. In particular, the lemmas of the previous sections all hold up to reindexing notation.
(i,k+1) is of the same order as the
Therefore, it now suffices to show that the stepsize noise s(i,k)
(cid:13)
(cid:13)s(i,k)
(cid:13)
(cid:13)
(cid:13)
(cid:13)F
Lemma A.1.19. Assume L[j, k + 1] and D[j, k + 1] hold for all j ≤ i − 1. Suppose that
other noise terms; in particular,
= O(1).
(i,k+1)
ηk = O
(cid:19)
,
(cid:18) 1
kβ
for some 1/2 < β < 1. Then the stepsize noise
(cid:13)
(cid:13)s(i,k)
(cid:13)
(i,k+1)
(cid:13)
(cid:13)
(cid:13)F
= O(1).
Proof. Since D[j, k + 1] holds, Lemma A.1.16 demonstrates that
(cid:13)
(cid:13)gk+1
(cid:13)
hand, Corollaries A.1.8 and A.1.10 show that
have ηk+1 − ηk = O(1/kβ+1) = O(η2
k ). Similarly η2
(cid:13)
(cid:13)
(cid:13)s(i,k)
(cid:13)
(cid:13)
into Eq. (A.27), we conclude that
(cid:13)F
(cid:13)
(cid:13)
(cid:13)2
k+1 − η2
= O(1), as desired.
(i,k+1)
j
(cid:13)
(cid:13)qk+1
(cid:13)
j
(cid:13)
(cid:13)
(cid:13)2
= O(1). On the other
= O(1). Since ηk = O(1/kβ) and β ≤ 1, we
k ). Plugging these
k = O(1/k2β+1) = O(η3
35
Composite noise term is negligible. Now that we have formally defined the stepsize noise that
arise for i > 0, we also redefine the composite noise term rk (Equation (A.19)) originally defined
for i = 0. The updated definition is simply
r(i,k) ≜
(cid:16)
(i−1,k+1)
∑
(a,b)=(i,k)
(cid:17)
e(i,k)
(a,b) + qb
a
+ s(i,k)
(i,k+1),
which allows us to rewrite the epoch update spelled out in Equation (A.25) as
M k+1
i = M k
i − ηk ̃g(i,k) + η2
k r(i,k).,
(A.28)
(A.29)
which is a generalization of Equation (A.18).
It is left to show formally that the composite noise term r(i,k) defined in Equation (A.28),
a, the path dependent noise e(i,k)
(a,b)
obtained from combining the mismatched gradient noise terms qb
for (i, k) ≤ (a, b) ≤ (i − 1, k + 1), and the stepsize noise s(i,k)
(i,k+1), is indeed O(1).
Proposition A.1.20 (Composite noise term). Suppose L[a, b] and D[a, b] hold for (i, k) ≤ (a, b) ≤
(i − 1, k + 1), and ηk = O(1/kβ) for some 1/2 < β < 1. Then the composite noise term r(i,k) satisfies
(cid:13)
(cid:13)
(cid:13)r(i,k)(cid:13)
(cid:13)
(cid:13)F
≤ poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) + O(ηk).
Proof. Combining Lemmas A.1.16, A.1.18 and A.1.19, taking care to analyze the constants (which
are all poly(m, Cw, CL,
)) hidden by the big–O notation, yields the desired result.
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
A.1.6 Accumulated loss update
In this section, we formally account for the noise terms and prove that an accumulated loss
inequality holds. More precisely, we can use the gradient update spelled out in Equation (A.29)
and the noise bounds in Appendix A.1.5 to obtain a single epoch loss update. In other words, this
section prove the inductive step that the hypotheses R[i, k + 1] and L[i, k + 1] holds. For the sake
of simplicity, in this section we focus on the case i = 0. However, as discussed above, the case
i > 0 only adds a negligible stepsize error and the same arguments go through.
We start with the following proposition, which proves the hypothesis R[0, k + 1].
Proposition A.1.21. Assume that L[j, k] and D[j, k] hold for all j < m. Consider optimizing the linear+BN
network with stepsize satisfying
ηk ≤
1
2kβ ,
for 1/2 < β < 1.
Then
Lπ(M k+1
0
) − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
(Lπ(M k
0 ) − L∗
π) + poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k ,
(A.30)
where the poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) term is independent of k and has constant degree.
Proof. First, we use the Gπ-smoothness of Lπ with respect to M guaranteed by Lemma A.1.2 to
obtain
Lπ(M k+1
0
) − Lπ(M k
0 ) ≤
(cid:68)
∇M Lπ(M k
0 ), M k+1
0 − M k
0
(cid:69)
+
F
Gπ
2
(cid:13)
(cid:13)M k+1
(cid:13)
0 − M k
0
(cid:13)
(cid:13)
(cid:13)
2
F
.
36
Using the gradient update Equation (A.18) and Cauchy-Schwarz, we can upper bound the RHS by
(cid:68)
∇M Lπ(M k
(cid:68)
0 ), −ηk ̃gk + η2
0 ), ̃gk(cid:69)
∇M Lπ(M k
≤ −ηk
k rk(cid:69)
+
F
Gπ
2
+ η2
k
F
(cid:13)
(cid:13)
(cid:13)rk(cid:13)
(cid:13)
(cid:13)F
(cid:13)
(cid:13)
(cid:13)
0 − M k
(cid:13)
(cid:13)M k+1
(cid:13)
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
0
2
F
(cid:13)
(cid:13)
(cid:13)F
+
Gπ
2
(cid:13)
(cid:13)M k+1
(cid:13)
0 − M k
0
(cid:13)
(cid:13)
(cid:13)
2
F
.
Next, we can use Lemma A.1.17, with t = m, together with the inequality (a + b)2 ≤ 2a2 + 2b2, to
obtain an upper bound of
(cid:68)
≤ −ηk
∇M Lπ(M k
+
Gπ
2
(4mη2
k C4
wCL
0 ), ̃gk(cid:69)
(cid:13)
(cid:13)X π
F
(cid:13)
(cid:13)
+ η2
k
(cid:13)
(cid:13)
(cid:13)rk(cid:13)
(cid:13)
(cid:13)F
k C4
+ η4
wC2
L
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)X π
(cid:13)
).
4
F
2
F
(cid:13)
(cid:13)
(cid:13)F
Then, because the inductive hypotheses apply we can apply Corollary A.1.10 to bound
F. Moreover, since
gradients, Corollary A.1.15 to bound the inner product (cid:10)∇M Lπ(M k
ηk = O(1/kβ), we can use Proposition A.1.20 to bound
(cid:13)F. This yields an upper bound of
0 ), ̃gk(cid:11)
(cid:13)rk(cid:13)
(cid:13)
−
ηk
2
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
η2
ηk
k
2
2
−
+
(cid:32)
≤
2
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
+ η2
k
(cid:13)
(cid:13)
(cid:13)
F
(cid:33)
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)F
(cid:13)
(cid:13)
(cid:13)rk(cid:13)
(cid:13)
(cid:13)F
+ poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k
(cid:13)
(cid:13)
(cid:13)
2
F
+ poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k
≤ −
∥∇M Lπ(k)∥2
ηk
4
In the second line, we have used ab ≤ 1
ηk ≤ 1
2 to reduce higher order terms of ηk.
F + poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k
2 (a2 + b2), and throughout, we have used the assumption
Putting it together, we find that
Lπ(M k+1
0
) − Lπ(M k
0 ) ≤ −
ηk
4
(cid:13)
(cid:13)∇M Lπ(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
+ poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k
We now use απ–strong convexity with respect to M (and hence απ-PŁ) guaranteed by
Lemma A.1.3 to obtain
Lπ(M k+1
0
) − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
(Lπ(M k
0 ) − L∗
π) + poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k .
One consequence of Proposition A.1.21 is that if the stepsize ηk is small enough, we can
guarantee that the loss decreases from Lπ(M k
i ) to Lπ(M k+1
i
).
Next, from Proposition A.1.21, we can prove the other inductive hypothesis, namely L[0, k + 1].
Corollary A.1.22. Suppose L[j, k] and D[j, k] hold for all j < m and the stepsize satisfies
(cid:40)
ηk ≤
1
kβ min
1
2
,
απCL
poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)
(cid:41)
,
for some 1/2 < β < 1.
Then L[0, k + 1] holds, i.e.
Lπ(M k+1
0
) ≤ CL.
37
Proof. Since ηk ≤ 1
Then, for the bound Lπ(M k+1
0
2kβ , we can apply Proposition A.1.21 to conclude that Equation (A.30) holds.
) ≤ CL to hold, it suffices to show that
Equivalently,
(cid:16)
1 −
(cid:17)
απηk
2
CL + poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)η2
k ≤ CL.
poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)ηk ≤
απ
2
CL.
Clearly this holds for the stated assumption on ηk.
Finally, we show that by inductively unrolling the inequality in Proposition A.1.21, we can
show that Lπ(M k
i ) converges to L∗
π at a sublinear rate.
Proposition A.1.23. Assume we are in the same setup as Proposition A.1.21. Suppose that the stepsize
satisfies
c
kβ ,
(cid:111)
ηk =
(cid:110) 1
2 , 2
απ
for some absolute constant c such that c ≤ min
holds for every b ∈ [k + 1]. Then if β < 1 we have
(cid:18) cαπ
) − L∗
π ≤ (Lπ(Θ1
0) − L∗
π) exp
Lπ(Θk+1
0
and 1/2 < β < 1. Further suppose that R[0, b]
(2 − k1−β)
(cid:19)
+
c2 poly(m, Cw, CL,
kβ
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
) log k
,
2(1 − β)
Proof. Note that by inspecting the proof of Proposition A.1.21 and Proposition A.1.20, the term
poly(m, Cw, CL,
) has no dependence on k. So for simplicity we will assume that this term
is bounded by some absolute constant A. Since ηk ≤ 1
2kβ , Proposition A.1.21 implies that
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
Lπ(M k+1
0
) − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
We can unroll the recurrence to obtain
(Lπ(M k
0 ) − L∗
π) + Aη2
k
(A.31)
Lπ(M k+1
0
) − L∗
π ≤ (Lπ(M 1
0 ) − L∗
π)
k
∏
t=1
(cid:16)
1 −
(cid:17)
απηt
2
+ A
k
∑
t=1
η2
t
(cid:32) k
∏
j=t+1
(cid:18)
1 −
απηj
2
(cid:19)(cid:33)
.
(A.32)
We have for any ct ≤ 1 that
b
∏
t=a
(1 − ct) ≤ exp
(cid:33)
log(1 − ct)
(cid:32) b
∑
t=a
(cid:32)
≤ exp
−
(cid:33)
ct
,
b
∑
t=a
where we have used log(1 − x) ≤ −x for x ≤ 1. For 1/2 < β < 1 we have
b
∑
t=a
Hence, since we assumed ηk = c
1
tβ
≥
(cid:90) b
a
1
tβ dt =
b1−β − a1−β
1 − β
.
kβ , and απ c
2 ≤ 1, we have
(cid:18)
≤ exp
−
cαπ
2(1 − β)
(cid:16)
1 −
b
∏
t=a
(cid:17)
απηt
2
(b1−β − a1−β)
(cid:19)
38
Now we can bound
A
k
∑
t=1
η2
t
(cid:32) k
∏
j=t+1
(cid:18)
1 −
απηj
2
(cid:19)(cid:33)
≤
c2 A
k2β
+
k−1
∑
t=1
(cid:18)
c2 A
t2β exp
−
cαπ
2(1 − β)
(k1−β − (t + 1)1−β)
(cid:19)
Define T ≜ k − Ckβ log k, where C > 0 is an absolute constant to be picked later. We can split up
the sum into t < T and t ≥ T. For the terms t < T we can use concavity to deduce that
k1−β − (t + 1)1−β ≥ (1 − β)(k − t − 1)k−β ≥ Θ(log k),
where the constant hidden in Θ(log k) increases with C. Hence we pick C so that for t < T we
have
cαπ
2(1 − β)
(k1−β − (t + 1)1−β) ≥ β log k.
Then,
(cid:18)
c2 A
t2β exp
−
cαπ
2(1 − β)
∑
t<T
(k1−β − (t + 1)1−β)
(cid:19)
≤ exp(−β log k) ∑
t<T
c2 A
t2β
≤ O
(cid:18) c2 A
kβ
(cid:19)
.
On the other hand, for the terms t ≥ T we can naively bound the exponential term by 1 and
obtain
(cid:18)
c2 A
t2β exp
−
cαπ
2(1 − β)
∑
t≥T
(k1−β − (t + 1)1−β)
(cid:19)
≤ ∑
t≥T
c2 A
t2β
≤ Θ(kβ log k)
(cid:18) c2 A log k
kβ
≤ Θ
c2 A
T2β
(cid:19)
.
Hence we have that
Lπ(M k+1
0
) − L∗
π ≤ (Lπ(M 1
0 ) − L∗
π) exp
(cid:18) cαπ
2(1 − β)
(2 − k1−β)
(cid:19)
+ Θ
(cid:18) c2 A log k
kβ
(cid:19)
,
and the inequality in the proposition statement holds by recalling that A = poly(m, Cw, CL,
(A.33)
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
).
A.1.7 Bounding approximate invariances
Armed with Corollaries A.1.8 and A.1.10, we slog through the arduous task of inductively
bounding the approximate invariance. As a reminder, these corollaries tell us that assuming the
inductive hypotheses L[j, k] and D[j, k] hold, all weight norms and losses for iterate (j, k) can be
bounded by uniform constants.
Lemma A.1.24. Suppose L[j, k] and D[j, k] hold for some j < m. We have
(cid:13)
(cid:13)Dk
(cid:13)
j+1 − Dk
j
(cid:13)
(cid:13)
(cid:13)2
≤ 2C2
wCL
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
(cid:13)
(cid:13)
(cid:13)
2
2
η2
k .
39
Hence, if D[t, k] holds for all t ≤ j, we have
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 2C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
k
∑
t=1
η2
t .
Proof. We have
(W k
j+1)⊤W k
j+1 = (W k
= (W k
j − ηk∇W L(X j+1
j )⊤W k
j − ηk
k [∇W L(X j+1
+ η2
π ; Θk
∇W L(X j+1
j − ηk∇W L(X j+1
j ))⊤(W k
j )⊤W k
π ; Θk
j + (W k
j )⊤∇W L(X j+1
π ; Θk
π ; Θk
j )]
(cid:104)
π ; Θk
j ))
j )⊤∇W L(X j+1
(cid:105)
π ; Θk
j )
Similarly, we have
(Γk
j+1)2 = (Γk
= (Γk
π ; Θk
∇ΓL(X j+1
j − ηk∇ΓL(X j+1
(cid:104)
j )2 − ηk
+ η2
k [∇ΓL(X j+1
j − ηk∇W L(X j+1
j ))(Γk
j ∇ΓL(X j+1
j )Γk
j + Γk
j )∇ΓL(X j+1
j )]
π ; Θk
π ; Θk
π ; Θk
π ; Θk
π ; Θk
j )
j ))
(cid:105)
j+1)2. Hence, if we take the operator norm of Dk
The gradient invariance in Fact A.1.1 cancels out the ηk term in Dk
j+1 −
(Γk
j and use Lemma A.1.5, we can ignore
the diagonal operator. Then, since the inductive hypotheses hold, we can apply the inductive
gradient bound (Corollary A.1.10) to obtain
j+1 = I + diag((W k
j+1 − Dk
j+1)⊤W k
(cid:13)
(cid:13)Dk
(cid:13)
j+1 − Dk
j
(cid:13)
(cid:13)
(cid:13)2
≤ η2
k
π ; Θk
j )
(cid:20)(cid:13)
(cid:13)∇W L(X j+1
(cid:13)
(cid:13)
(cid:13)BN(X j+1
(cid:13)
π )
wCL
(cid:13)
(cid:13)
(cid:13)
2
2
η2
k .
≤ 2C2
(cid:13)
(cid:13)
(cid:13)
2
2
+
(cid:13)
(cid:13)∇ΓL(X j+1
(cid:13)
π ; Θk
j )
(cid:13)
(cid:13)
(cid:13)
(cid:21)
2
2
To conclude, we apply triangle inequality and the inductive hypothesis on D[t, k], yielding
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤
≤
0
(cid:13)
(cid:13)Dk
(cid:13)
(cid:13)
(cid:13)Dk
(cid:13)
0
(cid:13)
(cid:13)
(cid:13)2
(cid:13)
(cid:13)
(cid:13)2
+ 2C2
wCLη2
k
+ 2C2
wCLη2
k
k
∑
t=1
2
F
(cid:13)
(cid:13)
η2
t .
≤ 2C2
wCL
(cid:13)
(cid:13)X π
j
∑
t=0
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)BN(X t+1
(cid:13)
π )
(cid:13)
(cid:13)
2
F
(cid:13)
(cid:13)
(cid:13)
2
2
As a corollary, we see that for stepsizes of the form ηk = c/kβ for 1/2 < β < 1, we can select c
to guarantee that
≤ 1/2 for all (j, k).
(cid:13)
(cid:13)
(cid:13)Dk
j
(cid:13)
(cid:13)
(cid:13)2
Corollary A.1.25. Assume that D[t, k] holds for all t ≤ j < m and ηk = c
kβ for 1/2 < β < 1. If
c2 ≤
1
2β−1 )C2
wCL
4(1 + 1
,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
40
then
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 2C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
k
∑
t=1
η2
t ≤
1
2
.
In other words, D[j + 1, k] holds.
Proof. Lemma A.1.24 implies that
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 2C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
k
∑
t=1
t ≤ 2C2
η2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
∞
∑
t=1
η2
t .
For 1/2 < β < 1, we have
∞
∑
k=1
1
k2β
≤ 1 +
(cid:90) ∞
1
1
t2β dt = 1 +
1
1 − 2β
t1−2β
(cid:12)
(cid:12)
(cid:12)
(cid:12)
∞
1
= 1 +
1
2β − 1
.
Hence, if
c2 ≤
1
2β−1 )C2
wCL
4(1 + 1
,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
then evidently
(cid:13)
(cid:13)
(cid:13)Dk
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 1
2 , as desired.
A.1.8 Completing the induction
With all the pieces in place, we formally state the theorem for SS convergence.
Theorem A.1.26 (Formal statement of convergence for SS). Let π ∈ Sn be such that Assumption 1(a)
holds. Let f (*; Θ) = W ΓBN(*) be a 2-layer linear+BN network initialized at Θ1
0) = (0, I).
Consider optimizing f using SS with permutation π and decreasing stepsize
0 = (W 1
0 , Γ1
(cid:40)
ηk =
1
kβ
* min
1
2
,
2
απ
,
απCL
poly(m, Cw, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F
)
(cid:118)
(cid:117)
(cid:117)
(cid:116)
,
for any 1/2 < β < 1. Then the SS risk satisfies
1
2β−1 )C2
wCL
4(1 + 1
(cid:41)
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
Lπ(Θk+1
0
) − L∗
π ≤
kβ
In particular, the SS risk converges to the global optimal risk L∗
π.
poly(m, d, CL,
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F,
1
σmin(X
⊤
π )
) log k
.
Proof of Theorem A.1.26. We proceed by induction on the epoch. We restate the key inductive
statements to prove:(with appropriate selection of ηk):
• L[j, k]: Lπ(Θk
j ) stays bounded above by some uniform constant CL ≥ ∥Yπ∥2
F - this is the
content of Corollary A.1.22.
• R[j, k]: Lπ(Θk
tion A.1.21.
j ) satisfies the per-epoch loss inequality - this is the content of Proposi-
• D[j, k]: The approximate invariances stay bounded in norm away from 1. More precisely,
(cid:13)
(cid:13)
(cid:13)Dk
j
(cid:13)
(cid:13)
(cid:13)2
≤ 2C2
wCL
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F
∑∞
t=1 η2
t ≤ 1
2 - this is the content of Corollary A.1.25.
41
Notice that the assumptions on ηk exactly satisfy the hypotheses of Corollaries A.1.22
and A.1.25 and Proposition A.1.23.
The base cases follows from the initialization. Recall that we set
(cid:111)
(cid:110)
CL = max
Lπ(Θ1
t ) : 0 ≤ t ≤ m − 1
.
Since we only look at the loss values for the first epoch, CL is indeed an absolute constant
depending on π. So L[j, 1], as defined in Hypothesis 1, holds for all j < m. Next, we have from
the initialization that D1
0 = 0. Then, applying Lemma A.1.24, we can conclude D[j, 1] also holds
for all j < m, so Hypothesis 3 holds. Finally, there is no need to check Hypothesis 2 because it is
only defined for k > 1.
Now our inductive hypotheses are that L[j, k], R[j, k], D[j, k] hold for all j < m. For the
inductive step, we want to prove L[0, k + 1], R[0, k + 1], D[0, k + 1]. By construction of ηk, the
hypotheses of Corollary A.1.22 is satisfied, so L[0, k + 1] holds. Moreover, the hypotheses of
Proposition A.1.21 are satisfied, so R[0, k + 1] holds. Finally, the hypotheses of Lemma A.1.24 are
satisfied, so that D[0, k + 1] holds.
As asserted earlier, the above argument is robust up to reindexing if we want to prove the
statement for i > 0. In particular, all of the results of the previous section go through, as we showed
in Proposition A.1.20 that the stepsize noise is negligible. Hence the induction is completed for
all (i, k) and so the unrolled update equation in Proposition A.1.23 holds for all k. This gives
the formal rate of convergence for the stated stepsize. In particular, we see that the SS risk Lπ
converges to its global minimum.
Proof of Theorem 3.2.2. All we need to do is convert the stepsizes requirements. Examining the
stepsize requirements in Theorem A.1.26, they depend on CL, Cw, and
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)F.
Now recall the definition of Cw in Corollary A.1.8:
C2
w ≤
3
2
+ d2
(cid:32)
1
2
+
C1/2
L + ∥Yπ∥F
σmin(X
⊤
π )
(cid:33)
.
Hence Cw = poly(d, CL, ∥Yπ∥F, 1/σmin(X
σmin(X
F = dn, σmin(X πX
⊤
π )2, and CL is an absolute constant, we can convert the stepsize requirements into
⊤
π )). Finally, since ∥Xπ∥2
⊤
π ) =
(cid:40)
ηk =
1
kβ
* min
1
2
,
2
σmin(X πX
,
⊤
π )
(cid:112)
2β − 1 poly(σmin(X
poly(n, d, ∥Yπ∥F)
(cid:41)
⊤
π ))
,
which directly implies the stepsize requirements in Theorem 3.2.2.
A.2 Proof of convergence for RR
In this section, we prove Theorem 3.2.3. With RR, we randomly resample permutation πk ∈ Sn on
epoch k. Hence, it is natural to seek a convergence bound in expectation. We briefly comment on
the complications that arise in this setting.
Since we want to prove convergence an expectation, an inductive approach that controls the
approximate invariances and loss evolution is complicated by the necessity for bounds on these
quantities that are stronger than merely being in expectation. This is precisely why we need
Assumption 3.
42
Additional notation. As introduced in Section 2, we can view RR as optimizing the risk
LRR(Θ) ≜ 1
n!
∑
π∈Sn
Lπ(Θ)
via with-replacement SGD on an epoch level (i.e., Lπ is sampled uniformly with replacement at
every epoch), albeit with noise terms due to the shuffling algorithm. Motivated by the setup in
Section 2, we can also write LRR in an equivalent form to LGD as follows:
LRR(Θ) ≜ 1
n!
∑
π∈Sn
L( f (Xπ; Θ), Yπ) =
1
n!
L(W ΓBNRR(X), YRR),
where BNRR(X) ≜ (cid:2)X π1
≜ (cid:2)Yπ1
YRR
. . .
* * * Yπn!
* * * X πn!
(cid:3) ∈ Rd×(n*n!),
(cid:3) ∈ Rp×(n*n!).
For notational convenience, we also write X RR
the presence of batch normalization.
≜ BNRR(X), and reiterate that overlines indicate
Just as in the SS case, we will abuse notation and refer to the RR risk function as a function of
Lπ(M ). Similarly, we will often refer to the gradient of
∇M Lπ(M ). We will find it helpful to
(cid:13)
(cid:13)2. Similarly we will denote the maximum Frobenius
(cid:13)
(cid:13)F. Furthermore, it follows from
(cid:13)
(cid:13)
(cid:13)2
(cid:13)F
M = W Γ by writing LRR(M ) ≜ 1
n!
the RR risk with respect to M as ∇M LRR(M ) ≜ 1
n!
use the notation X max,2 ≜ arg maxπ∈Sn
(cid:13)
norm batch normalized dataset by X max,F ≜ arg maxπ∈Sn
(cid:13)X π
(cid:13)
(cid:13)X max,2
the unit variance constraint in the definition of BN that
(cid:13)X max,F
∑π∈Sn
∑π∈Sn
(cid:13)
(cid:13)X π
≤ (cid:13)
dn.
√
≤
At a high level, the RR proof of convergence closely follows the SS proof of convergence.
Indeed, most of the technical legwork has already been fleshed out in the SS case - most of the
results port over immediately, taking care to replace π with πk. However, we will be careful in
accounting for where we need to deviate from the SS logic.
A.2.1 Checking optimization properties
We first check the smoothness and strong convexity property with respected to the merged matrix
M that we heavily relied on for the proof of convergence for SS.
Fact A.2.1 (Smoothness of RR). Define
Then LRR(M ) is GRR-smooth with respect to M .
GRR
≜ 1
n!
∑
π∈Sn
Gπ.
Proof. The statement follows from combining Lemma A.1.2 with the fact that if fi are Gi-smooth,
then ∑n
i=1 Gi-smooth.
i=1 fi is ∑n
As before, we cannot directly use a PŁ inequality on W or Γ; we must instead bootstrap this
from the strong convexity of the risk with respect to M = W Γ.
Fact A.2.2 (Strong convexity). Suppose that Assumption 1(b) holds for some π ∈ Sn. Then the
≜
loss function LRR(M ) = 1
n!
∑π απ.
1
n!
Lπ(M ) is αRR-strongly convex with respect to M with αRR
∑π σmin(X πX
⊤
π ) = 1
n!
∑π∈Sn
43
Proof. Take the Hessian of LRR with respect to vec(M ) to obtain ∇2
I. Hence we have ∇2
holds, the sum is strictly positive, so LRR is indeed strongly convex.
vec(M )LRR(M ) ⪰ 1
∑π σmin(X πX
n!
vec(M )LRR(M ) = 1
X πX
⊤
π ). Since we assumed Assumption 1(b)
∑π∈Sn
n!
⊤
π ⊗
A.2.2 Proof sketch of RR convergence
We first state the modified inductive hypothesis for the one-epoch risk update, which replaces
R[j, k].
Hypothesis 4. For k > 1, the inductive hypothesis S[k] states that
Eπk−1[LRR(M k
0 )|Fk−1] − L∗
RR ≤
(cid:16)
1 −
(cid:17)
αRRηk−1
2
0
k−1 poly(m, Aw, AL,
(LRR(M k−1
(cid:13)
(cid:13)X max,F
) − L∗
RR)
(cid:13)
(cid:13)F
),
+ η2
where Eπk−1 denotes the expectation over random draws of the permutation πk−1.
Proof sketch of Theorem 3.2.3. As before, we start by writing out the smoothness inequality with
respect to M :
LRR(M k+1
0
) ≤ LRR(M k
0 ) +
(cid:68)
∇M LRR(M k
0 ), M k+1
0 − M k
0
(cid:69)
+
GRR
2
(cid:13)
(cid:13)M k+1
(cid:13)
0 − M k
0
2
(cid:13)
(cid:13)
(cid:13)
.
(A.34)
Next, we have the same gradient update
M k+1
0 = M k
0 − ηk ̃gk + η2
k rk,
but now all quantities involving π turn into πk. For example, we redefine
̃gk ≜
m−1
∑
t=0
t = ∇W Lπk (M k
̃gk
0 )Γk
0 + W k
0 ∇ΓLπk (M k
0 ).
Since we want to prove convergence in expectation, it is standard to consider the natural
filtration Fk of which permutations we have picked up to (but not including) epoch k. Formally,
Fk = σ(π1, . . . , πk−1), where σ(Z) denotes the σ-algebra generated by the random variable Z.
Noting the identity
Eπ[∇M Lπ(M k
0 )] = ∇M LRR(M k
0 ),
it follows that if we can apply Corollary A.1.15, then
(cid:104)(cid:68)
Eπk
∇M LRR(M k
0 ), ̃gk(cid:69)
(cid:68)
(cid:105)
=
F
∇M LRR(M k
0 ), Eπk [ ̃gk]
(cid:69)
≥
F
(cid:13)
(cid:13)∇M LRR(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
.
1
2
Hence, we can follow the same argument for upper bounding the smoothness inequality for
SS and take a conditional expectation over πk conditioned on Fk. Assuming for now that the
weight norms are bounded by some absolute constant Aw and the relevant losses are bounded by
an absolute constant AL, this yields
Eπk [LRR(M k+1
0
)|Fk] ≤ LRR(M k
0 ) −
ηk
4
(cid:13)
(cid:13)∇M LRR(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
+ η2
k
Eπk [poly(m, Aw, AL, ∥Xπk ∥F)].
44
Noting that we can upper bound ∥Xπk ∥F uniformly by
k, this shows that we have
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)F, which does not depend on
Eπk [LRR(M k+1
0
)|Fk] ≤ LRR(M k
0 ) −
ηk
4
(cid:13)
(cid:13)∇M LRR(M k
(cid:13)
0 )
(cid:13)
(cid:13)
(cid:13)
2
F
+ η2
k poly(m, Aw, AL,
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)F
).
Next, αRR–strong convexity yields
Eπk [LRR(M k+1
0
)|Fk] − L∗
RR ≤
(cid:16)
1 −
(cid:17)
αRRηk
2
(LRR(M k
0 ) − L∗
RR) + η2
k poly(m, Aw, AL,
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)F
).
This is exactly the statement of S[k + 1]. To proceed, we must fill in the following details.
First, we must show that the relevant losses are bounded by AL - see Corollary A.2.6. Then, we
show that the weight norms are bounded by Aw - this is shown in Corollary A.2.7. Finally, we
must show that D[j, k] holds, i.e., bound the approximate invariances - this is the content of
Corollary A.2.9. Once we address these technicalities, an inductive argument similar to the SS
version proves the theorem. Note that the SS inductive hypotheses L[j, k] and R[j, k] are not active
in this proof.
A.2.3 Weight bounds
In this section we elucidate the connection between weight norms and the loss evolution. In
particular, we show that bounds on the weight norms confer a bound on the loss function value.
First, we state the following inequality, which follows from a quick application of Cauchy-Schwarz.
Fact A.2.3. We have 1
n!
∑π∈Sn
(Lπ(M ))1/2 ≤ LRR(M )1/2.
With this identity in hand, we derive the following corollaries about weight and gradient
bounds.
Proposition A.2.4. We have
∥∇M LRR(M )∥ ≤ (cid:13)
(cid:13)X max,2
(cid:13)
(cid:13)2
LRR(M )1/2.
Proof. We have ∥∇M LRR(M )∥2 ≤ 1
n!
individual gradient bounds in Lemma A.1.9 and uniformly bounding
that
∑π ∥∇M Lπ(M )∥2 by the triangle inequality. Applying the
(cid:13)
(cid:13), we see
(cid:13)
(cid:13)X max,2
(cid:13)
(cid:13)X π
(cid:13)
(cid:13) by
∥∇M LRR(M )∥2 ≤ (cid:13)
(cid:13)X max,2
(cid:13)
(cid:13)2
*
1
n!
∑
π
L1/2
π (M ).
Applying Fact A.2.3 yields the desired result.
As promised, we quantify the relationship between LRR, Lπ, and ∥M ∥2 with the following
proposition.
Proposition A.2.5. Let σ0 ≜ 1
n!
∑π σmin(X
LRR(M ) − 2∥Y ∥2
F
(cid:13)
(cid:13)X max,F
Similarly, for any π ∈ Sn, we have
(cid:13)
(cid:13)
2
F
2
⊤
π ). We have
(cid:32)
≤ ∥M ∥2
2 ≤
∥Y ∥F + LRR(M )1/2
σ0
(cid:33)2
.
Lπ(M ) − 2∥Y ∥2
F
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
2
F
≤ ∥M ∥2
2 ≤
(cid:32)
∥Y ∥F + Lπ(M )1/2
σmin(X
⊤
π )
(cid:33)2
.
45
Proof. First, we have
1
n!
∑
π∈Sn
(cid:13)
(cid:13)M X π
(cid:13)
(cid:13)2
≤ ∥Y ∥F +
= ∥Y ∥F +
1
n!
1
n!
∑
π
∑
π
(cid:13)
(cid:13)Yπ − M X π
(cid:13)
(cid:13)F
Lπ(M )1/2,
where we have used in the first line the fact that ∥Yπ∥F = ∥Y ∥F for all π. Therefore by Fact A.2.3
and using
⊤
π )∥M ∥2, we find that
(cid:13)
(cid:13)M X π
≥ σmin(X
(cid:13)
(cid:13)2
It follows that
1
n!
∑
π
σmin(X
⊤
π )∥M ∥2 ≤ ∥Y ∥F + LRR(M )1/2.
∥M ∥2 ≤
∥Y ∥F + LRR(M )1/2
σ0
.
For the other direction, note that
Lπ(M ) = (cid:13)
(cid:13)Yπ − M X π
(cid:13)
(cid:13)
2
F
Averaging over all π ∈ Sn gives us
≤ 2∥Y ∥2
F + 2∥M ∥2
2
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
LRR(M ) ≤ 2∥Y ∥2
F +
2∥M ∥2
2
n!
∑
π
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F.
Uniformly bounding
(cid:13)
(cid:13)X π
(cid:13)
(cid:13)
2
F by
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F and rearranging yields the desired result.
The set of inequalities for π also follow by a similar argument.
As a corollary of Proposition A.2.5, it follows from Assumption 3 that each of the losses
Lπ(M k
i ) stay bounded by an absolute constant throughout training.
Corollary A.2.6 (Uniform bound on SS losses). Under Assumption 3, for every π ∈ Sn we have
where
Lπ(M k
i ) ≤ AL,
AL ≜ 2∥Y ∥2
F + 2A2
RR
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F.
Here, ARR was previously defined in Assumption 3.
Finally, Assumption 3 implies the following inductive statement about the weight norms.
Corollary A.2.7 (Uniform bound on weight norms). Assume Assumption 3 and D[j, k] holds. Then
for RR, we have
max
(cid:110)(cid:13)
(cid:13)W k
(cid:13)
i
(cid:13)
(cid:13)
(cid:13)2
,
(cid:13)
(cid:13)
(cid:13)
Γk
i
(cid:13)
(cid:13)
(cid:13)2
(cid:111)
≤ Aw,
where
A2
w
≜ 3
2
+ d2
(cid:18) 1
2
(cid:19)
.
+ ARR
Here, ARR was previously defined in Assumption 3.
46
A.2.4 Bounding approximate invariances
In this section we formally bound the approximate invariances throughout RR training under
Assumption 3. In particular, as a consequence of Corollaries A.2.6 and A.2.7, the following two
claims follow almost directly upon inspection of the proofs of Lemma A.1.24 and Corollary A.1.25.
Lemma A.2.8. Suppose D[j, k] holds for some j < m. We have
(cid:13)
(cid:13)Dk
(cid:13)
j+1 − Dk
j
(cid:13)
(cid:13)
(cid:13)2
≤ 2A2
w AL
(cid:13)
(cid:13)BN(X j+1
(cid:13)
πk )
(cid:13)
(cid:13)
(cid:13)
2
2
η2
k .
Hence, if D[t, k] holds for all t ≤ j, we also have
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 2A2
w AL
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F
k
∑
t=1
η2
t .
Corollary A.2.9. Assume that D[t, k] holds for all t ≤ j < m and ηk = c
kβ for 1/2 < β < 1. If
c2 ≤
1
2β−1 )A2
w AL
4(1 + 1
,
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F
then
(cid:13)
(cid:13)Dk
(cid:13)
j+1
(cid:13)
(cid:13)
(cid:13)2
≤ 2A2
w AL
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F
k
∑
t=1
η2
t ≤
1
2
.
In other words, D[j + 1, k] holds.
A.2.5 Completing the proof
With the connection between the RR loss function and weight bounds in hand, we can complete
the proof of convergence for RR. Finally, we formally state the RR convergence result.
Theorem A.2.10 (Formal statement of convergence for RR). Suppose Assumption 1(b) and Assump-
tion 3 hold. Let f (*; Θ) = W ΓBN(*) be a 2-layer linear+BN network initialized at Θ1
0) =
(0, I). Consider optimizing f using RR with decreasing stepsize
0 = (W 1
0 , Γ1
ηk =
1
kβ
* min
(cid:40)
(cid:118)
(cid:117)
(cid:117)
(cid:116)
1
2
,
2
αRR
,
for any 1/2 < β < 1. Then the RR risk satisfies
1
2β−1 )A2
w AL
4(1 + 1
(cid:41)
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F
poly(n, d, ARR, ∥Y ∥F) log k
kβ
In other words, the RR risk converges to the global optimal risk L∗
E[LRR(Θk+1
)] − L∗
RR ≤
0
RR.
.
Proof of Theorem A.2.10. We inductively prove that D[j, k] and S[k] hold. There is no need to check
S[1] because Hypothesis 4 is defined for k > 1. The proof that the base cases D[j, 0] all hold
follows the same proof as that in the SS case.
47
Now suppose for the sake of induction that D[j, k] and S[k] hold. We will show that D[j + 1, k]
holds. Once we show that D[j, k] holds for all j < m, we can then show that S[k + 1] holds.
In particular, by the assumption on ηk, Corollary A.2.9 implies that D[j + 1, k] holds. Hence by
induction D[j, k] holds for all j < m. We see that assuming Assumption 3 simplified the proof
strategy significantly, as we did not have to go through the trouble of proving L[j, k].
Next, let's understand what happens to the per-epoch loss bound in S[k + 1]. Explicitly,
kβ where
we can follow the same steps as in the proof sketch - which only required ηk ≤ c
c ≤ min
- to see that
(cid:110) 1
(cid:111)
2 , 2
αRR
Eπk [Lπk (M k+1
0
)|Fk] − L∗
π ≤
(cid:16)
1 −
(cid:17)
απηk
2
(LRR(M k
0 ) − L∗
RR) + poly(m, Aw, AL,
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)F
)η2
k .
Indeed, under Assumption 3 and D[j, k] for j < m, we can apply Corollaries A.2.6 and A.2.7 to
rigorously bound all of the analogous noise terms a.s.. We can then follow the same argument
as in Proposition A.1.23 to unroll the recurrence, using iterated expectation to obtain a total
expectation in the end. We can thus conclude that with ηk = c
kβ for 1/2 < β < 1 and the constant
c chosen as the theorem statement that
E[LRR(Θk+1
0
)] − L∗
RR ≤ (LRR(Θ1
0) − L∗
π) exp
(2 − k1−β)
poly(m, Aw, AL,
) log k
(cid:18) cαRR
2(1 − β)
(cid:13)
(cid:13)F
(cid:13)
(cid:13)X max,F
kβ
(cid:18) cαRR
(cid:19)
(cid:19)
≤ (LRR(Θ1
0) − L∗
π) exp
2(1 − β)
poly(n, d, ARR, ∥Y ∥F) log k
kβ
(2 − k1−β)
.
+
+
In the last line we used the fact that AL = poly(ARR, ∥Y ∥F,
Aw = poly(d, ARR) from Corollary A.2.7, and
follows.
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)
2
F
(cid:13)
(cid:13)X max,F
(cid:13)
(cid:13)F
) from Corollary A.2.6,
= dn. The desired claim immediately
We can also immediately see how the stepsize requirements match that of Theorem 3.2.3.
B Proofs for classification results
In this section we lay out the groundwork for formally proving our main results Theorems B.2.1
and B.3.1 about the separability decomposition of SS+BN and RR+BN (cf. Theorems 4.1.3 and 4.1.4).
At a high level, we show that the separability decomposition is closely linked to the presence of
monochromatic batches (Lemma B.1.1) and the dimensionality of the batch normalized dataset
(Lemma B.1.2). In Appendix B.4, we formally characterize the optimal directions of linear+BN
classifiers. We defer the proofs of the more technical lemmas to Appendix C.
Additional notation and setup
We lay out some additional notation that will aid in our discussion of classification. Division of
two vectors should be interpreted in a coordinatewise fashion, so μ
σ ∈ Rd with kth coordinate
μk/σk. For a matrix A ∈ Rd×n, we define ∥A∥2,∞ = maxi∈[n] ∥A:,i∥2, i.e., the maximum Euclidean
norm of the columns.
48
We remind the reader of some notation introduced previously, with an important redefinition
for X RR. For a dataset Z = (X, Y ), we write Z + = (X +, Y +) and Z − = (X −, Y −) to denote
the positive and negative examples, respectively. Recall that we write the dataset batch normalized
under a permutation π as Z π ≜ (X π, Yπ), where X π ≜ BNπ(X) ∈ Rd×n and Yπ = π ◦ Y . We
−
also use X
π to denote the submatrices of X π containing its columns corresponding to
the positive and negative examples, respectively.
+
π and X
B ) denote the set of all (n
For the sake of analyzing the rank of X RR, we will redefine it as follows by throwing out
redundant batches. Let ([n]
B) unique (up to permutation) batches of size B
that can be created from choosing the columns of X ∈ Rd×n. Fix an arbitrary labelling of these
B) batches, and let B j ∈ Rd×B refer to the jth such batch. Then
(n
≜ BNRR(X) ≜ (cid:104)
. . . BN(B(n
∈ Rd×B(n
B)
BN(B1)
X RR
B))
(cid:105)
Note that the rank of X RR is the same as the rank of the original definition, since all we did was
throw out redundant batches for the purposes of analyzing the rank.
We now turn to laying down some of the background necessary to introduce our technical
results. As a motivating step, recall Proposition 4.1.2. It states that SS with permutation π can
cause divergence of the GD risk if Z π is PLS or LS, but not if it is SC. Hence, determining sufficient
conditions for when Z π is SC is of primary interest. Intuitively, Z π being SC should be related
to some notion of genericity - the convex hulls of positive and negative features should be
full dimensional. To formalize this intuition, we take a quick detour and recall several standard
notions in convex analysis, defined for example in Boyd et al. (2004).
For S ⊆ Rd, its interior int(S) denotes the largest open set contained in S. We say that S
is affine if for any x1, x2 ∈ S, the line λx1 + (1 − λ)x2 ⊆ S. An affine combination of k points
x1, . . . , xk ∈ Rd is given by ∑k
i=1 λi = 1.6 The affine hull of S is the set of all
affine combinations of S, and is denoted by aff(S), and clearly aff(S) is an affine set. Similarly, the
relative interior relint(S) denotes the largest open subset of aff(S) contained in S. For a matrix A,
we slightly abuse notation and write aff(A) to denote the affine hull of its columns. Similarly, we
use conv(A) to denote the convex hull of its columns.
i=1 λixi where ∑k
Let x0 ∈ aff(S) be any element of the affine hull of S. It is not hard to see that aff(S) = x0 + V,
where V is a linear subspace of Rd. Furthermore, this V is uniquely determined by S. One can
think of x0 as an offset and V as the space of valid directions to move in to stay in aff(S). We
define dim(S) ≜ dim(V).
Definition 3. A set S ⊆ Rd is called full dimensional if dim(S) = d. This definition is equivalent to
saying that int(conv(S)) is nonempty. Similarly, for any matrix A ∈ Rd×n, we say A is full dimensional
if the set of its columns is full dimensional.
This formal definition of full dimensional allows us to identify sufficient conditions for a
dataset Z = (X, Y ) to be SC.
B.1 Preliminary results on separability decomposition
In this section, we introduce the technical results that help us analyze the separation between
shuffling SGD and GD. A unifying theme is to understand the effect of monochromatic batches
6Here, unlike the definition of a convex combination, the λi's are allowed to be negative.
49
and rank on the separability decomposition - and thus, divergence. In particular, we show that
having monochromatic batches and being full-rank prevents divergence in the underparameterized
regime. In a later section (Appendix B.4), we also show that these properties also significantly
influence the optimal directions under the logistic loss.
The following lemma formalizes how monochromatic batches affect the separability decompo-
sition.
Lemma B.1.1. Given a permutation π, suppose there are two batches Z1
entirely of positive examples and Z2
resulting Z π = (X π, Yπ), the submatrices X
π consists
π consists entirely of negative examples. Then, if we consider the
π such that Z1
−
π of X π satisfy
+
π and X
π and Z2
relint(conv(X
+
π )) ∩ relint(conv(X
−
π )) ̸= ∅.
Consequently, Z π is not LS.
Proof. Batch normalization ensures that the batch normalized features X 1
But this implies that 0 is in the convex hulls of each batch, which implies that conv(X 1
conv(X 2
that the mean μ of a batch B = {x1, . . . , xB} lies in the relative interior of conv(B).
π are mean-zero.
π) intersects
π). In fact, 0 is in the intersection of their relative interiors as well. To see this, we prove
π and X 2
This can be shown via an inductive argument on the batch size. If B = 2, then μ is the
midpoint between x1 and x2, which is in the relative interior of conv(B). Now assume it's
true for all possible batches of size B. When we add xB+1, we get a new batch B′, with mean
B+1 xB+1. Hence if xB+1 ∈ conv(B), clearly μ′ ∈ relint(conv(B)) by convexity. If
μ′ = B
xB+1 ̸∈ conv(B), then xB+1 is one of the vertices of conv(B′). Since μ ∈ relint(conv(B)) and
convexity, the segment between μ and xB+1 must stay in the relative interior of conv(B′) except
at the endpoints. Since μ′ is in the relative interior of this segment, the conclusion follows.
B+1 μ + 1
X 2
Hence relint(conv(X 1
π, the relative interiors of the larger convex hulls intersect as well.
Finally, suppose Z π was LS. By definition there must exist a strict separating hyperplane for
π)) intersects relint(conv(X 2
π)). Since we have X
π ⊇ X 1
π and X
−
π ⊇
+
the two hulls. But the hulls intersect, so this is a contradiction. We conclude that Z π is not LS.
As Lemma B.1.1 establishes, monochromatic batches lead to Z π being PLS or SC. The following
lemma synthesizes nicely with the above result; it demonstrates that if X is full dimensional, and
the relative interiors of the convex hulls of X + and X − intersect, then Z is SC.
Lemma B.1.2. Let Z = (X, Y ) be such that
(1) X is full dimensional.
(2) relint(conv(X +)) intersects relint(conv(X −)).
Then Z is SC.
Proof. Consider any halfspace in Rd. First, since the relative interiors of the hull of positive points
and negative points intersect, then so too do the hulls themselves. So there is no hyperplane that
separates X + from X −, i.e. Z is either PLS or SC.
Suppose that Z is PLS, i.e., there exists a hyperplane v such that yiv⊤xi ≥ 0 for every
(xi, yi) ∈ Z. Since X is full dimensional, the hyperplane orthogonal to v cannot pass through
50
through every point of X - hyperplanes are affine subspaces of dimension at most d − 1. So
yiv⊤xi > 0 for some i and also yjv⊤xj = 0 for some i ̸= j; otherwise, Z is LS, which is a
contradiction. Hence conv(X +) and conv(X −) touch only at the hyperplane defined by v, which
contradicts the assumption that the relative interiors intersect. Hence Z is SC.
Lemmas B.1.1 and B.1.2 taken together show that to identify sufficient conditions for Z π
to be SC, one should look for conditions under which X π is full dimensional and monochro-
matic batches are present. We already answered the former question in the main text with
Proposition 3.2.1, which we restate for reference. Its proof is deferred to Appendix C.3.
Proposition B.1.3. Assume that the original features X ∈ Rd×n satisfies Assumption 2 and B > 2.
Then if we batch normalize and remove one datapoint from each normalized batch, to form a d × (B − 1) n
B
matrix in the SS case and a d × (B − 1)(n
B) matrix in the RR case, the dataset is full-rank almost surely,
regardless of which datapoints we remove. In particular, we have rank(X π) = min (cid:8)d, (B − 1) n
(cid:9) and
rank(X RR) = min (cid:8)d, (B − 1)(n
B)(cid:9) almost surely.
B
Let us now consider the other question about the presence of monochromatic batches. Intu-
itively, under Assumption 4(a), there should be many monochromatic batches w.h.p. as long as B
is small. The following lemma formalizes this intuition; its proof is contained in Appendix C.1.
Lemma B.1.4. Assume Assumption 4(a). If B = o(log n) then there are Ω(n) monochromatic batches
w.h.p.. If B = Ω(log n), then there are no monochromatic batches w.h.p..
The upshot of Lemmas B.1.1, B.1.2 and B.1.4 and Proposition B.1.3 is that small batch sizes
naturally prevent divergence. However, there is a natural tradeoff here: small batch sizes also
entail significant variance in the batch statistics, so they can lead to large (but non-diverging)
values of the GD risk anyway when we train the network with SS.
Remark B.1.5 (Multiclass classification). In the multiclass case with K > 2 different classes, one
can directly generalize the above analysis to look at all (K
2) pairwise combinations of classes.
Lemma B.1.1 generalizes by requiring the existence of a monochromatic batch for each class. Hence
as K increases the batch size must shrink to ensure that Z π is SC w.h.p., opening up a wider range
of batch sizes for SS divergence.
Finally, we formally define a robust notion of the separability decomposition that will prove
helpful for quantifying the effects of increasing the batch size. To do so, we rely on the notion
of the margin of a linearly separably dataset and the so-called penetration depth of overlapping
convex hulls.
Definition 4 (Margin and penetration depth). Let Z = (X, Y ) be a dataset, and let X +, X − denote
the positive and negative features, respectively. If Z is linearly separable, then the margin of Z is defined
to be the l2 margin corresponding to the maximum margin classifier for Z.
If Z is not linearly separable, then by definition conv(X +) intersects conv(X −). The penetration
depth (Agarwal et al., 2000) of Z is defined as the smallest Euclidean distance of translation of conv(X +)
such that the resulting convex body still intersects conv(X −). In words, this quantifies the smallest
perturbation we need to make Z linearly separable.
Definition 5 (γ-robust separability decomposition). Let Z = (X, Y ) be a dataset and SLS
the separability decomposition of ZGD
≜ (X GD, Y ) ≜ (BN(X), Y ).
GD ⊔ SSC
GD be
For γ > 0, we say that Z is γ-robust if the following conditions hold.
51
(1) One of the following:
(a) ZGD is LS and SLS
(b) ZGD is SC and SSC
GD has margin at least γ; or,
GD has penetration depth at least γ.
(2) Let σk, ak, and bk denote the standard deviation, min, and max of the kth feature of X. Then
mink∈[d]
σk
bk−ak
= Ω(1).
√
(3)
(cid:13)
(cid:13)X GD
(cid:13)
(cid:13)2,∞ = O(
d), i.e., the maximum Euclidean norm of datapoints in BN(X) is O(
√
d).
Definition 5 formalizes the informal statement in Theorem 4.1.3 that "ZGD's separability
decomposition can change with small perturbations." If a dataset is robust, its separability
decomposition cannot change easily by small perturbations (e.g., due to batch normalization) on
datapoints. Notice here that PLS datasets can never be robust; to see why, note that Z is PLS
whenever ZGD is PLS. It follows that if Z is PLS then it is not γ-robust for any γ > 0.
This definition of robustness is also natural from the perspective of concentration, since it
provides an immediate link between concentration of batch statistics and the separability decom-
position of Z π. In order to estimate X GD well, we need to estimate σ to within a multiplicative
factor, which explains (2). Moreover, the degree to which the SS datapoints concentrate around
the GD datapoints also depend multiplicatively on the size of GD datapoints, which explains (3).
The following proposition provides a sufficient condition for the datapoints concentrating
within a distance γ of the GD datapoints (cf. the definition of γ-robustness); its proof is deferred
to Appendix C.2.
Proposition B.1.6. Suppose Z is γ-robust and B = Ω(d log(nd)/γ2). Then with probability at least
1 − 1/ poly(n, d) over the choice of π, we have
(cid:13)
(cid:13)X π − π ◦ X GD
(cid:13)
(cid:13)2,∞ = O(γ).
With this setup in hand, we are ready to present our main theorems characterizing the
separability decompositions of SS+BN and RR+BN.
B.2 Separability decomposition for SS
Theorem B.2.1 (Separability decomposition for SS, formal). Throughout this theorem, assume that
B > 2 and Assumption 4(a) and Assumption 2 hold.
Suppose that d ≤ (B − 1) n
B . Then the following hold.
(1) Z π is SC w.h.p. for B = o(log n). If we relax Assumption 2, then Z π can be PLS as well.
(2) Suppose further that Z is γ-robust. Then Z π has the same separability decomposition as ZGD w.h.p.
for B = Ω(d log(nd)/γ2).
Now suppose d > (B − 1) n
B . Then the following hold.
(3) Z π is PLS w.h.p. for B = o(log n).
(4) Z π is LS w.h.p. for B = Ω(log n).
Proof. We consider cases based on whether the batch size is large or small.
Small batch size. By Lemma B.1.4, when B = o(log n), w.h.p. we get a batch comprised solely
of positive examples and a batch comprised solely of negative examples. By Lemma B.1.1, this
52
implies that Z π is PLS or SC, and the relative interior of the positive features intersects the relative
interior of the negative features. By Lemma B.1.2, if X π is full dimensional, then Z π is SC. Hence
it suffices to analyze the rank of X π.
The maximal rank of X π is min (cid:8)d, (B − 1) n
(cid:9) because of the mean zero constraint enforced
B
in every batch. Because we assumed that Assumption 2 holds, Proposition 3.2.1 implies that
X π achieves this upper bound almost surely. Putting it all together, we conclude that when
d ≤ (B − 1) n
B , X π is full-dimensional. It follows that Z π is SC w.h.p. over the choice of π, which
proves (1).
On the other hand, when d > (B − 1) n
B , there always exists a hyperplane that passes through
all of the monochromatic batches of Z π and perfectly classifies non-monochromatic batches (see
Appendix B.4). It follows that Z π is PLS, which proves (3).
Large batch size. Now consider when B = Ω(log n). In this regime, Lemma B.1.4 implies
there are no monochromatic batches with high probability. Moreover, Proposition 3.2.1 implies
that the features are full rank. It thus follows that when d > (B − 1) n
B , Z π is LS, which proves (4).
Let us now consider the case d ≤ (B − 1) n
B .
When Z is γ-robust, we can directly apply Proposition B.1.6 to prove (2). Indeed, for B =
Ω(d log(nd)/γ2), each SS datapoint is within distance O(γ) of the corresponding GD datapoint
with probability at least 1 − 1/ poly(n, d). By increasing the batch size by at most a constant factor,
we can guarantee that each SS datapoint is in fact within distance γ/3 of the corresponding GD
datapoint.
If ZGD is LS, γ-robustness implies that the max-margin hyperplane for ZGD has margin at
least γ. Since each SS datapoint moves at most γ/3 from the corresponding GD datapoint, this
hyperplane still has margin at least 2γ/3, implying that Z π is LS. If ZGD is SC, then γ-robustness
implies that we need to translate the convex hulls of positive and negative points by at least γ to
separate them. But we can only translate them by a total of γ/3 + γ/3 = 2γ/3 < γ, so the hulls
stay strictly overlapping. This implies Z π is also SC. This concludes the proof of (2).
Remark B.2.2. If ZGD is not γ-robust for any γ > 0 (for example if ZGD is PLS), then it is not
hard to construct examples where the separability decomposition of Z π is LS or PLS, and SS
diverges. For a good example of this scenario, see Figures 4b and 4d. Even if ZGD is γ-robust,
if B = o(d log(nd)/γ2), then concentration can fail to hold in the worst case, and we can find
analogous constructions where SS diverges.
B.3 Separability decomposition for RR
Theorem B.3.1 (Separability decomposition for RR, formal). Suppose that B > 2 and Assumption 4(b)
and Assumption 2 hold.
If d ≤ (B − 1)(n
decomposition of ZGD.
B), then ZRR is SC and X RR is full-rank almost surely, regardless of the separability
Otherwise, if d > (B − 1)(n
B), then ZRR is deterministically PLS, regardless of the separability
decomposition of ZGD.
Proof. When there are at least B positive and B negative examples, there exists a batch of all
positive and a batch of all negative examples. Hence by Lemma B.1.1, ZRR is PLS or SC. By
Proposition B.1.3, under Assumption 2, X RR attains the maximal rank of min (cid:8)d, (B − 1)(n
B)(cid:9)
almost surely. So by Lemma B.1.2, if d ≤ (B − 1)(n
B), ZRR will be SC and X RR is full-rank almost
surely. On the other hand, if d > (B − 1)(n
B), then ZRR is PLS deterministically because there
53
always exists a hyperplane that passes through all of the monochromatic batches of ZRR and
perfectly classifies non-monochromatic batches.
B.4 Characterizing the optimal direction of classifiers
Thus far, we have primarily considered the separability decomposition of Z π and ZRR. In fact,
we can say more about the direction of optimal classifiers under the logistic loss. First, we prove
Lemma 4.1.1, which constrains optimal directions via the separability decomposition. Next, we
leverage overparameterization and the rank properties shown in Proposition B.1.3 to characterize
the optimal direction under the logistic loss for data drawn from a density. Using these insights,
we can prove our main result of this section, Proposition B.4.3.
We first restate and prove Lemma 4.1.1.
Lemma B.4.1. Let Z = SLS ⊔ SSC be the separability decomposition of Z. If v is an optimal direction for
L, then v⊤x = 0 for all x ∈ Span(X SC) and yiv⊤xi > 0 for every (xi, yi) ∈ SLS.
Proof. By definition of SSC, there exists some (xi, yi) ∈ SSC such that yi ⟨v, xi⟩ ≤ 0. If ⟨v, xi⟩ ̸= 0,
then yi ⟨tv, xi⟩ → −∞ as t → ∞, which contradicts the assumption that v is an optimal direction.
Similarly, if yi ⟨v, xi⟩ ≤ 0 for some (xi, yi) ∈ SLS, then clearly u + tv cannot infimize L, as there
exists a hyperplane which strictly separates SLS and is orthogonal to Span(SSC).
Next, we restate and prove Proposition 4.1.2.
Proposition B.4.2. Suppose Assumption 1(a) holds. Assume that the iterates vπ(t) infimize Lπ, and their
projections onto Span(X SC
π )⊥ converge in direction to some optimal direction v∗
π for Lπ. Then the GD risk
LGD diverges if and only if Z π is PLS or LS and there exists some (xi, yi) ∈ ZGD such that yiv∗⊤
π xi < 0.
The analogous statement holds true for ZRR under Assumption 1(b). Furthermore, the if part holds true for
SS and RR without Assumption 1.
π must be orthogonal to all of Rd, so v∗
Proof. First suppose Assumption 1(a) holds. Then if Z π is SC, Lemma B.4.1 implies that any
optimal direction v∗
π = 0. Hence the iterates vπ(t) converge
to a finite optimum, which implies the GD risk cannot diverge. Note that if Assumption 1(a)
doesn't hold, then the only difference is that being orthogonal to X SC
π = 0.
Now suppose Z π is PLS or LS. Regardless of whether Assumption 1(a) holds, if vπ(t) infimizes
Lπ, we necessarily have ∥vπ(t)∥2 → +∞. Hence any mistake on (xi, yi) ∈ ZGD implies divergence.
And clearly, if there is no mistake on any (xi, yi) then the GD risk does not diverge.
π does not imply that v∗
The same proof also goes through for ZRR, so this proves the theorem.
At first glance, one might expect to be able to perfectly classify all the datapoints in the
overparameterized regime. However, under the logistic risk, the optimal direction instead puts
monochromatic batches on the decision boundary; the following proposition formalizes this notion.
B . Almost surely, for any π ∈ Sn,
Proposition B.4.3. Suppose Assumption 2, B > 2, and d > (B − 1) n
there exists v ∈ Rd which satisfies (1) for any non-monochromatic batch Z j
π) = Y j
π
and (2) for any monochromatic batch Z k
π for
the logistic risk Lπ necessarily satisfies both (1) and (2). The same conclusion holds for RR as well, with the
requirement d > (B − 1)(n
π = 0⊤. Furthermore, any optimal direction v∗
π we have sgn(v⊤X j
π we have v⊤X k
B).
54
More precisely, our analysis is motivated by the fact that if d ≥ n and X ∈ Rd×n is full-rank,
then given any c ∈ Rn we can find some halfspace v ∈ Rd such that v⊤X = c⊤. In our binary
classification setting, linear separability is implied by sgn(c⊤) = Y . However, we cannot directly
apply this fact because BN actually prevents X π from being full-rank due to the mean zero
constraint. However, it turns out that the following slightly weaker statement is true. We can
always find a halfspace v ∈ Rd that perfectly separates all the non-monochromatic batches. The
following lemma proves this half of the proposition.
Lemma B.4.4. Suppose Assumption 2, B > 2, and d > (B − 1) n
such that for every non-monochromatic batch Z j
conclusion holds for RR as well, with the requirement d > (B − 1)(n
π = (X j
π, Y j
B . Then almost surely there exists v ∈ Rd
π. The same
π), we have sgn(v⊤X j
π) = Y j
* * * xB
(cid:3) and Y j
π) = (cid:2)x1
π = BN(X j
(cid:3). Since Assumption 2
Proof. We denote X j
holds, it also follows that Proposition 3.2.1 holds. Hence, within each batch, any B − 1 of the
datapoints are linearly independent almost surely. This implies that we can find v ∈ Rd such that
for any batch X j
π and c ∈ RB−1, we have v⊤xi = ci for all i ∈ [B − 1]. In particular, we can pick ci
such that sgn(ci) = yi. Next, we show that v can be picked such that sgn(v⊤xB) = yB. The mean
zero constraint enforces that v⊤xB = − ∑B−1
i=1 ci. But if the labels are not monochromatic, we can
just increase the absolute value of one of the ci's so that sgn(− ∑B−1
i=1 ci) = yB, as desired.
* * * yB
B).
π = (cid:2)y1
Hence, in the overparameterized regime minimizing the logistic risk will lead to a classifier
which separates all the non-monochromatic batches. What happens to the monochromatic batches?
It turns out that minimizing the logistic risk will lead to a classifier whose decision boundary
contains all of the monochromatic batches.
B , any optimal direction v∗ ∈ Rd for the logistic risk simultaneously
Lemma B.4.5. Assuming d > (B − 1) n
puts all of the monochromatic batches on the decision boundary. More precisely, for any monochromatic
batch Z j
π = (X j
B), the same conclusion holds for
the RR dataset.
π = 0⊤. Similarly, if d > (B − 1)(n
π) we have v⊤
π, Y j
∗ X j
* * * yB
Proof. Again, we denote the monochromatic batch by Z j
π =
(cid:3). The logistic loss on a single input xi for classifier v ∈ Rd is l(v⊤xi, yi) =
(cid:2)y1
− log ρ(yiv⊤xi), where ρ(t) = 1/(1 + exp(−t)) is the sigmoid function. WLOG suppose that
yi = 1 for all i ∈ [B]. Hence the minibatch risk is
π by X j
* * * xB
π = (cid:2)x1
(cid:3) and Y j
−
B
∑
i=1
log ρ(v⊤xi) = −
B−1
∑
i=1
log ρ(v⊤xi) − log ρ
−v⊤
(cid:32)
(cid:33)
xi
.
B−1
∑
i=1
For each i we can look at the first order optimality condition for si = v⊤xi. This yields ρ(si) =
ρ(− ∑B−1
i=1 si).
Note that this is satisfied when si = 0 for all i ∈ [B], and by strict convexity this is the unique
minimizer. And because of overparameterization, we can find a v∗ that will satisfy si = 0 for each
monochromatic batch, i.e., the batch entirely lies on the decision boundary of the classifier defined
by v∗.
The proof carries over immediately to the RR setting, except in that setting, being overparame-
terized means d > (B − 1)(n
B). Hence the lemma is proved.
55
The geometric interpretation of Lemma B.4.5 is that in the overparameterized regime, if the
dataset contains any monochromatic batches, then any optimal direction v∗ must be orthogonal
to the subspace spanned by the monochromatic batches. Note, however, that the definition
of overparameterized here depends on whether we look at Z π or ZRR.
In the former case,
overparameterized means d > (B − 1) n
B , whereas in the latter case, overparameterized means
d > (B − 1)(n
B). This insight motivates the construction of the toy datasets in Section 4.2. We
conclude our characterization of the optimal direction in the overparameterized regime by proving
Proposition B.4.3.
Proof of Proposition B.4.3. Proposition 3.2.1 implies that for d > (B − 1) n
B and assuming assump-
tion 2, almost surely we have rank(X π) = (B − 1) n
B . We can lower bound the infimum of the SS
logistic risk by the sum of the infima of the mini-batch SS logistic risks. Combining Lemmas B.4.4
and B.4.5, the claim follows. The same argument holds for ZRR assuming d > (B − 1)(n
B).
C Proofs of technical lemmas
In this section we spell out the formal details of our guarantees for how permutations interact
with BN. In Appendix C.1, we show that given a batch size B = o(log n) and a constant number
of classes K, then w.h.p. over the choice of π there exists (many) monochromatic batches. In
other words, for small batch sizes there are many batches consisting solely of positive or negative
examples (in case of K = 2). Conversely, we show that above this threshold such monochromatic
batches do not appear w.h.p.. In Appendix C.2, we show that there is a commensurate threshold
above which the batch statistics themselves concentrate in the without-replacement setting. To do
so we will appeal to the recent results of Bardenet and Maillard (2015) on the concentration of
without-replacement estimators. Finally, in Appendix C.3, we prove that assuming the original
features were drawn from a density, the batch normalized features have maximal rank almost
surely. In other words, batch normalization preserves genericity of the original features modulo
the mean zero constraint inside each batch.
C.1 Presence of monochromatic batches
In this section we formally prove Lemma B.1.4 via standard concentration arguments. One of the
potential pitfalls of any mini-batch based algorithm is that its batches may not be representative
of the entire dataset. More precisely, let's suppose we have a dataset Z with labels coming from K
classes. Suppose furthermore that the dataset is balanced - each class contains n = Bm examples
(here K is a constant). For any batch size B which is not sufficiently large, i.e. B = o(log n), then
w.h.p. over the permutation π we will have Θ(n) batches which are monochromatic - batches
which only consist of examples in the same class. This is closely related to the classic coupon
collector problem, but we restate the guarantees here for the sake of completeness.
To prove this claim, we appeal to standard martingale concentration inequalities. Consider the
π is monochromatic], and set
π for i ∈ [Km] and define the indicator variables Ti = 1[Z i
batches Z i
T ≜ ∑i Ti, the total number of monochromatic batches.
Next, note that the sequence
E[T], E[T|T1], E[T|T1, T2], . . . , E[T|T1, T2, . . . , TKm]
56
is a Doob martingale. Indeed the martingale property follows from the tower property:
E[E[T|T1:k]| E[T|T1:(k−1)]] = E[T|T1:(k−1)].
Note that E[T|T1, . . . , TKm] = T and E[T1] = K(n
B)/(Kn
Let us now show that the martingale increments E[T|T1:k] − E[T|T1:(k−1)] are bounded a.s.. In
the worst case, the kth batch can only decrease this conditional expectation by at most K, since
for any fixed class we can only remove at most one monochromatic batch from it. Hence the
total number of potential monochromatic batches left can decrease by at most K. This worst case
B ). Hence by linearity E[T] = K2n
B
.
(n
B)
(Kn
B )
guarantee still holds under conditional expectation, so
Azuma-Hoeffding then tells us that for any ε > 0 we have
(cid:12)
(cid:12)
(cid:12)
E[T|T1:k] − E[T|T1:(k−1)]
(cid:12)
(cid:12)
(cid:12) ≤ K a.s..
P[|T − E[T]| ≥ ε] ≤ 2 exp
(cid:18)
−
Bε2
2nK3
(cid:19)
.
This gives us the following fact which we use in both the regression and classification setting.
Fact C.1.1. For any δ ∈ (0, 1), and a constant number of classes K with n datapoints each, we have with
probability at least 1 − δ that the total number of monochromatic batches T satisfies
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
T −
K2n
B
(n
B)
(Kn
B )
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:114)
≤
2nK3 log(2/δ)
B
.
For K = O(1), we note that the above inequality guarantees that we can get within O((cid:112)n log n)
of the true expectation with at most 1/ poly(n) failure probability. For the toy regression dataset
in Section 3.3, we have K = 2 and B = 2, so we can use Fact C.1.1 to deduce that there will be Θ(n)
monochromatic batches with high probability. We can also use Fact C.1.1 to prove Lemma B.1.4.
Proof of Lemma B.1.4. In the classification setting, we have K = 2 classes (positive and negative).
Using the folklore inequalities
(cid:17)k
(cid:16) n
k
≤
(cid:19)
(cid:18)n
k
≤
(cid:17)k
,
(cid:16) en
k
we can deduce the lower bound on the expectation of T:
E[T] ≥
4n
B(2e)B .
The lower bound is Ω(n1−ε) for any ε > 0 whenever B = o(log n), so indeed when when
B = o(log n) we have a positive number of monochromatic batches w.h.p.
Let us now upper bound the probability of obtaining any monochromatic batches. We have
P[T1 = 1] = 2
(n
B)
(2n
B )
≤ 2
∏B−1
k=0 (n − k)
∏B−1
k=0 (2n − k)
≤ 2
∏B−1
k=0 (n − k)
∏B−1
k=0 2(n − k)
≤ 2−B+1.
Hence by union bound the probability that T > 0 is upper bounded by 4n
B*2B . This is 1/ poly(n)
for some B = Ω(log n), so indeed when B = Ω(log n) we have no monochromatic batches with
probability at least 1 − 1/ poly(n). This concludes the proof.
57
C.2 Concentration of batch statistics for without-replacement sampling
In the following, we are generating B samples of Xi ∈ R without replacement from a population of
size n, contained in [a, b] a.s.. We let μ be the population mean and σ2 be the population variance.
Lemma C.2.1 (Corollary 2.5 in (Bardenet and Maillard, 2015)). Let ˆμB denote the sample mean for a
sample of size B drawn without replacement from the overall population. For all B ≤ n and δ ∈ (0, 1) we
have with probability at least 1 − δ that
| ˆμB − μ| ≤ (b − a)
(cid:114)
log(2/δ)
B
.
Similarly, they prove the following result about concentration of the empirical variance
Lemma C.2.2 (Lemma 4.1 in (Bardenet and Maillard, 2015)). Let ˆσ2
B
(biased) empirical variance estimator and ˆσB ≜
least 1 − δ that
i=1(Xi − ˆμB)2 be the
ˆσ2
B. Then for all δ ∈ (0, 1) we have with probability at
(cid:113)
≜ 1
B
∑B
ˆσB ≥ σ − 3(b − a)
(cid:114)
log(3/δ)
2B
.
We now prove the other side of this concentration inequality with a quick application of
(Maurer, 2006, Theorem 1), following the same notation as in Bardenet and Maillard (2015).
Lemma C.2.3. For all δ ∈ (0, 1) we have with probability at least 1 − δ that
ˆσB ≤ σ + (b − a)
(cid:114)
log(1/δ)
2B
.
Proof. We take the self bounded random variable Z = B
(b−a)2
̃VB, where
̃VB ≜ 1
B
B
∑
i=1
(Xi − μ)2
is computed with the samples Xi sampled with replacement. On the other hand,
VB ≜ 1
B
B
∑
i=1
(X′
i − μ)2
is computed with the samples X′
i sampled without replacement. We can relate the concentration
of VB to that of ̃VB; the latter quantity is possible to analyze with the entropy method. Indeed,
a routine modification of the proof of Bardenet and Maillard (2015, Lemma 3.3) (which uses
essentially the same definition of Z) implies that
(cid:20)
P
VB − σ2 ≥
(cid:21)
(b − a)2
B
ε
≤ exp
(cid:18)
−
(b − a)2ε2
2Bσ2
(cid:19)
.
Solving for ε in terms of δ yields ε =
(cid:113) 2Bσ2
(b−a)2 log(1/δ), so we obtain
(cid:34)
P
VB − σ2 ≥ (b − a)σ
(cid:114)
2 log(1/δ)
B
(cid:35)
≤ δ.
58
Since VB = ( ˆμB − μ)2 + ˆσ2
B, we can complete the square to obtain
B ≥ ˆσ2
ˆσ2
P
B ≥
(cid:32)
σ + (b − a)
(cid:114)
log(1/δ)
2B
(cid:33)2
≤ δ.
So with probability at least 1 − δ, we have
(cid:32)
ˆσ2
B ≤
σ + (b − a)
(cid:114)
log(1/δ)
2B
(cid:33)2
,
and taking square roots implies the desired result.
Now, let us return to the question of concentration for batch norm with a randomly selected
permutation π. The following proposition shows that assuming the batch size is large enough,
the features of corresponding SS and GD datapoints are close to each other.
Proposition C.2.4. If
(cid:32)
B = Ω
log(nd)
mink∈[d]( σk
bk−ak
)2ε2
(cid:33)
,
then with probability at least 1 − 1/ poly(n, d) we have
(cid:13)
(cid:13)X π − π ◦ X GD
(cid:13)
(cid:13)2,∞ ≤
ε
1 − ε
(cid:13)
(cid:13)X GD
(cid:13)
(cid:13)2,∞ +
√
d
ε
1 − ε
.
Here, we remind the reader that for a matrix A ∈ Rd×n, we define ∥A∥2,∞ = maxi∈[n] ∥A:,i∥2, i.e. the
maximum Euclidean norm of the columns.
Proof. WLOG consider the unnormalized first batch X 1
π = {x1, . . . , xB}. We initially handle
concentration along its first coordinate {x1, . . . , xB} for its first datapoint x1. Write ˆμ, ˆσ ∈ Rd
to denote the mini-batch mean and standard deviation, respectively, and ˆμk, ˆσk ∈ R for the kth
coordinate of these vectors. Similarly let μ, σ ∈ Rd denote the full-batch mean and standard
deviation, and let μk, σk ∈ R to denote the kth coordinate of these vectors, respectively. Finally, let
a, b ∈ Rd denote the coordinate-wise min and max of X, with ak, bk ∈ R denoting the min and
max for the kth coordinate of X.
Hence, the first feature of the first datapoint in the normalized first batch X 1
π is x1− ˆμ1
ˆσ1
, whereas
the corresponding quantity in X GD is x1−μ1
σ1
Pick
.
(cid:32)
B = Ω
(cid:33)
.
(log(1/δ)
( σ1
)2ε2
b1−a1
Then from Lemmas C.2.1 to C.2.3, we see that | ˆμ1 − μ1| ≤ εσ1 and | ˆσ1 − σ1| ≤ εσ1 with probability
at least 1 − δ for the first datapoint x1.
59
Now, we have
(cid:12)
(cid:12)
(cid:12)
(cid:12)
x1 − ˆμ1
ˆσ1
−
x1 − μ1
σ1
(cid:12)
(cid:12)
(cid:12)
(cid:12)
=
≤
≤
≤
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
−
(cid:12)
(cid:12)
(cid:12)
(cid:12)
x1 − μ1
ˆσ1
σ1 − ˆσ1
ˆσ1
εσ1
(1 − ε)σ1
(cid:12)
(cid:12)
(cid:12)
(cid:12)
x1 − μ1
σ1
(cid:12)
x1 − μ1
(cid:12)
(cid:12)
(cid:12)
σ1
(cid:12)
x1 − μ1
(cid:12)
(cid:12)
(cid:12)
σ1
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12)
x1 − μ1
σ1
ε
1 − ε
+
+
+
+
(cid:12)
μ1 − ˆμ1
(cid:12)
(cid:12)
ˆσ1
(cid:12)
|μ1 − ˆμ1|
ˆσ1
εσ1
(1 − ε)σ1
ε
1 − ε
.
To aggregate this bound across features, we need to pick B such that | ˆμk − μk| ≤ εσk and
| ˆσk − σk| ≤ εσk for every feature k ∈ [d]. Indeed, this is achieved via the union bound by picking
δ = 1/ poly(d) and
B = Ω
For this batch size, we see that
(cid:32)
log(1/δ)
mink∈[d]( σk
bk−ak
(cid:33)
.
)2ε2
(cid:13)
(cid:13)
(cid:13)
(cid:13)
x1 − ˆμ
ˆσ
−
x1 − μ
σ
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
≤
ε
1 − ε
(cid:13)
(cid:13)
(cid:13)
(cid:13)
x1 − μ
σ
(cid:13)
(cid:13)
(cid:13)
(cid:13)2
+
√
d
ε
1 − ε
.
Note that a similar inequality holds for all of x1, . . . , xB. Now, recalling the definition of ∥*∥2,∞, by
applying union bound on all the batches, we have
(cid:13)
(cid:13)X π − π ◦ X GD
(cid:13)
(cid:13)2,∞ ≤
ε
1 − ε
(cid:13)
(cid:13)X GD
(cid:13)
(cid:13)2,∞ +
√
d
ε
1 − ε
,
which occurs with probability at least 1 − 1/ poly(n, d) when we appropriately choose B =
Ω
(cid:18)
(cid:19)
log(nd)
σk
bk −ak
mink∈[d](
)2ε2
.
We now use the above proposition to prove Proposition B.1.6.
Proof of Proposition B.1.6. Conditions (2) and (3) in the definition of γ-robustness ensures that
√
mink∈[d]( σk
) as in Proposi-
bk−ak
ε2
tion C.2.4, we conclude that with probability at least 1 − 1/ poly(n, d) we have
d). Hence taking B = Ω( log(nd)
)2 = Ω(1) and
(cid:13)
(cid:13)2,∞ = O(
(cid:13)
(cid:13)X GD
(cid:13)
(cid:13)X π − π ◦ X GD
(cid:13)
(cid:13)2,∞ ≤ O
(cid:32)
√
d
ε
1 − ε
(cid:33)
.
Hence, by taking ε = O( γ√
d
), we see that
(cid:13)
(cid:13)X π − π ◦ X GD
(cid:13)
(cid:13)2,∞ ≤ O(γ).
Plugging this choice of ε back into our definition of B, we conclude that when B = Ω( d log(nd)
X π concentrates around π ◦ X GD within distance γ.
γ2
),
60
C.3 Rank of batch normalized features
In this section we prove Proposition 3.2.1, which states that for batch sizes greater than 2, Assump-
tion 2 implies that the batch normalized dataset will be full-rank (and hence full-dimensional)
almost surely.
One shift in perspective that is fruitful for proving linear independence is to view batch
normalization as an operation that returns functions of the input dataset. Since BN operates
independently on each of the d features, we first handle the case where the input is a batch of
scalars. Let ([n]
B ) denote the set of all (n
B) batches of size B that can be created from n datapoints
contained in X. Fix an arbitrary labelling of these (n
B) batches, and let B j refer to the jth such
batch. WLOG suppose that B1 = {x1, . . . , xB} ∈ RB.
Formally, let F B ≜ (cid:8) f : RB \ (cid:8)x ∈ RB | x1 = x2 = * * * = xB
valued functions on batches of size B where BN is defined. On batch B j = (cid:8)xj1, . . . , xjB
operation that maps this batch to the set of B functions
, where
(cid:111)B
(cid:110)
(cid:9) → R(cid:9) denote the space of real
(cid:9), BN is an
gj
i (B j)
i=1
i (B j) ≜ xji − μj
gj
σj
∈ F B
where μj and σj are the empirical mean and standard deviation, respectively of B j. If j is clear
from context, we may drop the superscript j without chance of confusion. We also sometimes
abuse notation and write gj
i as a function of X, since X contains all datapoints in B j. From this
perspective, BNπ maps a dataset of n datapoints to n functions.
We first show that, within a batch, the functions have rank B − 1 over R.
Lemma C.3.1. Viewed as functions, any subset of B − 1 functions of the batch normalized outputs
(cid:8)g1
have rank B − 1 over R.
(cid:110) x1−μ
(cid:9) =
(cid:111)
σ , . . . , xB−μ
σ
i
Proof. First, we note that the functions xi are linearly independent over R for i ∈ [n]. WLOG take
the subset of B − 1 functions to be (cid:8)g1
(cid:9)B−1
i=1 . Suppose that there is a dependence relationship
i
B−1
∑
i=1
ci
xi − μ
σ
= 0.
Rearranging, we see that
B−1
∑
i=1
(cid:32) B
∑
t=1
and because of linear independence of the xi's as functions over R and only the right-hand side
contains xB, the only way this can happen is if ∑B−1
i=1 ci = 0. But then we have a dependence
relationship between the xi's for i ≤ B − 1. Linear independence of the xi's thus implies that
ci = 0 for each i.
(cid:33)(cid:32)B−1
∑
i=1
cixi =
1
B
xt
(cid:33)
ci
With the above lemma in hand, we can show that as functions, any collection of batch
normalized outputs are essentially full rank. The caveat is we need to throw out one function in
each batch, as each batch is trivially dependent because of the zero mean constraint.
Proposition C.3.2. Let B > 2. Consider the B(n
B) batches B j ∈ ([n]
(n
B ). If we take any subset of (B − 1)(n
B) functions that are the batch normalized outputs of all
B) of these functions obtained by removing one
61
function from each of the (n
the rank of the functions corresponding to any π is (B − 1) n
B .
B) batches, then the rank of these functions over R is (B − 1)(n
B). In particular,
i
(cid:111)B−1
(cid:9)B−1
i=1
(cid:110) xi−μ
σ
Proof. Consider the batch B1 = {x1, . . . , xB}. By Lemma C.3.1, we know that the functions
(cid:8)g1
=
i=1
subset of the (B − 1)(n
formed by throwing out gj
(B − 1)(n
are linearly independent. Consider a dependence relation amongst any
B) described in the theorem statement. WLOG we can suppose that this was
B from each batch B j and consider a dependence relation between the
B) remaining functions. The dependence relation reads
B−1
∑
i=1
xi − μ
σ
B−1
∑
i=1
ci,jgj
i.
∑
j>1
ci,1
=
(C.1)
We show that some setting of the input xi for i ∈ [n] yields a contradiction unless ci,1 = 0 for
i ∈ [B]. The main insight is that BN has jump discontinuities at the points where it is undefined,
i.e., where the entire batch is equal to the same thing.
More formally, for i > B we set the other datapoints xi to be arbitrary pairwise distinct positive
real numbers. Suppose for the sake of contradiction that ci,1 ̸= 0 for some i ∈ [B]; WLOG we can
assume that i = 1. Since the functions on the LHS are linearly independent by Lemma C.3.1, the
LHS is not identically zero. We show that the LHS of Eq. (C.1) exhibits discontinuous behavior in
the punctured neighborhood around (x1, . . . , xB) = 0, whereas the RHS of Eq. (C.1) is continuous
on the same neighborhood; this yields a contradiction.
Indeed, set (x1, x2, x3, . . . , xB) = (ε, ε2, −ε − ε2, 0, . . . , 0), where ε ̸= 0. We have
√
x1 − μ
σ
=
(cid:112)
Bε
ε2 + ε4 + (ε + ε2)2
.
If ε → 0+, then the the first normalized coordinate approaches +
(cid:113)
(cid:113)
2 . However, if ε → 0−,
B
2 . This is a contradiction, since the RHS of
B
then the first normalized coordinate approaches −
Eq. (C.1) is continuous as a function of ε. We conclude that ci,1 = 0 for all i ∈ [B − 1].
The same argument holds if we replace the LHS with any batch B j. Hence, ci,j = 0 for all
i ∈ [B − 1] and j ∈ [(n
B), as
desired. Notice also that this argument also shows that the functions corresponding to the batches
in π also have rank (B − 1) n
B .
B)]. We conclude the rank of these (B − 1)(n
B) functions is (B − 1)(n
Note that the assumption that B > 2 is critical for the construction in the proof. If B = 2, then
σ ∈ {±1}, and the proof breaks down. The batch normalized dataset will be a Boolean
actually xi−μ
matrix; hence, its rank cannot be analyzed by using density arguments.
The following lemma establishes that the zero set of any nontrivial linear combination of the
gj
i's is a measure zero subset of Rn.
Lemma C.3.3. Suppose that ci,j are not identically zero. Then for B > 2, the zero set of ∑B−1
i=1
a measure zero subset of Rn.
∑(n
B)
j=1 ci,jgj
i is
Proof. Since B > 2, Proposition C.3.2 implies that f (X) ≜ ∑B−1
i is not identically zero.
i=1
Furthermore, f (X) is real analytic on finitely many connected components of Rn, since each of
the functions gj
i are real analytic on finitely many connected components of Rn. The claim follows
by applying Proposition 0 in Mityagin (2015).
∑(n
B)
j=1 ci,jgj
62
Having established these results, we can finally prove Proposition 3.2.1.
Proof of Proposition 3.2.1. Denote
and the (B − 1)(n
B) functions
X =
∈ Rd×n,
X1
...
Xd
gj
i (X) =
gj
i,1(X1)
...
gj
i,d(Xd)
∈ Rd
We can assemble these vector valued functions into a matrix G(X) of size d × (B − 1)(n
B) with
i,k(X). Now consider the determinant of
(cid:9) submatrix of these scalar functions, which is itself a
the kth row consisting of the scalar valued functions gj
any min (cid:8)d, (B − 1) n
function of X.
(cid:9) × min (cid:8)d, (B − 1) n
B
B
To prove the claim, it suffices to show that this determinant - which is a function of X ∈ Rd×n
- is analytic almost everywhere and not identically zero; then Lemma C.3.3 implies that it vanishes
on a measure zero set of Rd×n.
We prove the above claim by induction on d. For d = 1, note that for any i, j, the scalar function
gj
i,1(X) is not identically zero and is analytic on finitely connected components of Rd×n. Now
suppose the claim is true for d, we prove the claim for d + 1. When we use cofactor expansion
along the first row of G, which has functions gj
i,1 which crucially only depend on the X1, we
obtain
B−1
∑
i=1
(n
B)
∑
j=1
(−1)i+jgj
i,1(X1) det(cid:0)Mi,j(X)(cid:1),
where Mi,j denotes the minor corresponding to the the ith function of batch j. Note that these
minors are not functions of X1, so they can be treated as constants with respect to X1. By
induction these constants are nonzero almost surely. Then Proposition C.3.2 implies that the
determinant, which is a linear combination of the functions gj
i,1 is itself is not zero identically. Also,
the determinant is manifestly piecewise analytic on finitely connected components of R(d+1)×n,
being a polynomial of such functions. Hence the induction is completed.
We can now finish off the proof of the proposition. When Assumption 2 holds, the probability
that the data falls in measure zero set is a probability zero event. In other words, almost surely any
such d × (B − 1)(n
B) matrix constructed by batch normalizing and throwing out one normalized
point in each batch is full rank. The same argument holds for the (B − 1) n
B functions that
correspond to the batch normalized outputs for a permutation π. Hence the proposition is
proved.
D Additional experiments on real data
In this section we provide detailed explanations of our experimental setup and present our
additional experiments for regression and classification. All experiments were implemented in
PyTorch 1.12.
63
D.1 Experiment details
We first define the architectures used in our real data experiments outlined in Section 4.3.
For the linear+BN networks, the 1-layer network is
X (cid:55)→ W1
Γ
1BN(X),
On the other hand, the 2-layer network is
X (cid:55)→ W2Γ2BN(W1X)
and the 3-layer network is
X (cid:55)→ W3Γ3BN(W2Γ2BN(W1X)).
Hence the difference between the 1-layer network and deeper network is that the deeper networks
have tunable parameters inside of BN.
For the MLP experiments, the 3-layer network is
X (cid:55)→ W3 ReLU(Γ3BN(W2 ReLU(Γ2BN(W1X)))).
For the ResNet18 experiments, we used the ResNet18 architecture available through PyTorch,
using ResNet18_Weights.DEFAULT pretrained weights.
The linear and BN layers were all initialized using the default PyTorch initialization. For
the linear+BN networks, the linear layers were instantiated with a width of 512 and bias=False.
For the 3 layer MLP, the linear layers were instantiated with a width of 512 and bias=True. The
BN layers were instantiated with track_running_stats=False. As alluded to in Section 1.2, to
evaluate the training GD risk LGD in the eval loop, we passed in the entire dataset as a single
batch, thus avoiding EMA altogether. Except for the ResNet18 experiments, the images in the
dataset were flattened into vectors.
Except for in the respective batch size and momentum ablation study (Figures 11 and 12),
we used batch size B = 128 and no momentum. Note that for all of the datasets, log2 n ≈ 16,
which suggests that we are in the asymptotic regime where divergence can happen as stated in
Theorem 4.1.3.
We now explain the difference in divergence behavior between the 1-layer and deeper lin-
ear+BN networks for SS. As suggested by Theorem 4.1.3, divergence can happen if the separability
decomposition of ZGD is not robust to perturbation. In the 1-layer case, the data remains far from
being linearly separable. Meanwhile, in the deeper case, the network is incentivized to train the
parameters inside BN such that the final features (e.g., BNπ(W1X)) are closer to being LS. But
the nonlinearity of BN is not enough to make BNπ(W1X) robustly LS. This also explains why
introducing nonlinear activations prevents the divergence phenomenon.
We also note that in reality RR is run for T epochs. Thus, if T < (n
B)
n
B
, the optimization routine
only sees a proper subset of ZRR. However, there are other forces that help ensure that the subset
of ZRR actually seen during optimization is SC and satisfies Assumption 1(b). For example, it is
likely that the algorithm sees non-monochromatic batches that also cause the hulls to overlap. One
way this can happen is if 0 is in the relative interiors of the convex hulls of the monochromatic
portion of each batch. Moreover, with extremely high probability we never see a repeat batch, so
(cid:9). For us,
by Proposition B.1.3 the rank of the subset of ZRR is w.h.p. equal to T * min (cid:8)d, (B − 1) n
B
64
d = 10 * 512, B = 128, and n ≥ 50000, so the rank of the subset of ZRR we see easily outstrips the
dimensionality of the final linear layers. This ensures that Assumption 1(b) holds.
In Figure 11, we see that divergence on 3 layer linear+BN networks generally occurs for large
batch sizes, which corroborates Theorem 4.1.3. These batch sizes were picked because they are
common choices for batch sizes in practice. For the largest batch size (B = 128), there does not
appear to be divergence within 1000 epochs, which we address below.
In Figure 12, we see that the presence of momentum preserves divergence for SS, and in some
cases accelerates it. Note that for each stepsize we used the same permutation. For the η = 10−4
experiment, although the 0 momentum run did not start to diverge within 1000 epochs, the 0.9
and 0.99 momentum runs started to diverge. This further lends evidence to the claim that the
apparent reason for no divergence for η = 10−4 without momentum is that the small learning rate
leads to slower convergence to an optimal direction for Lπ.
Figure 7: Loss evolution for lπk (M (k)) for experiment described in Section 3.4.
Figure 8: Eventual separation between SS and RR for 3 layer linear+BN network for η = 10−4 after
around epoch 1200 on CIFAR10.
65
020406080100Epoch1234567SS train riskConvergence of k(k0)RRSS*05001000150020002500Epoch1.51.61.71.81.9GD train riskLR0.0001ShufflingRRSSFigure 9: Evidence that the 2 layer and 3 layer linear+BN actually had diverging GD risks when
trained with SS. Indeed, the SS risk for both 2 and 3 layer networks continues to decrease, whereas
the 1 layer network seems to plateau.
Figure 10: No divergence occurs for 1, 2, and 3 layer linear networks without BN trained with SS.
Here η = 10−2.
Figure 11: Batch size ablation. These experiments were done on 3 layer linear+BN networks;
each subfigure shows the results of training with different stepsizes η ∈ (cid:8)10−2, 10−3, 10−4(cid:9). All
experiments were performed on CIFAR10. All batch sizes are in the regime where divergence can
happen according to Theorem 4.1.3.
66
050010001500200025003000Epoch0.00.51.01.52.02.5SS train riskDepth123ShufflingSS02004006008001000Epoch1.61.71.81.92.02.12.22.3GD train riskLinear networks without BNDepth123ShufflingRRSS02004006008001000Epoch234567GD train risk=10202004006008001000Epoch23456GD train risk=10302004006008001000Epoch1.52.02.53.03.54.04.5GD train risk=104Batch Size3264128ShufflingRRSSFigure 12: Momentum ablation. These experiments were done on 3 layer linear+BN networks;
each subfigure shows the results of training with different stepsizes η ∈ (cid:8)10−2, 10−3, 10−4(cid:9). All
experiments were performed on CIFAR10. For each subfigure, the experiment was run with the
same random permutation.
67
02004006008001000Step1.52.02.53.03.54.04.55.05.5Value=10202004006008001000Step1.52.02.53.03.54.04.55.0Value=10302004006008001000Step1.501.752.002.252.502.753.003.25Value=104Momentum0.00.90.99ShufflingRRSSE Calculations for toy datasets
In this section we do the detailed calculations and provide additional figures to understand the
toy datasets we introduced in Sections 3.3 and 4.2. Since both constructions use B = 2, we remind
the reader that the batch normalization of any two distinct real numbers is (−1, 1). It follows
that if we batch normalize with B = 2, we obtain X π ∈ {−1, 1}d×n. Recall the distorted risk Lπ
reflects the single-shuffle batch normalized dataset Z π. This Lπ is a random quantity, and it is
over this source of randomness (the construction of the batches) that we show that there is a gap
between SS, RR, and GD.
E.1 Regression toy dataset
Proposition E.1.1. There exists a regression dataset Z = (X, Y ) ∈ [−1, 1]1×16n × [−1, 1]1×16n such
that the following statements hold with batch size B = 2:
(1) M ∗
(2) M ∗
RR = 0.
GD = M ∗
π ̸= 0 with probability at least 1 − O( 1√
n
).
(3) |M ∗
π| = Ω( 1√
n
) with constant probability.
We first describe the construction and then prove that the dataset satisfies the properties
outlined above.
Formal construction of regression dataset: Construct the dataset as follows. Take A ∈ R1×4n to
be 4n equally spaced points in the interval ( 3
4 , 1). Define
X 1 = A;
1
2
1⊤;
X 3 = −A +
X 2 = −A
X 4 = A −
1⊤
1
2
and
Y 1 = 1⊤;
Y 3 = −1⊤;
Y 2 = 1⊤
Y 4 = −1⊤.
Notice that the indices also match which quadrant the cluster of points are in. Visually, these four
groups of points Z i ≜ (X i, Y i) are clusters with the ith cluster in the ith quadrant. For brevity,
we also refer to these clusters by their index i only, so cluster 1 refers to the cluster Z1 = (X 1, Y 1),
and so on. These definitions are consistent with the clusters depicted in Fig. 13a.
Then take X = (cid:2)X 1 X 2 X 3 X 4(cid:3) ∈ R1×16n and Y = (cid:2)Y 1 Y 2 Y 3 Y 4(cid:3) ∈ R1×16n. After
applying BN with permutation π and batch size 2, we obtain a dataset X π with every point being
located in one of four SS clusters Z i
π) for i ∈ [4] located at (±1, ±1) with the same
π
relative labelling: Z1
π is located at (1, 1) and then labelling counterclockwise (see Fig. 13b).
≜ (X i
π, Y i
In Fig. 13a, we visualize the construction with n = 3 (so the depicted dataset has 16n = 48
datapoints). We plot the slopes of the M ∗
RR (purple dash-dotted line),
and typical values for M ∗
π (yellow dotted line). In Fig. 13b, we show what Z π looks like for a
typical permutation π. The sizes of the points represent the number of points that end up in the
corresponding cluster.
GD (green solid line), M ∗
68
(a) Unnormalized toy regression dataset Z demon-
strating distortion of SS with constant probability.
Notice how the GD and RR lines are aligned with
slope 0, but the SS lines are distorted away from 0.
E.1.1 Analyzing the regression toy dataset
(b) Toy regression dataset after BN with permu-
tation π. The size of the point corresponding to
Zi
π represents the number of normalized points in
Zi
π (not to scale), and here we picked π such that
M ∗
π = 1
4 .
In order to prove this proposition, we will need the following standard technical estimate on the
asymptotics of binomial coefficients (see e.g. Thomas and Joy (2006))
Lemma E.1.2. For all n and k we have
(cid:114) n
8k(n − k)
2H(k/n)n ≤
(cid:114)
(cid:19)
(cid:18)n
k
≤
n
πk(n − k)
2H(k/n)n,
where H(p) ≜ −p log2 p − (1 − p) log2(1 − p) is the binary entropy function.
Now let us prove the prove the proposition.
Proof of Proposition E.1.1. First, it is clear from the symmetry of X that YGDX
This proves the first half of (1).
⊤
GD = 0, so M ∗
GD = 0.
π denote the number of points that end up in cluster Z i
Setup: For i ∈ [4], let ki
with permutation π. Since we have M ∗
In fact, more is true: we claim that M ∗
π = 1
π = 0 if and only if k1
To see why this is true, first note that the label Y is unaffected by BN. Hence, there are
necessarily 8n points that end up with y coordinate 1. It follows that if there are k points in Z1
π,
then there are 8n − k points in Z2
π. Similarly, if there are j in Z3
π. On
the other hand, recall that BN with B = 2 and d = 1 always sends one point in each batch to
π, then there are 8n − j in Z4
π after normalizing
π completely determine M ∗
π.
⊤
π , evidently the ki
16n YπX
π = 4n.
69
1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00Cluster 1Cluster 2Cluster 3Cluster 4ZZ1Z2Z3Z4M*GDM*M*RR1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00ZZ1Z2Z3Z4M*GDM*M*RRx = +1 and one point to x = −1. Hence, there are 8n points that end up with x coordinate 1,
which means k + 8n − j = 8n, implying that k = j.
Referring back to the formula for M ∗
π, we see that
M ∗
π =
1
16n
4
∑
i=1
π(X i
Y i
π)⊤
=
=
(k − (8n − k) + k − (8n − k))
1
16n
k − 4n
4n
.
Hence M ∗
clusters represent ki
To analyze k1
π = 0 if and only if k1
π = 4n. Referring back to Fig. 13b, we see that the sizes of the
π with slope 1
π, and the plotted M ∗
4 corresponds to a π where k1
{i,j}
π, for i, j ∈ [4] we introduce the random variables T
π
to denote the number
of batches formed with one point from cluster i and cluster j with permutation π. Similarly
let U ≜ {1, 2} denote the upper clusters and L ≜ {3, 4} denote the lower clusters. Define
{i,L}
T
, which represents the total number of batches with one point in cluster
π
{2,L}
{U,L}
+ T
i and another point in L when using permutation π. Finally, define T
,
π
π
which represents the total number of batches with one point in cluster U and another in L with
permutation π.
{i,4}
{i,3}
π + T
π
{1,L}
≜ T
π
π = 5n.
≜ T
With this notation in hand, let us prove the claim. Evidently, k1
. Because we established earlier that k1
{U,U}
we have k2
π = T
π
{1,L}
and only if T
π
batches is the same as the number of {2, L} batches.
{2,L}
+ T
π
{2,L}
. In words, this means that M ∗
= T
π
{U,U}
{1,L}
π = T
+ T
π
π
π = 8n, then k1
π + k2
. Similarly
π = 4n if
π = 0 if and only if the number of {1, L}
RR averages out distortion: For every π we can find π′ such that M ∗
{1,L}
we can always find π′ that swap T
π
and vice versa. Then Proposition 3.3.1 implies that M ∗
π. This is because
, by turning all {1, L} batches into {2, L} batches
RR = 0, which proves the second half of (1).
π′ = −M ∗
{2,L}
and T
π
SS is distorted: Now, let us show that P[k1
π = 4n] = O( 1√
n
{2,L}
{1,L}
= T
= 2t, we can compute the probability that T
π
π
{U,L}
= t exactly. Indeed, of the 4n
on T
π
points in cluster 1, we pick t of them to form batches with L, and similarly for cluster 2. This gives
{2,L}
(4n
= T
= t. In total, there are 8n points in U and we picked 2t of them to
t )
π
match with L, which gives a denominator of (8n
). The main idea is that conditioned
{1,L}
ways for T
π
2
2t). Hence
P[k1
{U,L}
π = 4n|T
π
= 2t] =
2
(4n
t )
(8n
2t)
.
In order to obtain the O( 1√
n
) bound we desire, we need to use the fact that T
{U,L}
π - the
number of batches between U and L - concentrates tightly. In fact, if we color the 4 clusters
corresponding to membership in U and L and slightly generalize the analysis leading to Fact C.1.1,
(cid:12)
(cid:12) ≤ 2C(cid:112)n log n with probability
(cid:12)
we obtain that for some absolute constant C, we have
at least 1 − 1/n.
(cid:12)
{U,L}
(cid:12)
(cid:12)T
π
− 4n
70
Applying Lemma E.1.2, we obtain for all t such that |t − 2n| ≤ 2C(cid:112)n log n, we have
P[k1
{U,L}
π = 4n|T
π
= 2t] = O
4n )n
n
t(4n−t) 28H( t
(cid:113) n
t(4n−t) 28H( t
(cid:19)
4n )n
(cid:18)(cid:114) n
= O
= O
t(4n − t)
(cid:19)
(cid:18) 1
√
n
.
(E.1)
(E.2)
(E.3)
Hence we have
P[k1
π = 4n] =
≤
4n
∑
t=0
1
n
+
P[k1
{U,L}
π = 4n|T
π
{U,L}
= 2t] P[T
π
= 2t]
P[k1
{U,L}
π = 4n|T
π
{U,L}
= 2t] P[T
π
= 2t]
n log n
∑
√
|t−2n|≤C
(cid:18) 1
√
n
(cid:19)
+ O
(cid:18) 1
√
n
(cid:19)
,
≤
1
n
≤ O
{U,L}
where in the second line we have used the union bound along with the fact that T
π
and in the third line we have used Eq. (E.3). This proves (2).
concentrates,
Quantitative SS distortion bounds with constant probability: Finally, we show (3). Suppose
that k1
n). The above analysis for the case of d = 0 immediately generalizes
to show that, if t − d > 0,
π = 4n + d for |d| = O(
√
P[k1
{U,L}
π = 4n + d|T
π
= 2t − d] =
t )( 4n
(4n
t−d)
( 8n
2t−d)
.
Notice that since 2t − d concentrates around 4n, it suffices to only consider the high probability
regime where 2t − d = 4n + O((cid:112)n log n). In particular, since |d| = O(
n), we have t − d = O(t).
√
Thus, if we plug in Lemma E.1.2, we obtain in the regime where t − d = O(t) that
t )( 4n
(4n
t−d)
( 8n
2t−d)
(cid:18) 1
√
= O
(cid:19)
t
24n[H( t
4n )+H( t−d
4n )−2H( 2t−d
8n )].
Concavity of binary entropy implies that H( t
4n ) + H( t−d
8n ) ≤ 0. It follows that
P[k1
{U,L}
π = 4n + d|T
π
= 2t − d] = O
4n ) − 2H( 2t−d
(cid:19)
(cid:18) 1
√
.
t
71
Following the same argument as in the d = 0 case, we have for |d| = O(
√
n) that
P[k1
{U,L}
π = 4n|T
π
{U,L}
= 2t − d] P[T
π
= 2t − d]
P[k1
{U,L}
π = 4n + d|T
π
{U,L}
= 2t − d] P[T
π
= 2t − d]
√
n log n
P[k1
π = 4n + d] =
≤
4n
∑
2t−d=0
1
n
+
|t− d
∑
2 −2n|≤C
(cid:18) 1
(cid:19)
√
n
+ O
(cid:18) 1
√
n
(cid:19)
,
≤
1
n
≤ O
From here, it follows that there exists some positive constant c such that
P[
(cid:12)
(cid:12)
(cid:12)k1
π − 4n
√
(cid:12)
(cid:12)
(cid:12) > c
n] = Ω(1),
which proves (3).
E.2 Classification toy dataset
In this section, we motivate how we constructed our toy classification dataset parameterized by n.
We then give a detailed construction and analysis of the dataset, parameterized by n. We plot the
unnormalized Z in Fig. 14a and the normalized ZGD in Fig. 14b for n = 10.
The main idea is that since d = 2 and the optimal direction is orthogonal to the SC portion
of the separability decomposition (Lemma 4.1.1), we can fix the optimal directions of Z π and
π ) and Span(X SC
ZGD by carefully constraining Span(X SC
GD), respectively. For, ZGD we carefully
−
select the boundary points Xbdr which define the boundary of conv(X
GD) so
that dim(Span(X SC
GD)) = 1. For Z π, we need to ensure that Span(X SC
π ) is a one dimensional
subspace of R2 which is close to orthogonal with Span(X SC
GD). Although we can guarantee
dim(Span(X SC
π )) ≥ 1 w.h.p., the main subtlety here is ensuring that equality holds with con-
stant probability. Given the above, we are afforded the luxury of adding datapoints which are
misclassified by v∗
+
GD) and conv(X
π, the optimal direction of Lπ.
Proposition E.2.1. There exists a classification dataset Z = (X, Y ) ∈ [−3, 3]2×(2n+6) × {−1, 1}2n+6
such that the following statements hold with batch size B = 2:
(1) ZGD is PLS and as n → ∞, v∗
(2) Z π is PLS with constant probability. If so, we have v∗
GD converges in direction to (cid:2)
π = (cid:2)
1 2
(cid:3)⊤
.
1 −1
(cid:3)⊤
.
(3) There exists points (xi, yi) ∈ ZGD such that yi⟨v∗
π, xi⟩ < 0, i.e., GD points that v∗
π misclassifies.
Hence, the GD risk LGD diverges with constant probability if we train with SS.
err, X +
Proof. In our construction, we separate out Z = (X, Y ) into several groups of points: X +
cor,
X +
bdr, and their negative variants. Let the overlined version of these matrices denote the
≜ BN(X)), and the overlined
corresponding points after full-batch BN (i.e., after taking X GD
version with an extra π subscript denoting the corresponding points after BN with permutation π
72
(i.e., X π ≜ BNπ(X)). For example, X
that are to be classified correctly by v∗
batch normalization with π.
+
cor denotes the features for the positive examples in X GD
+
cor,π denotes those same datapoints in X π after
π, whereas X
Setup: Let us first explain the semantic meanings of the different groups of points in our
construction.
X +
cor : Unnormalized positive examples correctly classified by v∗
X +
err : Unnormalized positive example incorrectly classified by v∗
bdr : Unnormalized positive examples on the decision boundary of v∗
X +
+
cor : full-batch-normalized positive examples correctly classified by v∗
+
err : full-batch-normalized positive example incorrectly classified by v∗
X
+
bdr : full-batch-normalized positive examples on the decision boundary of v∗
X
π
π
X
GD
π with positive margin
π with positive margin
We construct X +
The semantic meanings of the negative versions of these points are completely analogous. We also
define Xbdr = X +
bdr, and the normalized quantity analogously.
err, and X +
bdr as follows. Take X +
(cid:3)⊤
n centered at (cid:2)
cor to be n equally spaced points on
. For the sake of visual clarity, we increase the
bdr ∪ X −
cor, X +
the line segment of width 1
spacing of the points in the diagram Fig. 14a. Define X +
(cid:20)−3
1.5 −0.5
, lying on the line y = −0.5x. Finally, define
. Next, define X +
bdr to be
err to be (cid:2)
3 2.5
2 2
(cid:3)⊤
(cid:21)
1
cor
cor = −X +
X −
err = −X +
X −
cor
bdr = −X +
X −
bdr.
In Fig. 14, we visualize this toy dataset. Note the visual similarity between Z in Fig. 14a and
ZGD in Fig. 14b; this is a feature of the construction. Indeed, as we'll see shortly, as n → ∞, X GD
approaches a uniform rescaling of X in all coordinates. We also plotted the decision boundaries
−
corresponding to v∗
GD and v∗
err are both on
the wrong side of the decision boundary for v∗
π.
π. We highlight the fact that in Fig. 14b, X
+
err and X
GD is PLS: Evidently μ = 0 and one can compute that as n → ∞ that σ → (cid:2)
we see that ZGD is PLS with Span(X SC
by X bdr and v∗
Span(X bdr) = Span((cid:2)−2 1
. Regardless,
GD) corresponding to the one-dimensional subspace spanned
GD correctly classifies all of the other points. In the limit n → ∞, we have that
GD is in the direction (cid:2)
. This proves (1).
) and v∗
2 2
1 2
(cid:3)⊤
(cid:3)⊤
(cid:3)⊤
SS is PLS with constant probability: Now, let us compute what happens to Z π. Because BN
with B = 2 sends features to ±1, this implies that a normalized batch is either mapped to
(1)
(2)
(cid:21)
(cid:21)
(cid:20)−1 +1
−1 +1
(cid:20)−1 +1
+1 −1
, i.e. the normalized batch lies in the direction (cid:2)+1 +1
(cid:3)⊤
; or
, i.e the normalized batch lies in the direction (cid:2)+1 −1
(cid:3)⊤
.
73
(a) Unnormalized toy classification dataset Z.
(b) Normalized toy classification dataset Z π demon-
strating divergence of SS with constant probability.
Figure 14: Toy classification dataset (a) before full-batch BN, i.e. Z (b) after full-batch BN, i.e.
ZGD.
Note that due to Fact C.1.1, with high probability, there will be a batch drawn from X +
cor and a
cor. These batches necessarily land in situation (1), so (cid:2)
∈ Span(X SC
batch drawn from X −
π )
with high probability. On the other hand, with high probability there will be a batch with one point
from X +
),
this implies that Z π is PLS with optimal direction (cid:2)−1 +1
(cid:3)⊤
1 1
cor, which lands in (2). Hence, as long as Span(X SC
By inspection, to ensure that Span(X SC
), there are two bad events we need
cor and one from X −
π ) = Span((cid:2)
π ) = Span((cid:2)
1 1
1 1
(cid:3)⊤
(cid:3)⊤
(cid:3)⊤
.
to avoid:
(a) We send a positive example to (cid:2)+1 −1
(cid:3)⊤
.
(b) We send a negative example to (cid:2)−1 +1
(cid:3)⊤
.
We will use
P[avoid (a) and (b)] = P[avoid (a) | avoid (b)] P[avoid (b)].
Note that by symmetry, P[avoid (b)] = P[avoid (a)].
A little thought reveals that (a) can happen only if the positive boundary example (i.e. in X +
located originally at (cid:2)
occurs with probability at most 2
probability at least 1
both (a) and (b) is at least 1
3
This proves (2).
(cid:3)⊤
1 −0.5
bdr)
cor. In turn, this event
3 . Also, notice avoiding (a) still happens with
3 even after conditioning on avoiding (b). Hence, the probability that we avoid
(cid:3)⊤
).
is batched together with a point in Xbdr ∪ X +
3 . So P[avoid (b)] ≥ 1
9 . So with constant probability, Span(X SC
π ) = Span((cid:2)
2 = 1
1 1
Putting it all together, we see that with constant probability, Span(X SC
GD → (cid:2)
and Z π is PLS with optimal direction v∗
π = (cid:2)+1 −1
. Recall that v∗
(cid:3)⊤
π ) = Span((cid:2)
(cid:3)⊤
1 2
),
1 1
as n → ∞. So
(cid:3)⊤
74
321012321012Xerr+Xcor+XerrXcorXbdrXbdrZPosNeg(v*)x=01.51.00.50.00.51.01.51.00.50.00.51.0X+errX+corXerrXcorXbdrXbdrZGDPosNeg(v*GD)x=0(v*)x=0asymptotically we have
|⟨v∗
∥v∗
π, v∗
π∥(cid:13)
(cid:13)v∗
GD⟩|
(cid:13)
(cid:13)
GD
=
1
√
10
.
SS misclassifies GD points: On the constant probability event that Z π is PLS, we have v∗
+
the direction (cid:2)
err and X
−
err. So this proves (3).
. This misclassifies X
1 −1
(cid:3)⊤
π is in
Remark E.2.2. Note that at the cost of visual clarity, we can modify the construction to obtain
optimal classifiers v∗
GD which are asymptotically orthogonal. In this alternate construction,
we take X +
bdr =
, lying on the line y = −x, and X +
π and v∗
(cid:20)−1
0.5
1 −0.5
(cid:21)
cor to be n equally spaced
GD → (cid:2)
. Then v∗
, and
1 1
(cid:3)⊤
(cid:3)⊤
points on the line segment between (cid:2)−2 2
π = (cid:2)
v∗
1 −1
with constant probability, as desired.
(cid:3)⊤
(cid:3)⊤
and (cid:2)−2 + 1
n
2 + 1
n
75
|
|
http://arxiv.org/abs/2302.12441v2 | 2023-05-22T20:29:28 | 2023-02-24T04:03:15 | MUX-PLMs: Data Multiplexing for High-throughput Language Models | The widespread adoption of large language models such as ChatGPT and Bard has
led to unprecedented demand for these technologies. The burgeoning cost of
inference for ever-increasing model sizes coupled with hardware shortages has
limited affordable access and poses a pressing need for efficiency approaches
geared towards high throughput and performance. Multi-input multi-output (MIMO)
algorithms such as data multiplexing, offer a promising solution with a
many-fold increase in throughput by performing inference for multiple inputs at
the cost of a single input. Yet these approaches are not currently performant
enough to be deployed in modern systems. We change that by developing MUX-PLMs,
a class of high throughput pre-trained language models (PLMs) trained with data
multiplexing, that can be fine-tuned for any downstream task to yield
high-throughput high-performance. Our novel multiplexing and demultiplexing
modules proficiently entangle and disentangle inputs, and enable
high-performance high throughput \muxplms{} that are competitive with vanilla
PLMs while achieving 2x/5x inference speedup with only a $1-4\%$ drop on a
broad suite of tasks. | [
"Vishvak Murahari",
"Ameet Deshpande",
"Carlos E. Jimenez",
"Izhak Shafran",
"Mingqiu Wang",
"Yuan Cao",
"Karthik Narasimhan"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12441v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12441v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.CL"
] | MUX-PLMs: Data Multiplexing for High-throughput Language Models
Vishvak Murahari1
Ameet Deshpande1
Carlos E. Jimenez1
Izhak Shafran2
Mingqiu Wang2
Yuan Cao2
Karthik Narasimhan1
1Princeton University
2 Google Brain
[email protected]
3
2
0
2
y
a
M
2
2
]
G
L
.
s
c
[
2
v
1
4
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Abstract
The widespread adoption of large language
models such as ChatGPT and Bard has led
to unprecedented demand for these technolo-
gies. The burgeoning cost of inference for ever-
increasing model sizes coupled with hardware
shortages has limited affordable access and
poses a pressing need for efficiency approaches
geared towards high throughput and perfor-
mance. Multi-input multi-output (MIMO) al-
gorithms such as data multiplexing, offer a
promising solution with a many-fold increase
in throughput by performing inference for mul-
tiple inputs at the cost of a single input. Yet
these approaches are not currently performant
enough to be deployed in modern systems. We
change that by developing MUX-PLMs, a class
of high throughput pre-trained language models
(PLMs) trained with data multiplexing, that can
be fine-tuned for any downstream task to yield
high-throughput high-performance. Our novel
multiplexing and demultiplexing modules profi-
ciently entangle and disentangle inputs, and en-
able high-performance high throughput MUX-
PLMs that are competitive with vanilla PLMs
while achieving 2x/5x inference speedup with
only a 1 − 4% drop on a broad suite of tasks. 1
1
Introduction
Language models like ChatGPT (OpenAI, 2023),
PaLM (Chowdhery et al., 2022), T5 (Raffel et al.,
2020), and CM3 (Aghajanyan et al., 2022), have
seen unprecedented adoption in diverse sectors
ranging from education and healthcare to manu-
facturing and marketing. The proficiency of these
tools has led to unprecedented demand for these
models, with users facing frequent outages and ca-
pacity limits. Additionally, ever-increasing model
sizes and hardware shortages have constrained
models' ability to handle a very high load of re-
quests, thus limiting large-scale affordable access
1Code
+ Models:
https://github.com/
princeton-nlp/datamux-pretraining/.
to these models. These trends bring into focus the
need for high-throughput, high-performance, ef-
ficient, and environmentally responsible models
that can be deployed at scale to meet the quickly
growing demand.
Multi-input Multi-output architectures (MIMO)
(Havasi et al., 2021; Ramé et al., 2021; Murahari
et al., 2022) are a promising hardware-agnostic
and architecture-agnostic paradigm that perform
inference for multiple inputs simultaneously at the
cost of a single input. This efficiency paradigm is
natively geared towards yielding high-throughput
models, in addition to being complementary in ap-
proach and motivation to current efficiency meth-
ods such as pruning, quantization, and distilla-
tion. Interestingly, MIMO approaches are partly
inspired by the human brain's extraordinary abil-
ity to process multiple inputs and propagate in-
formation at a high bandwidth with a few neural
codes (Blumhagen et al., 2011; Akam and Kull-
mann, 2014; Pirschel and Kretzberg, 2016; Hong
et al., 2016; Friedrich et al., 2004).
Murahari et al. (2022) introduced data multiplex-
ing, a MIMO technique that can enable a many-fold
increase in throughput. The method compresses
N different instances into a single "multiplexed"
hidden representation before decompressing it into
N independent predictions. While they show the
plausibility of MIMO training, their method leads
to a significant drop in performance (20 − 30%
points) compared to state-of-the-art models.
In this work, we introduce MUX-PLMs, a class
of high-throughput pre-trained language models
trained in a MIMO fashion with data multiplex-
ing to process multiple inputs (2-10) simultane-
ously with a forward pass over a single instance.
MUX-PLMs offer up to 400% improvement in
throughput over baseline pre-trained models while
only being ∼ 4 points and ∼ 2 points worse than
baseline pre-trained language models for text clas-
sification and token classification tasks, respec-
Figure 1: Illustrating the training process for MUX-PLMs. MUX-PLMs are first primed for MIMO style training
with a token-retrieval auto-encoding task, where the model is trained to output the tokens in the N inputs. MUX-
PLMs are then pre-trained by adapting standard pre-training objectives (BERT in this example), to MIMO style
training with data multiplexing. The resulting MUX-BERT model, similar to standard PLMs, provides a general
model initialization that can be fine-tuned on any downstream task (NER in this example). Output predictions are
shown above the system head with highlighted predictions contributing to the gradient update; violet indicates a
correct prediction while orange indicates an incorrect prediction. Red highlighted tokens in the input indicate a
position that has been masked.
tively. MUX-PLMs, like other pre-trained lan-
guage models, provide general model initializa-
tion that can be fine-tuned for any downstream
task. We demonstrate the effectiveness and gener-
ality of our MUX-PLMs class of pre-trained mod-
els by training MUX-BERT and MUX-ELECTRA
models, which are trained with pre-trained objec-
tives adapted from BERT (Devlin et al., 2019) and
ELECTRA (Clark et al., 2020) respectively, al-
though in a MIMO fashion with data multiplexing.
Our work is the first to introduce MIMO archi-
tectures to PLMs. To enable this, we first develop
a new demultiplexing module, RSA-demux (Fig-
ure 2), that randomly initializes and learns private
key vectors to recover the multiple outputs from
a multiplexed representation. Secondly, we intro-
duce a new Contextual Multiplexer module (Fig-
ure 3) that uses a cross-instance attention-based
mechanism to aggregate context across the set of
multiplexed instances, which seems to be particu-
larly effective for token-level tasks. Thirdly, our
three-stage training algorithm (Figure 1) enables
stable and efficient training of MUX-PLMs.
Importantly, MUX-PLMs are complementary to
existing state-of-the-art model compression tech-
niques. We hope our work validates MIMO archi-
tectures as a promising complementary direction
to existing efficiency techniques. Consequently,
we hope future research develops MIMO architec-
tures in tandem with other efficiency approaches,
leveraging the best of both paradigms. We pub-
licly release our models and code to promote open-
source research on the next generation of MIMO
architectures for large language models.
2 Related Work
Efficient Inference with Transformers Recent
methods in NLP rely heavily on transfer learning
through Transformer-based (Vaswani et al., 2017)
language models trained on large text corpora us-
ing self-supervised objectives, such as autoregres-
sive (Radford and Narasimhan, 2018) or masked
language modeling (Devlin et al., 2019). Prior
analysis on pre-training language models has ob-
served power-law scaling of model performance
with respect to model size (Kaplan et al., 2020),
leading the community to develop ever-larger lan-
guage models. It is also generally recognized that
pre-trained language models are significantly over-
parameterized; effectively learning a subnetwork
that utilizes only a relatively small number of their
total parameters (Voita et al., 2019; Michel et al.,
2019; Gordon et al., 2020; Prasanna et al., 2020).
The ubiquity of pre-trained language models,
their growing size, and over-parameterization has
inspired extensive research on improving inference
efficiency. This includes methods such as struc-
tured pruning (Liu et al., 2019; Wang et al., 2020;
Lagunas et al., 2021; Xia et al., 2022; Yang et al.,
2022), knowledge distillation (Hinton et al., 2015;
<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUXthechefatethemealMASKchefMASKthemeal<latexit sha1_base64="oLWedUKi3DSeLcbGgAPrLPdx07g=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRahp5JIUY8FLx4r2A9oQ9lsJ+3SzSbsTqQl9K948aCIV/+IN/+N2zYHbX0w8Hhvhpl5QSK4Rtf9tgpb2zu7e8X90sHh0fGJfVpu6zhVDFosFrHqBlSD4BJayFFAN1FAo0BAJ5jcLfzOEyjNY/mIswT8iI4kDzmjaKSBXe4jTDFrKkBFueRyNB/YFbfmLuFsEi8nFZKjObC/+sOYpRFIZIJq3fPcBP2MKuRMwLzUTzUklE3oCHqGShqB9rPl7XPn0ihDJ4yVKYnOUv09kdFI61kUmM6I4livewvxP6+XYnjrZ1wmKYJkq0VhKhyMnUUQzpArYChmhlCmuLnVYWOqKEMTV8mE4K2/vEnaVzXvulZ/qFca1TyOIjknF6RKPHJDGuSeNEmLMDIlz+SVvFlz68V6tz5WrQUrnzkjf2B9/gDhNJTq</latexit>Pretraining<latexit sha1_base64="YMsxORc1qROyZt/Sshecb25Lu40=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHYJUY9ELx4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfju7nffkKleSwfzCRBP6JDyUPOqLFSo9IvltyyuwBZJ15GSpCh3i9+9QYxSyOUhgmqdddzE+NPqTKcCZwVeqnGhLIxHWLXUkkj1P50ceiMXFhlQMJY2ZKGLNTfE1MaaT2JAtsZUTPSq95c/M/rpia88adcJqlByZaLwlQQE5P512TAFTIjJpZQpri9lbARVZQZm03BhuCtvrxOWpWyd1WuNqql2m0WRx7O4BwuwYNrqME91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AH8PjL8=</latexit>2thechefcooksthemealthechefwalkthemeal<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUX<latexit sha1_base64="82iJvDRh4RJsfWvspHMJy3OpPwY=">AAAB/3icbVDLSgNBEJyNrxhfUcGLl8Eg5BR2JajHgBePUfKCJITZSScZMju7zPQGw5qDv+LFgyJe/Q1v/o2Tx0ETCxqKqm66u/xICoOu++2k1tY3NrfS25md3b39g+zhUc2EseZQ5aEMdcNnBqRQUEWBEhqRBhb4Eur+8Gbq10egjQhVBccRtAPWV6InOEMrdbInLYQHTCrhEBS9B9QCRkxOOtmcW3BnoKvEW5AcWaDcyX61uiGPA1DIJTOm6bkRthOmUXAJk0wrNhAxPmR9aFqqWACmnczun9Bzq3RpL9S2FNKZ+nsiYYEx48C3nQHDgVn2puJ/XjPG3nU7ESqKERSfL+rFkmJIp2HQrtDAUY4tYVwLeyvlA6YZRxtZxobgLb+8SmoXBe+yULwr5kr5RRxpckrOSJ545IqUyC0pkyrh5JE8k1fy5jw5L8678zFvTTmLmWPyB87nD4ofll4=</latexit>TokenRetrieval<latexit sha1_base64="DSs/otLGM3tGcbw7Y+b2owP1uy4=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mkqMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlptcvV9yqOwdZJV5OKpCj0S9/9QYxSyOUhgmqdddzE+NnVBnOBE5LvVRjQtmYDrFrqaQRaj+bHzolZ1YZkDBWtqQhc/X3REYjrSdRYDsjakZ62ZuJ/3nd1ITXfsZlkhqUbLEoTAUxMZl9TQZcITNiYgllittbCRtRRZmx2ZRsCN7yy6ukfVH1Lqu1Zq1Sv8njKMIJnMI5eHAFdbiDBrSAAcIzvMKb8+i8OO/Ox6K14OQzx/AHzucPfYuMvg==</latexit>1<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUXB-LOCOOB-MISCOBeninwonthefirstleg<latexit sha1_base64="PvkqMPf0KQ2ZiRgX4QPbidqMLN8=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHaVqEeiF4+QyCOBDZkdemFkdnYzM2tCCF/gxYPGePWTvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCoqeNUMWywWMSqHVCNgktsGG4EthOFNAoEtoLR3cxvPaHSPJYPZpygH9GB5CFn1FipftkrltyyOwdZJV5GSpCh1it+dfsxSyOUhgmqdcdzE+NPqDKcCZwWuqnGhLIRHWDHUkkj1P5kfuiUnFmlT8JY2ZKGzNXfExMaaT2OAtsZUTPUy95M/M/rpCa88SdcJqlByRaLwlQQE5PZ16TPFTIjxpZQpri9lbAhVZQZm03BhuAtv7xKmhdl76pcqVdK1dssjjycwCmcgwfXUIV7qEEDGCA8wyu8OY/Oi/PufCxac042cwx/4Hz+AICTjMA=</latexit>3Finetuning(NER)Sanh et al., 2019; Sun et al., 2020; Jiao et al., 2020;
Yin et al., 2021), quantization (Zafrir et al., 2019;
Shen et al., 2020), and data multiplexing (Mura-
hari et al., 2022). These approaches assume that
PLMs are highly over-parametrized and attempt to
approximate a large function by learning a smaller,
compressed, version of the original model. Past
work has also focused on unstructured pruning for
both task finetuning (Chen et al., 2020; Sanh et al.,
2020) and pre-trained (Zafrir et al., 2021; Jiang
et al., 2022) language model settings, but don't
increase model throughput due to hardware limits.
Multi-input Multi-output Models While prun-
ing, quantization, and distillation seek to reduce
overparameterization by reducing models' repre-
sentational capacity, other lines of work seek to
exploit overparameterization in other ways. Multi-
input Multi-output (MIMO) architectures (Havasi
et al., 2021; Ramé et al., 2021; Murahari et al.,
2022) train models using mixed-instance represen-
tations, i.e. Zhang et al. (2018), in order to obtain
predictions for multiple instances simultaneously.
Unlike efficiency methods, Havasi et al. (2021) and
Ramé et al. (2021) try to obtain better performance
by inducing multiple subnetworks in a single con-
volutional model to perform "ensembling for free"
during inference. Data multiplexing, introduced in
DataMUX (Murahari et al., 2022), aims to improve
model efficiency by training Transformer models
with mixed-instance representations to perform si-
multaneous inference for language tasks, thereby
improving inference throughput many-fold. Cur-
rently, MIMO architectures have only been used in
a limited setting, achieving middling performance.
Our work training PLMs with data multiplexing,
dramatically improves inference throughput while
preserving high accuracy for downstream tasks.
3 Methodology
We briefly introduce readers to the data multiplex-
ing MIMO architecture (Murahari et al., 2022),
which we denote T-MUX. We then detail our
novel approach to train MUX-PLMs to yield high-
throughput and performant language models.
3.1 T-MUX: Data multiplexing with
Transformer
Data multiplexing allows parallel processing of
multiple sequences with a single forward or back-
ward pass through the model (M ) and requires
two crucial components, multiplexer, and demulti-
plexer.
Multiplexer The multiplexer module (MUX)
combines an ordered set of multiple inputs –
X 1:N = (cid:0)x1, . . . , xN (cid:1) into a single superimposed
representation (xMUX). If xi ∈ Rd, the multiplexer
is a transformation (MUX : RN ×d → Rd) such that
xMUX = MUX (cid:0)X 1:N (cid:1).
To ensure MUX is an order-preserving
transformation,T-MUX samples a vector (vi ∈ Rd)
from a standard multivariate Gaussian and applies
the Hadamard product (element-wise multiplica-
tion) with the corresponding input representation
(xi) before summing up vectors for all positions.
xMUX = MUX (cid:0)X 1:N (cid:1) =
vi ∈ Rd ∼ N (0, I)
1
N
N
(cid:88)
i=1
xi ⊙ vi
(1)
The model processes the multiplexed representa-
tion and emits a multiplexed hidden state – hMUX =
M (cid:0)xMUX(cid:1). To multiplex Transformers' sequenced
inputs (cid:0)xi = (cid:0)xi
(cid:1)(cid:1) of length L, T-MUX
1, . . . , xi
L
applies the same vi to all L positions of instance i.
xMUX = MUX (cid:0)X 1:N (cid:1) =
(cid:32)
1
N
N
(cid:88)
i=1
1 ⊙ vi, . . . ,
xi
(cid:33)
L ⊙ vi
xi
1
N
N
(cid:88)
i=1
(2)
Demultiplexer A prediction needs to be made
for each instance in X 1:N , and T-MUX's demul-
tiplexer module (DeMUX) achieves this by sep-
arating the superimposed output (hMUX) into N
output representations corresponding to the input
(h1, . . . , hN ).
hi = DeMUX (cid:0)hMUX, pi(cid:1)
j = DeMUX (cid:0)hMUX
j, pi(cid:1)
hi
(3)
The vector pi ∈ Rd is dynamically generated
for each instance (i) with the help of a prefix that is
added to the input and re-used for all positions in
the instance. They add a prefixi to xi, represented
by the following pattern, where εi is a special token,
and pi is set to be the output corresponding to token
Figure 2: Illustrating our novel RSA-inspired demultiplexing module. The module is initialized with N key vectors
which are used to demultiplex the transformed multiplexed representations (hM U X ). The keys are concatenated
with hM U X and are processed with an MLP to generate the demultiplexed output representations (h1 * * * h4).
and the generality of this class of models, we pre-
train Transformer models with objectives based
on BERT and ELECTRA, to get MUX-BERT and
MUX-ELECTRA respectively. MUX-PLMs are
trained with our three stage training algorithm (Fig-
ure 1). Firstly, MUX-PLMs are trained with the
token retrieval task in T-MUX, which is an auto-
encoding setup to decode all the tokens in the mul-
tiplexed input. This simple auto-encoding task is
critical to prime the model for MIMO-style data
multiplexing. The MUX-PLMs are then pre-trained
with standard pre-training objectives but adapted
to MIMO-fashioned training with data multiplex-
ing. MUX-PLMs show significant throughput im-
provement over standard pre-trained LMs while
matching their downstream task accuracies. Fi-
nally, MUX-PLMs, like other pre-trained language
models, provide general model initialization that
can be fine-tuned for any downstream task.
Contextual multiplexer T-MUX's multiplexer
multiplexes tokens independent of 1) tokens in the
same position in other instances and 2) other to-
kens in the instance, which could lead to subop-
timal representations. We, therefore, explore a
contextual multiplexing scheme that aggregates
context both from tokens in the same instance
and tokens in the same position of other instances
(Figure 3). We first use a single transformer
layer TRANSctx to get contextual representations
(cid:1)) of length L. We
1, . . . , xi
hi
L
apply a hadamard product with a multivariate gaus-
sian vi to all L positions.
ctx = hi
gi
(4)
We generate multiplexed representations, xMUX,
by applying another transformer layer TRANSinst
across encoded representations from N instances
ctx = TRANSctx
ctx ⊙ vi
(cid:0)xi
Figure 3: Illustrating our attention-based multiplexing
module. The module generates contextual representa-
tions for instances x1 * * * x4 with a Transformer layer
and then applies a hadamard product between the con-
textual representations and the corresponding multivari-
ate gaussian to generate instance-conditioned represen-
tations. The final multiplexed representations are gener-
ated by first applying another Transformer layer, which
attends across the instances for all the positions in the
sequence, and then averaging across the instances.
i in the prefix.
prefix1 = [ε1, εpad, . . . , εpad]
prefix2 = [εpad, ε2, εpad, . . . , εpad]
* * *
prefixN = [εpad, . . . , εpad, εN ]
3.2 MUX-PLMs: Data multiplexing for
high-throughput language models
We propose MUX-PLMs, a class of high-
throughput pre-trained Transformer-based lan-
guage models trained in a MIMO fashion with
data multiplexing. To demonstrate the viability
<latexit sha1_base64="8/mZexLsMZmF+cd8DoFjIoRZMiE=">AAAB83icbVDLSgMxFL1TX7W+qm4EN8EiuCozUtRlwY3LCvYBnbFk0kwbmsmEJCOUob/hxoUibv0Zd/6NmXYW2nogcDjnXu7JCSVn2rjut1NaW9/Y3CpvV3Z29/YPqodHHZ2kitA2SXiieiHWlDNB24YZTntSURyHnHbDyW3ud5+o0iwRD2YqaRDjkWARI9hYyfdjbMZhlI1nj96gWnPr7hxolXgFqUGB1qD65Q8TksZUGMKx1n3PlSbIsDKMcDqr+KmmEpMJHtG+pQLHVAfZPPMMnVtliKJE2ScMmqu/NzIcaz2NQzuZZ9TLXi7+5/VTE90EGRMyNVSQxaEo5cgkKC8ADZmixPCpJZgoZrMiMsYKE2NrqtgSvOUvr5LOZd27qjfuG7XmSVFHGU7hDC7Ag2towh20oA0EJDzDK7w5qfPivDsfi9GSU+wcwx84nz8Gt5GO</latexit>h1<latexit sha1_base64="sR87z0EnzyCzWXKSbPlPwjoMRRI=">AAAB83icbVBNSwMxFHxbv2r9qnoRvASL4KnslqIeC148VrC10F1LNs22oUl2SbJCWfo3vHhQxKt/xpv/xmy7B20dCAwz7/EmEyacaeO6305pbX1jc6u8XdnZ3ds/qB4edXWcKkI7JOax6oVYU84k7RhmOO0limIRcvoQTm5y/+GJKs1ieW+mCQ0EHkkWMYKNlXxfYDMOo2w8e2wMqjW37s6BVolXkBoUaA+qX/4wJqmg0hCOte57bmKCDCvDCKezip9qmmAywSPat1RiQXWQzTPP0LlVhiiKlX3SoLn6eyPDQuupCO1knlEve7n4n9dPTXQdZEwmqaGSLA5FKUcmRnkBaMgUJYZPLcFEMZsVkTFWmBhbU8WW4C1/eZV0G3Xvst68a9ZaJ0UdZTiFM7gAD66gBbfQhg4QSOAZXuHNSZ0X5935WIyWnGLnGP7A+fwBCDuRjw==</latexit>h2<latexit sha1_base64="PuUaimZdG0KCoWA5fPt1PyXKLaQ=">AAAB83icbVDLSgMxFL3js9ZX1Y3gJlgEV2VGi7osuHFZwT6gM5ZMmmlDM5mQZIQy9DfcuFDErT/jzr8x085CWw8EDufcyz05oeRMG9f9dlZW19Y3Nktb5e2d3b39ysFhWyepIrRFEp6obog15UzQlmGG065UFMchp51wfJv7nSeqNEvEg5lIGsR4KFjECDZW8v0Ym1EYZaPp42W/UnVr7gxomXgFqUKBZr/y5Q8SksZUGMKx1j3PlSbIsDKMcDot+6mmEpMxHtKepQLHVAfZLPMUnVllgKJE2ScMmqm/NzIcaz2JQzuZZ9SLXi7+5/VSE90EGRMyNVSQ+aEo5cgkKC8ADZiixPCJJZgoZrMiMsIKE2NrKtsSvMUvL5P2Rc27qtXv69XGcVFHCU7gFM7Bg2towB00oQUEJDzDK7w5qfPivDsf89EVp9g5gj9wPn8ACb+RkA==</latexit>h3<latexit sha1_base64="gU6Y49A8Evooq3DfmtsTUEGKTcc=">AAAB83icbVDLSgMxFL2pr1pfVTeCm2ARXJUZKeqy4MZlBfuAzlgyaaYNzWSGJCOUob/hxoUibv0Zd/6NmXYW2nogcDjnXu7JCRLBtXGcb1RaW9/Y3CpvV3Z29/YPqodHHR2nirI2jUWsegHRTHDJ2oYbwXqJYiQKBOsGk9vc7z4xpXksH8w0YX5ERpKHnBJjJc+LiBkHYTaePTYG1ZpTd+bAq8QtSA0KtAbVL28Y0zRi0lBBtO67TmL8jCjDqWCzipdqlhA6ISPWt1SSiGk/m2ee4XOrDHEYK/ukwXP190ZGIq2nUWAn84x62cvF/7x+asIbP+MySQ2TdHEoTAU2Mc4LwEOuGDViagmhitusmI6JItTYmiq2BHf5y6ukc1l3r+qN+0ateVLUUYZTOIMLcOEamnAHLWgDhQSe4RXeUIpe0Dv6WIyWULFzDH+APn8AC0ORkQ==</latexit>h4<latexit sha1_base64="jpTjQ68RnuomyCwnnw2wsyL+DLA=">AAAB+XicbVDLSgNBEJyNrxhfq14EL4NB8BR2JajHgBdPEsE8ILuE2UknGTL7YKY3GJb8iRcPinj1T7z5N06SPWhiQUNR1U13V5BIodFxvq3C2vrG5lZxu7Szu7d/YB8eNXWcKg4NHstYtQOmQYoIGihQQjtRwMJAQisY3c781hiUFnH0iJME/JANItEXnKGRurZ971EP4QkzHicC9LRrl52KMwddJW5OyiRHvWt/eb2YpyFEyCXTuuM6CfoZUyi4hGnJSzUkjI/YADqGRiwE7Wfzy6f03Cg92o+VqQjpXP09kbFQ60kYmM6Q4VAvezPxP6+TYv/Gz0SUpAgRXyzqp5JiTGcx0J5QwFFODGFcCXMr5UOmGEcTVsmE4C6/vEqalxX3qlJ9qJZrJ3kcRXJKzsgFcck1qZE7UicNwsmYPJNX8mZl1ov1bn0sWgtWPnNM/sD6/AGoVZOQ</latexit>Ncopies<latexit sha1_base64="n7wVP41N0un63hCbP+3IRg563bU=">AAAB9XicbVDJSgNBEO1xjXGLehG8NAbBU5iRoB4DXjxJBLNAZgw9nZqkSc9Cd406DPkPLx4U8eq/ePNv7CwHTXxQ8Hiviqp6fiKFRtv+tpaWV1bX1gsbxc2t7Z3d0t5+U8ep4tDgsYxV22capIiggQIltBMFLPQltPzh1dhvPYDSIo7uMEvAC1k/EoHgDI10f+NSF+EJ8yFketQtle2KPQFdJM6MlMkM9W7py+3FPA0hQi6Z1h3HTtDLmULBJYyKbqohYXzI+tAxNGIhaC+fXD2iJ0bp0SBWpiKkE/X3RM5CrbPQN50hw4Ge98bif14nxeDSy0WUpAgRny4KUkkxpuMIaE8o4CgzQxhXwtxK+YApxtEEVTQhOPMvL5LmWcU5r1Rvq+Xa4SyOAjkix+SUOOSC1Mg1qZMG4USRZ/JK3qxH68V6tz6mrUvWbOaA/IH1+QOtiJKE</latexit>Nkeys<latexit sha1_base64="sHjTX1Z4jRBAa/fsMzsifaDPyvo=">AAAB8XicbVDLSgNBEJyNrxhfUY9eBoPgKeyKqMegFw8KEcwDkyXMTjrJkNnZZaZXDEv+wosHRbz6N978GyfJHjSxoKGo6qa7K4ilMOi6305uaXlldS2/XtjY3NreKe7u1U2UaA41HslINwNmQAoFNRQooRlrYGEgoREMryZ+4xG0EZG6x1EMfsj6SvQEZ2ilhzbCE6a3N9Vxp1hyy+4UdJF4GSmRDNVO8avdjXgSgkIumTEtz43RT5lGwSWMC+3EQMz4kPWhZaliIRg/nV48pkdW6dJepG0ppFP190TKQmNGYWA7Q4YDM+9NxP+8VoK9Cz8VKk4QFJ8t6iWSYkQn79Ou0MBRjixhXAt7K+UDphlHG1LBhuDNv7xI6idl76x8endaqlxmceTJATkkx8Qj56RCrkmV1AgnijyTV/LmGOfFeXc+Zq05J5vZJ3/gfP4ApXKQ6Q==</latexit>MLP<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="2OR/xMMcJSQ1UuIIc3xPTEiOATU=">AAAB83icbVDLSgMxFL2pr1pfVZdugkVwVWZE1GXRjcsK9gGdsWTSTBuayQxJRixDf8ONC0Xc+jPu/Bsz7Sy09UDgcM693JMTJIJr4zjfqLSyura+Ud6sbG3v7O5V9w/aOk4VZS0ai1h1A6KZ4JK1DDeCdRPFSBQI1gnGN7nfeWRK81jem0nC/IgMJQ85JcZKnhcRMwrC7Gn64ParNafuzICXiVuQGhRo9qtf3iCmacSkoYJo3XOdxPgZUYZTwaYVL9UsIXRMhqxnqSQR0342yzzFJ1YZ4DBW9kmDZ+rvjYxEWk+iwE7mGfWil4v/eb3UhFd+xmWSGibp/FCYCmxinBeAB1wxasTEEkIVt1kxHRFFqLE1VWwJ7uKXl0n7rO5e1M/vzmuN66KOMhzBMZyCC5fQgFtoQgsoJPAMr/CGUvSC3tHHfLSEip1D+AP0+QMryZHI</latexit>x1<latexit sha1_base64="Uf5LR7Ekg+9UGx+jPS9Ch+Y1g8k=">AAAB83icbVDLSsNAFL2pr1pfVZduBovgqiSlqMuiG5cV7AOaWCbTSTt0MgkzE7GE/oYbF4q49Wfc+TdO0iy09cDA4Zx7uWeOH3OmtG1/W6W19Y3NrfJ2ZWd3b/+genjUVVEiCe2QiEey72NFORO0o5nmtB9LikOf054/vcn83iOVikXiXs9i6oV4LFjACNZGct0Q64kfpE/zh8awWrPrdg60SpyC1KBAe1j9ckcRSUIqNOFYqYFjx9pLsdSMcDqvuImiMSZTPKYDQwUOqfLSPPMcnRllhIJImic0ytXfGykOlZqFvpnMMqplLxP/8waJDq68lIk40VSQxaEg4UhHKCsAjZikRPOZIZhIZrIiMsESE21qqpgSnOUvr5Juo+5c1Jt3zVrruqijDCdwCufgwCW04Bba0AECMTzDK7xZifVivVsfi9GSVewcwx9Ynz8tTZHJ</latexit>x2<latexit sha1_base64="90ZTaAQfpSKuRJdG+WwJ8Zz76kQ=">AAAB83icbVDLSsNAFL2pr1pfVZduBovgqiRa1GXRjcsK9gFNLJPppB06mYSZiVhCfsONC0Xc+jPu/BsnbRbaemDgcM693DPHjzlT2ra/rdLK6tr6RnmzsrW9s7tX3T/oqCiRhLZJxCPZ87GinAna1kxz2oslxaHPadef3OR+95FKxSJxr6cx9UI8EixgBGsjuW6I9dgP0qfs4XxQrdl1ewa0TJyC1KBAa1D9cocRSUIqNOFYqb5jx9pLsdSMcJpV3ETRGJMJHtG+oQKHVHnpLHOGTowyREEkzRMazdTfGykOlZqGvpnMM6pFLxf/8/qJDq68lIk40VSQ+aEg4UhHKC8ADZmkRPOpIZhIZrIiMsYSE21qqpgSnMUvL5POWd25qDfuGrXmdVFHGY7gGE7BgUtowi20oA0EYniGV3izEuvFerc+5qMlq9g5hD+wPn8ALtGRyg==</latexit>x3<latexit sha1_base64="m/Q9xdoxzWrS8KcoWwMrVxZEooY=">AAAB83icbVDLSgMxFL3js9ZX1aWbYBFclRkp6rLoxmUF+4DOWDJppg1NMkOSEcvQ33DjQhG3/ow7/8ZMOwttPRA4nHMv9+SECWfauO63s7K6tr6xWdoqb+/s7u1XDg7bOk4VoS0S81h1Q6wpZ5K2DDOcdhNFsQg57YTjm9zvPFKlWSzvzSShgcBDySJGsLGS7wtsRmGUPU0f6v1K1a25M6Bl4hWkCgWa/cqXP4hJKqg0hGOte56bmCDDyjDC6bTsp5ommIzxkPYslVhQHWSzzFN0apUBimJlnzRopv7eyLDQeiJCO5ln1IteLv7n9VITXQUZk0lqqCTzQ1HKkYlRXgAaMEWJ4RNLMFHMZkVkhBUmxtZUtiV4i19eJu3zmndRq9/Vq43roo4SHMMJnIEHl9CAW2hCCwgk8Ayv8Oakzovz7nzMR1ecYucI/sD5/AEwVZHL</latexit>x4<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUXthechefcooksthemeal<latexit sha1_base64="oVPk618V8E12zzvLW03Ectn2edA=">AAACDHicbVDLSsNAFJ3UV62vqks3g0VwVRIRdVl0YZcV7APaUG4mk3bsZBJmJmIJ/QA3/oobF4q49QPc+TdO2iy09cDA4ZxzuXOPF3OmtG1/W4Wl5ZXVteJ6aWNza3unvLvXUlEiCW2SiEey44GinAna1Exz2oklhdDjtO2NrjK/fU+lYpG41eOYuiEMBAsYAW2kfrnS0/RBp9eQKMVA4Dr4EIL0cUNGd5RkoYlJ2VV7CrxInJxUUI5Gv/zV8yOShFRowkGprmPH2k1BakY4nZR6iaIxkBEMaNdQASFVbjo9ZoKPjOLjIJLmCY2n6u+JFEKlxqFnkiHooZr3MvE/r5vo4MJNmYgTTQWZLQoSjnWEs2awz6Q5mI8NASKZ+SsmQ5BAtOmvZEpw5k9eJK2TqnNWPb05rdQu8zqK6AAdomPkoHNUQ3XUQE1E0CN6Rq/ozXqyXqx362MWLVj5zD76A+vzB17Km9U=</latexit>GaussianHadamardProjection<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="AaeU8bMtT64k4CKOutQt8NVK4vo=">AAACCnicbVA9SwNBEN3zM8avqKXNahBsDHcS1DKYRrsI+YIkhL3NJFmyt3fszonhSG3jX7GxUMTWX2Dnv3HzUWjig4HHezPMzPMjKQy67reztLyyurae2khvbm3v7Gb29qsmjDWHCg9lqOs+MyCFggoKlFCPNLDAl1DzB8WxX7sHbUSoyjiMoBWwnhJdwRlaqZ05aiI8YFLUoTFnt8ogUxxoWTNluqEOQI/amaybcyegi8SbkSyZodTOfDU7IY8DUMglM6bhuRG2EqZRcAmjdDM2EDE+YD1oWKpYAKaVTF4Z0ROrdKhdbUshnai/JxIWGDMMfNsZMOybeW8s/uc1YuxetRKhohhB8emibiwphnScC+0IDRzl0BLGtbC3Ut5nmnG06aVtCN78y4ukep7zLnL5u3y2cD2LI0UOyTE5JR65JAVyQ0qkQjh5JM/klbw5T86L8+58TFuXnNnMAfkD5/MHKfCbNg==</latexit>Cross-InstanceTransformer<latexit sha1_base64="seLnnuR19kMlrdHK2xKwAzeZCLg=">AAACBnicbVDLSgMxFM34rPVVdSlCsAhuLDNS1GW1G91VsA9oS8mkt21oJjMkd8QydOXGX3HjQhG3foM7/8b0sdDWA4HDOfckucePpDDout/OwuLS8spqai29vrG5tZ3Z2a2YMNYcyjyUoa75zIAUCsooUEIt0sACX0LV7xdHfvUetBGhusNBBM2AdZXoCM7QSq3MQQPhAZOiDo05uVEGmeJAL22EdWHYymTdnDsGnSfelGTJFKVW5qvRDnkcgEIumTF1z42wmTCNgksYphuxgYjxvr28bqliAZhmMl5jSI+s0qadUNujkI7V34mEBcYMAt9OBgx7ZtYbif959Rg7F81EqChGUHzyUCeWFEM66oS2hQaOcmAJ41rYv1LeY5pxtM2lbQne7MrzpHKa885y+dt8tnA1rSNF9skhOSYeOScFck1KpEw4eSTP5JW8OU/Oi/PufExGF5xpZo/8gfP5A5h2mTY=</latexit>Cross-InstanceAverageat each position from 1 to L. This is done by trans-
posing gctx and applying TRANSinst.
(cid:17)
(cid:16)
xMUX = TRANSinst
g⊤
ctx
(5)
RSA demultiplexer The demultiplexer in T-
MUX requires a prefix whose length scales lin-
early with the number of instances (N ), thus reduc-
ing the effective context length during pre-training,
which degrades performance (Ainslie et al., 2020;
Zaheer et al., 2020; Beltagy et al., 2020). Further-
more, it decreases throughput during inference for
large N because the model must process an ex-
tra prefix of length N for each of the N instances.
To address these issues, we draw inspiration from
the RSA cryptosystem (Rivest et al., 1978) to ran-
domly initialize and learn N (private) key vectors
(k1, . . . , kN , ki ∈ Rd) which are keys that can
be used to demultiplex the output representation
(Figure 2).
hi = DeMUX (cid:0)hMUX, ki(cid:1)
j, ki(cid:1)
j = DeMUX (cid:0)hMUX
hi
(6)
Akin to RSA, vi and ki can be treated as the
keys for multiplexing (encryption) and demulti-
plexing (decryption) while ensuring that, unlike
T-MUX, the input sequence length does not change
and thereby leading to an improvement in through-
put. Importantly, this architecture ensures that the
keys better transfer across the different stages of
training as they are no longer conditioned on the
input instances.
4 Experimental Setup
pre-train
all models
Datasets We
on
Wikipedia (Foundation) and Bookscorpus (Zhu
et al., 2015). We evaluate on all datasets from
the GLUE benchmark (Wang et al., 2018), which
are CoLA (Warstadt et al., 2019), SST-2 (Socher
et al., 2013), MRPC (Dolan and Brockett,
2005), QQP (qqp), STS-B (Cer et al., 2017),
MNLI (Williams et al., 2018), QNLI (Wang
et al., 2018), RTE (Wang et al., 2018), and
WNLI (Levesque et al., 2012). We also evaluate
on token classification tasks – named entity
recognition (Sang and Meulder, 2003) and POS
tagging (Grünewald et al., 2021). We don't report
average over the two smallest tasks in GLUE,
WNLI and CoLA, as we observe high variance
across seeds. All numbers are reported on the dev
split. We report scores for all tasks in Appendix E.
Model
N
GLUE
Token
Mean (std) Max Mean (std) Max
BERT
ELECTRA
T-MUX
MUX-BERT‡
MUX-ELEC‡
T-MUX
MUX-BERT‡
MUX-ELEC‡
T-MUX
MUX-BERT‡
MUX-ELEC‡
1
2
5
10
85.4 (0.0)
82.1 (0.0)
60.4 (0.6)
82.5 (0.6)
82.5 (0.4)
59.7 (0.6)
80.3 (0.4)
79.8 (0.6)
58.1 (0.5)
77.8 (0.6)
78.2 (0.6)
85.4
82.1
61.8
83.4
83.1
60.6
80.9
80.5
59.1
78.8
79.0
95.8 (0.0)
95.3 (0.0)
81.4 (0.1)
95.2 (0.1)
95.0 (0.0)
81.3 (0.2)
93.6 (0.1)
93.4 (0.0)
79.7 (0.2)
91.6 (0.1)
91.7 (0.1)
95.8
95.3
81.5
95.4
95.1
81.5
93.6
93.5
80.0
91.8
91.8
↗
1.0×
1.0×
1.9×
2.0×
2.0×
4.4×
4.9×
4.9×
8.4×
9.8×
9.7×
Table 1: Average GLUE and token-level classifica-
tion scores for the BASE (L=12, H=768) configura-
tion, across ELECTRA, BERT, and MUX-PLMs for
N ∈ {1, 2, 5, 10}. ‡ indicates our models and ↗ indi-
cates throughput increase w.r.t. to a vanilla BERTBASE
model. All models are evaluated on 5 seeds with mean
and max scores reported.
Models We experiment with ELECTRA and
BERT pre-training objectives and present
the
pre-trained multiplexed models MUX-BERT and
MUX-ELECTRA for N = 2, 5 and 10. To sim-
plify training, we use a random generator to train
MUX-ELECTRA models, presented as an ablation
in Clark et al. (2020), instead of using a smaller
masked LM. Except where otherwise noted, we
do not use the contextual MUX module, but in-
stead, use the RSA demultiplexing module. Refer
to Appendix B and C for implementation details.
Baselines We run experiments to compare our
models against T-MUX, from Murahari et al.
(2022) and baseline PLMs - ELECTRA and
BERT, across three different model configurations
(SMALL, BASE, and LARGE). We also provide a
comparison to results reported in recent PLM prun-
ing and distillation papers in Table 2.
Multi-run evaluation We evaluate all models
across 5 random seeds to reduce variance for
smaller datasets which is caused by the random-
ized order in which we multiplex instances in the
batch. We report both the average and maximum
scores across seeds in Table 1 to understand the
importance of ordering the multiplexed instances
and report average across seeds for all other results.
5 Results
5.1 Comparing MUX-PLMs with PLMs and
T-MUX
Table 1 shows that both MUX-BERT and MUX-
ELECTRA outperform T-MUX at all levels of
multiplexing (N ), with improvements between 12
and 20 points on GLUE and token-classification
tasks respectively. Furthermore, MUX-PLMs' effi-
cient RSA-inspired demultiplexing method allows
it to achieve faster throughput than T-MUX, in-
creasing it by over 16% for N = 10.
Moreover, MUX-PLMs provide a significant
boost in throughput (N times faster) when com-
pared to PLMs, without a significant loss in
performance. For example, MUX-ELECTRA
(N = 2) is 0.4 points better and only 0.3 points
worse than ELECTRA for GLUE and TOKEN
tasks respectively, while being 2× faster. Similarly,
MUX-BERT (N = 2) is within 3 and 0.6 points of
BERT for GLUE and TOKEN tasks respectively,
while being significantly faster. We also observe
that as N increases, MUX-PLMs' throughput is
significantly better, though performance compared
to PLMs can degrade. This is because a large N
implies that MUX-PLMs must parallelly process
more instances, thus having to share network pa-
rameters and activations with a larger number of
instances, thus improving throughput and degrad-
ing performance. For example, the gap between
ELECTRA and MUX-ELECTRA on TOKEN for
N = 2 is 0.2 points and increases to 3.5 points for
N = 10, which shows that N serves as a parame-
ter to control the performance-throughput trade-off.
We explore this further in Section 5.3 and Figure 4.
5.2 Comparing MUX-PLMs with recent
model compression methods
We compare our MUX-PLM models with other
efficient learning methods, such as pruning and dis-
tillation, in Table 2. Contrary to other methods,
our vanilla MUX-PLMs achieve competitive per-
formance and significant throughput improvement
without additional unlabeled and task-specific data,
and can be easily fine-tuned to any downstream
task without any architectural modifications. For
instance, when compared to DistilBERT, MUX-
BERT (N = 2) does 1 point worse on QNLI and 2
points better on QQP while being equally fast and
not requiring any additional unlabeled data.
More broadly, methods like CoFi, AutoTiny-
BERT, and MobileBERT show that combining a
Model
↗
QNLI QQP SST2
BERT
MUX-BERT (N=2)
MUX-BERT (N=5)
1.0×
2.0×
4.9×
90.5
88.2
85.6
91.2
90.4
88.8
91.7
90.6
86.9
Use additional unlabelled or task-specific data
DistilBERT6
Block Pruning
Prune OFA
Hybrid Approaches
TinyBERT6
CoFi
AutoTinyBERT
MobileBERT
2.0×
2.7×
1.0×
2.0×
2.7×
4.3×
2.3×
89.2
89.7
90.3
91.1
91.3
89.7
91.0
88.5
-
91.2
91.1
-
89.9
-
91.3
91.2
91.5
93.0
93.0
91.4
92.1
Table 2: MUX-PLMs are complementary to existing
efficiency methods, while being competitive standalone.
Contrary to existing methods, MUX-PLMs do not use
additional unlabelled and task-specific data and can
be easily fine-tuned for any downstream task without
architectural modifications. The inference speedups (↗)
are reported against BERTBASE.
Config Model
GLUE Token ↗
SMALL
BASE
LARGE
BERT
T-MUX
MUX-BERT‡
BERT
T-MUX
MUX-BERT‡
BERT
T-MUX
MUX-BERT‡
80.6
59.5
79.0
85.4
60.4
82.5
85.8
61.7
84.1
94.0
81.8
93.3
95.8
81.4
95.2
95.6
80.9
95.2
5.9×
8.7×
11.5×
1.0×
1.9×
2.0×
0.3×
0.6×
0.6×
Table 3: Changing the model size for MUX-BERT
(N = 2) models. Across different model sizes, MUX-
BERT outperforms T-MUX and achieve higher through-
put (indicated under ↗ column). ‡ = our models.
wide range of paradigms (for example, CoFi com-
bines structured pruning and knowledge distillation,
AutoTinyBERT combines knowledge distillation
and neural architecture search, and MobileBERT
combines knowledge distillation with novel archi-
tectural innovations) is a promising approach to-
wards efficient high-performance models.
Towards this end, MUX-PLMs are complemen-
tary in both approach and motivation to these meth-
ods, and can evolve in tandem with existing effi-
ciency methods. MUX-PLMs demonstrate the via-
bility of MIMO architectures for PLMs, in addition
to being complementary to existing approaches,
and we hope that MIMO architectures develop and
evolve with other efficiency approaches while lever-
aging the best of all efficiency methods.
5.3 Effect of varying model size
In this section, we show that our multiplexing
techniques work on a host of model sizes and
report results for MUX-BERT on three models
sizes, SMALL, BASE, and LARGE for N = 2 (Ta-
ble 3). We report results for other values of N
in the appendix. MUX-BERT's performance is
close to that of BERT for all model sizes while
having a significantly better throughput (the gap
is less than 0.7 points for TOKEN tasks and 2.9
points for GLUE for close to twice the throughput).
Multiplexing works effectively on all model sizes,
with the drops with respect to BERT being 1.6 and
1.7 points on GLUE for SMALL and LARGE re-
spectively. MUX-BERT's throughput is always
≈ 2× that of BERT, which shows that a spectrum
of MUX-PLM model sizes can be multiplexed dur-
ing pre-training with competitive performance and
with significantly higher throughput.
Figure 4: (Top) BERT GLUE performance and through-
put and (Bottom) BERT Token task performance and
throughput, for N ∈ {1, 2, 5, 10} with the SMALL,
BASE, and LARGE configurations (illustrated as S/B/L).
All multiplexed models lie either on or very close to the
Pareto frontier (shown in grey).
Pre-trained models typically have a performance-
computational efficiency trade-off, with larger mod-
els having better performance but worse compu-
Model
Mux (N )
MUX-BERT
MUX-ELEC
2
5
10
2
5
10
MNLI
QQP
No Ens Ens ∆ No Ens Ens ∆
80.6
77.2
73.6
80.3
77.0
74.6
81.2 + 0.6
78.8 + 1.6
74.8 + 1.2
80.8 + 0.5
78.4 + 1.4
76.0 + 1.4
90.4
88.8
86.9
90.6
89.1
87.6
90.8 + 0.4
89.7 + 0.9
87.7 + 0.8
90.9 + 0.3
89.9 + 0.8
88.3 + 0.7
Table 4: Ensembling results for MUX-BERT and MUX-
ELECTRA models for N ∈ {2, 5, 10}. Ens denotes
Ensembling. Ensembling improves performance for all
the models, with the gains increasing with increasing N.
This suggests that the multiplexing approach can be nat-
urally adapted to load-balancing applications, where the
ensembling strategy can be changed based on demand.
tational efficiency. MUX-PLMs offers a similar
trade-off, with large N leading to better through-
put but lower performance. To understand this
trade-off, we plot the performance and through-
put of BERT and MUX-BERT for different model
sizes and draw the pareto-optimal envelope (Fig-
ure 4). For any model on the envelope, no model
has both better accuracy and throughput. Users
would only choose models on the envelope be-
cause for every model within the envelope, there
always exists a model on the envelope which has
both better performance and throughput. We note
that all multiplexed models lie either on or very
close to the Pareto frontier, for both TOKEN and
GLUE tasks. This suggests that given an accuracy
threshold, MUX-PLM models will usually be faster
than PLMs. For instance, if we wanted the highest
throughput model with a performance ≥ 77% on
GLUE, the optimal BERT model is the SMALL con-
figuration with a throughput of 2815 (in/s), but for
the MUX-BERT model would be the N = 2 with
the SMALL configuration, achieving a significantly
higher throughput of 5539 (in/s).
5.4 Ensembling MUX-PLMs
As opposed to feeding N different instances to
MUX-PLMs to improve throughput, we consider
an alternate setting where we feed the same in-
stance N times and build an ensemble by averag-
ing the N class logits to make a single prediction.
We randomly permute the batch, after duplicating
the instance N times, to prevent distribution shift.
We use the BASE size models for N ∈ {2, 5, 10}
for both MUX-BERT and MUX-ELECTRA (Ta-
ble 4). The ensemble model does significantly
better than the non-ensemble variant on both
MNLI and QQP for all values of N (e.g., 1.6 and
15040011003000810022000Throughput(instances/sec.)7477818487Accuracy(%)SSSBBBLLLN=1N=2N=515040011003000810022000Throughput(instances/sec.)8588929598F1(%)SSSBBBLLLN=1N=2N=5Mux (N) Model
Mux
Demux
GLUE Token
2
5
10
MUX-BERT Non-contextual RSA-DeMUX
Non-contextual
Ablation 1
Contextual
Ablation 2
Prefix
RSA-DeMUX
MUX-BERT Non-contextual RSA-DeMUX
Non-contextual
Ablation 1
Contextual
Ablation 2
Prefix
RSA-DeMUX
MUX-BERT Non-contextual RSA-DeMUX
Non-contextual
Ablation 1
Contextual
Ablation 2
Prefix
RSA-DeMUX
82.5
83.2
82.3
80.3
78.6
76.8
77.8
76.6
76.0
95.2
95.3
95.3
93.6
38.9
94.2
91.6
25.6
93.3
Table 5: Ablation analysis for MUX-BERT (base con-
figuration) for N ∈ {2, 5, 10}. Across most configura-
tions, the prefix demultiplexing variant performs worse
than our proposed approach and fails to converge for
token-level tasks for N ∈ {5, 10} (underlined numbers).
The new contextual multiplexing variant (Contextual)
outperforms Non-contextual on token-level tasks.
0.9 points on N = 5 MUX-BERT for the two
tasks). We note that the improvement over the non-
ensemble variant (∆) is better for higher N , due to
the larger ensemble size. This result shows that non-
ensemble variants are faster but perform slightly
worse, while the ensemble variant performs better
but is slower. A spectrum of models lie between
these two extremes, where only a fraction of the
N multiplexed representations can be ensembled,
allowing users to trade off performance and speed.
6 Analysis
6.1 Ablation study
We analyze multiplexing and demultiplexing com-
ponents of MUX-PLMs and report the results in
Table 5. We consider two variants, one which uses
the prefix demultiplexing proposed in T-MUX in-
stead of our proposed RSA-DeMUX and another
which uses Contextual multiplexing instead of Non-
contextual. We note that Variant 1, which uses pre-
fix demultiplexing, performs worse than our MUX-
BERT, other than for N = 2.
In fact, Variant
1 does not converge for TOKEN tasks for N = 5
and N = 10 and performs 1.7 and 1.2 points worse
on GLUE when compared to MUX-BERT.
Variant 2 uses Contextual multiplexing which
takes into account other tokens present in the in-
stance and also tokens present in the same position
of other instances. This variant performs better than
Non-contextual for TOKEN tasks (almost over 1.7
points on TOKEN for N = 10) but performs worse
for GLUE tasks. We believe that Contextual multi-
plexing's better performance in TOKEN is because
the model needs to make a prediction for every
single position in the instance, which requires it
to efficiently multiplex all token positions in the
output. However, for GLUE tasks, the model needs
to make a prediction only for the [CLS] token, for
which Non-contextual multiplexing suffices.
6.2 Muxology: Analyzing hidden
representations of multiplexed models
To understand the nature of representations being
learned by MUX-BERT models, we analyze the
absolute value of activations and entropy of the
attention distribution across all the layers of the
Transformer encoder, averaged over the evaluation
split of WikiText-103 (Merity et al., 2016) (Fig-
ure 5). We report this analysis for different values
of N and for different model sizes.
1. Activation norms spike for MUX-BERT in the
last layer. Figure 5 (top) shows that activation
norms spike in the last layer for multiplexed models.
We believe this is because the model is preparing
for demultiplexing and is packing information from
all N instances, which makes the activations denser.
We believe MUX-BERT has learned to efficiently
encode multiple instances until the last layer where
it needs to make independent predictions for them.
2. Entropy of the attention weights of MUX-
BERT is lower than BERT for higher layers.
Figure 5 (bottom) suggests that MUX-BERT tends
to have lower entropy attention distributions on av-
erage as opposed to BERT for higher layers. This
could be related to Deshpande and Narasimhan
(2020)'s observation of pre-trained models having
peaky attention distributions in the higher layers,
with small irregularities. Since the model implicitly
has to use the same attention distribution for all the
multiplexed instances, the peaky distribution gets
reinforced and is further corroborated by higher
N having lower entropy in the final layer. We,
therefore, believe that MUX-BERT has learned to
create shared representations for multiple instances
to effectively use the instance-independent atten-
tion distribution.
6.3 Effect of data sampling strategies during
inference
During inference, our MUX-PLMs sample N in-
stances uniformly at random from the evaluation
set. However, other data-sampling strategies such
as clustering similar instances based on word-
overlap could improve performance. We explore
the effect of composition of N instances on the
performance of MUX-PLMs in Table 6. For
each model variant, we consider 5 random seeds
Figure 5: Comparing (Top) Layer-wise activation and (Bottom) attention entropy of MUX-BERT and BERT, for
N ∈ {2, 5, 10} across different configurations. Activation norms tend to spike for MUX-BERT in the last layer and
entropy of MUX-BERT is lower than BERT for higher layers.
N
2
5
10
MUX-ELECTRA
MUX-BERT
Best ticket Worst ticket ∆ Best ticket Worst ticket ∆
83.1
80.5
79.0
82.0
78.9
77.3
1.1
1.6
1.7
83.4
80.9
78.8
81.8
79.7
77.0
1.6
1.2
1.8
Table 6: We consider 5 random seeds for every model
variant, which can be viewed as lottery tickets as the
seeds control the composition of N instances. We
present the difference between the worst and the best-
performing ticket across GLUE tasks and regularly see
a ≥ 1 point difference.
which can be viewed as lottery tickets (Frankle and
Carbin, 2018). Since the random seed controls the
composition of N instances, we measure the differ-
ence (∆) between the best-performing ticket and
the worst-performing ticket and average the perfor-
mance for all the GLUE tasks. ∆ is consistently
greater than 1 point for all values of N for both
MUX-ELECTRA and MUX-BERT, and illustrates
the importance of the composition of N instances.
An improved data sampling strategy could lead to
improvements and we leave this to future work.
7 Conclusion
We introduce MUX-PLMs, a class of high-
throughput pre-trained language models trained
with data multiplexing, a multi-input multi-output
(MIMO) architecture. Our MUX-PLMs models,
trained with novel MIMO modules, are competitive
with state-of-the-art PLMs on several downstream
tasks while achieving a many-fold increase in infer-
ence throughput. MUX-PLMs, similar to standard
PLMs, can be fine-tuned on any downstream task
to yield high-throughput, high-performance mod-
els. We hope our work inspires future research in
MIMO architectures for PLMs as a complementary
efficiency paradigm to existing approaches.
Acknowledgements
We gratefully acknowledge support from Google
AI Princeton, where Vishvak Murahari was a stu-
dent researcher for part of this work, and the Sam-
sung GRO program. We thank Mengzhou Xia, Jens
Tuyls, and Tianyu Gao, with special thanks to our
espresso machine.
References
data.quora.com/First-Quora-
Quora.
Dataset-Release-Question-Pairs. Ac-
cessed: 2022-10-15.
Armen Aghajanyan, Bernie Huang, Candace Ross,
Vladimir Karpukhin, Hu Xu, Naman Goyal, Dmytro
Okhonko, Mandar Joshi, Gargi Ghosh, Mike Lewis,
Cm3: A causal masked multi-
et al. 2022.
arXiv preprint
modal model of the internet.
arXiv:2201.07520.
Joshua Ainslie, Santiago Ontañón, Chris Alberti, Philip
Pham, Anirudh Ravula, and Sumit Sanghai. 2020.
0.40.60.81.0NormSmallBaseLarge1234Layer0246Entropy14812Layer14812162024LayerN=1N=2N=5N=10ETC: encoding long and structured data in transform-
ers. CoRR, abs/2004.08483.
Thomas Akam and Dimitri M Kullmann. 2014. Os-
cillatory multiplexing of population codes for selec-
tive communication in the mammalian brain. Nature
Reviews Neuroscience, 15(2):111–122.
Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020.
Longformer: The long-document transformer. arXiv
preprint arXiv:2004.05150.
Francisca Blumhagen, Peixin Zhu, Jennifer Shum, Yan-
Ping Zhang Schärer, Emre Yaksi, Karl Deisseroth,
and Rainer W Friedrich. 2011. Neuronal filter-
ing of multiplexed odour representations. Nature,
479(7374):493–498.
Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez-
Gazpio, and Lucia Specia. 2017. Semeval-2017
task 1: Semantic textual similarity multilingual and
crosslingual focused evaluation.
In Proceedings
of the 11th International Workshop on Semantic
Evaluation (SemEval-2017), pages 1–14.
Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia
Liu, Yang Zhang, Zhangyang Wang, and Michael
Carbin. 2020. The lottery ticket hypothesis for
In Advances in Neural
pre-trained bert networks.
Information Processing Systems, volume 33, pages
15834–15846. Curran Associates, Inc.
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin,
Maarten Bosma, Gaurav Mishra, Adam Roberts,
Paul Barham, Hyung Won Chung, Charles Sutton,
Sebastian Gehrmann, et al. 2022. Palm: Scaling
language modeling with pathways. arXiv preprint
arXiv:2204.02311.
Kevin Clark, Minh-Thang Luong, Quoc V Le, and
Christopher D Manning. 2020. Electra: Pre-training
text encoders as discriminators rather than gener-
In International Conference on Learning
ators.
Representations.
Ameet Deshpande and Karthik Narasimhan. 2020.
Guiding attention for self-supervised learning with
In Findings of the Association for
transformers.
Computational Linguistics: EMNLP 2020, pages
4676–4686.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and
Kristina Toutanova. 2019. BERT: Pre-training of
deep bidirectional transformers for language under-
standing.
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),
pages 4171–4186, Minneapolis, Minnesota. Asso-
ciation for Computational Linguistics.
Wikimedia Foundation. Wikipedia.
Jonathan Frankle and Michael Carbin. 2018. The lottery
ticket hypothesis: Finding sparse, trainable neural
networks. In International Conference on Learning
Representations.
Rainer W Friedrich, Christopher J Habermann, and
Gilles Laurent. 2004. Multiplexing using synchrony
in the zebrafish olfactory bulb. Nature neuroscience,
7(8):862–871.
Mitchell Gordon, Kevin Duh, and Nicholas Andrews.
2020. Compressing BERT: Studying the effects of
weight pruning on transfer learning. In Proceedings
of the 5th Workshop on Representation Learning for
NLP, pages 143–155, Online. Association for Com-
putational Linguistics.
Stefan Grünewald, Prisca Piccirilli, and Annemarie
Friedrich. 2021. Coordinate constructions in en-
glish enhanced universal dependencies: Analysis
and computational modeling.
In Proceedings of
the 16th Conference of the European Chapter of the
Association for Computational Linguistics: Main
Volume, pages 795–809.
Marton Havasi, Rodolphe Jenatton, Stanislav Fort,
Jeremiah Zhe Liu, Jasper Snoek, Balaji Lakshmi-
narayanan, Andrew Mingbo Dai, and Dustin Tran.
2021. Training independent subnetworks for robust
prediction. In International Conference on Learning
Representations.
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean.
2015. Distilling the knowledge in a neural network.
ArXiv, abs/1503.02531.
Sungho Hong, Mario Negrello, Marc Junker, Aleksan-
dra Smilgin, Peter Thier, and Erik De Schutter. 2016.
Multiplexed coding by cerebellar purkinje neurons.
Elife, 5:e13810.
Ting Jiang, Deqing Wang, and Fuzhen Zhuang. 2022.
Pruning pre-trained language models without fine-
tuning.
Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao
Chen, Linlin Li, Fang Wang, and Qun Liu. 2020.
TinyBERT: Distilling BERT for natural language un-
derstanding. pages 4163–4174.
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B.
Brown, Benjamin Chess, Rewon Child, Scott Gray,
Alec Radford, Jeffrey Wu, and Dario Amodei. 2020.
Scaling laws for neural language models.
François Lagunas, Ella Charlaix, Victor Sanh, and
Alexander M Rush. 2021. Block pruning for faster
transformers. arXiv preprint arXiv:2109.04838.
William B Dolan and Chris Brockett. 2005. Automati-
cally constructing a corpus of sentential paraphrases.
In Proceedings of the Third International Workshop
on Paraphrasing (IWP2005).
Hector Levesque, Ernest Davis, and Leora Morgen-
stern. 2012. The winograd schema challenge.
In
Thirteenth international conference on the principles
of knowledge representation and reasoning.
Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang,
and Trevor Darrell. 2019. Rethinking the value of
network pruning.
In International Conference on
Learning Representations.
Stephen Merity, Caiming Xiong, James Bradbury, and
Richard Socher. 2016. Pointer sentinel mixture mod-
els.
Paul Michel, Omer Levy, and Graham Neubig.
2019. Are sixteen heads really better than one?
In Advances in Neural
Information Processing
Systems, volume 32. Curran Associates, Inc.
Vishvak Murahari, Carlos E Jimenez, Runzhe Yang,
and Karthik R Narasimhan. 2022. DataMUX:
Data multiplexing for neural networks.
In
Thirty-Sixth Conference on Neural
Information
Processing Systems.
OpenAI. 2023. Introducing chatgpt.
Friederice Pirschel and Jutta Kretzberg. 2016. Mul-
tiplexed population coding of stimulus proper-
ties by leech mechanosensory cells.
Journal of
Neuroscience, 36(13):3636–3647.
Sai Prasanna, Anna Rogers, and Anna Rumshisky. 2020.
When BERT Plays the Lottery, All Tickets Are Win-
ning.
In Proceedings of the 2020 Conference on
Empirical Methods in Natural Language Processing
(EMNLP), pages 3208–3229, Online. Association
for Computational Linguistics.
Alec Radford and Karthik Narasimhan. 2018.
Im-
proving language understanding by generative pre-
training.
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine
Lee, Sharan Narang, Michael Matena, Yanqi Zhou,
Wei Li, and Peter J Liu. 2020. Exploring the lim-
its of transfer learning with a unified text-to-text
transformer. Journal of Machine Learning Research,
21:1–67.
Alexandre Ramé, Rémy Sun, and Matthieu Cord. 2021.
Mixmo: Mixing multiple inputs for multiple out-
puts via deep subnetworks. In Proceedings of the
IEEE/CVF International Conference on Computer
Vision (ICCV), pages 823–833.
Ronald L Rivest, Adi Shamir, and Leonard Adleman.
1978. A method for obtaining digital signatures and
public-key cryptosystems. Communications of the
ACM, 21(2):120–126.
Erik Tjong Kim Sang and Fien De Meulder. 2003. In-
troduction to the conll-2003 shared task: Language-
independent named entity recognition. In CoNLL.
Victor Sanh, Thomas Wolf, and Alexander Rush.
2020. Movement pruning: Adaptive sparsity by
fine-tuning.
In Advances in Neural Information
Processing Systems, volume 33, pages 20378–20389.
Curran Associates, Inc.
Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei
Yao, Amir Gholami, Michael W. Mahoney, and Kurt
Keutzer. 2020. Q-bert: Hessian based ultra low pre-
cision quantization of bert. In AAAI.
Richard Socher, Alex Perelygin, Jean Wu, Jason
Chuang, Christopher D Manning, Andrew Y Ng, and
Christopher Potts. 2013. Recursive deep models for
semantic compositionality over a sentiment treebank.
In Proceedings of the 2013 conference on empirical
methods in natural language processing, pages 1631–
1642.
Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu,
Yiming Yang, and Denny Zhou. 2020. MobileBERT:
a compact task-agnostic bert for resource-limited de-
vices. pages 2158–2170.
Ashish Vaswani, Noam M. Shazeer, Niki Parmar, Jakob
Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser, and Illia Polosukhin. 2017. Attention is all
you need. In NIPS.
Elena Voita, David Talbot, Fedor Moiseev, Rico Sen-
nrich, and Ivan Titov. 2019. Analyzing multi-head
self-attention: Specialized heads do the heavy lift-
In Proceedings of
ing, the rest can be pruned.
the 57th Annual Meeting of the Association for
Computational Linguistics, pages 5797–5808, Flo-
rence, Italy. Association for Computational Linguis-
tics.
Alex Wang, Amanpreet Singh, Julian Michael, Felix
Hill, Omer Levy, and Samuel R Bowman. 2018.
Glue: A multi-task benchmark and analysis platform
for natural language understanding. In International
Conference on Learning Representations.
Ziheng Wang, Jeremy Wohlwend, and Tao Lei. 2020.
Structured pruning of large language models.
In
Proceedings of the 2020 Conference on Empirical
Methods in Natural Language Processing (EMNLP).
Association for Computational Linguistics.
Alex Warstadt, Amanpreet Singh, and Samuel Bow-
man. 2019. Neural network acceptability judgments.
Transactions of the Association for Computational
Linguistics, 7:625–641.
Adina Williams, Nikita Nangia, and Samuel R Bow-
man. 2018. A broad-coverage challenge corpus
for sentence understanding through inference.
In
NAACL-HLT.
Victor Sanh, Lysandre Debut, Julien Chaumond, and
Thomas Wolf. 2019. DistilBERT, a distilled version
of bert: smaller, faster, cheaper and lighter. arXiv
preprint arXiv:1910.01108.
Mengzhou Xia, Zexuan Zhong, and Danqi Chen. 2022.
Structured pruning learns compact and accurate mod-
els.
In Association for Computational Linguistics
(ACL).
Ziqing Yang, Yiming Cui, and Zhigang Chen. 2022.
TextPruner: A model pruning toolkit for pre-
trained language models.
In Proceedings of
the 60th Annual Meeting of the Association for
Computational Linguistics: System Demonstrations,
pages 35–43, Dublin, Ireland. Association for Com-
putational Linguistics.
Yichun Yin, Cheng Chen, Lifeng Shang, Xin Jiang,
Xiao Chen, and Qun Liu. 2021. AutoTinyBERT:
Automatic hyper-parameter optimization for efficient
pre-trained language models. pages 5146–5157.
Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe
Wasserblat. 2019. Q8bert: Quantized 8bit bert.
2019 Fifth Workshop on Energy Efficient Machine
Learning and Cognitive Computing - NeurIPS
Edition (EMC2-NIPS), pages 36–39.
Ofir Zafrir, Ariel Larey, Guy Boudoukh, Haihao Shen,
and Moshe Wasserblat. 2021. Prune once for all:
Sparse pre-trained language models. arXiv preprint
arXiv:2111.05754.
Manzil Zaheer, Guru Guruganesh, Kumar Avinava
Dubey, Joshua Ainslie, Chris Alberti, Santiago On-
tanon, Philip Pham, Anirudh Ravula, Qifan Wang,
Li Yang, et al. 2020. Big bird: Transformers for
longer sequences. Advances in Neural Information
Processing Systems, 33:17283–17297.
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and
David Lopez-Paz. 2018. mixup: Beyond empirical
risk minimization. In International Conference on
Learning Representations.
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhut-
dinov, Raquel Urtasun, Antonio Torralba, and Sanja
Fidler. 2015. Aligning books and movies: Towards
story-like visual explanations by watching movies
and reading books.
In The IEEE International
Conference on Computer Vision (ICCV).
Hyperparameter
MUX-BERT
MUX-ELECTRA
SMALL
BASE
LARGE
BASE
Number of layers
Hidden Size
FFN intermediate hidden size
Attention heads
Attention head size
Mask percent
Learning Rate Decay
Warmup steps
Learning Rate
Adam ε
Adam β1
Adam β2
Attention Dropout
Dropout
Batch Size
Sequence Length
Train Steps
4
512
2048
8
64
15
Linear
10000
[1e-4, 5e-5]
1e-6
0.9
0.999
0.1
0.1
256
512
1M
12
768
3072
12
64
15
Linear
10000
[1e-4, 5e-5]
1e-6
0.9
0.999
0.1
0.1
256
512
1M
24
1024
4096
16
64
15
Linear
10000
[1e-4, 5e-5]
1e-6
0.9
0.999
0.1
0.1
256
512
1M
12
768
3072
12
64
N/A
Linear
10000
[1e-4, 5e-5]
1e-6
0.9
0.999
0.1
0.1
256
512
1M
Table 7: Pre-train hyper-parameters for MUX-BERT and MUX-ELECTRA models. We only report results for the
Base configuration for MUX-ELECTRA models.
A Appendices
B Pre-training Details
We report all pre-training related hyper-parameters in Table 7. We primarily use the HuggingFace
Transformers implementations for BERT and ELECTRA based models. All pre-training experiments
were run on 8 A100 GPUs with distributed training. We run a small hyper-parameter search over over two
learning rates. All pre-trained models are primed with the token retrieval task introduced in Murahari
et al. (2022). We train on the Wikipedia and Bookscorpus datasets for up to 10000 training steps with a
learning rate of 1e − 4, and with a sequence length of 512.
For MUX-ELECTRA models, we don't train a generator as in the original ELECTRA work, but only
use uniform-random token replacement. This is similar to what was used in ablations in ELECTRA (Clark
et al., 2020). The generator randomly replaces 15% of tokens in the input with other tokens in the
vocabulary.
C Fine-tuning Details
We report all the fine-tuning related hyper-parameters in Table 8. We run a small hyper-parameter search
on the learning rate, batch size and number of training steps for different tasks. All models were trained
with half-precision. We report numbers on the validation split. For GLUE tasks, we use the default metrics
in Wang et al. (2018) and use F1 for the token-level tasks. All fine-tuning experiments were trained on 1
V100 GPU.
Speedup calculation For all models, we calculate throughput (samples/second) on a single V100 GPU
and report throughput gains with respect to the BERTBASE model. We calculate throughput by averaging
across 3 different trials (1 trial = 200 mini-batches) and use a batch size of 128 and a sequence length of
128 following prior work (Xia et al., 2022). We measure throughput for sequence-classification tasks on
QQP and measure throughput for token-level classification tasks on named entity recognition.
Hyperparameter
Value
[2e-5, 5e-5]
Learning Rate
Adam ε
1e-8
Adam β1
0.9
Adam β2
0.999
Learning rate decay Linear
Warmup fraction
Attention Dropout
Dropout
Weight Decay
Batch Size
Train Steps
0.1
0.1
0.1
0
[32, 128] for SMALL/ BASE, [16, 64] for LARGE
2000 for RTE and WNLI
10000 for MRPC, COLA and STSB
20000 for NER, SST2, QNLI and POS
[20000, 100000] for MNLI and QQP
128
Table 8: Fine-tune hyperparameters
Sequence Length
D Analysis details
D.1 Ensembling results setup
We find that multiplexing the same instance by duplicating the instance N times leads to worse performance.
This is likely because this input configuration is very out of distribution from what the multiplexed models
are trained on. To address this, we randomly permute the instances in the batch after duplicating the
instances N times. This ensures that the input to the multiplexer lies in a similar distribution to what the
model was trained on.
D.2 Muxology setup
To analyze the hidden states of pre-trained MUX-BERT models at different layers, we take the average
absolute value of hidden states and every layer for both multiplexed and baseline models, across different
configurations. To analyze the entropies of the attention distributions at different layers, we calculate the
attention distribution across different attention heads for each position in the sequence length. To measure
how peaky the attention distribution is likely to be, we calculate the entropies of the attention distributions
at all positions and average across all the positions and across all the attention heads to get the average
entropy for all layers. We conduct this analysis on WikiText-103 and average across all the samples in the
evaluation split.
E Task performance breakdown for all variants
Model Size N
MNLI
QQP
QNLI
MRPC
WNLI
STSB
RTE
SST2
COLA
GLUE GLUE−WNLI, COLA
SMALL
BASE
LARGE
1
2
5
10
1
2
5
10
1
2
5
10
77.86±0.0
75.09±0.1
70.50±0.1
61.98±0.1
84.24±0.0
80.59±0.1
77.18±0.2
73.62±0.3
85.79±0.0
83.23±0.2
79.55±0.2
35.45±0.0
88.99±0.0
88.88±0.1
86.39±0.1
80.85±0.1
91.19±0.0
90.36±0.1
88.79±0.1
86.94±0.1
91.46±0.0
90.85±0.1
89.37±0.1
63.18±0.0
84.00±0.0
84.31±0.2
81.23±0.2
63.47±0.3
90.54±0.0
88.17±0.1
85.58±0.1
82.08±0.3
92.29±0.0
90.66±0.2
87.41±0.2
50.54±0.0
77.70±0.0
79.75±0.7
74.26±1.0
70.69±0.9
87.75±0.0
83.77±1.4
80.10±0.6
78.63±0.6
83.82±0.0
84.90±0.8
83.77±1.1
68.38±0.0
56.34±0.0
50.99±8.1
54.65±3.3
56.62±4.3
56.34±0.0
50.70±7.0
53.52±2.5
52.68±6.0
56.34±0.0
56.34±0.0
54.93±0.0
56.90±5.2
84.25±0.0
82.65±0.3
79.90±0.2
36.93±1.0
89.18±0.0
85.84±0.1
84.28±0.2
81.62±0.2
89.53±0.0
88.22±0.2
85.86±0.3
82.81±0.2
62.45±0.0
55.52±1.5
58.56±1.9
53.57±1.8
63.18±0.0
58.19±1.6
59.13±1.2
58.27±2.4
66.06±0.0
59.21±0.9
57.26±2.0
52.13±1.9
88.88±0.0
87.04±0.7
82.57±0.3
80.39±0.4
91.74±0.0
90.62±0.6
86.88±0.4
83.44±0.6
91.40±0.0
91.38±0.4
88.65±0.7
50.92±0.0
43.48±0.0
30.64±1.7
12.78±1.6
1.10±2.2
58.79±0.0
55.61±1.6
12.33±2.4
0.00±0.0
57.79±0.0
57.89±1.5
46.66±0.9
1.87±4.6
73.77
70.54
66.76
56.18
79.22
75.98
69.75
66.36
79.39
78.08
74.83
51.35
80.59
79.03
76.20
63.98
85.40
82.51
80.28
77.80
85.76
84.06
81.70
57.63
Table 9: We show the full GLUE results for MUX-BERT. We report the mean accuracy and standard deviation over
5 seeds. Extrema and values within their standard deviation are emphasized for each model size.
Model Size N MNLI QQP QNLI MRPC WNLI STSB RTE
SST2 COLA GLUE GLUE−WNLI, COLA
SMALL
BASE
LARGE
1
2
5
10
1
2
5
10
1
2
5
10
77.86
75.21
70.66
62.17
84.24
80.82
77.66
74.04
85.79
83.40
79.69
35.46
88.99
89.01
86.46
80.93
91.19
90.47
88.89
87.03
91.46
90.94
89.43
63.18
84.00
84.61
81.60
63.85
90.54
88.28
85.70
82.45
92.29
90.96
87.81
50.89
77.70
80.64
75.74
71.81
87.75
86.03
81.13
79.41
83.82
86.27
84.80
68.38
56.34
61.97
61.97
63.38
56.34
66.20
59.15
63.38
56.34
56.34
57.75
61.97
84.25
82.97
80.24
38.20
89.18
86.06
84.47
81.89
89.53
88.50
86.49
83.04
62.45
58.12
60.65
55.96
63.18
60.65
60.65
62.45
66.06
60.29
60.65
55.60
88.88
87.84
83.49
80.96
91.74
91.51
87.50
84.29
91.40
91.86
89.45
50.92
43.48
33.08
15.57
2.63
58.79
56.93
15.79
0.00
57.79
60.50
47.56
7.55
73.77
72.61
68.49
57.77
79.22
78.55
71.22
68.33
79.39
78.78
75.96
53.00
80.59
79.77
76.98
64.84
85.40
83.40
80.86
78.79
85.76
84.60
82.62
58.21
Table 10: We show the full GLUE results for MUX-BERT. We report the maximum accuracy over 5 seeds. Extrema
are emphasized.
N
1
2
5
10
MNLI
QQP
QNLI
MRPC
WNLI
STSB
RTE
SST2
COLA
GLUE GLUE−WNLI, COLA
81.49±0.0
80.29±0.2
76.99±0.2
74.62±0.2
90.73±0.0
90.58±0.1
89.08±0.0
87.63±0.1
89.73±0.0
88.39±0.2
85.40±0.3
82.70±0.2
75.98±0.0
83.73±0.7
80.25±1.6
77.89±0.7
56.34±0.0
57.18±2.1
56.90±4.5
50.99±4.9
87.73±0.0
86.80±0.1
84.27±0.2
81.96±0.5
57.76±0.0
58.77±1.1
57.26±1.0
59.86±2.1
91.51±0.0
88.65±0.4
85.09±1.0
82.71±0.5
56.79±0.0
51.92±1.7
26.89±1.2
27.76±2.3
76.45
76.26
71.35
69.57
82.13
82.46
79.76
78.20
Table 11: We show the full GLUE results for MUX-ELECTRABASE. We report the mean accuracy and standard
deviation over 5 seeds. Extrema and values within their standard deviation are emphasized for each model size.
N Retreival Rate MNLI
QQP
QNLI
MRPC
WNLI
STSB
RTE
SST2
COLA
GLUE GLUE−WNLI, COLA
2
5
10
0.0
0.1
0.2
0.5
0.0
0.1
0.2
0.5
0.0
0.1
0.2
0.5
83.23±0.2
83.55±0.3
83.50±0.1
83.41±0.2
79.55±0.2
79.49±0.1
79.37±0.1
79.24±0.1
35.45±0.0
35.45±0.0
35.45±0.0
35.45±0.0
90.85±0.1
90.90±0.1
90.96±0.1
90.91±0.0
89.37±0.1
89.34±0.1
89.42±0.1
89.30±0.1
63.18±0.0
63.18±0.0
63.18±0.0
63.18±0.0
90.66±0.2
90.58±0.2
90.69±0.2
90.47±0.1
87.41±0.2
87.25±0.3
87.23±0.3
87.21±0.3
50.54±0.0
50.65±0.2
50.21±0.5
50.43±0.4
84.90±0.8
85.49±1.1
84.95±0.5
85.25±0.5
83.77±1.1
81.81±1.3
82.40±1.1
82.06±1.7
68.38±0.0
68.38±0.0
68.43±0.8
68.38±0.0
56.34±0.0
56.34±0.0
56.34±0.0
56.34±0.0
54.93±0.0
53.24±1.6
54.93±0.0
56.34±0.0
56.90±5.2
54.93±5.0
54.65±4.2
56.06±0.6
88.22±0.2
88.28±0.2
88.28±0.2
88.02±0.1
85.86±0.3
85.80±0.2
85.85±0.2
85.97±0.2
82.81±0.2
4.45±1.5
0.23±1.5
82.01±0.6
59.21±0.9
57.76±1.4
58.34±1.6
59.35±1.6
57.26±2.0
55.60±2.4
55.38±2.6
52.27±4.0
52.13±1.9
51.48±2.4
52.35±2.0
52.71±0.0
91.38±0.4
90.69±0.8
90.69±0.5
89.52±0.6
88.65±0.7
88.19±0.7
87.84±0.8
88.58±0.6
50.92±0.0
50.92±0.0
51.72±0.4
50.92±0.0
57.89±1.5
59.36±1.4
59.17±1.5
59.41±2.0
46.66±0.9
47.60±1.0
43.58±1.2
47.01±2.3
1.87±4.6
1.34±1.8
0.29±2.7
1.51±1.7
78.08
78.11
78.10
78.08
74.83
74.26
74.00
74.22
51.35
42.31
41.83
51.18
84.06
83.89
83.92
83.85
81.70
81.07
81.07
80.66
57.63
46.36
45.94
57.58
Table 12: GLUE results for MUX-BERTLARGE when using a retrieval auxiliary objective during MLM pretraining
with different trade-off rates to the MLM objective. We report the average accuracy over 5 seeds. Extrema and
values within their standard deviation are emphasized for each value of N.
N Mux Strategy MNLI
QQP
QNLI
MRPC
WNLI
STSB
RTE
SST2
COLA
GLUE GLUE−WNLI, COLA
2
5
10
MUX-BERT
DataMUX
Attention
MUX-BERT
DataMUX
Attention
MUX-BERT
DataMUX
Attention
80.59±0.1
81.64±0.2
81.32±0.2
77.18±0.2
76.32±0.1
77.16±0.1
73.62±0.3
72.74±0.1
71.83±0.2
90.36±0.1
90.67±0.1
90.65±0.0
88.79±0.1
89.13±0.1
88.71±0.0
86.94±0.1
87.88±0.1
88.00±0.0
88.17±0.1
88.39±0.2
88.77±0.1
85.58±0.1
84.22±0.3
84.33±0.1
82.08±0.3
82.28±0.2
81.46±0.2
83.77±1.4
84.17±0.4
80.88±0.6
80.10±0.6
78.38±0.9
70.49±0.6
78.63±0.6
77.30±0.5
73.53±0.5
50.70±7.0
56.34±0.0
56.34±0.0
53.52±2.5
59.44±3.5
54.08±3.2
52.68±6.0
56.34±0.0
53.24±5.4
85.84±0.1
86.36±0.2
86.25±0.1
84.28±0.2
81.78±0.4
80.37±0.3
81.62±0.2
78.07±0.4
82.95±0.2
58.19±1.6
60.87±0.7
56.90±1.2
59.13±1.2
54.15±1.3
54.44±2.5
58.27±2.4
55.31±1.2
52.71±0.0
90.62±0.6
90.50±0.4
91.06±0.2
86.88±0.4
86.17±0.4
81.95±0.3
83.44±0.6
82.36±0.3
81.28±0.4
55.61±1.6
53.74±1.0
47.15±1.1
12.33±2.4
28.32±0.8
34.67±1.2
0.00±0.0
13.56±3.0
32.84±0.6
75.98
76.96
75.48
69.75
70.88
69.58
66.36
67.32
68.65
82.51
83.23
82.26
80.28
78.59
76.78
77.80
76.56
75.97
Table 13: GLUE results for MUX-BERTBASE using alternative multiplexing-demultiplexing strategies. We report
the average accuracy over 5 seeds. Extrema and values within their standard deviation are emphasized for each
value of N.
Model Size N
MNLI
QQP
QNLI
MRPC
WNLI
STSB
RTE
SST2
COLA
GLUE GLUE−WNLI, COLA
SMALL
BASE
LARGE
2
5
10
2
5
10
2
5
10
61.48±0.2
58.35±0.2
53.63±0.2
63.29±0.3
60.67±0.2
59.07±0.2
64.64±0.2
60.78±0.3
48.79±0.6
80.33±0.0
77.50±0.1
77.03±0.1
81.42±0.1
79.42±0.1
78.22±0.1
82.10±0.1
78.56±0.1
68.41±0.1
60.05±0.2
57.17±0.3
51.22±0.3
60.35±0.4
59.77±0.2
57.99±0.5
60.21±0.2
60.19±0.3
55.76±0.8
68.43±0.5
68.38±0.0
68.38±0.0
68.38±0.2
69.61±0.8
68.38±0.0
69.95±0.9
69.51±0.5
68.58±0.6
56.34±0.0
56.34±0.0
57.46±6.3
56.90±5.8
53.80±7.3
60.28±3.0
56.34±0.0
56.34±0.0
58.59±3.3
15.02±0.4
11.31±0.3
12.40±1.3
17.65±1.0
14.92±1.8
11.83±0.6
21.62±0.4
17.33±1.1
8.38±1.1
51.12±0.6
51.70±1.3
52.35±2.7
51.19±1.7
52.71±0.8
53.07±1.1
52.71±0.0
52.71±0.0
54.95±0.9
79.75±0.3
77.78±0.3
50.92±0.0
80.78±0.5
81.15±0.6
78.35±1.1
80.34±0.9
78.28±0.8
64.82±1.0
8.22±0.7
6.02±0.7
0.00±0.0
9.62±1.5
10.35±1.7
7.40±1.7
8.72±2.1
10.63±2.7
3.48±3.9
53.42
51.62
47.04
54.40
53.60
52.73
55.18
53.81
47.97
59.45
57.46
52.28
60.44
59.75
58.13
61.65
59.62
52.81
Table 14: GLUE results for T-MUX with the original training recipe and implementation from Murahari et al.
(2022). We report the average accuracy and standard deviation over 5 seeds. Extrema and values within their
standard deviation are emphasized for each model size.
|
|
http://arxiv.org/abs/2302.12432v2 | 2023-07-01T03:09:13 | 2023-02-24T03:24:04 | Graph Neural Networks with Learnable and Optimal Polynomial Bases | Polynomial filters, a kind of Graph Neural Networks, typically use a
predetermined polynomial basis and learn the coefficients from the training
data. It has been observed that the effectiveness of the model is highly
dependent on the property of the polynomial basis. Consequently, two natural
and fundamental questions arise: Can we learn a suitable polynomial basis from
the training data? Can we determine the optimal polynomial basis for a given
graph and node features?
In this paper, we propose two spectral GNN models that provide positive
answers to the questions posed above. First, inspired by Favard's Theorem, we
propose the FavardGNN model, which learns a polynomial basis from the space of
all possible orthonormal bases. Second, we examine the supposedly unsolvable
definition of optimal polynomial basis from Wang & Zhang (2022) and propose a
simple model, OptBasisGNN, which computes the optimal basis for a given graph
structure and graph signal. Extensive experiments are conducted to demonstrate
the effectiveness of our proposed models. Our code is available at
https://github.com/yuziGuo/FarOptBasis. | [
"Yuhe Guo",
"Zhewei Wei"
] | [
{
"@title": null,
"@href": "http://arxiv.org/abs/2302.12432v2",
"@rel": "alternate",
"@type": "text/html"
},
{
"@title": "pdf",
"@href": "http://arxiv.org/pdf/2302.12432v2",
"@rel": "related",
"@type": "application/pdf"
}
] | null | {
"@xmlns:arxiv": "http://arxiv.org/schemas/atom",
"@term": "cs.LG",
"@scheme": "http://arxiv.org/schemas/atom"
} | [
"cs.LG",
"cs.AI"
] | 3
2
0
2
l
u
J
1
]
G
L
.
s
c
[
2
v
2
3
4
2
1
.
2
0
3
2
:
v
i
X
r
a
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Yuhe Guo 1 Zhewei Wei 1 2 3 4
Abstract
Polynomial filters, a kind of Graph Neural Net-
works, typically use a predetermined polynomial
basis and learn the coefficients from the training
data. It has been observed that the effectiveness of
the model is highly dependent on the property of
the polynomial basis. Consequently, two natural
and fundamental questions arise: Can we learn a
suitable polynomial basis from the training data?
Can we determine the optimal polynomial basis
for a given graph and node features?
In this paper, we propose two spectral GNN mod-
els that provide positive answers to the questions
posed above. First, inspired by Favard's Theo-
rem, we propose the FavardGNN model, which
learns a polynomial basis from the space of all
possible orthonormal bases. Second, we examine
the supposedly unsolvable definition of optimal
polynomial basis from Wang & Zhang (2022) and
propose a simple model, OptBasisGNN, which
computes the optimal basis for a given graph struc-
ture and graph signal. Extensive experiments
are conducted to demonstrate the effectiveness
of our proposed models. Our code is available at
https://github.com/yuziGuo/FarOptBasis.
1. Introduction
Spectral Graph Neural Networks are a type of Graph Neu-
ral Networks that comprise the majority of filter-based
GNNs (Shuman et al., 2013; Isufi et al., 2021; 2022). They
are designed to create graph signal filters in the spectral
domain. To avoid eigendecomposition, spectral GNNs ap-
proximate the desired filtering operations by polynomials
of laplacian eigenvalues.
1Gaoling School of Articial Intelligence, Renmin University
of China 2Peng Cheng Laboratory 3Beijing Key Laboratory of
Big Data Management and Analysis Methods 4MOE Key Lab of
Data Engineering and Knowledge Engineering. Correspondence
to: Zhewei Wei <[email protected]>.
Proceedings of the 40 th International Conference on Machine
Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright
2023 by the author(s).
1
there are mainly
As categorized in He et al. (2022),
two kinds of spectral GNNs.
In some works, the de-
sired polynomial filters are predefined. For example,
ˆL, and
GCN (Kipf & Welling, 2017) fixes the filter to be I
APPNP (Klicpera et al., 2019) restricts the filtering function
within the Personalized Pagerank.
−
Another line of research approximates arbitrary filters with
learnable polynomials. These models typically fix a prede-
termined polynomial basis and learn the coefficients from
the training data. ChebNet (Defferrard et al., 2016) uses
Chebyshev basis following the tradition of Graph Signal Pro-
cessing (Hammond et al., 2009). GPR-GNN (Chien et al.,
2021) uses Monomial basis, which is straightforward. Bern-
Net (He et al., 2021) uses the non-negative Bernstein basis
for regularization and interpretation. JacobiConv (Wang &
Zhang, 2022) chooses among the family of Jacobi polyno-
mial bases, with the exact basis determined by two extra
hyperparameters. ChebNetII (He et al., 2022) revisits the
Chebyshev basis, and incorporates the power of Chebyshev
interpolation by reparameterizing learnable coefficients by
chebynodes. Please refer to Section 2.1 for more concrete
backgrounds about polynomial filtering.
However, there are still two fundamental challenges on the
choice of basis.
Challenge 1:
It is well known and checked by ablation
studies (Wang & Zhang, 2022) that the choice of basis has
a significant impact on practical performance. However,
the proportion of known polynomial bases is small and
may not include the best-fitting basis for a given graph and
signal. Therefore, we pose the following question: Can we
learn a polynomial basis from the training data out of
all possible orthonormal polynomials? 1
Challenge 2: On the other hand, although these bases dif-
fer in empirical performances, their expressiveness should
be the same: any target polynomial of order K can be rep-
resented by any complete polynomial basis with truncated
order K (See Figure 1 for an example). Therefore, Wang &
Zhang (2022) raised a definition of optimal basis from an
optimization perspective, which promises an optimal conver-
gence rate. However, this basis is believed to be unsolvable
using existing techniques. Consequently, a natural question
1For the concrete definition of orthonormal polynomial bases,
please check the preliminaries in Section 2.2.
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Figure 1. Representation of h(λ) = λ2 + 1 by different bases.
is: can we compute this optimal basis for a given graph
and signal using innovative techniques?
In this paper, we provide positive answers to the questions
posed above. We summarize our contributions in three folds.
Firstly, we propose FavardGNN with learnable orthonor-
mal basis to tackle the first challenge. The theoretical basis
of FavardGNN is two Theorems in orthogonal polynomials:
the Three-term recurrences and its converse, Favard's Theo-
rem. FavardGNN learns from the whole space of possible
orthonormal basis with 2(K+1) extra parameters. Secondly,
we propose OptBasisGNN with solvable optimal basis. We
solve the optimal basis raised by Wang & Zhang (2022) by
avoiding the explicit solving of the weight function , which
invites the need for eigendecomposition. Note that although
we write out the implicitly defined/solved polynomial series
in the methodology section, we never need to solve it explic-
itly. Last but not least, we conduct extensive experiments
to demonstrate the effectiveness of our proposed models.
2. Background and Preliminaries
2.1. Background of Spectral GNNs
In this section, we provide some necessary backgrounds of
spectral graph neural networks, and show how the choice of
polynomial bases emerges as a problem. Notations used are
summarized in Table 6 in Appendix A.
−
Graph Fourier Transform. Consider an undirected and
connected graph G = (V, E) with N nodes, its symmetric
normalized adjacency matrix and laplacian matrix are de-
noted as ˆP and ˆL, respectively, ˆL = I
ˆP . Graph Fourier
Transform, as defined in the spatial/spectral domain of graph
signal processing, is analogous to the time/frequency do-
main Fourier Transform (Hammond et al., 2009; Shuman
et al., 2013) . One column in the representations of N nodes,
RN ×d, is considered a graph signal, denoted as x. The
X
complete set of N eigenvectors of ˆL, denoted as U , who
show varying structural frequency characteristics (Shuman
et al., 2013), are used as frequency components. Graph
Fourier Transform is defined as ˆx := U Tx , where signal
x is projected to the frequency responses of all compo-
nents. It is then followed by modulation, which suppresses
or strengthens certain frequency components, denoted as
ˆx∗ := diag
ˆx . After modulation, inverse
∈
θ0,
{
* * *
, θN −1}
Fourier Transform: x∗ := U ˆx∗ transforms ˆx∗ back to the
spatial domain. The three operations form the process of
spectral filtering: U diag
U Tx (1) .
θ0, θ1, . . . , θN −1}
{
Polynomial Approximated Filtering.
In order to avoid
time-consuming eigendecomposition, a line of work ap-
proximate θi by some polynomial function of λi, which
is the i-th eigenvalue of ˆL, i.e. θi ≈
h(λi). Equation (1)
then becomes a form that is easy for fast localized calcula-
U Tx = h( ˆL)x.
tion: U diag
h(λ0), h(λ1), . . . , h(λN −1)
}
{
As listed in Introduction, various polynomial bases have
been utilized, denoted as h(λ) = (cid:80)K
k=0 αkgk(λ). For fur-
ther simplicity, we equivalently use b( ˆP ) instead of h( ˆL)
ˆP ). Note that b(
in this paper, where b( ˆP ) := h(I
) is
*
defined on the spectrum of ˆP , and the i-th eigenvalue of ˆP ,
denoted as μi, equals 1
λi.
−
−
→
z = (cid:80)K
The filtering process on the input signal x is then expressed
k=0 αkgk( ˆP )x . When consider indepen-
as x
dent filtering on each of the d channels in X simulta-
neously, the multichannel filtering can be denoted as:
X
k=0 αk,lgk,l( ˆP )X:,l (2).
Z =
(cid:80)K
→
∥l∈[1,h]
2.2. Orthogonal and Orthonormal Polynomials
In this section, we give a formal definition of orthogonal
and orthonormal polynomials, which plays a central role in
the choosing of polynomial bases (Simon, 2014).
Inner Products. The inner product of polynomials is de-
:= (cid:82) b
⟩
f, g
⟨
fined as
a f (x)g(x)w(x)dx , where f , g and w
are functions of x on interval (a, b), and the weight func-
tion w should be non-negative to guarantee the positive-
definiteness of inner-product space.
The definition of the inner products induces the definitions
of norm and orthogonality. The norm of polynomial f is
f
∥
defined as:
=
f, f
, and f and g are orthogonal
∥
⟩
to each other when
= 0 . Notice that the concept of
inner product, norm, and orthogonality are all defined with
respect to some weight function.
⟩
(cid:112)
⟨
f, g
⟨
Orthogonal Polynomials. A sequence of polynomi-
∞
als
is
n=0 where pn(x) is of exact degree n,
}
called orthogonal w.r.t.
the positive weight function
pn(x)
{
2
k=0k=1k=2Representationofh()=2+1MonomialBasisM0()=1M1()=M2()=2h()=M0+M2()ChebyshevBasisT0()=1T1()=T2()=2¡1h()=2T0()+T2()BernsternBasisBk;2()=2kk(1¡)2¡k(k=0;1;2)h()=B0;2()+B1;2()+2B2;2()JacobiBasis(==1)P0(;)()=1P1(;)()=2P2(;)()=338+154+1582h()=¡1815P0(;)¡P1(;)+815P2(;)Graph Neural Networks with Learnable and Optimal Polynomial Bases
Algorithm 1: FAVARDFILTERING
Input: Input signals X with d channels; Normalized
graph adjacency ˆP ; Truncated polynomial order
K
3
0
Learnable Parameters :β, γ, α
Output: Filtered Signals Z
1 x−1 ←
2 for l = 0 to d
1 do
−
X:,l , x0 ←
x
←
for k = 0 to K do
xk+1 ←
( ˆP xk −
z
←
z
Z:,l ←
7
8 return Z
γk,lxk −
z + αk+1,lxk+1
x/(cid:112)β0,l , z
6
5
4
α0,lx0
←
(cid:112)βk,lxk−1)/(cid:112)βk+1,l
2
∥
=
is
,
* * *
pn∥
, there exists
= 0), where the inner product
w(x) if, for m, n = 0, 1, 2,
2(
pn∥
pn∥
δmn∥
∥
defined w.r.t. w(x). When
pn(x)
pn, pm⟩
⟨
f, g
⟩
⟨
2 = 1 for n = 0, 1, 2,
* * *
∞
n=0 is known as orthonormal polynomial series.
}
{
When a weight function is given, the orthogonal or orthonor-
mal series with respect to the weight function can be solved
by Gram-Schmidt process.
Remark 2.1. In this paper, the orthogonal/orthonormal poly-
nomial bases we consider are truncated polynomial series,
i.e. the polynomials that form a basis are of increasing order.
3. Learnable Basis via Favard's Theorem
Empirically, spectral GNNs with different polynomial bases
vary in performance on different datasets, which leads to two
observations: (1) the choice of bases matters; (2) whether a
basis is preferred might be related to the input, i.e. different
signals on their accompanying underlying graphs.
For the first observation, we notice that up to now, polyno-
mial filters pick polynomial bases from well-studied polyno-
mials, e.g. Chebyshev polynomials, Bernstein polynomials,
etc, which narrows down the range of choice. For the sec-
ond observation, we question the reasonableness of fixing
a basis during training. A related effort is made by Jacobi-
Conv (Wang et al., 2019), who adapt to a Jacobi polynomial
series from the family of Jacobi polynomials via hyperpa-
rameter tuning. However, the range they choose from is
discrete. Therefore, we aim at dynamically learn polyno-
mial basis from the input from a vast range.
3.1. Recurrence Formula for Orthonormal Bases
Luckily, the Three-term recurrences and Favard's theorem
of orthonormal polynomials provide a continuous param-
eter space to learn basis. Generally speaking, three-term
3
Algorithm 2: FAVARDGNN (For Classification)
Input: Raw features Xraw; Normalized graph
adjacency ˆP ; Truncated polynomial order K
Learnable Parameters :W0, b0, W1, b1, β, γ, α
Output: Label predictions ˆY
1
2
3
X
Z
ˆY
XrawW0 + b0
FAVARDFILTERING(X, ˆP , K, β, γ, α)
Softmax(ZW1 + b1)
←
←
←
recurrences states that every orthonormal polynomial series
satisfies a very characteristic form of recurrence relation,
and Favard's theorem states the converse.
Theorem 3.1 (Three Term Recurrences for Orthonormal
Polynomials). (Gautschi, 2004, p. 12) For orthonormal
∞
polynomials
k=0 w.r.t. weight function w, suppose that
the leading coefficients of all polynomials are positive, there
exists the three-term recurrence relation:
pk}
{
(cid:112)βk+1 pk+1(x) = (x
γk)pk(x)
−
−
√βk pk−1(x),
p−1(x) := 0, p0(x) = 1/
βk ∈
γk ∈
R+, k
R,
(cid:112)
≥
(cid:112)
β0,
0
(3)
with β0 = (cid:82) w(x)dx.
Theorem 3.2 (Favard's Theorem; Orthonormal Case).
(Favard, 1935), (Simon, 2005, p. 14) A polynomial se-
∞
k=0 who satisfies the recurrence relation in Equa-
ries
pk}
{
tion (3) is orthonormal w.r.t. a weight function w that
β0 = (cid:82) w(x)dx.
By Theorem 3.2, any possible recurrences with the form (3)
defines an orthonormal basis. By Theorem 3.1, such a
formula covers the whole space of orthonormal polynomials.
√βk}
If we set
to be learnable parameters with
{
√βk > 0(k
0), any orthonormal basis can be obtained.
≥
γk}
{
and
We put the more general orthogonal form of Theorem 3.1
and Theorem 3.2 in Appendix B.1 to B.5. In fact, the prop-
erty of three-term recurrences for orthogonal polynomials
has been used multiple times in the context of current spec-
tral GNNs to reuse gk( ˆP )x and gk−1( ˆP )x for the calcula-
tion of gk+1( ˆP )x. Defferrard et al. (2016) owe the fast filter-
ing of ChebNet to employing the three-term recurrences of
Chebyshev polynomials (the first kind, which is orthogonal
w.r.t.
Tk−1(x). Similarly,
JacobiConv (Wang & Zhang, 2022) employs the three-term
recurrences for Jacobi polynomials (orthogonal w.r.t.
to
x)a(1 + x)b). In this paper, however, we focus on
(1
orthonormal bases because they minimize the mutual influ-
ence of basis polynomials and the influence of the unequal
norms of different basis polynomials.
): Tk+1(x) = 2xTk(x)
x2−1
1√
−
−
̸
Graph Neural Networks with Learnable and Optimal Polynomial Bases
3.2. FavardGNN
Formulation of FavardGNN. We formally write the ar-
chitecture of FAVARDGNN (Algorithm 2), with the filtering
process illustrated in FAVARDFILTERING (Algorithm 1).
Note that the iterative process of Algorithm 1 (lines 3-5)
follows exactly from Equation (3) in Favard's Theorem.
The key insight is to treat the coefficients β, γ, α in Equa-
tion (3) as learnable parameters. Since Theorem 3.1 and
Theorem 3.2 state that the orthonormal basis must satisfy
the employed iteration and vice versa, it follows that the
model can learn a suitable orthonormal polynomial basis
from among all possible orthonormal bases.
Following convention, before FAVARDFILTERING, an MLP
is used to map the raw features onto the signal channels
(often much less than the dimension of raw features). In
regression problems, the filtered signals are directly used as
predictions; for classification problems, they are combined
by another MLP followed by a softmax layer.
Parallel Execution. Note that for convenience of presen-
tation, we write the FAVARDFILTERING Algorithm in a
form of nested loops. In fact, the computation on different
channels (the inner loop k) is conducted simultaneously.
We put more concrete implementation in PyTorch-styled the
pseudocode in Appendix C.1.
3.3. Weaknesses of FavardGNN
there are still
However,
two main weaknesses of
FavardGNN. Firstly, the orthogonality lacks interpretability.
The weight function w can only be solved analytically in a
number of cases (Geronimo & Van Assche, 1991). Even if
the weight function is solved, the form of w might be too
complicated to understand.
Secondly, FAVARDFILTERING is not good in convergence
properties: consider a simplified optimization problem
2
F which has been examined in the context
min
∥
of GNN (Xu et al., 2021; Wang & Zhang, 2022), even this
problem is non-convex w.r.t the learnable parameters in Z.
We will re-examine this problem in the experiment section.
Z
∥
−
Y
4. Achieving Optimal Basis
Although FavardGNN potentially reaches the whole space
of orthonormal polynomial series, on the other hand, we still
want to know: whether there is an optimal and accessible
basis in this vast space.
this optimal basis to our polynomial filter with O(K
time complexity.
|
E
)
|
Wang & Zhang (2022) make an essential step towards this
question: they derive and define an optimal basis from the
angle of optimization. However, they do not exhaust their
own finding in their model, since based on a habitual process,
they believe that the optimal basis they find is inaccessible.
In this section, we show how we can exactly apply this
) time
optimal basis to our polynomial filter in O(K
|
complexity.
E
|
4.1. A Review: A Definition for Optimal Basis
We start this section with a quick review of the related part
from Wang & Zhang (2022), with a more complete review
put in Appendix E.
z
y
Y
−
−
2 ∥
2 ∥
k=0 αkgk( ˆP )x.
Definition of Optimal Basis.
Wang & Zhang (2022)
considers the squared loss R = 1
2
F, where Y is
Z
∥
the target signal. Since each signal channel contributes
independently to the loss, the authors then consider the
loss function channelwisely and ignore the index l, that is,
r = 1
F, where z = (cid:80)K
2
∥
K
The task at hand is to seek a polynomial series
k=0
which is optimal for the convergence of coefficients α. Since
r is convex w.r.t. α, the gradient descent's convergence rate
reaches optimal when the Hessian matrix is identity. The
[0, K]) of the Hessian matrix is:
(k1, k2) element (k1, k2 ∈
∂2r
∂αk1∂αk2
= xTgk2( ˆP )gk1 ( ˆP )x.
Hk1k2 =
gk}
{
(4)
Definition 4.1 (Optimal basis for signal x). For a
K
k=0 is
given graph signal x, polynomial basis
optimal in convergence rate when H given in (4) is
an identity matrix.
gk}
{
Wang & Zhang (2022) further reveal the orthonormality
inherent in the optimal basis by rephrasing Equation (4) into
Hk1k2 = (cid:82) 1
μ=−1 gk1(μ)gk2(μ)f (μ)dμ, where the form of
f is given in Proposition 4.2 and and derivation is delayed
in Appendix E. Combining Definition 4.1, we soonly get:
Proposition 4.2 (Exact weight function of optimal
basis). The optimal polynomial basis in Definition
4.1 is orthonormal w.r.t. weight function f , where
f (μ) =
△F (μ)
△μ , with F (μ) := (cid:80)
μi≤μ(U Tx)2
i .
Recently, Wang & Zhang (2022) raises a criterion for opti-
mal basis. Since different bases are the same in expressive-
ness, this criterion is induced from an angle of optimization.
However, Wang & Zhang (2022) believe that this optimal
basis is unreachable. In this section, we follow this defini-
tion of optimal basis, and show how we can exactly apply
Unachievable Algorithm Towards Optimal Basis. Now
we illustrate why Wang & Zhang (2022) believe that though
properly defined, this optimal basis is unachievable, and
how they took a step back to get their final model. We sum-
marize the process they thought of in Algorithm 3. This
process is quite habitual: with the weight function in Propo-
4
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Algorithm 3: (An Unreachable Algorithm for Utilizing
Optimal Basis)
Input: Graph signal x; Normalized graph adjacency ˆP ;
Truncated polynomial order K
Output: Optimal basis
μi}
{
N
i=1 ←
gk(
*
{
K
)
k=0
}
Eigendecomposition of ˆP
U,
Calculate f (μ) as descripted in Proposition 4.2
Use Gram-Schmidt process and weight function
f (μ) to contruct an orthonormal basis
K
k=0 in polynomial filtering
Apply
gk}
{
K
k=0
gk}
{
1
2
3
4
sition 4.2 solved, it is natural to use it to determine the
first K polynomials by the Gram-Schmidt process and then
use the solved polynomials in filtering as other bases, e.g.
Chebyshev polynomials. This process is unreachable due
to the eigendecomposition step, which is essential for the
calculation of f (see Proposition 4.2), but prohibitively ex-
pensive for larger graphs.
As a result, Wang & Zhang (2022) came up with a com-
promise. They allow their model, namely JacoviConv, to
choose from the family of orthogonal Jacobi bases, who
μ)a(1 +
have "flexible enough weight functions", i.e., (1
μ)b (
(0, 1)). In their implementation, a and b are
∀
discretized and chosen via hyperparameter tuning. Obvi-
ously, the fraction of possible weight functions JacoviConv
can cover is still small, very possibly missing the optimal
weight function in Proposition 4.2.
a, b
−
∈
4.2. OptBasisGNN
|
|
E
In this section, we show how the polynomial filter can em-
ploy the optimal basis in Definition 4.1 efficiently via an
) methodology. Our method does not
innovative O(K
follow the convention in Algorithm 3 where four progressive
steps are included to solve the optimal polynomial bases out
and utilize them. Instead, our solution to the optimal bases
is implicit, accompanying the process of solving a related
vector series. Thus, our method bypasses the untractable
eigendecomposition step.
z = (cid:80)K
Optimal Vector Basis with Accompanying Polynomials.
Still, we consider graph signal filtering on one channel,
k=0 αkgk( ˆP )x. Instead of taking the
that is, x
matrix polynomial b( ˆP ) = (cid:80)K
k=0 αkgk( ˆP ) as a whole, we
vk := gk( ˆP )x
K
k=0 as a vector basis. Then
now regard
vk|
}
the filtered signal z is a linear combination of the vector
→
{
z = (cid:80)K
basis, namely x
→
meets Definition 4.1, for all k1, k2 ∈
satisfies:
k=0 αkvk (5) . When
K
k=0
[0, K], the vector basis
gk}
{
Algorithm 4: OPTBASISFILTERING
1. In the comment, we write the implicitly undergoing process
of obtaining the accompanying optimal polynomial basis.
2. Steps 1-3 will be further substituted by Algorithm 5 after
the derivative of Proposition 4.4.
Input: Input signals X with d channels; Normalized
graph adjacency ˆP ; Order K
Learnable Parameters :α
Output: Filtered signals Z
6
4
5
3
;
−
1 do
1 for l = 0 to d
X:,l
x
2
←
x/
x
v0 ←
∥
∥
α0,lv0
z
←
for k = 0 to K do
Step 1: v∗
Step 2: v⊥
// g⊥
k+1 ←
k+1 ←
k+1(μ) := g∗
Step 3: vk+1 ←
// gk+1(μ) := g⊥
z
←
z
Z:,l ←
10
11 return Z
9
8
7
// g0(μ) = 1/
x
∥
∥
(cid:80)k
ˆP vk ;
v∗
k+1 −
k+1(μ)
v⊥
k+1/
(cid:80)
∥
v⊥
k+1(μ)/
k+1∥
∥
z + αk+1,lvk+1
−
k
i=0⟨
v⊥
k+1∥
// g∗
k+1(μ) := μgk(μ)
v∗
k+1, vi⟩
i=0⟨
v∗
k+1, vi⟩
;
vi ;
gi(μ)
Given ( ˆP , x), we term gk the accompanying polynomial
of a vector vk if vk = gk( ˆP )x. Note that an accompanying
polynomial does not always exists for any vector. Follow-
ing Equation (6), finding the optimal polynomial basis for
K
filtering is equivalent to finding a vector basis
k=0
that satisfies two conditions: Condition 1: Orthonormal-
ity; Condition 2: Accompanied by the optimal polynomial
gk( ˆP )x establishes for each k, where
basis, that is, vk ≡
gk follows Definition 4.1. We term such
the optimal
vector basis.
vk}
{
vk}
{
When focusing solely on Condition 1, one can readily think
of the fundamental Gram-Schmidt process, which generates
a sequence of orthonormal vectors through a series of iter-
ative steps: each subsequent basis vector is derived by 1)
orthogonalization with respect to all the previously obtained
vectors, and 2) normalization.
Moreover, with a slight generalization, Condition 2 can
also be met. As illustrated in our OPTBASISFILTERING
algorithm (Algorithm 11), besides Steps 2-3 taken directly
from the Gram-Schmidt process to ensure orthonormality,
there is an additional Step 1 that guarantees the existence
of the subsequent accompanying polynomial. To show this,
we can write out the accompanying polynomial in each step.
Inductively, assuming that the accompanying polynomials
for the formerly obtained basis vectors are g0,
, gk, we
can observe immediately from the algorithmic flow that the
* * *
k2vk1 = xTgk2 ( ˆP )gk1( ˆP )x = δk1k2.
vT
(6)
5
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Algorithm 5: OBTAINNEXTBASISVECTOR
Input: Normalized graph adjacency ˆP ; Two solved
channels are conducted in parallel. Please check the Pytorch-
style pseudo-code in Appendix C.2.
basis vectors vk−1, vk (k
0)
≥
ˆP vk
k+1 ←
Output: vk+1
Step 1: v∗
Step 2:
v⊥
k+1 ←
Step 3: vk+1 ←
return vk+1
1
2
3
4
v∗
v∗
k+1, vk⟩
k+1 − ⟨
v⊥
v⊥
k+1/
k+1∥
∥
vk − ⟨
4.3. More on the Implicitly Solved Polynomial Basis
This section is a more in-depth discussion about the nature
of our method, that is, we implicitly determine the optimal
polynomials by three-term recurrence relations rather than
the weight function.
v∗
k+1, vk−1⟩
vk−1
(k + 1)-th accompanying polynomial is
gk+1(μ) := (cid:0)μgk(μ)
−
k
(cid:88)
v∗
k, vi⟩
⟨
i=0
gi(μ)(cid:1)/
∥
v⊥
,
k+1∥
(7)
∥
* * *
x
∥
as the initial step. Since for each
with g0(μ) = 1/
(k1, k2), xTgk2 ( ˆP )gk1( ˆP )x = vT
k1 vk2 = δk1k2 establishes,
the sequence g0,
, gK is exactly the optimal basis in Defi-
nition 4.1. Thus, by solving the vectors in the optimal vector
basis in order and at the same time apply them in filtering
by Equation (5), we can make implicit yet exact use of
the optimal polynomial basis. Thus, we can make implicit
and exact use of the optimal polynomial basis via solving
the optimal vector basis and applying them by Equation (5).
The cost, due to the recursive conducting over Step 2 until
vK is obtained, is in total O(K
Remark 4.3. It is revealed by Equation (7) that we have in
fact provided an alternative solution to the optimal basis.
However, notice that we never need to explicitly compute
the polynomial series.
+ K 2
E
|
).
|
V
|
|
V
|
+K
|
) Time Complexity. We can
Achieving O(K
E
|
) by Proposi-
further reduce the cost to O(K
V
|
|
tion 4.4, which shows that in Step 2, instead of subtracting
all the former vectors, we just need to subtract vk and vk−1
from v∗
+ K
E
|
|
|
k+1.
Proposition 4.4. In Algorithm 11, v∗
pendent with vk and vk−1.
k+1 is only den-
Proof. Please check Appendix B.6.
Remark 4.5. The proof is hugely inspired by the core proof
part of the Theorem B.1 (Appendix B.1, the three-term
recurrences theorem for orthogonal polynomials), which
shows that xpk(x)is only relevant to pk+1(x), pk(x) and
pk−1(x). The difference is just a shift of consideration of
the inner-product space from polynomials to vectors.
By Proposition 4.4, we substitute Steps 1-3 in Algorithm 11
by Algorithm 5. Note that we define v−1 := ⃗0, g−1(μ) := 0
for consistency and simplicity of presentation. The im-
proved OPTBASISFILTERING algorithm serves as the core
part of the complete OptBasisGNN. The processes on all
We begin with a lemma. The proof can be found in Ap-
pendix B.7.
Lemma 4.6. In Algorithm 5,
v∗
k+1, vk−1⟩
⟨
This lemma soonly leads to the following theorem.2
v⊥
k ∥
=
∥
.
Theorem 4.7 (Three-term Recurrences of Accom-
panying Polynomials (Informal)). The process for
deriving the vector basis correspondingly defines
the optimal polynomial basis through the following
three-term relation:
v⊥
k+1∥
∥
gk+1(μ) = (μ
− ⟨
− ∥
g−1(μ) := 0, g0(μ) = 1/
∥
, K
k = 0,
1.
* * *
−
)gk(μ)
gk−1(μ),
v∗
k+1, vk⟩
v⊥
k ∥
x
,
∥
Proof. Combining Proposition 4.4, the accompanyingly de-
rived basis polynomial in Equation (7) comes to
v⊥
k+1∥
∥
gk+1(μ) = μgk(μ)
k
(cid:88)
−
i=k−1
v∗
k+1, vi⟩
⟨
gk(μ).
By employing Lemma 4.6 on the right-hand side and staking
the steps, the proof is completed.
v⊥
k ∥
∥
v∗
k+1, vk⟩
⟨
This implicit recurring relation revealed in Theorem 4.7
perfectly matches the three-term formula in Equation (3)
by √βk, and
by γk. This
if we substitute
is guaranteed by the orthonormality of the optimal basis
(Proposition 4.2) and the three-term recurrence formula
that constrains any orthonormal polynomial series (Theo-
rem 3.2). From this perspective, OptBasisGNN is a particu-
lar case of FavardGNN. FavardGNN is possible to reach the
whole space of orthonormal bases, among which OptBasis-
GNN employs the ones that promise optimal convergence
property.
Let us recall the Favard's theorem (Theorem 3.1) and three-
term recurrence theorem (Theorem 3.2) from a different per-
spective: An orthonormal polynomial series can be defined
either through a weight function or a recurrence relation of
a specific formula. We adopt the latter definition, bypassing
2Here, x is the input signal.
6
Graph Neural Networks with Learnable and Optimal Polynomial Bases
the need for eigendecomposition as a prerequisite for the
weight function. Moreover, our adoption of such a way of
definition is hidden behind the calculation of vector basis.
Algorithm 6: OPTBASISFILTERING
Input: Input signals X with d channels; Normalized
graph adjacency ˆP ; Order K
0
Learnable Parameters :α
Output: Filtered signals Z
1 v−1 ←
2 for l = 0 to d
1 do
−
X:,l , v0 ←
x
3
←
for k = 0 to K do
vk+1 ←
vk−1)
z
←
z
Z:,l ←
7
8 return Z
x
∥
x/
4
5
6
z + αk+1,lvk+1
, z
α0,lv0
∥
←
OBTAINNEXTBASISVECTOR( ˆP ,vk,
4.4. Scale Up OptBasisGNN
By slightly generalizing OptBasisGNN, it becomes feasible
to scale it up for significantly larger graphs, such as ogbn-
papers100M(Hu et al., 2020). This follows the approach
of previous works that achieve scalability in GNNs by de-
coupling feature propagation from transformation (Chen
et al., 2020a; Wu et al., 2019; He et al., 2022). We make
several modifications to OptBasisGNN. First, we remove
the MLP layer before OPTBASISFILTERING, resulting in
the optimal basis vectors for all channels being computed
in just one pass. Second, we preprocess the entire set of
Rd×(K+1)×N ) on CPU. Third, we adopt
basis vectors (V
, the corre-
batch training, where for each batch of nodes
sponding segment of basis vectors V [:, :,
] is transferred to
the GPU.
∈
B
B
5. Experiments
In this section, we conduct a series of comprehensive ex-
periments to demonstrate the effectiveness of the proposed
methods. Experiments consist of node classification tasks
on small and large graphs, the learning of multi-channel
filters, and a comparison of FavardGNN and OptBasisGNN.
5.1. Node Classification
Experimental Setup. We include medium-sized graph
datasets conventionally used in preceding graph filtering
works, including three heterophilic datasets (Chameleon,
Squirrel, Actor) provided by Pei et al. (2020) and two ci-
tation datasets (PubMed, Citeseer) provided by Yang et al.
(2016) and Sen et al. (2008) . For all these graphs, we take
7
a 60%/20%/20% train/validation/test split proportion fol-
lowing former works, e.g. Chien et al. (2021). We report
our results of twenty runs over random splits with random
initialization seeds. For baselines, we choose sota spec-
tral GNNs. For other experimental settings, please refer to
Appendix D.1. Besides, for evaluation of OptBasisGNN,
please also check the results in the scalability experimental
section (Section 5.2).
Results. As shown in Table 1, FavardGNN and OptBa-
sisGNN outperform most strong baselines. Especially, in
Chameleon, Squirrel and Actor, we see a big lift. The vast
selection range and learnable nature of FavardGNN and the
optimality of convergence provided by OptBasisGNN both
enhance the performance of polynomial filters, and their
performances hold flat.
5.2. Node Classification on Large Datasets
Experimental Setup. We perform node classification
tasks on two large citation networks: ogbn-arxiv and ogbn-
papers100M (Hu et al., 2020), and five large non-homophilic
networks from the LINKX datasets (Lim et al., 2021) . Ex-
cept for Penn94, Genius and Twitch-Gamers, all other men-
tioned datasets use the scaled version of OptBasisGNN.
For ogbn datasets, we run repeating experiments on the
given split with ten random model seeds, and choose base-
lines following the scalability experiments in ChebNetII
(He et al., 2022). For LINKX datasets, we use the five
given splits to align with other reported experiment results
for Penn94, Genius, Twitch-Gamer and Pokec. For Wiki
dataset, since the splits are not provided, we use five random
splits. For baselines, we choose spectral GNNs as well as
top-performing spatial models reported by Lim et al. (2021),
including LINK, LINKX, GCNII (Chen et al., 2020b) and
MixHop (Abu-El-Haija et al., 2019). For more detailed
experimental settings, please refer to Appendix D.1.
Results. As shown in Table 2 and Table 3, On Penn94,
Genius and Twitch-gamer, our two models achieve compa-
rable results to those of the state-of-the-art spectral methods.
On ogbn datasets as well as Pokec and Wiki with tens or
hundreds of millions of edges, we use the scaled version
of OptBasisGNN with batch training. We do not conduct
FavardGNN on these datasets, since the basis vectors of
FavardGNN cannot be precomputed. Notably, on Wiki
dataset, the largest non-homophilous dataset, our method
surpasses the second top method by nearly one percent, this
demonstrates the effectiveness of our scaled-up version of
OptBasisGNN.
5.3. Learning Multi-Channel Filters from Signals
Experimental Setup. We extend the experiment of learn-
ing filters conducted by He et al. (2021) and Balcilar et al.
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Table 1. Experimental results. Accuracies ± 95% confidence intervals are displayed for each model on each dataset. The best-performing
two results are highlighted. The results of GPRGNN are taken from He et al. (2021). The results of BernNet, ChebNetII and JacobiConv are
taken from original papers. The results of FavardGNN and OptBasisGNN are the average of repeating experiments over 20 cross-validation
splits.
Dataset
V
∥
(G)
∥
H
MLP
GCN (Kipf & Welling, 2017)
ChebNet (Defferrard et al., 2016)
ARMA (Bianchi et al., 2021)
APPNP (Klicpera et al., 2019)
GPR-GNN (Chien et al., 2021)
BernNet (He et al., 2021)
ChebNetII (He et al., 2022)
JacobiConv (Wang & Zhang, 2022)
FavardGNN
OptBasisGNN
Chameleon
2,277
.23
Squirrel
5,201
.22
46.59
60.81
59.51
60.21
52.15
67.49
68.53
71.37
74.20
72.32
74.26
1.84
2.95
1.25
1.00
1.79
1.38
1.68
1.01
1.03
1.90
0.74
±
±
±
±
±
±
±
±
±
±
±
31.01
45.87
40.81
36.27
35.71
50.43
51.39
57.72
57.38
63.49
63.62
1.18
0.8
0.42
0.62
0.78
1.89
0.92
0.59
1.25
1.47
0.76
±
±
±
±
±
±
±
±
±
±
±
Actor
7,600
.22
40.18
33.26
37.42
37.67
39.76
39.91
41.71
41.75
41.17
43.05
42.39
0.55
1.15
0.58
0.54
0.49
0.62
1.12
1.07
0.64
0.53
0.52
±
±
±
±
±
±
±
±
±
±
±
Citeseer
3,327
.74
76.52
79.85
79.33
80.04
80.47
80.13
80.08
80.53
80.78
81.89
80.58
0.89
0.78
0.57
0.55
0.73
0.84
0.75
0.79
0.79
0.63
0.82
±
±
±
±
±
±
±
±
±
±
±
Pubmed
19,717
.80
86.14
86.79
87.82
86.93
88.13
88.46
88.51
88.93
89.62
90.90
90.30
0.25
0.31
0.24
0.24
0.33
0.31
0.39
0.29
0.41
0.27
0.19
±
±
±
±
±
±
±
±
±
±
±
Table 2. Experimental results of large-scale datasets (non-homophilous). Accuracies ± standard errors are displayed for each model on
each dataset. The best-performing two results are highlighted. Results of BernNet and ChebNet are taken from He et al. (2022). Other
results are from Lim et al. (2021). Note that for the large Pokec and Wiki datasets, we use the scaled-up version of OptBasisGNN, which
is introduced in Section 4.4.
Dataset
V
∥
E
∥
(G)
∥
∥
H
MLP
GCN (Kipf & Welling, 2017)
GCNII (Chen et al., 2020b)
MixHop (Abu-El-Haija et al., 2019)
LINK (Lim et al., 2021)
LINKX (Lim et al., 2021)
GPR-GNN (Chien et al., 2021)
BernNet (He et al., 2021)
ChebNetII (He et al., 2022)
FavardGNN
OptBasisGNN
Penn94
41,554
1,362,229
.470
73.61
82.47
82.92
83.47
80.79
84.71
83.54
83.26
84.86
84.92
84.85
0.40
0.27
0.59
0.71
0.49
0.52
0.32
0.29
0.33
0.41
0.39
±
±
±
±
±
±
±
±
±
±
±
Genius
421,961
984,979
.618
86.68
87.42
90.24
90.58
73.56
90.77
90.15
90.47
90.85
90.29
90.83
0.09
0.31
0.09
0.16
0.14
0.27
0.30
0.33
0.32
0.14
0.11
±
±
±
±
±
±
±
±
±
±
±
Twitch-Gamers
168,114
6,797,557
.545
60.92
62.18
63.39
65.64
64.85
66.06
62.59
64.27
65.03
64.26
65.17
0.07
0.26
0.61
0.27
0.21
0.19
0.38
0.31
0.27
0.12
0.16
±
±
±
±
±
±
±
±
±
±
±
Pokec
1,632,803
30,622,564
.445
62.37
75.45
78.94
81.07
80.54
82.04
80.74
81.67
82.33
-
82.83
0.02
0.17
0.11
0.16
0.03
0.07
0.22
0.17
0.28
0.04
±
±
±
±
±
±
±
±
±
±
Wiki
1,925,342
303,434,860
.389
37.38
OOM
OOM
49.15
57.11
59.80
58.73
59.02
60.95
-
61.85
0.21
0.26
0.26
0.41
0.34
0.29
0.39
0.03
±
±
±
±
±
±
±
±
(2021). The differences are twofold: First, we consider the
case of multi-channel input signals and learn filters chan-
nelwisely. Second, the only learnable parameters are the
coefficients α. Note that the optimization target of this ex-
periment is identical to how the optimal basis was derived
by Wang & Zhang (2022) (See Section 4.1).
We put the practical background of our multichannel ex-
100 image is
periment in YCbCr color space. Each 100
considered as a grid graph with input node signals on three
channels: Y, Cb and Cr. Each signal might be filtered by
complex filtering operations defined in (He et al., 2021). As
shown in Table 4, using different filters on each channel re-
sults in different combination effects. We create a synthetic
dataset with 60 samples from 15 original images. More
about the synthetic dataset are in Appendix D.2.
×
Following He et al. (2021), we use input signals X and the
true filtered signals Y to supervise the learning process of
α. The optimization goal is to minimize 1
2
2, where
∥
Z is the output multi-channel signal defined in Equation (2).
During training, we use an Adam optimizer with a learning
rate of 0.1 and a weight decay of 5e
4. We allow a maxi-
mum of 500 epochs, and stop iteration when the difference
2 ∥
−
−
Z
Y
of losses between two epochs is less than 1e
4.
−
For baselines, we choose the Monomial basis, Bernstein
basis, Chebyshev basis (with Chebyshev interpolation) cor-
responding to GPR-GNN, BernNet and ChebNetII, respec-
tively. We also include arbitrary orthonormal basis learned
by Favard for comparison. Note that, we learn different
filters on each channel for all baseline basis for fairness.
Results. We exhibit the mean MSE losses with standard er-
rors of the 60 samples achieved by different bases in Table 5.
Optbasis, which promises the best convergence property,
demonstrates an overwhelming advantage. A special note is
needed that, the Monomial basis has not finished converging
at the maximum allowed 500th epoch. In Section 5.4, we
extend the maximum allowed epochs to 10,000, and use the
slowly-converging Monomial basis curve as a counterpoint
to the non-converging Favard curve.
Particularly, in Figure 2, we visualize the converging pro-
cess on one sample. Obviously, OptBasis show best con-
vergence property in terms of both the fastest speed and
smallest MSE error. Check Appendix D.2 for more samples.
8
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Table 3. Experimental results of large-scale datasets (ogbn-
citation datasets). Accuracies ± 95% standard errors are dis-
played. Besides OptBasisGNN, all the reported results are taken
from ChebNetII. The dash line in BernNet means failing in prepro-
cessing basis vectors in 24 hrs. Fixed splits of train/validation/test
sets are used. 10 random model seeds are used for repeating exper-
iments.
Dataset
V
∥
E
∥
(G)
∥
∥
H
GCN (Kipf & Welling, 2017)
ChebNet (Defferrard et al., 2016)
ARMA (Bianchi et al., 2021)
GPR-GNN (Chien et al., 2021)
BernNet (He et al., 2021)
SIGN (Frasca et al., 2020)
GBP (Chen et al., 2020a)
NDLS* (Zhang et al., 2021)
ChebNetII (He et al., 2022)
OptBasisGNN
ogbn-arxiv
169,343
1,166,243
0.66
ogbn-papers100M
111,059,956
1,615,685,872
-
71.74
71.12
71.47
71.78
71.96
71.95
71.21
72.24
72.32
72.27
±
±
±
±
±
±
±
±
±
±
0.29
0.22
0.25
0.18
0.27
0.12
0.17
0.21
0.23
OOM
OOM
OOM
65.89
−
65.68
65.23
65.61
67.18
0.35
±
0.16
0.31
0.29
0.32
±
±
±
±
0.15
67.22
0.15
±
Table 4. Illustration of our multichannel filter learning experiment.
Original Image
Y: Band Reject
Cb: :Low pass
Cr: High Pass
Y: Low Pass
Cb: Band Reject
Cr: Band Reject
5.4. Non-Convergence of FavardGNN
Notably, in Figure 2, an obvious bump appeared near the
130th epoch. We now re-examine the non-convergence
problem of FavardGNN (Section 3.3). We rerun the multi-
channel filter learning task by canceling early stopping and
stretching the epoch number to 10,000. As shown in Fig-
ure 3 (left), the curve of Favard bump several times. In
contrast with Favard is the Monomial basis, though showing
an inferior performance in Table 5, it converges slowly but
stably. We observe a similar phenomenon with a node clas-
sification setup in Figure 3 (right) (See Appendix D.3 for
details). Still, very large bumps appear. Such a phenomenon
might seem contradictory to the outstanding performance of
FavardGNN in node classification tasks. We owe the good
performances in Table 1 and 2 to the early stop mechanism.
6. Conclusion
In this paper, we tackle the fundamental challenges of basis
learning and computation in polynomial filters. We propose
two models: FavardGNN and OptBasisGNN. FavardGNN
Table 5. Experimental results of the multichannel filtering learning
task. MSE loss ± standard errors of the 60 samples achieved by
different bases are exhibited.
OptBasis ChebII
Monomial
Bernstein
BASIS
Favard
MSE
0.0058
0.1501
0.4231
0.3175
3.9076
STDV
±
±
0.0157
±
0.2433
±
0.4918
0.2840
±
±
2.9263
9
2 ∥Z − Y ∥2
Figure 2. Convergence rate of minimizing 1
2 on one
sample. Sample message: The true filters for this sample are
low-pass(Y) / band-reject(Cb) / band-reject(Cr). Legends: ChebII
means using Chebyshev polynomials combined with interpolation
on chebynodes as in ChebNetII (He et al., 2022). Favard means the
bases are learned as FavardGNN. In 500 epochs, the experimental
groups of the Monomial basis and Bernstein basis did not converge.
OptBasis achieves the smallest MSE error in the shortest time.
Figure 3. Drop of loss in 10,000 epochs. Left: MSE loss of re-
gression task on one sample. Right: Cross entropy loss of clas-
sification problem on the Chameleon dataset. Models based on
Monomial basis converge slowly, but stably. while FavardGNNs
don't converge. For the convergence curve for OptBasis, please
check Figure 2. It converges much faster than Monomial Basis.
learns arbitrary basis from the whole space of orthonor-
mal polynomials, which is rooted in classical theorems in
orthonormal polynomials. OptBasisGNN leverages the op-
timal basis defined by Wang & Zhang (2022) efficiently,
which was thought unsolvable. Extensive experiments are
conducted to demonstrate the effectiveness of our proposed
models. An interesting future direction is to derive a convex
and easier-to-optimize algorithm for FavardGNN.
Acknowledgements
This research was supported in part by the major key project
of PCL (PCL2021A12), by National Natural Science Foun-
dation of China (No. U2241212, No. 61972401, No.
61932001, No. 61832017), by Beijing Natural Science
Foundation (No. 4222028), by Beijing Outstanding Young
Scientist Program No.BJJWZYJH012019100020098, by
Alibaba Group through Alibaba Innovative Research Pro-
gram, and by Huawei-Renmin University joint program
on Information Retrieval. We also wish to acknowledge
the support provided by Engineering Research Center of
Next-Generation Intelligent Search and Recommendation,
6 W H S 0 6 ( 6 W H S 0 6 ( 6 W H S 0 6 ( 6 W H S 0 6 ( 6 W H S 0 6 ( 6 W H S 0 6 ( & |