Progressive distillation induces an implicit curriculum

## 

### Abstract

Knowledge distillation leverages a teacher model to improve the training of a student model.
A persistent challenge is that a better teacher does not always yield a better student, to which a common mitigation is to use additional supervision from several “intermediate” teachers.
One empirically validated variant of this principle is *progressive distillation*, where the student learns from successive intermediate checkpoints of the teacher.
Using sparse parity as a sandbox, we identify an implicit curriculum as one mechanism through which progressive distillation accelerates the student’s learning.
This curriculum is available only through the intermediate checkpoints but not the final converged one, and imparts both empirical acceleration and a provable sample complexity benefit to the student.
We then extend our investigation to Transformers trained on probabilistic context-free grammars (PCFGs) and real-world pre-training datasets (Wikipedia and Books).
Through probing the teacher model, we identify an analogous implicit curriculum where the model progressively learns features that capture longer context.
Our theoretical and empirical findings on sparse parity, complemented by empirical observations on more complex tasks, highlight the benefit of progressive distillation via implicit curriculum across setups.

### 1 Introduction

As the cost of training state-of-the-art models grows rapidly (Hoffmann et al., ), there is increased interest in using knowledge distillation (Hinton et al., ) to leverage existing capable models to train new models more efficiently and effectively.
Knowledge distillation is an effective technique to train smaller vision (Jia et al., ; Touvron et al., ; Yu et al., ; Lin et al., ) and language models (Sanh et al., ; Gunasekar et al., ; Touvron et al., ; Reid et al., ) that permit faster inference with comparable performance.
However, one curiously persistent phenomenon is that a better teacher does not always yield a stronger student.
Prior works (Mirzadeh et al., ; Jin et al., ; Jafari et al., ; Harutyunyan et al., ; Anil et al., ) hypothesized that this is due to a
capability gap between the teacher and the student.
As such, they proposed *progressive distillation*, where the student is incrementally supervised by increasingly capable teachers.
This technique has yielded strong empirical performance.
One recent example is the training of Gemini-1.5 Flash from Gemini-1.5 Pro (Reid et al., ; Team et al., ):
Gemini-1.5 Flash achieves $95\%$ of Gemini-1.5 Pro’s performance on average and outperforms Gemini-1.0 Pro on $41$ out of $50$ text-based long-context benchmarks, while being substantially smaller.
However, little is understood about progressive distillation in terms of the optimization or generalization benefits, compared to directly learning from the data or the final teacher checkpoint (i.e., *one-shot distillation*).

Most prior work hypothesizes that progressive distillation enables better generalization (Mirzadeh et al., ; Jafari et al., ; Harutyunyan et al., ).
In contrast, we identify a novel mechanism by which progressive distillation helps a student by *accelerating its optimization* (Figure 1). We define optimization acceleration as achieving improved performance with fewer training steps or samples. In this paper, we use fresh training samples in each training step; hence we use training steps and samples interchangeably to measure the optimization speed.

We study two tasks where learning the right features is believed to be important
and show that the intermediate checkpoints provide signal towards these features.
The first is learning sparse parity (Definition 3.1), which is a commonly studied setting to understand the feature learning dynamics of neural networks. The second is learning probabilistic context-free grammars (PCFGs), which we use as a sandbox for capturing certain aspects of language modeling.
Theory and extensive experiments in these settings support the following claims.

- 1.
Progressive distillation accelerates student learning. Our experiments in multiple settings demonstrate that progressive distillation
accelerates training compared to standard one-shot distillation and learning from the data directly (Figure 1).
More specifically, for sparse parity, progressive distillation can train a smaller MLP (or Transformer) at the same speed as a larger MLP (or Transformer).
For PCFGs, progressive distillation improves the accuracy of a smaller BERT model (Devlin et al., ) at masked prediction.
Finally, we verify our findings on more realistic setups of training BERT on Wikipedia and Books dataset.
- 2.
An implicit curriculum drives faster learning.
We demonstrate theoretically and empirically that acceleration comes from an *implicit curriculum* of easy-to-learn subtasks provided by intermediate teacher checkpoints, which is not available from the final teacher checkpoint.
For sparse parity, the easy-to-learn subtasks provide supervision for the coordinates which constitute
the support of the sparse parity (Section 3).
As a consequence, we show progressive distillation provably improves the sample complexity for sparse parity over one-shot distillation or learning directly from data (Theorem 3.2).
For PCFGs, the implicit curriculum is defined in terms of learning features that increasingly capture larger $n$-gram contexts.
Our results also provide guidance on how to select the intermediate teachers used during progressive distillation.

Figure: Figure 1: Progressive distillation accelerates training. Left: MLP on $(100,6)$-sparse parity (Definition 3.1), with width-50k teachers and width-100 students. Progressive distillation checkpoints are at 100k-step intervals, and one-shot checkpoint uses the final (20M-step) checkpoint. Middle: Transformer on $(100,6)$-sparse parity, with 32-head teachers and 4-head students. Progressive distillation checkpoints are at 10k-step intervals, and the one-shot checkpoint is at 250k steps. Right: Transformers on PCFG (Section 4), with 32-head teachers and 8-head students using BERT-style masked prediction. Progressive distillation uses $8$ intermediate checkpoints.
Refer to caption: x1.png

Related works(^2^22We defer a detailed discussion of related work to Section A.1.).
One persistent surprise in knowledge distillation is that stronger teachers do not always lead to stronger students.
Prior works have speculated that an overly large “teacher-student gap” is the cause,
and accordingly proposed to bridge this gap by introducing supervision of intermediate difficulty (Mirzadeh et al., ; Cho & Hariharan, ; Harutyunyan et al., ; Jafari et al., ).
Mirzadeh et al. () used multi-step distillation involving models of intermediate sizes, and Shi et al. () proposed to directly inject teacher supervision into the student’s trajectory using an approximation of mirror descent.
Most related to our work, Harutyunyan et al. () analyzed distillation for extremely wide networks and found it helpful to learn from the intermediate checkpoints of the teacher, a strategy also adopted by Jin et al. ().
They speculated that this is because neural networks learn progressively complex functions during training (Kalimeris et al., ).
In contrast to their focus on the generalization ability of the student, we study the optimization dynamics of distillation.

It is worth noting that there is also a rich body of work on understanding standard (one-shot) distillation, mostly regarding regularization effects.
In particular, Menon et al. () shows that learning from the teacher leads to a tighter generalization bound when the teacher is closer to the Bayes distribution over the class labels.
However, such Bayes perspective cannot explain the training acceleration in the feature learning tasks considered in this work, whose the Bayes distributions are delta masses and hence are the same as the one-hot labels themselves.
Our results fill this gap by providing an orthogonal view of implicit curriculum.

The benefit of curriculum on sparse parity has also been explored in Abbe et al. (), where the curriculum also helps identify the support.
The difference though is that their curriculum is defined by explicitly altering the distribution over the inputs, whereas our curriculum shows up implicitly in the teacher supervision.
Moreover, our implicit curriculum emphasizes that a properly chosen intermediate checkpoint, while having a worse accuracy than the final checkpoint, can lead to a better-performing student.
This can be seen as a plausible mechanism for weak-to-strong generalization (Burns et al., ).

Outline.
Section 2 describes the distillation strategies.
Section 3 introduces the implicit curriculum with a case study on sparse parity, presenting both empirical evidence and a provable benefit in sample complexity.
Section 4 continues the empirical investigations on PCFG, and extends the observations to BERT’s
training on Wikipedia and Books dataset.
Finally, Section 5 discusses open directions.

### 2 Preliminaries

We now outline the distillation strategies considered in this paper and their empirical instantiation.
For ease of exposition, we discuss one-dimensional label
classification tasks here and generalize to sequence-to-sequence functions in Section 4.
Denote the teacher and student models operating on input domain ${\mathcal{X}}$ as $f_{\mathcal{T}}:{\mathcal{X}}\to{\mathbb{R}}^{C}$ and $f_{\mathcal{S}}:{\mathcal{X}}\to{\mathbb{R}}^{C}$, respectively.
The outputs of a model $f$ are logits that are transformed into a probability distribution over $C$ classes using a softmax function with temperature $\tau$, denoted as $p(x;\tau):=\text{softmax}(f(x)/\tau)$.
We will use $p_{\mathcal{T}}$, $p_{\mathcal{S}}$ to denote the probability distributions of the teacher and the student, and will omit the subscript to denote a generic model.
When $\tau=1$, we omit $\tau$ from the notation for brevity.
Following Zheng & Yang (), we set $\tau=1$ for the student and vary the temperature of the teacher.

We compare two loss functions: $\ell$, where the student $f_{\mathcal{S}}$ learns only from ground-truth labels
, and $\ell_{\text{DL}}$ , where the student $f_{\mathcal{S}}$ is supervised only with the logits of some teacher $f_{\mathcal{T}}$.(^3^33We note that prior papers generally use a combination of these objectives, but we use supervision from one source in order to isolate its effects on distillation.)

$$ $\displaystyle\ell(x,y;f_{\mathcal{S}})$ $\displaystyle=\text{KL}({\bm{e}}_{y}\|p_{\mathcal{S}}(x)),$ (1) $\displaystyle\ell_{\text{DL}}(x;f_{\mathcal{S}},f_{\mathcal{T}})$ $\displaystyle=\text{KL}(p_{\mathcal{T}}(x;\tau)\|p_{\mathcal{S}}(x)),$ (2) $$

where ${\bm{e}}_{y}$ is a one-hot vector whose $y^{th}$ entry is 1.
We consider two strategies for choosing the teacher.
The first is one-shot distillation, where the student learns from a fixed $f_{\mathcal{T}}$ throughout the training, and the teacher is chosen as the final converged checkpoint.
The second is progressive distillation, where the student learns from multiple intermediate checkpoints of the teacher’s training run:

###### Definition 2.1 ( $(C_{\mathcal{T}},{\mathcal{D}})$ -progressive distillation) .

Given a set of teacher checkpoints $C_{\mathcal{T}}=\{f_{\mathcal{T}_{i}}\}$ and a set of training durations ${\mathcal{D}}$,
the student is trained with the logits of teacher checkpoint $f_{\mathcal{T}_{i}}$ for training length ${\mathcal{D}}_{i}$
with $i\in[\left|C_{\mathcal{T}}\right|]:=\{1,\cdots,\left|C_{\mathcal{T}}\right|\}$.

To simplify the presentation,
the main paper tests a specific type of progressive distillation schemes, where $C_{\mathcal{T}}$ contains $N$ equally-spaced checkpoints and the student is trained on each one for $T$ steps:

###### Definition 2.2 ( $({N},T)$ -progressive distillation) .

$C_{\mathcal{T}}$ contains ${N}-1$ equally-spaced intermediate teacher checkpoints and the final teacher checkpoint.
The student is trained with each checkpoint for $T$ training steps. After ${N}T$ steps, the student is trained with the final teacher checkpoint.

To study the effect of each teacher checkpoint,
we will also consider an extreme version of progressive distillation with $N=2$,
where the student uses one intermediate teacher checkpoint.

###### Definition 2.1 ( ( C 𝒯 , 𝒟 ) subscript 𝐶 𝒯 𝒟 (C_{\mathcal{T}},{\mathcal{D}}) ( italic_C start_POSTSUBSCRIPT caligraphic_T end_POSTSUBSCRIPT , caligraphic_D ) -progressive distillation) .

###### Definition 2.2 ( ( N , T ) 𝑁 𝑇 ({N},T) ( italic_N , italic_T ) -progressive distillation) .

###### Choice of temperature.

We set $\tau=10^{-4}$ for sparse parity and PCFG experiments (Section 4) where the vocabulary size is smaller than 5, and $\tau=10^{-20}$ for natural language experiments (Section 4.2) whose vocabulary size is 30k.(^4^44Figure 14 provides a comparison in temperature choices for sparse parity learning.)
Using such a small temperature makes the teacher’s outputs close to one-hot labels.
This removes potential regularization effects due to the softness of the labels (Yuan et al., ) which would otherwise be a confounding factor.
Moreover, the supervision with nearly one-hot labels is more representative of the setting where the student learns directly from the teacher’s generations instead of the logits.
This method, often described as generating synthetic data in the language modeling setting, has generally yielded small yet highly performant students (Gunasekar et al., ; Liu et al., ).
For one-shot distillation, we report the best-performing temperature among $\tau=1,10^{-4}$ in the main paper and defer other results to Section D.8.

### 3 The implicit curriculum: a case study with sparse parity

To elucidate the mechanism by which distillation accelerates training, we first focus on the well-studied task of learning sparse parity.(^5^55We also experiment with a hierarchical generalization of sparse parity, which is deferred to Section C.3.)
Sparse parity is a commonly used sandbox for understanding neural network optimization in the presence of feature learning (Barak et al., ; Bhattamishra et al., ; Morwani et al., ; Edelman et al., ; Abbe et al., ).

###### Definition 3.1 ( $(d,k)$ -sparse parity task) .

Let $\mathbf{S}\subset[d]$ denote a fixed set of coordinates, with $|\mathbf{S}|=k$ and $k<d$.
Then, the sparse parity task is defined for any input $\mathbf{x}\in\{\pm 1\}^{d}$, whose label is computed as $y=1$ if $\prod_{i\in\mathbf{S}}\mathbf{x}_{i}>0$ and $2$ otherwise.

We train the teacher and student models using $2$-label classification, where $f_{\mathcal{T}}$ and $f_{\mathcal{S}}$ return logits in $\mathbb{R}^{2}$.
The teacher and the student have the same number of layers but different sizes.
We vary the model width for MLP, and vary the number of attention heads for Transformer, with a fixed per-head dimension.
These choices not only affect the parameter counts, but also govern the learning speed(^6^66In terms of the number of samples or the number of training steps, which coincide in our experiments as we use freshly sampled batches.).

Why can larger models learn faster?
A natural way to learn sparse parity with gradient descent involves first identifying the support $\mathbf{S}$ and subsequently computing the product of variables in the support (i.e., $\prod_{i\in\mathbf{S}}\mathbf{x}_{i}$).
Empirically, the two stages of learning manifest as a long plateau period in the model’s accuracy, followed by a sharp phase transition (Figure 1, left and middle).
The search for the support is what makes learning problem difficult, as it depends on the input dimension $d$ rather than the support size (Abbe et al., ; Barak et al., ).
The benefit of increasing the width or the number of heads comes from providing more “parallel search queries.”
For MLP, prior work has shown that increasing the width accelerates training (Edelman et al., ), which we also observe in Figure 7 (left) in appendix.
For Transformers though, we find that increasing the number of attention heads is the most effective for improving the convergence speed, as opposed to increasing the per-head dimension or the MLP width.
A detailed comparison is provided in Section C.2 (Figure 10).
Given this finding, we will vary the number of attention heads between the teacher and the student, while keeping the per-head dimension fixed.
The number of heads hence directly controls the parameter count.
This choice also aligns with the practice in open-sourced models such as the Llama series (Touvron et al., ).

In the following, we first empirically verify that carefully chosen intermediate teacher checkpoints constitute an *implicit curriculum* for the student to learn from.
Then, we show that this curriculum provably improves the speed of learning in the student by improving its training sample efficiency.

###### Definition 3.1 ( ( d , k ) 𝑑 𝑘 (d,k) ( italic_d , italic_k ) -sparse parity task) .

#### 3.1 Accelerating learning with the implicit degree curriculum

The difficulty of the search problem suggests that we can accelerate student learning by providing direct supervision for what the support is (Abbe et al., ).
We show that supplying the intermediate signal from a bigger teacher model accelerates the search process for the smaller model, as described by the following set of results.(^7^77We will mark our results with (Ri) throughout the paper for easy reference.)

(R1) Intermediate teacher checkpoints constitute an implicit degree curriculum.
We provide empirical evidence that the supervision from intermediate teacher checkpoints serves as an implicit curriculum supplying strong signals for certain degree-1 monomials, which require fewer samples to learn.
In Figure 2, we report the correlation between degree-1 monomials and the prediction of the teacher logits at various checkpoints.
The correlation for each monomial $x_{j},j\in[d]$ is computed as $|\mathbb{E}_{{\bm{x}},y}([p_{\mathcal{T}}(\mathbf{x})]_{1}\cdot x_{j})|$ at each checkpoint $f_{\mathcal{T}}$.
Here $[p_{\mathcal{T}}(\mathbf{x})]_{1}$ refers to the first output dimension of $f_{\mathcal{T}}$, which corresponds to $p(y=1)=p(\prod_{i\in\mathbf{S}}\mathbf{x}_{i}>0)=1-p(y=2)$ (recall Definition 3.1).
We take the absolute value as we are only concerned with the magnitude of the correlation.
Importantly, these strong correlations emerge when the teacher learns the sparse parity task (i.e., during the phase transition) but diminish with continued training.

Note that the monomials need not be strictly degree-1.
While our theory (Section 3.2) will only focus on degree-1 monomials for the sake of mathematical analysis,
low-degree polynomials can still provide acceleration, which we also observe in practice (see LABEL:{fig:interm_ckpt_6feat_behavior_lr0.01} in the Appendix for such an example).
This transient low-degree supervision, available only through intermediate teacher checkpoints, may explain the superior performance of progressive distillation over one-shot distillation (Figure 1).
We will confirm the provable sample complexity benefit of this implicit low degree curriculum in Section 3.2.
The importance of the implicit curriculum is further strengthened by the superior performance of $(2,T)$-progressive distillation:

Figure: Figure 2: Implicit curriculum for $(100,6)$-sparse parity. We compare 3 candidate intermediate checkpoints, labeled as ①, ②, ③, corresponding to 9.7M, 10.2M, and 10.8M steps, or the beginning, middle, and end of the teacher’s phase transition. Left: Teacher’s accuracy throughout training. Middle: During the phase transition, $f_{\mathcal{T}}$ is much more strongly correlated with in-support variables ($x_{1},\cdots,x_{6}$ in this case) than with off-support variables. Right: Only candidate ② (i.e., during phase transition) enables $(2,1M)$-progressive distillation to reach $100\%$ accuracy. We use width-50k teachers and width-100 students; Figure 8 shows similar results for width-1000 students.
Refer to caption: x2.png

(R2) Progressive distillation with a single intermediate checkpoint can outperform one-shot distillation.
We consider the extreme version of progressive distillation where only a single intermediate checkpoint is used (in addition to the final checkpoint).
Figure 2 shows the result for $(2,1\text{M})$-progressive distillation.
We consider 3 candidates for the intermediate teacher checkpoint, occurring respectively at the beginning, middle or the end of the teacher’s phase transition.
Our result demonstrates that the checkpoint selection is crucial, where only the checkpoint during the phase transition is useful in accelerating training.(^8^88We show similar results for width-1000 students (Figure 8) and transformers (Figure 13).)
This provides further evidence that the implicit degree curriculum is the key to faster training via progressive distillation.

More complex tasks may require more intermediate checkpoints, which we discuss in more depth in Section C.3.
Nevertheless, we find that progressive distillation can be run efficiently and effectively across tasks, and a small number of intermediate teacher checkpoints often suffice to accelerate training provided that the checkpoints are properly selected.

#### 3.2 The low-degree curriculum reduces sample complexity

We now formalize the benefits of progressive distillation for $(d,k)$-sparse parity in terms of sample complexity.
For the sake of mathematical analysis, we take the student $f_{\mathcal{S}}$ and the teacher $f_{\mathcal{T}}$ models to be $1$-hidden-layer MLPs with ReLU activations and scalar outputs.
Further, the labels $y$ are given as $\pm 1$, where $1$ (or $-1$) corresponds to the class dimension $1$ (or $2$) in Definition 3.1.

Following previous works (Barak et al., ; Abbe et al., ; Edelman et al., ), we analyze a simplified two-stage training procedure and train the model using the hinge loss: $L_{\alpha}(\mathbf{x},y;f_{\mathcal{S}},f_{\mathcal{T}})=\alpha\max(0,1-f_{
\mathcal{S}}(\mathbf{x})y)+(1-\alpha)\max(0,1-f_{\mathcal{S}}(\mathbf{x})f_{
\mathcal{T}}(\mathbf{x}))$.

Let’s first recall the hardness of learning sparse parity.(^9^99A more detailed discussion is provided in Section A.1.)
For simplicity, we consider the case of MLPs of width $\tilde{\mathcal{O}}(2^{k})$ trained using online SGD.
When learning from data alone, statistical query (SQ, Kearns ()) lower bound shows that learning the support for a $(d,k)$-sparse parity requires $\Omega(d^{k-1})$
samples (Abbe et al., ; Edelman et al., ).
We will show that although this lower bound also applies to one-shot distillation from a strong teacher, it can be circumvented when learning from the implicit low-degree curriculum identified in the previous section.

Specifically, we compare the sample complexity of one-shot distillation and $(2,T)$-progressive distillation (Section 2).
Both strategies use a well-trained final checkpoint with an error of $\mathcal{O}(\epsilon)$ error for an arbitrarily small $\epsilon>0$.

Progressive distillation additionally uses the teacher’s intermediate checkpoint after its first phase of training, where we can provably show its predictions to have correlations at least $\Omega(1/k)$ to the monomials $x_{i},\forall i\in\mathbf{S}$.
That is, progressive distillation first learns from the intermediate checkpoint and then switches to the final checkpoint, whereas one-shot distillation learns directly from the final checkpoint.

(R3) Progressive distillation reduces sample complexity.
We formally demonstrate the sample complexity benefit of progressive distillation.

###### Theorem 3.2 (Informal version of Theorem B.1 ) .

Consider learning $(d,k)$-sparse parity with a student model of size $\tilde{m}=\tilde{\Theta}(2^{k})$, where $\tilde{\cdot}$ hides polylog factors in $d,k$.
Suppose the teacher has a loss $\mathcal{O}(\epsilon)$ for some small $\epsilon>0$.
Then, the total sample complexity needed for the student to reach $\epsilon$-loss using progressive distillation with 2 checkpoints is $\tilde{\Theta}(2^{k}d^{2}\epsilon^{-2}+k^{3})$. However, one-shot distillation requires at least $\Omega(d^{k-1},\epsilon^{-2})$ samples.

###### Proof sketch.

We track the training behavior of the teacher model during its two-phase training.
We show that at the end of the first phase, the teacher’s predictions will have $\Omega(1/k)$ correlations to degree-1 monomials $x_{i},\forall i\in\mathbf{S}$.
In contrast, the correlations are smaller for degree-1 monomials $x_{i},\forall i\notin\mathbf{S}$.
Hence, the teacher’s predictions can be written as $\sum_{i\in\mathbf{S}}c_{i}x_{i}+\sum_{i\notin\mathbf{S}}c_{i}x_{i}$, plus additional higher degree odd polynomials which can be controlled, with $\left|c_{i}\right|\geq\Omega(1/k)$ for $i\in\mathbf{S}$, and $\left|c_{i}\right|=o(1/kd)$, if $i\notin\mathbf{S}$.

When training on the predictions from this intermediate teacher checkpoints, the correlation gap between in- and off-support degree-1 monomials will be reflected in the gradients of the student’s weights. Namely, there is a $\Omega(1/k)$ gap between the support and non-support coordinates in the weight gradients.
This gap allows the coordinates $i\in\mathbf{S}$ in the student’s weights to grow quickly with only $\mathcal{O}(k^{2}\log(\tilde{m}))$ samples.

On the other hand, for a teacher that has loss $\mathcal{O}(\epsilon)$, a similar argument can show that the separation gap between the correlations of the teacher’s predictions to degree-1 monomials on support and outside support can be at most $\mathcal{O}(\epsilon)$. So, harnessing this gap will require a sample size of at least $\Omega(\epsilon^{-2})$ by concentration inequalities. Learning directly from the labels will require $\Omega(d^{k-1})$ samples from the SQ lower bound as discussed above. This gives the sample complexity differences between one-shot and progressive distillation. The full proof is provided in Appendix B.

∎

Remark. One gap between our theory and experiments is that our analysis applies to large-batch SGD with small gradient noise, whereas the experiments use online SGD with batch size 1.
Bridging this gap, such as by adapting the analyses in Abbe et al. () on Gaussian data, is an interesting future direction.

###### Theorem 3.2 (Informal version of Theorem B.1 ) .

###### Proof sketch.

### 4 Implicit curriculum with PCFGs and Natural language

In this section, we empirically show that an implicit curriculum emerges generally, both when learning on probabilistic context-free grammars (PCFGs) and when performing natural language modeling tasks on the Wikipedia and Books datasets. We focus on BERT models (Devlin et al., )(^10^1010See Section D.5.1 for a primer on BERT.), and discuss experiments on GPT-2 (Radford et al., ) in Appendix E.

Figure: Figure 3: An example of a PCFG tree ${\rm T}(\mathbf{x})$ that generates $\mathbf{x}=$“The cat ran away”. “The cat” is an example of level-2 span, and “cat” is as a boundary token for the spans of both the level-1 non-terminal Noun and the level-2 non-terminal Noun Phrase.
Refer to caption: extracted/5908367/plots/PCFG_example.png

The masked prediction task.
Our experiments will be based on BERT models trained to perform masked prediction, which requires filling in masked-out tokens in an input sequence and excels at feature learning in natural languages (Hewitt & Manning, ; Tenney et al., ; Li et al., ).

###### Definition 4.1 (Masked prediction task with mask rate $p$ ) .

Let $v$ denote the vocabulary that contains a special token $[mask]$, and let $h$ denote an arbitrary sequence length.
Given a sequence $\mathbf{x}\in v^{h}$, sample a set of masked positions $\mathcal{M}\in[h]$ following $P(i\in\mathcal{M})=p$, $\forall i\in[h]$.
Create a masked input $\mathbf{x}_{\setminus\mathcal{M}}$ from $\mathbf{x}$ by replacing tokens at positions in $\mathcal{M}$ with $[mask]$, a random token from ${\mathcal{X}}$, or kept unchanged with probabilities $80\%,10\%,10\%$ respectively. Then, the masked prediction objective is the cross-entropy of the model’s predictions at positions $i\in\mathcal{M}$ on input $\mathbf{x}_{\setminus\mathcal{M}}$.

Since we are performing sequence-to-sequence modeling,
we need to generalize the definition of the teacher $f_{\mathcal{T}}$ and student $f_{\mathcal{S}}$ from Section 2 accordingly, denoted as $f_{\mathcal{T}}:v^{h}\to{\mathbb{R}}^{h\times C}$ and $f_{\mathcal{S}}:v^{h}\to{\mathbb{R}}^{h\times C}$.
We will use $p_{\mathcal{T}}^{(i)}(\mathbf{x};\tau):=\text{softmax}([f_{\mathcal{T}}(
\mathbf{x})]_{i}/\tau)$ to denote the teacher’s output distribution on the $i_{th}$ position;
similarly for $p_{\mathcal{S}}^{(i)}$.
As before, we omit $\tau$ when $\tau=1$.
We use the following loss functions for the masked prediction task (Definition 4.1):

$$ $\displaystyle\ell(\mathbf{x};f_{\mathcal{S}})$ $\displaystyle=\mathbb{E}_{\mathcal{M}}\frac{1}{|\mathcal{M}|}\sum_{i\in \mathcal{M}}\text{KL}({\bm{e}}_{x_{i}}\|p_{\mathcal{S}}^{(i)}(\mathbf{x}_{ \setminus\mathcal{M}})),$ (3) $\displaystyle\ell_{\text{DL}}(\mathbf{x};f_{\mathcal{S}},f_{\mathcal{T}})$ $\displaystyle=\mathbb{E}_{\mathcal{M}}\frac{1}{|\mathcal{M}|}\sum_{i\in \mathcal{M}}\text{KL}(p_{\mathcal{T}}^{(i)}(\mathbf{x}_{\setminus\mathcal{M}}; \tau)\|p_{\mathcal{S}}^{(i)}(\mathbf{x}_{\setminus\mathcal{M}})),$ (4) $$

where ${\bm{e}}_{y}$ is a one-hot vector whose $y_{th}$ entry is 1.

We train BERT models with $\ell$, $\ell_{\text{DL}}$
and report the average top-1 accuracy on the masked tokens.
As discussed in Section 3.1,
the teacher and student have the same depth ($4$ layers) but differ in the number of attention heads, with 32 heads for the teacher and 8 heads for the student.
Each attention head has dimension 8, so the teacher has width $256$ and the student has width $64$. All hyperparameter details are in Section D.6.

###### Definition 4.1 (Masked prediction task with mask rate p 𝑝 p italic_p ) .

#### 4.1 n 𝑛 n italic_n -gram curriculum in PCFGs

We first consider probabilistic context free grammars (PCFGs), which are commonly used to emulate the structure of natural language and thus provide mechanistic insights into language models (Zhao et al., ; Allen-Zhu & Li, ).
A PCFG generates sentences following a tree structure;
Figure 3 shows an example for the sentence “*The cat ran away*.”
More precisely, a PCFG ${\mathcal{G}}=({\mathcal{N}},{\mathcal{R}},{\mathcal{P}},v)$ is defined by a set of non-terminals ${\mathcal{N}}$, rules ${\mathcal{R}}$ over the non-terminals, a probability distribution ${\mathcal{P}}$ over ${\mathcal{R}}$, and a vocabulary (terminals) $v$.
A sentence $\mathbf{x}$ is associated with a generation tree ${\rm T}(\mathbf{x})$, whose intermediate nodes are non-terminals in ${\mathcal{N}}$, leaf nodes are terminals in $v$, and edges are defined by rules sampled from ${\mathcal{R}}$ according to ${\mathcal{P}}$.
A formal definition of PCFG is provided in Section D.1.
Our choices of PCFGs are taken from Allen-Zhu & Li (), where all leaves in the same tree have the same distance to the root.
Experiments in the main paper are based on the PCFG cfg3b generated by depth-7 trees, and results on other PCFGs are deferred to Section D.4.

##### 4.1.1 Progress measures of implicit curriculum

Unlike our experiments on parity, what constitutes as feature is less straightforward for PCFG.
We will use three progress measures to quantify the implicit curriculum for masked language modeling on PCFGs, based on $n$-gram statistics and non-terminal prediction.

Measures that use $n$-gram statistics will measure the dependence of the model’s predictions on tokens in the neighboring contexts, defined as follows:

###### Definition 4.2 ( $n$ -gram neighboring context) .

For a $h$-length sentence ${\bm{x}}\in v^{h}$ and for $i\in[h]$, we define the $n$-gram neighboring context around the $i^{th}$ token as the set of tokens at positions within $(n-1)/2$ distance from $i$,
denote as $n\text{-gram}(i):=\{j:\max(i-\lceil(n-1)/2\rceil,0)\leq j\leq\min(i+\lfloor(n-
1)/2\rfloor,h)\}$.

In the example of Figure 3, for the word “cat”, its $3$-gram neighboring context consists of words “The” and “ran”, and its $5$-gram neighboring context additionally includes the word “away.”
The choice of $n$-grams is inspired by results in Zhao et al. (), which show that
a BERT model can solve masked prediction by implementing a dynamic programming algorithm that builds hierarchically on increasingly larger $n$-gram neighboring context spans (Definition 4.2).
A model that primarily uses short $n$-gram neighboring context will be largely affected if the tokens within the context are perturbed during evaluation.
This motivates us to consider two $n$-gram based measures.

Measure 1: Robustness to removing $n$-gram context.
Our first progress measure of feature learning checks how the model’s prediction changes when the $n$-gram context is present or absent.
For each masked position $i$, we measure the total variation (TV) distance between the probability distributions when masking out only the current token, and when masking out all the tokens in $n\text{-gram}(i)$, i.e. the neighboring $n$-gram context centered at $i$.
Recall that $\mathbf{x}_{\setminus\mathcal{M}}$ denotes a masked version of $\mathbf{x}$ with masked set $\mathcal{M}$ (Definition 4.1), and that $p^{(i)}$ denotes a model’s output probability distribution at the $i_{th}$ position.
Then, our first measure is defined as

$$ $\displaystyle M_{\text{robust}}(f,\mathbf{x},i,n)$ $\displaystyle=\text{TV}(p^{(i)}(\mathbf{x}_{\setminus\{i\}}),p^{(i)}(\mathbf{x }_{\setminus n\text{-gram}(i)})).$ (5) $$

We report median of $M_{\text{robust}}(f,\mathbf{x},i,n)$ over randomly sampled $\mathbf{x}$ and $i$ (^11^1111Our observations stay the same for other percentiles.). A larger $M_{\text{robust}}(f,\mathbf{x},i,n)$ indicates that the model heavily depends on neighboring $n$-gram context tokens for the masked prediction.

Figure: Figure 4: BERT on the PCFG cfg3b. Left: A 32-head teacher’s loss exhibits three distinct phases: ① an initial phase with little change, ② a middle phase with a rapid drop, and ③ a final plateauing phase until the end of training. The triangles mark the selected checkpoints for progressive distillation, with the first teacher checkpoint (denoted by $C_{1}$) located at the middle of phase ②. Middle: $M_{\text{robust}}$ across training, which peaks at $C_{1}$. The model gets more robust to shorter $n$-gram perturbation as training progresses. The median is taken over the input sequences. Right: A 8-head student’s final accuracy with $(2,T)$-progressive distillation after $4000$ total training steps. The $x$-axis marks the choice of the first teacher checkpoint. $T$ is grid-searched over $\{500,1000,2000\}$. The best performance is obtained by choosing $C_{1}$. Although results in the plots are for a single training run of the teacher, similar behaviors occur robustly across random seeds.
Refer to caption: x3.png

Measure 2: Closeness between full and $n$-gram predictions.
Our second progress measure examines the change in predictions when the model is given the full sequence versus only a local $n$-gram window:

$$ $\displaystyle M_{\text{close}}(f,\mathbf{x},i,n)$ $\displaystyle=\text{TV}(p^{(i)}(\mathbf{x}_{\setminus\{i\}}),p^{(i)}(\mathbf{x }_{n\text{-gram}(i)\setminus\{i\}})),$ (6) $$

where $\mathbf{x}_{n\text{-gram}(i)\setminus\{i\}}$ denotes the $n$-gram context centered at position $i$, minus the position $i$ itself.
We report median of $M_{\text{close}}(f,\mathbf{x},i,n)$ over randomly sampled $\mathbf{x}$ and $i$.
A large $M_{\text{close}}(f,\mathbf{x},i,n)$ indicates that the model utilizes contexts outside a $n$-gram window in its predictions.

Measure 3: Non-terminal prediction.
Finally, we also measure how well the model outputs encode the features of the underlying PCFG by checking the accuracy at predicting non-terminals (Allen-Zhu & Li, ).
The predictions are given by a linear classifier on top of the output embeddings.

###### Definition 4.3 (PCFG non-terminal prediction task) .

Define the span of a non-terminal $n$ as the set of terminals within the subtree rooted at $n$, denoted by $\text{span}(n)$.
The (right) boundary of $\text{span}(n)$ refers to the rightmost position within $\text{span}(n)$.
We say a non-terminal is of level $i$ if it is at distance $i$ from the root.
Then, the level-$i$ non-terminal prediction task aims to predict $n^{(i)}$ at the boundary of $n^{(i)}$.

As an example, in Figure 3, the level-$2$ non-terminal prediction task aims to predict the non-terminals Noun Phrase and Verb Phrase at words “cat” and “away” respectively.
More details are provided in Section D.3.

###### Definition 4.2 ( n 𝑛 n italic_n -gram neighboring context) .

###### Definition 4.3 (PCFG non-terminal prediction task) .

##### 4.1.2 Empirical verification of the n 𝑛 n italic_n -gram curriculum

Similar to Section 3.1, we will start with examining the training dynamics of the teacher model.
We observe a phase transition period akin to that of sparse parity, during which we identify an inflection point concerning $M_{\text{robust}}$ and $M_{\text{close}}$.
This inflection point proves to be a crucial intermediate checkpoint.
We then demonstrate that progressive distillation improves feature learning in the student model, substantiated by the three measures defined in Section 4.1.1.

For training dynamics, we observe $3$ distinct phases of training in the teacher’s loss (Figure 4 left):
1) an initial phase where the loss doesn’t change much for the first $~{}5\%$ of training; 2) a rapid loss drop phase in the next $\approx 20\%$ of training; and 3) a final phase of slow loss drop till end of training.
In particular, the rapid loss drop phase is reminiscent of the phase transition in sparse parity (Section 3).
Moreover, we identify an inflection point (marked by $C_{1}$) during the second phase:
before the inflection point, the robust loss $M_{\text{robust}}$ increases (Figure 4 middle), and the loss $M_{\text{close}}$ stays high (Figure 22 left);
after the inflection point, both $M_{\text{robust}}$ and $M_{\text{close}}$ start to drop rapidly, suggesting that the model learns to utilize longer contexts as opposed to short neighboring $n$-grams.

(R4) The inflection point is best for $(2,T)$-progressive distillation.
We study the importance of each teacher checkpoint by comparing the performance of $(2,T)$-progressive distillation, where the student learns from a single intermediate checkpoint in addition to the final checkpoint.
The value of $T$ is grid-searched (more details in Section D.6).
For the choice of the intermediate checkpoint,
Figure 4 shows that the best intermediate checkpoint is the one at the inflection point (at 1000 training steps), which we denote as $C_{1}$.
Note that at the inflection point, the teacher has the highest reliance on shorter $n$-grams (e.g. for $n=3$), which are analogous to the low-degree monomials in Section 3 and serves as intermediate tasks that are likely easier to learn.
Hence, $C_{1}$ being the optimal checkpoint choice further strengthens our hypothesis that an implicit curriculum is the key to the acceleration enabled by progressive distillation.

Following Section 4.1.2,
we will choose the checkpoints for progressive distillation at training steps that are multiples of that of $C_{1}$, i.e. at steps $\{i\times 10^{3}\}_{i=1}^{8}$.
As shown in Figure 1 (right), progressive distillation helps the student learn faster than both one-shot distillation and cross entropy training.
Furthermore, progressive distillation leads to improved feature learning.

(R5) Progressive distillation improves feature learning on PCFG.
Progressive distillation improves over one-shot or no distillation over all 3 measures mentioned in Section 4.1.1.
As shown in Figure 5, progressive distillation makes the student better utilize long contexts rather than local $n$-gram windows, evidenced by a lower $M_{\text{robust}}$ and $M_{\text{close}}$.
The student can also better predict the non-terminals, suggesting a better structural learning of the underlying PCFG.

Figure: Figure 5: Comparisons on a $8$-attention head BERT model. (Left) $M_{\text{close}}$ for different $n$-grams. Progressive distillation has a lower $M_{\text{close}}$ with longer $n$-gram context. (Middle) $M_{\text{robust}}$ for different $n$-grams. Progressive distillation has a lower $M_{\text{robust}}$ for all $n$-gram contexts. (Right) Probe performance to predict the non-terminals (NTs) (Definition 4.3). Progressive distilled student performs better when probed for higher level non-terminals in its contextual embeddings.
Refer to caption: x4.png

#### 4.2 Beyond synthetic setups: implicit curriculum in natural languages

We conduct experiments on BERT training (Devlin et al., ) on Wikipedia and Books (details in Appendix F). The teacher and student both have 12 layers, with 12 and 4 attention heads per-layer respectively.
Each attention head is of dimension 64, corresponding to a width-768 teacher and a width-256 student.
Similar to PCFG, the teacher’s loss exhibits 3 distinct phases (Figure 6 left), with an inflection point marking the change in $M_{\text{robust}}$ (Figure 6 middle).
The inflection point can hence provide an implicit curriculum towards easier-to-learn local $n$-grams.
Finally, progressive distillation helps the student achieve better accuracy at masked language prediction (Figure 6 right).

Connections to related works.
Our results align with those of Chen et al. (), who observed a phase transition in loss when training BERT on real-world language data corresponding to the model learning syntax rules of language.
Comparable findings were also reported in a concurrent work on matrix completion (Gopalani et al., ).
For auto-regressive models, prior work has discussed the emergence of $n$-gram induction heads which indicate phases in which the model learns to perform in-context learning (Akyürek et al., ; Quirke et al., ; Olsson et al., ).
We observe similar behavior for PCFGs and Wikipedia datasets and quantify the phase change using $n$-gram context dependence. We take a step further and leverage the phase transitions to accelerate the training of a smaller student model.

Figure: Figure 6: BERT on Wikipedia and Books. Left to right: (a) Similar to our experiments on PCFG (Figure 4), we observe three distinct phases in the loss behavior of 12-head teacher. The rapid loss drop phase signifies a transition phase for the model. The triangles mark the selected checkpoints for progressive distillation, with the first teacher checkpoint roughly picked in the middle of the second phase ($C_{1}$). (b) We observe $M_{\text{robust}}$ peaks at $C_{1}$, and the model gets more robust to shorter $n$-gram context masking, as training progresses. (c) A $4$-head student achieves better top-$1$ accuracy on masked prediction objective with progressive distillation.
Refer to caption: x5.png

### 5 Discussions

We have shown that progressive distillation can improve the student’s feature learning via an implicit curriculum provided by the intermediate checkpoints. We discuss limitations and potential future directions below, and provide preliminary results for some of them in the appendix (see Appendix A).

Impact of temperature.
The teacher temperature $\tau$ is an important hyperparameter in knowledge distillation, where varying $\tau$ can sometimes lead to a greater performance gain than changing the distillation method (Touvron et al., ; Harutyunyan et al., ).
Our results are consistent with these prior findings.
However, our experiments use limited temperature choices, i.e. the default ($\tau=1.0$) and low temperature ($\tau=10^{-4}$ or $10^{-20}$).
A more precise understanding of temperature, especially its impact on optimization, is an interesting direction for future work.

Distillation via generations.
Another related distillation setting is training smaller (language) models using the generations of larger models,
which has been shown to greatly improve various abilities (Liu et al., ; Yue et al., ; Yu et al., ; Luo et al., ; Chaudhary, ; Taori et al., ; Zheng et al., ; Liu & Yao, ; Agarwal et al., ; Mitra et al., ).
There are two differences between our experiments and these generation-based approaches.
First, the supervision in our experiments are distributions (over classes or the vocabulary), while generations are samples from distributions.
Our experiments with a low or zero temperature provide positive evidence towards bridging this gap, but the precise effect remains to be explored.
More importantly, given an input, there is a unique supervision in our settings, whereas there could be multiple generations given by multiple steps of unrolling of the teacher.
Extending our framework to these generative setting will be an important direction for future work.

### Acknowledgement

AP and SM acknowledge funding from NSF, ONR, Simons Foundation, and DARPA. AR and BL are supported in part by NSF awards IIS-2211907, CCF-2238523, IIS-2403275, an Amazon Research Award, a Google Research Scholar Award, and an OpenAI Superalignment Fast Grant.
BL also acknowledges the support of the Tang Family Presidential Fellowship. SG was supported in part by a Microsoft Accelerating Foundation Models Grant and an OpenAI Superalignment Fast Grant.

## Appendix

### Appendix A Overview of the appendix

The appendix provides omitted proofs and additional empirical explorations,
which we outline below.

###### Omitted proofs

We will start with the proof of Theorem 3.2 in Appendix B.
The main idea is to show that the teacher can develop stronger correlation to in-support variables than to off-support variables, which can then be utilized by the students to reduce sample complexity.

###### Additional empirical results on sparse parity

We present more experiments with MLP (Section C.1) and Transformers (Section C.2), as well as results on learning a hierarchical extension of sparse parity (Section C.3).
For Transformer experiments, we study how scaling along different dimensions of the architecture, such as MLP width and number of attention heads, affects the search of support for sparse parity.
We discuss the effect of temperature in Figure 14.
For the hierarchical extension of sparse parity, we show that the implicit curriculum occurs in different phases, which suggests a natural choice for number of intermediate checkpoints used in progressive distillation.

###### Masked prediction on PCFGs

In
Section D.5, we provide a formal definition of probablistic context-free grammar (PCFG) and introduce the PCFGs that we use from Allen-Zhu & Li ().
We then provide details of our experimental setup and conduct extensive ablation studies on training a BERT model using the masked prediction task with PCFG data.
We experiment with variants of progressive distillation and confirm that they lead to improved performance on PCFGs, as measured by accuracy and the three progress measures introduced in Section 4.1.1.
Furthermore, we investigate the effect of temperature, masking rate, and PCFG variation in Section D.8.

###### Next-token prediction on PCFGs

In Appendix E, we conduct next-token prediction experiments using GPT-2 models on PCFG “cfg3f”, i.e. the most complex PCFG in Allen-Zhu & Li ().
We characterize conditions under which progressive distillation provides significant gains.

#### A.1 Additional related works

###### Understanding knowledge distillation

There have been many works dedicated to understanding the effectiveness of knowledge distillation (Hinton et al., ; Mobahi et al., ; Menon et al., ; Dao et al., ; Nagarajan et al., ; Pareek et al., ).
For classification tasks, which are the focus of most knowledge distillation works, one intuitive explanation is that the teacher output provides a distribution over the class labels, which is more informative than the one-hot data labels.
Menon et al. () formalizes this intuition and shows that a teacher that provides the Bayes class probabilities leads to a tighter generalization gap.
Motivated by their result and the observation that a high-accuracy teacher can be poorly calibrated, Ren et al. () proposes to supervise the student using a moving average of the teacher across the training trajectory.
While Ren et al. () uses information of trajectory, their student learns from a fixed target throughout training, which is a major difference from progressive distillation.
The teacher supervision also provides regularization benefits, such as controlling the bias-variance tradeoff (Zhou et al., ), encouraging sparsity (Mobahi et al., ), or as a form of label smoothing (Yuan et al., ).
Finally,
prior work by Mobahi et al. () and concurrent work by Pareek et al. () have studied multi-step distillation, which also uses multiple teachers throughout training.
However, unlike the progressive distillation setting considered in this work, they study self-distillation where the student in the previous distillation round becomes the teacher in the next round, and the results are for regression rather than classification.

###### Learning sparse parity

There are well established hardness results for learning sparse parity.
When given access to labels only, learning $(d,k)$-sparse parity with gradients from finite samples is an example of learning with statistical queries (SQ)  (Kearns, ), for which a $\Omega(d^{k})$ SQ computational lower bound applies (Edelman et al., ).
When learning with a fully-connected network (MLP),
these parallel queries correspond to a combination of model width (i.e. neurons) and training steps,
(^12^1212More precisely, it is a combination of width and steps, as well as the batch size which affects the precision of the stochastic gradient. We omit the impact of batch size here since we keep the batch size unchanged in the experiments.)
and hence the SQ lower bound implies a fundamental trade-off between the width, the number of training steps, and the number of samples (Edelman et al., ). In particular, given the same number of training steps, narrower models require more samples to learn parity.

###### Feature learning

In this work, we use feature learning to refer to a learning process that recovers a low-dimensional “feature” which helps reduce sample complexity.
Sparse parity is a task that can benefit from feature learning, where the feature is the support.
For the special case of $k=2$, Glasgow () shows that feature learning using a jointly-optimized 2-layer neural network can reduce the sample complexity from $\Theta(d^{2})$ (corresponding to learning with NTK (Wei et al., ; Ghorbani et al., )) to $O(d\text{poly}\log d)$.
Sparse parity is an example of a single-/multi-index function, where the label is determined by a 1-dimensional/low-dimensional projection of the data.
These functions have also been studied on Gaussian inputs (Nichani et al., ; Abbe et al., , ; Damian et al., , ) and have known separation between neural networks (Abbe et al., , ) and non-feature-learning kernel methods (Hsu, ).

###### Benefit of width in optimization

Prior work has shown that width plays an important role in the optimization difficulty, where wider networks are more optimized easily.
Du & Hu () shows that sufficient width is necessary for the optimization on deep linear networks.
Multiple works show that overparameterization leads to favorable optimization landscape, such as fewer sub-optimal local minima (Soudry & Hoffer, ; Soltanolkotabi et al., ) or guaranteed convergence at the limit (Chizat & Bach, , ).
Wider models also exhibit faster decaying loss empirically (Yang et al., ; Bordelon et al., ).
Most related to our focus on learning sparse parity, Edelman et al. () relates the width to the number of parallel statistical queries (SQs).
Combined with sparse parity’s SQ lower bound, their result implies a trade-off where a larger width requires fewer optimization steps.
Our work also acknowledges the benefit of width in optimization, but takes a different perspective by demonstrating that a smaller student can inherit the optimization benefit when learning from a higher-width teacher.
Moreover, we consider the number of attention heads as another scaling dimension for Transformers, where the intuition is similar to having more “paths” (Dong et al., ).
There have been results on studying the limiting output distribution as the number of attention heads goes to infinity (Hron et al., ; Bordelon et al., ), though to our knowledge, there are no quantitative descriptions for finite number of heads.

### Appendix B Proofs of results in Section 3.2

We provide the formal version of Theorem 3.2 in this section.

Recall that the teacher model is defined as

$$ $\displaystyle f_{\mathcal{T}}(\mathbf{x})=\sum_{i=1}^{m}a_{i}\sigma\left( \langle{\bm{w}}_{i},\mathbf{x}\rangle+b_{i}\right).$ $$

The student model is similarly defined as

$$ $\displaystyle f_{\mathcal{S}}(\mathbf{x})=\sum_{i=1}^{\tilde{m}}\tilde{a}_{i} \sigma\left(\langle\tilde{{\bm{w}}}_{i},\mathbf{x}\rangle+\tilde{b}_{i}\right).$ $$

###### Setup

We assume the data points are sampled at random from $\mathcal{U}(\{\pm 1\}^{d})$.
Without loss of generality, let the target $k$-sparse parity function be $y=x_{1}x_{2}\cdots x_{k}.$
Symmetric initialization: Following (Barak et al., ), we use the following symmetric initialization: for each $1\leq i\leq m/2$,

$$ $\displaystyle{\bm{w}}_{i}\sim\mathcal{U}(\{\pm 1\}^{d}),\quad b_{i}\sim \mathcal{U}(\{-1+k^{-1},\cdots,1-k^{-1}\}),\quad a_{i}\sim\mathcal{U}(\{\pm 1/ m\}),$ $\displaystyle{\bm{w}}_{i+m/2}={\bm{w}}_{i},\quad b_{i+m/2}=b_{i},\quad a_{i+m/ 2}=-a_{i}.$ $$

Two-stage training:
Following prior work (Barak et al., ; Abbe et al., , ), we adopt a two-stage batch gradient descent training, where we first train the first-layer weights $\{{\bm{w}}_{1},\cdots,{\bm{w}}_{m}\}$, keeping the output weights $\{a_{i}\}_{i=1}^{m}$ fixed.
In the second stage of training, we fit the output weights $\{a_{i}\}_{i=1}^{m}$ while keeping others fixed.
We keep the biases $\{b_{i}\}_{i=1}^{m}$ fixed throughout training. Similar strategy for training the student model as well.
The teacher is trained with hinge loss, given by $\ell(\mathbf{x},y)=\max(0,1-f_{\mathcal{T}}(\mathbf{x})y).$ The student is trained with $\ell_{\text{DL}}(\mathbf{x},y;f_{\mathcal{S}},f_{\mathcal{T}})=\max(0,1-f_{
\mathcal{S}}(\mathbf{x})f_{\mathcal{T}}(\mathbf{x}))$.

The training process is summarized in Algorithm 1.

Figure: Algorithm 1 2-stage training

###### Sample complexity benefits with progressive distillation for the student

Our result is that progressive distillation provably reduces the sample complexity compared to (one-shot) distillation or no distillation.
The key is to establish a separation between the correlations with in-support and off-support variables, which happens with high probability as formalized in Corollary B.6.
Under such event, we show:

###### Theorem B.1 (Sample complexity benefits with progressive distillation) .

Suppose the teacher model has been trained with 2-stage training in Algorithm 1,
which satisfies the conditions in Corollary B.6 at the end of first stage and achieves loss $\mathcal{O}(d^{-c})$ for some constant $c\geq 1$ at the end of the second stage.
Suppose we train a student model $f_{\mathcal{S}}$ of size $\tilde{m}=\tilde{\Theta}(2^{k}k)$ using the following two strategies:

- 1.
Progressive distillation: Train for the first $T_{1}=1$ steps w.r.t. the teacher’s logits at $T_{1}$ checkpoint.
Then, train with the final teacher checkpoint in the second stage.
- 2.
Distillation: Train with the final teacher checkpoint throughout training.

Then,

- 1.
Under progressive distillation, the total sample complexity to reach a loss of $\epsilon$ with probability $1-\delta$ is
$\Theta(k^{2}\log(d\tilde{m}/\delta)+2^{k}d^{2}k^{4}\epsilon^{-2}\log(k/\delta)).$
- 2.
The necessary sample complexity under distillation is at least $\Omega(d^{\min(2c,k-1)}).$

The proof consists of two parts:
1) showing that the teacher develops strong correlation with the in-support variables after the first stage of training (Lemma B.2, Corollary B.6),
and 2) showing that given the support, the second phase of training converges quickly (Corollary B.8).
These two helper lemmas are proven in Section B.1.1 (first stage) and Section B.1.2 (second stage).
The proof of Theorem B.1
is given in Section B.2.

###### Theorem B.1 (Sample complexity benefits with progressive distillation) .

###### Notations

Before stating the proofs, we provide a list of necessary notations.

- •
At any training step $t$, $f_{\mathcal{T}}^{(t)}$ will refer to the teacher’s output at that step. Its parameters are referred to as $\theta^{(t)}=\{a^{(t)}_{i},{\bm{w}}^{(t)}_{i},b^{(t)}_{i}\}_{i=1}^{m}.$ The loss for $f_{\mathcal{T}}^{(t)}$ is denoted by $L(f_{\mathcal{T}}^{(t)})$ or $L_{\theta^{(t)}}.$
Notations for the student $f_{\mathcal{S}}$ are defined similarly.
- •
Given a set $\tilde{S}$, $\chi_{\tilde{S}}$ denotes the Fourier function on $\tilde{S}$,
where $\chi_{\tilde{S}}(\mathbf{x})=\prod_{i\in\tilde{S}}x_{i}$.
We are particularly interested in $\tilde{S}=\mathbf{S}$, i.e. the support of the sparse parity.
- •
$\text{Maj}:\{\pm 1\}^{d}\to\pm 1$ represents the majority function.
On any $\mathbf{x}$, Maj returns the sign of $\sum_{i=1}^{d}\mathbf{x}_{i}.$ $\zeta_{i}$ for $i\geq 1$ represents its $i$th fourier coefficient, i.e. $\zeta_{i}=\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})$ for any $S\in\{0,1\}^{d}$ with $|S|=i.$ $\zeta_{i}=0$ when $i$ is even,
and $\zeta_{i}=\Theta(i^{-1/3}/\binom{d}{i})$ when $i$ is odd (O’Donnell, ).
- •
$\tau_{g}$ denotes the error tolerance in the gradient estimate due to mini-batch gradient estimation: let $g$ be the population gradient and $\hat{g}$ be the estimated gradient with a few examples, $\tau_{g}$ is defined such that $\|\hat{g}-g\|_{\infty}\leq\tau_{g}$.
A $\tau_{g}$-error gradient estimate can be obtained using a batch size of $\tilde{\Omega}(1/\tau_{g}^{2})$.

#### B.1 Analysis for the teacher

##### B.1.1 First stage analysis for the teacher

First, we show that with an appropriate learning rate, the magnitude of the weights $w_{ij}$ on coordinates $i\in\mathbf{S}$ increases to $\frac{1}{2k}$, while the coordinates $i\not\in\mathbf{S}$ stay $\mathcal{O}\left(\frac{1}{kd}\right)$ small.

###### Lemma B.2 (Single step gradient descent, adapted from Claims 1, 2 in Barak et al. ( 2022 ) ) .

Fix $\tau_{g},\delta>0$. Set $T_{1}$ as $1$. Suppose the batch size $B_{1}\geq\Omega(\tau_{g}^{-2}\log(md/\delta)).$
For learning rate $\eta_{1}=\frac{m}{k\left|\zeta_{k-1}\right|}$ and $\lambda_{1}=1$, the following conditions hold true for all neurons $i\in[m]$ at the end of first stage of training w.p. at least $1-\delta$.

- 1.
$\left|w_{ij}^{(1)}-\frac{\operatorname{sign}(a_{i}^{(0)}\zeta_{k-1})
\operatorname{sign}(\chi_{[k]\setminus\{j\}}({\bm{w}}_{i}^{(0)}))}{2k}\right|
\leq\frac{\tau_{g}}{\left|\zeta_{k-1}\right|},$ for all $j\in[k].$
- 2.
$\left|w_{ij}^{(1)}-\frac{\zeta_{k+1}}{\left|\zeta_{k-1}\right|}\frac{
\operatorname{sign}(a_{i}^{(0)})\operatorname{sign}(\chi_{[k]\cup\{j\}}({\bm{w
}}_{i}^{(0)}))}{2k}\right|\leq\frac{\tau_{g}}{\left|k\zeta_{k-1}\right|},$ for all $j>k$.

###### Proof.

The proof follows that of (Barak et al., ), which we outline here for completeness.
The proof has two major components:
First, the magnitude of the population gradient at initialization reveals the support of the sparse parity.
Second, the batch gradient and the population gradient can be made sufficiently close given a sufficiently large batch size.
We will explain each step below.

###### Claim B.3 .

At initialization, the population gradient of the weight vector in neuron $i$ is given by $\mathbb{E}_{\mathbf{x},y}\nabla_{w_{ij}}\ell(\mathbf{x},y;f_{\mathcal{T}}^{(0)
})=-\mathbb{E}_{\mathbf{x},y}\nabla_{w_{ij}}f_{\mathcal{T}}^{(0)}(\mathbf{x})y$, which can be split across the coordinates as

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}\nabla_{w_{ij}}f_{\mathcal{T}}^{(0)}( \mathbf{x})y=-\frac{1}{2}a_{i}^{(0)}\zeta_{k-1}\chi_{[k]\setminus\{j\}}({\bm{w }}^{(0)}),\quad\text{ for all }j\in\mathbf{S}$ $\displaystyle\mathbb{E}_{\mathbf{x},y}\nabla_{w_{ij}}f_{\mathcal{T}}^{(0)}( \mathbf{x})y=-\frac{1}{2}a_{i}^{(0)}\zeta_{k+1}\chi_{[k]\cup\{j\}}({\bm{w}}^{( 0)}),\quad\text{ for all }j\not\in\mathbf{S}$ $$

Thus, the gradient of the weight coordinates $w_{ij}$ for any neuron $i$ and $j\in\mathbf{S}$ has magnitude $\left|\zeta_{k-1}\right|$, while the gradients of the weight coordinates $w_{ij}$ for any neuron $i$ and $j\notin\mathbf{S}$ has magnitude $\left|\zeta_{k+1}\right|$. The gap between the gradient in support and out of support is given by $\left|\zeta_{k-1}\right|-\left|\zeta_{k+1}\right|\geq 0.03((d-1)^{-(k-1)/2})$ (Lemma 2 in Barak et al. ()).

The second component involves applying a hoeffding’s inequality to show the gap between sample and population gradient.

###### Claim B.4 .

Fix $\delta,\tau_{g}>0$. For all $i,j$, for a randomly sampled batch of size $B_{1}$, $\{(\mathbf{x}_{k},y_{k})\}_{k=1}^{B_{1}}$, with probability at least $1-\delta$,

$$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y\sim\mathcal{U}(\{\pm\}^{d})}\nabla _{w_{ij}}f_{\mathcal{T}}^{(0)}(\mathbf{x})-\mathbb{E}_{\{(\mathbf{x}_{k},y_{k} )\}_{k=1}^{B_{1}}}\nabla_{w_{ij}}f_{\mathcal{T}}^{(0)}(\mathbf{x})\right|\leq \tau_{g},$ $$

provided $B_{1}\geq\Omega(\tau_{g}^{-2}\log(md/\delta)).$

Because we want the noise $\tau_{g}$ to be smaller than the magnitude of the true gradients for the coordinates in the support $\mathbf{S}$, we want $\tau_{g}$ to be smaller than $\left|\zeta_{k-1}\right|$. We set this to get favorable condition for second phase of training (see Lemma B.7).
∎

On the other hand, we show that after the first phase, the output of the network has positive correlations to the individual variables in the support of the label function, and thus the checkpoint after the first phase can be used to speed up training of future models.

###### Lemma B.5 (Correlation with in-support variables) .

Under the event that the conditions in Lemma B.2 are satisfied by each neuron, which occurs with probability at least $1-\delta$ w.r.t. the randomness of initialization and sampling,
the output of the model after the first phase satisfies the following conditions:

- 1.
$\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})x_{i}\geq\frac{1}{8k
}+\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})+\mathcal{O}(m^{-1/2})$ for all $i\in\mathbf{S}$.
- 2.
$\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})x_{i}\leq\mathcal{O}
((kd)^{-1})$ for all $i\notin\mathbf{S}$.
- 3.
$\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})\chi_{S}(\mathbf{x})
\leq\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})$ for all $S$ with even $\left|S\right|$.
- 4.
$\left\|f_{\mathcal{T}}^{(1)}\right\|^{2}_{2}=\mathbb{E}_{\mathbf{x},y}[f_{
\mathcal{T}}^{(1)}(\mathbf{x})]^{2}\leq\mathcal{O}(d/k).$

###### Proof.

Consider a neuron $i\in[m/2]$ and its symmetric counterpart $i+m/2$. W.L.O.G., we assume $\operatorname{sign}(w_{ij}^{(0)})=\operatorname{sign}(a_{i}^{(0)}\zeta_{k-1})$ for all $j\in[k]$, and $\operatorname{sign}(a_{i}^{(0)})=1$.
Recall that $k$ is assumed to be even, hence $\operatorname{sign}(\chi_{[k]}({\bm{w}}_{i}^{(0)}))=1$.
Then, the condition in Lemma B.2 can be simplified as

$$ $\displaystyle w_{ij}^{(1)}=\frac{1}{2k}+v_{ij},$ $\displaystyle\quad w_{i+m/2,j}^{(1)}=-\frac{1}{2k}-v_{ij},\text{ for all }j\in [k],$ $\displaystyle w_{ij}^{(1)}=\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1} \right|}\operatorname{sign}(w_{ij}^{(0)})+v_{ij},$ $\displaystyle\quad w_{i+m/2,j}^{(1)}=-\frac{1}{2k}\frac{\zeta_{k+1}}{\left| \zeta_{k-1}\right|}\operatorname{sign}(w_{ij}^{(0)})+v_{ij},\text{ for all }j \geq k,$ $$

where $v_{ij}$ satisfies the following conditions.

$$ $\displaystyle\left|v_{ij}\right|$ $\displaystyle\leq\frac{\tau_{g}}{\left|\zeta_{k-1}\right|},\text{ for all }j \in[k],$ $\displaystyle\left|v_{ij}\right|$ $\displaystyle\leq\frac{\tau_{g}}{\left|k\zeta_{k-1}\right|},\text{ for all }j \geq k.$ $$

Then, the sum of the output of the neurons $i$ and $i+m/2$ on an input $\mathbf{x}$ (ignoring the magnitude of $a_{i}$) is given by

$$ $\displaystyle(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})$ $\displaystyle=\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)$ $\displaystyle-\sigma\left(-\frac{1}{2k}\sum_{j=1}^{k}x_{j}-\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right),$ $$

and

$$ $f_{\mathcal{T}}^{(1)}(\mathbf{x})=\sum_{i=1}^{m/2}a_{i}(f_{\mathcal{T}}^{(1)}) _{i}(\mathbf{x})=\frac{1}{m}\sum_{i=1}^{m/2}(f_{\mathcal{T}}^{(1)})_{i}( \mathbf{x}).$ $$

###### Lemma B.2 (Single step gradient descent, adapted from Claims 1, 2 in Barak et al. ( 2022 ) ) .

###### Proof.

###### Claim B.3 .

###### Claim B.4 .

###### Lemma B.5 (Correlation with in-support variables) .

###### Proof.

###### 1. In-support correlations:

We are interested in the correlation of this function to a variable $x_{u}$ for $u\in\mathbf{S}$. We argue for $u=1$, as the similar argument applies for others. Thus, we are interested in

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x _{1}=\mathbb{E}_{\mathbf{x},y}$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)x_{1}$ $\displaystyle-\sigma\left(-\frac{1}{2k}\sum_{j=1}^{k}x_{j}-\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)x_{1}.$ (7) $$

We focus on the first term; argument for the second term is similar. First of all, we can ignore $\langle{\bm{v}}_{i},\mathbf{x}\rangle$ incurring an error of $\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1}).$

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+b_{i}\right)x_{1}$ $\displaystyle=\mathbb{E}_{\mathbf{x},y:x_{1}=+1}\sigma\left(\frac{1}{2k}+\frac {1}{2k}\sum_{j=2}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1} \right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\right)$ $\displaystyle-\mathbb{E}_{\mathbf{x},y:x_{1}=-1}\sigma\left(-\frac{1}{2k}+ \frac{1}{2k}\sum_{j=2}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k- 1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\right)$ $\displaystyle\geq\frac{1}{2k}\mathbb{E}_{\mathbf{x},y}\mathbb{I}\left(\frac{1} {2k}\sum_{j=2}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1}\right |}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\geq 0\right).$ $$

The final step follows from the observation that the argument of $\sigma$ in the first term is $\frac{1}{k}$ higher than the argument of $\sigma$ in the second term. This implies that when the first term is non-zero, it’s at least $\frac{1}{2k}$ higher than the second term. Hence, we lower bound by considering one scenario where the first term is non-zero.

Continuing, we can further split the indicator function into cases when each term in the argument of the indicator function is positive.

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+b_{i}\right)x_{1}$ $\displaystyle\geq\frac{1}{2k}\mathbb{E}_{\mathbf{x},y}\mathbb{I}\left(\frac{1} {2k}\sum_{j=2}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1}\right |}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\geq 0\right)$ $\displaystyle\geq\frac{1}{2k}\mathbb{E}_{\mathbf{x},y}\mathbb{I}\left(\sum_{j= 2}^{k}x_{j}\geq 0\right)\mathbb{I}\left(\sum_{j=k+1}^{d}x_{j}\geq 0\right) \mathbb{I}\left(b_{i}\geq 0\right)$ $\displaystyle\geq\frac{1}{8k}\mathbb{I}\left(b_{i}\geq 0\right).$ $$

From Equation 7, we then have

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x _{1}\geq\frac{1}{4k}\mathbb{I}\left(b_{i}\geq 0\right)+\mathcal{O}(\tau_{g}d \left|\zeta_{k-1}\right|^{-1}).$ $$

As $b_{i}$ has been kept at random initialization and thus is a random variable selected from the set $\{-1+\frac{1}{k},\cdots,1-\frac{1}{k}\}$, with probability $\frac{1}{2}$, $\mathbb{I}\left(b_{i}\geq 0\right)$. This implies, w.p. atleast $1/2$ w.r.t. a neuron’s bias initialization, $\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x_{1}\geq\frac
{1}{4k}+\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})$. The final bound comes from the fact that $\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}(\mathbf{x})x_{1}=\mathbb{E}_{\mathbf{
x},y}\frac{1}{m}\sum_{i=1}^{m}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x_{1}\geq
\frac{1}{8k}+\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})+\mathcal{O}(m
^{-1/2})$, where the error term is bounded using Hoeffding’s inequality.

###### 2. Out-of-support correlations:

Similar to the Equation 7, we have for $u\notin\mathbf{S}$,

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x _{u}=\mathbb{E}_{\mathbf{x},y}$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)x_{u}$ $\displaystyle-\sigma\left(-\frac{1}{2k}\sum_{j=1}^{k}x_{j}-\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)x_{u}.$ (8) $$

However, we observe that the influence of $x_{u}$ in each of the terms is bounded by $\frac{1}{k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1}\right|}$. Consider the first term; the argument for the second term is similar. We can again ignore $\langle{\bm{v}}_{i},\mathbf{x}\rangle$ incurring an error of $\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1}).$

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+b_{i}\right)x_{u}$ $\displaystyle=\mathbb{E}_{\mathbf{x},y:x_{u}=+1}\sigma\left(\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\operatorname{sign}(w_{iu}^{(0)})+\frac{ 1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1} \right|}\sum_{j=k+1\to d;j\neq u}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\right)$ $\displaystyle-\mathbb{E}_{\mathbf{x},y:x_{u}=-1}\sigma\left(-\frac{1}{2k}\frac {\zeta_{k+1}}{\left|\zeta_{k-1}\right|}\operatorname{sign}(w_{iu}^{(0)})+\frac {1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k-1} \right|}\sum_{j=k+1\to d;j\neq u}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i}\right)$ $\displaystyle=\mathbb{E}_{\mathbf{x},y}\frac{C(\mathbf{x})}{k}\frac{\zeta_{k+1 }}{\left|\zeta_{k-1}\right|}\operatorname{sign}(w_{iu}^{(0)})\mathbb{I}\left( \frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{\zeta_{k+1}}{\left|\zeta_{k- 1}\right|}\sum_{j=k+1\to d;j\neq u}\operatorname{sign}(w_{ij}^{(0)})x_{j}+b_{i }\geq 0\right),$ $$

where $C(\mathbf{x})\in\{1,2\}$ denotes a function that depends on $\mathbf{x}$. The final step follows from a first order taylor expansion of $\sigma$.
The magnitude can hence be bounded by $\frac{1}{k}\frac{\left|\zeta_{k+1}\right|}{\left|\zeta_{k-1}\right|}$. This can be bounded by $\frac{1}{kd}$ (section 5.3, O’Donnell ()). The final bound comes from the fact that $\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}(\mathbf{x})x_{u}=\mathbb{E}_{\mathbf{
x},y}\frac{1}{m}\sum_{i=1}^{m}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})x_{u}\leq
\mathcal{O}((kd)^{-1}).$

###### 3. Correlations to support of an even size:

The function $(f_{\mathcal{T}}^{(1)})_{i}$ is given by

$$ $\displaystyle(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})=$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)$ $\displaystyle-\sigma\left(-\frac{1}{2k}\sum_{j=1}^{k}x_{j}-\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+\langle{\bm{v}}_{i},\mathbf{x}\rangle+b_{i}\right)$ $\displaystyle=$ $\displaystyle\sigma\left(\frac{1}{2k}\sum_{j=1}^{k}x_{j}+\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+b_{i}\right)$ $\displaystyle-\sigma\left(-\frac{1}{2k}\sum_{j=1}^{k}x_{j}-\frac{1}{2k}\frac{ \zeta_{k+1}}{\left|\zeta_{k-1}\right|}\sum_{j=k+1}^{d}\operatorname{sign}(w_{ ij}^{(0)})x_{j}+b_{i}\right)+\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})$ $\displaystyle:=$ $\displaystyle g(\mathbf{x})+\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1}).$ $$

One can observe that $g(\mathbf{x})$ is a symmetric function and so an odd function. Thus, $\mathbb{E}_{\mathbf{x},y}g(\mathbf{x})\chi_{S}(\mathbf{x})=0$ (exercise 1.8, O’Donnell ()) and so, $\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x})\chi_{S}(
\mathbf{x})=\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1}).$

###### 4. Output norm:

Focusing on function $(f_{f_{\mathcal{T}}}^{(1)})_{i}$:

$$ $\displaystyle\left\|(f_{\mathcal{T}}^{(1)})_{i}\right\|_{2}^{2}$ $\displaystyle=\mathbb{E}_{\mathbf{x},y}(f_{\mathcal{T}}^{(1)})_{i}(\mathbf{x}) ^{2}$ $\displaystyle=\mathbb{E}_{\mathbf{x},y}\left(\sigma(\langle w_{ij}^{(1)}, \mathbf{x}\rangle+b_{i})-\sigma(\langle w_{i+m/2,j}^{(1)},\mathbf{x}\rangle+b_ {i})\right)^{2}$ $\displaystyle\leq\mathbb{E}_{\mathbf{x},y}\min\left(\left\|{\bm{w}}_{i}^{(1)} \right\|_{2}^{2}+b_{i}^{2},\left\|{\bm{w}}_{i+m/2}^{(1)}\right\|_{2}^{2}+b_{i} ^{2}\right)\left\|\mathbf{x}\right\|_{2}^{2}=\mathcal{O}\left(\frac{1}{k} \right)\cdot d.$ $$

The intermediate step uses Cauchy-Schwartz inequality, and the final step uses the values of $w_{ij}^{(1)},w_{i+m/2,j}^{(1)}$. As $f_{\mathcal{T}}^{(1)}(\mathbf{x})=\frac{1}{m}\sum_{i=1}^{m/2}(f_{\mathcal{T}}^
{(1)})_{i}(\mathbf{x})$, we have $\left\|(f_{\mathcal{T}}^{(1)})\right\|_{2}^{2}\leq\frac{2}{m}\sum_{i=1}^{m/2}
\left\|(f_{\mathcal{T}}^{(1)})_{i}\right\|_{2}^{2}=\mathcal{O}\left(\frac{d}{k
}\right).$
∎

###### Corollary B.6 .

Under the event that the conditions in Lemma B.2 are satisfied by each neuron, which occurs with probability at least $1-\delta$ w.r.t. the randomness of initialization and sampling,
the output of the model after the first phase can be given as:

$$ $\displaystyle f_{\mathcal{T}}^{(1)}(\mathbf{x})=\sum_{j=1}^{k}c_{j}x_{j}+\sum_ {j=k+1}^{d}c_{j}x_{j}+\sum_{S\subseteq[d]:|S|\%2=1,|S|\geq 3}c_{S}\chi_{S}( \mathbf{x})+\sum_{S\subseteq[d]:|S|\%2=0}c_{S}\chi_{S}(\mathbf{x}),$ $$

where

$$ $\displaystyle|c_{j}|\geq\Omega(k^{-1}),$ $\displaystyle\quad\text{for all }1\leq j\leq k,$ $\displaystyle|c_{j}|\leq\mathcal{O}((kd)^{-1}),$ $\displaystyle\quad\text{for all }j>k,$ $\displaystyle|c_{S}|\leq\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1}),$ $\displaystyle\quad\text{for all }S\subseteq[d]\text{ with }|S|\%2=0,$ $\displaystyle|c_{S}|\leq\mathcal{O}(d/k),$ $\displaystyle\quad\text{for all }S\subseteq[d]\text{ with }|S|\%2=1.$ $$

As such, the following correlations hold true for all $i$.

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})\cdot \text{Maj}(\mathbf{x})x_{i}=\frac{1}{2}c_{i}+\mathcal{O}(\tau_{g}d^{5/3}\left| \zeta_{k-1}\right|^{-1}).$ $$

If batch size $B_{1}$ is set $\geq\Omega(k^{2}d^{10/3}\zeta_{k-1}^{-2})$, such that $\tau_{g}\leq\mathcal{O}(k^{-1}d^{-5/3}\left|\zeta_{k-1}\right|)$, then the following holds for all $i$.

$$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x}) \cdot\text{Maj}(\mathbf{x})x_{i}\right|\geq\Omega(k^{-1}),\quad\text{ if }i\in [k],$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x}) \cdot\text{Maj}(\mathbf{x})x_{i}\right|\leq o(k^{-1}),\quad\text{ if }i\notin[ k],$ $$

###### Proof.

The form of $f_{\mathcal{T}}^{(1)}$ follows from the fourier coefficient analysis in Lemma B.5.

Now, we can use the formulation to derive

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})\cdot \text{Maj}(\mathbf{x})x_{i}$ $\displaystyle=$ $\displaystyle\mathbb{E}_{\mathbf{x},y}\sum_{j=1}^{d}c_{j}x_{j}\cdot\text{Maj}( \mathbf{x})\cdot x_{i}+\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=1,| S|\geq 3}c_{S}\text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})\cdot x_{i}$ $\displaystyle+\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c_{S}\chi_ {S}(\mathbf{x})\cdot\text{Maj}(\mathbf{x})x_{i}$ $\displaystyle=$ $\displaystyle\mathbb{E}_{\mathbf{x},y}\sum_{j=1}^{d}c_{j}x_{j}\cdot\text{Maj}( \mathbf{x})\cdot x_{i}+\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c _{S}\text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})\cdot x_{j}$ $\displaystyle=$ $\displaystyle c_{i}\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf{x})+\mathbb{E}_ {\mathbf{x},y}\sum_{j,j\neq k}c_{j}\text{Maj}(\mathbf{x})x_{j}x_{i}+\mathbb{E} _{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c_{S}\text{Maj}(\mathbf{x})\chi_{S }(\mathbf{x})\cdot x_{i}$ $\displaystyle=$ $\displaystyle\frac{1}{2}c_{i}+\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S| \%2=0}c_{S}\text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})\cdot x_{i}.$ $$

The second step removes $\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c_{S}\chi_{S}(\mathbf{x}
)\cdot\text{Maj}(\mathbf{x})x_{i}$ because $\text{Maj}(\mathbf{x})$ is an odd function, and so $\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})x_{i}$ will be 0 0 for odd sized $S$. Similar argument holds for removing $\mathbb{E}_{\mathbf{x},y}\sum_{j,j\neq i}c_{j}\text{Maj}(\mathbf{x})x_{j}x_{i}$ in the final step.
We finish the proof by bounding $\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c_{S}\text{Maj}(\mathbf{
x})\chi_{S}(\mathbf{x})\cdot x_{i}$.

As $\left|c_{S}\right|\leq\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})$ for all $S$ with $|S|\%2=0$, we can bound it as

$$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y}\sum_{S\subseteq[d]:|S|\%2=0}c_{S} \text{Maj}(\mathbf{x})\chi_{S}(\mathbf{x})\cdot x_{i}\right|$ $\displaystyle\leq$ $\displaystyle\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})\cdot\left( \sum_{S\subseteq[d]:|S|\%2=0}\left|\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf {x})\chi_{S}(\mathbf{x})x_{i}\right|\right)$ $\displaystyle\leq$ $\displaystyle\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})\cdot\left( \sum_{S\subseteq[d]}\left|\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf{x})\chi_ {S}(\mathbf{x})\right|\right)$ $\displaystyle\leq$ $\displaystyle\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})\cdot\left( \sum_{S\subseteq[d]}\left|\mathbb{E}_{\mathbf{x},y}\text{Maj}(\mathbf{x})\chi_ {S}(\mathbf{x})\right|\right)$ $\displaystyle=$ $\displaystyle\mathcal{O}(\tau_{g}d\left|\zeta_{k-1}\right|^{-1})\cdot\sum_{S \subseteq[d]}\Theta\left(\frac{\left|S\right|^{-1/3}}{\binom{d}{\left|S\right| }}\right)$ $\displaystyle=$ $\displaystyle\mathcal{O}(\tau_{g}d^{5/3}\left|\zeta_{k-1}\right|^{-1}).$ $$

Here the pre-final step follows from the bounds on the Fourier coefficients of Maj outlined in Appendix B. Finally, we set $B_{1}\geq\Omega(\tau_{g}^{-2})$ is set such that $\tau_{g}\leq\mathcal{O}(k^{-1}d^{-5/3}\zeta_{k-1})$. This makes
$\mathcal{O}(\tau_{g}d^{5/3}\left|\zeta_{k-1}\right|^{-1})=o(1/k).$ Hence, with appropriate batch size $B_{1}$,

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(1)}(\mathbf{x})\cdot \text{Maj}(\mathbf{x})x_{i}=\frac{1}{2}c_{i}+o(1/k).$ $$

The proof follows from the magnitude of $c_{i}$ derived above.
∎

###### Corollary B.6 .

###### Proof.

##### B.1.2 Second stage analysis for the teacher

###### Lemma B.7 (Second stage Training, cf. Theorem 4 in (Barak et al., 2022 ) ) .

Fix $\epsilon,\delta>0$. Suppose $m\geq\Omega(2^{k}k\log(k/\delta))$, $d\geq\Omega\left(k^{4}\log(kd/\epsilon)\right)$. Furthermore, suppose $B_{1}\geq\Omega(\left|\zeta_{k-1}\right|^{2}k^{2}\log(kd/\epsilon))$ s.t. the weights satisfy the conditions in Lemma B.2 with $\tau_{g}=\mathcal{O}(\left|\zeta_{k-1}\right|k^{-1})$ after the first phase. Then after $T_{2}=\Omega(md^{2}k^{3}/\epsilon^{2})$ steps of training with batch size $B_{2}=1$, learning rate $\eta_{2}=4k^{1.5}/(d\sqrt{m(T_{2}-1)})$ and decay $\lambda_{2}=0$, we have with expectation over the randomness of the initialization and the sampling of the batches:

$$ $\displaystyle\min_{t\in[T_{2}]}\mathbb{E}\left[L_{\theta^{(t)}}(\mathbf{x},y) \right]\leq\epsilon.$ $$

Thus, the minimal sample complexity to reach a loss of $\epsilon$ is given by

$$ $\displaystyle T_{1}\times B_{1}+T_{2}\times B_{2}$ $\displaystyle=\Theta(\left|\zeta_{k-1}\right|^{2}k^{2}\log(kd/\epsilon))+ \Theta(md^{2}k^{3}/\epsilon^{2})$ $\displaystyle=\Theta(d^{k-1}k^{2}\log(dk/\epsilon)+2^{k}d^{2}k^{4}\epsilon^{-2 }\log(k/\delta)).$ $$

###### Corollary B.8 .

Under the conditions outlined in Lemma B.7, after $T_{2}$ steps of training in the second phase, if $t^{\dagger}$ denote the time step at which the model achieves the minimum loss, i.e. $t^{\dagger}:=\arg\min_{t\in[T_{2}]}\mathbb{E}\left[L_{\theta^{(t)}}(\mathbf{x}
,y)\right]$, then

$$ $\displaystyle\mathbb{E}\left[f_{\mathcal{T}}^{(t^{\dagger})}(\mathbf{x})x_{i} \right]\leq\epsilon,\text{ for all }i\in[d].$ $$

The proof follows from the fact that if the correlation along $y=\prod_{i\in\mathbf{S}}x_{i}$ is large ($\geq 1-\epsilon$ as hinge loss is below $\epsilon$), the correlations along other Fourier basis functions will be small. Hence, depending on how saturated the model is, the signal along the support elements are small.

We will use a slightly modified version of Lemma B.7 with higher sample complexity in the first phase, to ensure the stronger conditions of Corollary B.6 hold true as well. This will be necessary to get improved signal to teach a smaller student.(^13^1313We haven’t optimized the error bounds in Corollary B.6. Our sample complexity bounds are likely loose in Corollary B.9)

###### Corollary B.9 (Modified Version of Lemma B.7 ) .

Fix $\epsilon,\delta>0$. Suppose $m\geq\Omega(2^{k}k\log(k/\delta))$, $d\geq\Omega\left(k^{4}\log(kd/\epsilon)\right)$. Furthermore, suppose $B_{1}\geq\Omega(\left|\zeta_{k-1}\right|^{2}k^{2}d^{10/3}\log(kd/\epsilon))$ s.t. the weights satisfy the conditions in Corollary B.6 with $\tau_{g}=\mathcal{O}(\left|\zeta_{k-1}\right|k^{-1}d^{-5/3})$ after the first phase. Then after $T_{2}=\Omega(md^{2}k^{3}/\epsilon^{2})$ steps of training with batch size $B_{2}=1$, learning rate $\eta_{2}=4k^{1.5}/(d\sqrt{m(T_{2}-1)})$ and decay $\lambda_{2}=0$, we have with expectation over the randomness of the initialization and the sampling of the batches:

$$ $\displaystyle\min_{t\in[T_{2}]}\mathbb{E}\left[L_{\theta^{(t)}}(\mathbf{x},y) \right]\leq\epsilon.$ $$

Thus, the minimal sample complexity to reach a loss of $\epsilon$ is given by

$$ $\displaystyle T_{1}\times B_{1}+T_{2}\times B_{2}$ $\displaystyle=\Theta(\left|\zeta_{k-1}\right|^{2}d^{10/3}k^{2}\log(kd/\epsilon ))+\Theta(md^{2}k^{3}/\epsilon^{2})$ $\displaystyle=\Theta(d^{k+7/3}k^{2}\log(dk/\epsilon)+2^{k}d^{2}k^{4}\epsilon^{ -2}\log(k/\delta)).$ $$

###### Lemma B.7 (Second stage Training, cf. Theorem 4 in (Barak et al., 2022 ) ) .

###### Corollary B.8 .

###### Corollary B.9 (Modified Version of Lemma B.7 ) .

#### B.2 Analysis for the student

###### Proof of Theorem B.1 .

We will first prove the sample complexity upper bound for progressive distillation, followed by a sample complexity lower bound for distillation.

Sample complexity for Progressive distillation: Under progressive distillation, the label is given by $f_{\mathcal{T}}^{(T_{1})}$ for the first $T_{1}$ steps. We will follow similar steps as Lemma B.2, where the label is replaced by $f_{\mathcal{T}}^{(T_{1})}$. B.3 changes, while B.4 stays the same. We will showcase the change in B.3 here.

At initialization, the population gradient of the weight vector in neuron $i$ at coordinate $j$ is given by

$$ $\displaystyle\mathbb{E}_{\mathbf{x},y}\nabla_{\tilde{w}^{(0)}_{ij}}\ell_{\text {DL}}(\mathbf{x},y;f_{\mathcal{S}}^{(0)},f_{\mathcal{T}})$ $\displaystyle=-\mathbb{E}_{\mathbf{x},y}\nabla_{\tilde{w}^{(0)}_{ij}}f_{ \mathcal{S}}^{(0)}(\mathbf{x})f_{\mathcal{T}}^{(T_{1})}(\mathbf{x})$ $\displaystyle=-a_{i}\mathbb{E}_{\mathbf{x},y}\mathbb{I}\left[\langle\tilde{{ \bm{w}}}^{(0)}_{i},\mathbf{x}\rangle+\tilde{b}_{i}\geq 0\right]f_{\mathcal{T}} ^{(T_{1})}(\mathbf{x})x_{j}$ $\displaystyle=-a_{i}\mathbb{E}_{\mathbf{x},y}\left(\frac{1}{2}+\frac{1}{2} \text{Maj}(\tilde{{\bm{w}}}^{(0)}_{i},\mathbf{x})\right)f_{\mathcal{T}}^{(T_{1 })}(\mathbf{x})x_{j}$ $\displaystyle=-a_{i}\frac{1}{2}\mathbb{E}_{\mathbf{x},y}f_{\mathcal{T}}^{(T_{1 })}(\mathbf{x})x_{j}-a_{i}\frac{1}{2}\mathbb{E}_{\mathbf{x},y}\text{Maj}( \tilde{{\bm{w}}}^{(0)}_{i},\mathbf{x})f_{\mathcal{T}}^{(T_{1})}(\mathbf{x})x_{ j},$ $$

where the relation between $\mathbb{I}\left[\langle\tilde{{\bm{w}}}^{(0)}_{i},\mathbf{x}\rangle+\tilde{b}_
{i}\geq 0\right]$ and $\text{Maj}(\tilde{{\bm{w}}}^{(0)}_{i},\mathbf{x})$ follows because of $\left|\tilde{b}_{i}\right|<1$ at initialization. From Corollary B.6,

$$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y}\nabla_{\tilde{w}^{(0)}_{ij}}\ell_ {\text{DL}}(\mathbf{x},y;f_{\mathcal{S}}^{(0)},f_{\mathcal{T}})\right|\geq \Omega(k^{-1}),\quad\text{ if }j\in[k],$ $\displaystyle\left|\mathbb{E}_{\mathbf{x},y}\nabla_{\tilde{w}^{(0)}_{ij}}\ell_ {\text{DL}}(\mathbf{x},y;f_{\mathcal{S}}^{(0)},f_{\mathcal{T}})\right|\leq o(k ^{-1}),\quad\text{ if }j\notin[k].$ $$

Thus, a fourier gap exists between the population gradients on in-support and out-of-support coordinates in the gradients. We can then apply B.4 to show that a finite batch size of $B_{1}\geq\Omega(k^{2}\log(d\tilde{m}/\delta))$ is sufficient to maintain this gap between the coordinates in support and out of support. Thus, the change in the necessary sample complexity comes from the reduced sample complexity in the first phase. The proof for the second phase training is exactly equal to the proof for the teacher in Theorem B.1.

Sample complexity for Distillation: On the other hand, for the teacher checkpoint with loss $\mathcal{O}(d^{-c})$, the correlation to the monomial terms in the support is bounded by $\mathcal{O}(d^{(-c)})$ (by Corollary B.8). If we want to learn from the correlations to the support, we need the number of samples to be at least $\Omega(d^{2c})$ as the gradient noise needs to be lower than $\mathcal{O}(d^{-c})$ (by B.4).
To learn the support from the true label, we need the number of samples to be at least $\Omega(d^{k-1})$,
by the following result:

###### Lemma B.10 (Width-optimization trade-off, cf. Proposition 3 in (Edelman et al., 2023 ) ) .

For $\delta>0$, gradient noise $\tau_{g}>0$,
and model width $m>0$,
if $T\leq\frac{1}{2}{d\choose k}\frac{\delta\tau_{g}^{2}}{m}$,
then there exists a $(d,k)$-sparse parity such that w.p. at least $1-\delta$ over the randomness of initialization and samples,
the loss is lower bounded as $L(f_{\mathcal{T}}^{(t)})\geq 1-\tau_{g}$ for all $t\in\{1\cdots T\}$.

This result implies that for a fixed batch size (and hence a fixed $\tau_{g}$),
we either require a bigger width, or more number of gradient steps (which translates to sample complexity since we are using fresh samples each batch).
Hence, for the model to learn the support from a combination of the two components, it needs a sample complexity at least $\Omega(d^{\min(2c,k-1)}/\tilde{m})$.
∎

###### Proof of Theorem B.1 .

###### Lemma B.10 (Width-optimization trade-off, cf. Proposition 3 in (Edelman et al., 2023 ) ) .

### Appendix C Results on sparse parity and its generalization

Figure: Figure 7: Larger models learn sparse parity faster. A larger model has more width (MLP, left) or more attention heads (Transformers, right). The results are for $(100,6)$-parity, aggregated over 5 runs for each setup.
Refer to caption: extracted/5908367/plots_acc/parity_size_comparison_median.png

#### C.1 Additional results on sparse parity with MLP

We take both the teacher and student models to be 1-hidden-layer MLPs with ReLU activations.
The teacher has a hidden width of $5\times 10^{4}$, and the students are of widths $10^{2}$ or $10^{3}$.
All models are trained using SGD with batch size 1 for $20M$ steps on sparse parity data with $n=100$ and $k=6$ (Definition 3.1).
The support is set to be the first 6 coordinates of the input vector without loss of generality.
The learning rate is searched over $\{10^{-2},5\times 10^{-3},10^{-3}\}$.
Evaluation is based on a held-out set consisting of $4096$ examples, and
we report the average across $3$ different training seeds.
For one-shot distillation, we use the teacher checkpoint at the end of training (20M checkpoint), at which point the teacher has fully saturated. For progressive distillation, we use ${N}=200$ equally spaced teacher checkpoints that are 0.1M steps apart.

Figure: Figure 8: Repeated experiments from Figure 2 for a student of width $1000$.
Refer to caption: x6.png

Figure: Figure 9: Repeated experiments from Figure 2 but for a different teacher. For $(2,0.1M)$ progressive distillation, the checkpoint that lies in the middle of the second phase accelerates training the most. In Figure 2, we used a teacher that was trained with learning rate $5\times 10^{-3}$. The correlation plot for the teacher to degree-1 monomials had a clear gap for degree-1 monomials in-support and out-of-support at the middle of the second phase (indicated by candidate 2). However, for a teacher that is trained with a higher learning rate $10^{-2}$, we didn’t find such a clean gap in correlations for degree-1 monomials. On the other hand, correlations to degree-2 and degree-3 monomials showed a clean gap between in-support and off-support variables at the middle of the phase transition. Hence, the student needn’t learn only from degree-1 monomials to get training acceleration, any low degree monomials suffice to teach the student about the support. Rest for degree-2 monomials refers to all monomials of the form $x_{i}x_{j}$ where atleast one of $i,j\notin\mathbf{S}$. Similar definition for degree-3 monomials.
Refer to caption: x7.png

#### C.2 Learning with Transformers: parallel search with attention heads

The benefit of progressive distillation and the implicit curriculum is not specific to MLP.
This section presents similar results with Transformers (Vaswani et al., ).
The $d$-dimensional input vector is now treated as a length-$d$ sequence, and the label is predicted using the last token’s output.
We fix the support $\mathbf{S}$ to be the first 6 coordinates of the sequence. Note that unlike MLP, Transformer’s learning is not permutation-invariant to the location of $\mathbf{S}$ due to the causal mask.
Nevertheless, given the same $\mathbf{S}$, the comparison on learning speed is still meaningful.

For Transformers, the parallel queries come from both the MLP width and also the number of attention heads.
To illustrate this, consider the following two solutions (which we formalize in Section C.2.1)
to sparse parity:
The first solution uses attention to locate the support and then uses MLP to compute the product of the in-support variables.
The second solution copies over all variables to the final position, whose MLP is then responsible for both identifying the support and computing the product.
The second solution is less interesting as it reduces to an MLP, so we focus on the first solution in the following, which utilizes the attention mechanism unique to Transformers.

(R6) More attention heads helps with the search for support
Our experiments are based on 2-layer Transformers
(^14^1414We use 2 layers since 1-layer Transformers are hard to train empirically, despite being representationally sufficient to solve sparse parity.) with 8 dimensions per attention head.
As shown in Figure 7 (right), increasing the number of heads makes learning faster.
There are clear phase transitions similar to the MLP case.

###### Ablation with other ways to vary the model size

Most Transformer experiments in this work keep the per-head dimension to be fixed and vary the number of attention heads between the teacher and the student.
The MLP input dimension is the sum of the attention head dimensions, so a student with fewer heads will have a smaller MLP than the teacher, which is preferable in terms of efficiency.
Fixing the per-head dimension is a widely adopted setup in practice, such as in the Llama series (Touvron et al., ).
We now additionally consider two other ways to vary the model size.
In particular, we vary the number of heads, while
1) fixing the hidden dimension (i.e. the total dimension of all heads concatenated) to be 256,
or 2) fixing the dimension of each head to be 256 and averaging the output from each head, in which case the hidden dimension is also 256.
These two setups are less common in practice but nevertheless serves as complementary evidence: the performance difference comes solely from the number of attention heads, as the MLP dimension is kept the same.
As shown in Figure 10 (b,c), increasing the number of attention also increases the training speed in these two setups.

Figure: (a) Per-head dimension = 8
Refer to caption: extracted/5908367/plots/L1F6_2layer_headDim8.png

Figure: Figure 11: In-support attention growth co-occurs with accuracy increase Attention on individual coordinates on or off the support of the sparse parity, taking the median of 1024 random binary input sequences. The shade highlights the teacher’s phase transition period. The model accuracy is marked by the gray dashed line, with scale adjusted for better display. The two subfigures show the same type of results but with different randomness seeds.
Refer to caption: extracted/5908367/plots/attn_patterns/L1F6_gpt2_L2H16_attn_support_sum_paths_median_seed35.png

###### Ablation with 2-shot distillation

We repeat the 2-shot distillation ablation for MLP.
We first confirm that the low-degree curriculum described in Section 3.1 is also observed in Transformers.
As shown in Figure 12, the 2-layer 32-head teacher model exhibits significantly higher correlation with the in-support monomials (i.e. $\{x_{i}\}_{i\in\mathbf{S}}$ than with off-support monomials during the phase transition.
(^15^1515Note that the upper right subplot in Figure 12 has a second correlation spike with the in-support variables. However, supervising with this second checkpoint does not provide acceleration. This suggests that there might be mechanisms other than the low-degree curriculum at play.)
Then, we show in Figure 13 that using as few as 1 intermediate checkpoint suffices to significantly speeds up the training of the student.

Figure: Figure 12: Low-degree curriculum in Transformers on (100, 6)-sparse parity. The $x$-axis shows the training steps, and $y$-axis shows the 2-layer 32-head teacher’s correlation with in-support (orange lines) vs off-support (blue lines, aggregated into mean and standard deviation) degree-1 monomials. The black dotted lines mark the accuracy, scaled for better display. The correlation values are calculated using 100k randomly drawn sequences. The 4 subplots correspond to models trained using 4 random seeds.
Refer to caption: extracted/5908367/plots/L1F6_corr_gpt_L2H32_seed14_deg1.png

Figure: Figure 13: 2-shot progressive distillation with Transformers: Compared to cross-entropy training or one-shot distillation, transformers learn faster with progressive distillation, where the intermediate checkpoints are taken either at regular 10k intervals (“progressive”), or during the phase transition (“progressive (2-shot)”). The two vertical lines show the teacher training steps at which the two checkpoints for 2-shot distillation are chosen. We set the teacher temperature to be $\tau=10^{-4}$ for progressive distillation, and $\tau=1$ for one-shot distillation.
Refer to caption: extracted/5908367/plots/L1F6_2layer_distill_headDim8_with2shot.png

###### Ablation with various temperatures

As mentioned in Section 2, our progressive distillation results use a low temperature in order to remove potential favorable regularization effects from soft labels.
We chose a temperature of $\tau=10^{-4}$ for sparse parity, where the output dimension is 2.
In Figure 14, we empirically confirm that setting the temperature to be below 0.01 is sufficient to get results that are qualitatively similar to using $\tau=0$ (i.e. taking the argmax).
Note that using a higher temperature such as $\tau=1$ can make learning slower
despite potentially having more regularization effects from softer labels.
We leave understanding the exact effect of temperature to future work.

Figure: Figure 14: The benefit of progressive distillation holds with hard labels, as shown by comparing 2-shot progressive distillation with different temperatures. The two gray vertical lines mark the training steps at which the teacher checkpoints are taken.
Refer to caption: extracted/5908367/plots/L1F6_2layer_distill_headDim8_temp.png

##### C.2.1 Two Transformer solutions for sparse parity ( Proposition C.1 and Proposition C.3 )

We consider a simplified version of a Transformer block, without the residual connection or the layernorm:

$$ $f_{\mathrm{block}}=f_{\mathrm{mlp}}^{(L)}\circ f_{\mathrm{attn}},$ $$

where

$$ $f_{\mathrm{attn}}(X;W_{Q},W_{K},W_{V}):=\mathsf{CausalAttn}(XW_{Q}W_{K}^{\top} X^{\top})XW_{V},$ $$

with $W_{Q},W_{K},W_{V}$ being the query, key, value matrices,
and $f_{\mathrm{mlp}}^{(L)}(x;\{W_{l},b_{l}\}_{l\in[L]})$ is a $L$-layer MLP that recursively apply $f_{\mathrm{mlp}}^{(l+1)}(x)=\sigma(W_{l+1}f_{\mathrm{mlp}}^{(l)}(x)+b_{l+1})$ position-wise.
$\sigma$ is the relu function for $l\in[L-1]$, and is the identity function for $l=L$.

###### Proposition C.1 (Attention support selection) .

$(d,k)$-sparse parity can be solved by a 1-layer Transformer with a 2-layer MLP, whose attention weights satisfy $\alpha_{i,d}\propto\exp(c\mathbbm{1}[i\in\mathbf{S}])$ for some large constant $c>0$.
The MLP has hidden dimension $4(k+1)$, $L_{\infty}$ norm bounded by $4k(k+1)$.

###### Proof.

The idea is that the attention selects the $k$ in-support variables, and the MLP computes the product of these variables.

To select the in-support variables, we want the attention weight $\alpha_{i,d}\propto\exp(c\mathbbm{1}[i\in\mathbf{S}])$, for some large constant $c$.
This can be achieved by having the projection matrices $W_{Q},W_{K}$ focus only on the position and ignore the tokens.
In particular, let $z$ denote the input sequence, and let the embedding of a token be ${\bm{x}}_{i}={\bm{v}}_{z_{i}}+p_{i}$, where $\{{\bm{v}}_{0},{\bm{v}}_{1}\}$ are embeddings for the binary token 0 or 1, and $p_{i}$ is the position encoding for position $i$.
Take $\{{\bm{v}}_{0},{\bm{v}}_{1}\}$, $\{p_{i}\}_{i}$ such that ${\bm{v}}_{z_{i}}\bot p_{i}$.
Let $c>0$ be a large enough constant.
Choose $W_{Q},W_{K}$ such that for any $i\in[d]$, ${\bm{x}}_{i}^{\top}W_{Q}^{\top}W_{K}{\bm{x}}_{d}=p_{i}^{\top}W_{Q}^{\top}W_{K}
p_{d}=c\cdot\mathbbm{1}[i\in\mathbf{S}]$.
This ensures that $\alpha_{i,d}\propto\exp(c\mathbbm{1}[i\in\mathbf{S}])$.

Then, the role of attention is to average over the in-support tokens.
For simplicity of exposition, let’s take $c\rightarrow\infty$ for now (i.e. using saturated attention (Merrill et al., )), so that $\alpha_{i,n}\rightarrow\frac{\mathbbm{1}[i\in\mathbf{S}]}{k}$; that is, the attention weights at the last position average over the in-support variables.
Take $W_{V}$ to be a vector, such that $W_{V}$ ignores the positional information and the input token 0, and only preserves the input token 1, i.e. $W_{V}p_{i}=0$, $\forall i\in[d]$,
$W_{V}{\bm{v}}_{0}=0$,
and $W_{V}{\bm{v}}_{1}=1$.

Next, the MLP needs to compute the parity function over the $k$ in-support variables.
The input to the MLP is hence proportional to $(\sum_{i\in\mathbf{S}}\mathbbm{I}[z_{i}=1]){\bm{v}}_{1}$, and the size of the set of inputs is $k+1$.
To determine the size of the MLP, we use the following lemma:

###### Lemma C.2 (1D discrete function interpolation with an MLP (Lemma 1 in Liu et al. ( 2022 ) )) .

Let $\mathcal{X}$ be a finite subset of $\mathbb{R}$, such that $|x|\leq B_{x}$ for all $x\in{\mathcal{X}}$, and $|x-x^{\prime}|\geq\Delta$ for all $x\neq x^{\prime}\in\mathcal{X}$.
Let $f:\mathcal{X}\rightarrow\mathbb{R}^{d}$ be such that $\left\|f(x)\right\|_{\infty}\leq B_{y}$ for all $x\in{\mathcal{X}}$. Then, there is a 2-layer ReLU network for which

$$ $f_{\mathrm{mlp}}(x+\xi;\theta_{\mathrm{mlp}})=f(x)\qquad\forall x\in{\mathcal{ X}},\quad|\xi|\leq\Delta/4.$ $$

The inner dimension is $d^{\prime}=4|{\mathcal{X}}|$, and the weights satisfy

$$ $\left\|W_{1}\right\|_{\infty}\leq\frac{4}{\Delta},\quad\left\|b_{1}\right\|_{ \infty}\leq\frac{4B_{x}}{\Delta}+2,\quad\left\|W_{2}\right\|_{\infty}\leq B_{y },\quad b_{2}=0.$ $$

Setting $B_{x}=1$, $B_{y}=1$, and $\Delta=\frac{1}{|\mathbf{S}|}$,
the parity function over these $k+1$ input values can be approximated by a 2-layer MLP with inner dimension $4(k+1)$, with norm bounded by $4k(k+1)$.

As a concrete example, one way to satisfy the requirements above is to set the attention weights to ${\bm{v}}_{1}=W_{V}={\bm{e}}_{1}:=[1,0,0,0]$, ${\bm{v}}_{0}={\bm{e}}_{2}:=[0,1,0,0]$.
Set $p_{i}=p_{n}={\bm{e}}_{3}$ for $i\in\mathbf{S}$, and $p_{i}={\bm{e}}_{4}$ for $i\not\in\mathbf{S}$.
Set $W_{Q}=W_{K}=c\begin{bmatrix}0&0&1&0\\
0&0&0&0\end{bmatrix}$ for some sufficiently large $c>0$.

∎

###### Proposition C.3 (No attention selection) .

There exists a 1-layer Transformer with 3-layer MLP that computes $k$-sparse parity, whose attention weights satisfy $\alpha_{i,d}=\frac{1}{d}$.
Consequently, the MLP computes the sparse parity function given the full set of variables.

###### Proof.

The idea is for the uniform attention to copy all tokens to the last position.
However, unlike in Proposition C.1, the attention needs to copy the tokens into a length-$d$ embedding vector, as we need to preserve the position information in this embedding vector.
We need to generalize Lemma C.2 accordingly to handle multi-dimensional inputs:

###### Lemma C.4 (General discrete function interpolation with an MLP; (Lemma 2 in Liu et al. ( 2022 ) )) .

Let $\mathcal{X}$ be a finite subset of $\mathbb{R}^{d_{\mathrm{in}}}$, such that $\left\|x\right\|_{\infty}\leq B_{x}$ for all $x\in{\mathcal{X}}$, and $\left\|x-x^{\prime}\right\|_{\infty}\geq\Delta$ for all $x\neq x^{\prime}\in\mathcal{X}$.
Let $f:\mathcal{X}\rightarrow\mathbb{R}^{d_{\mathrm{out}}}$ be such that $\left\|f(x)\right\|_{\infty}\leq B_{y}$ for all $x\in{\mathcal{X}}$. Then, there is a 3-layer ReLU network for which

$$ $f_{\mathrm{mlp}}(x+\xi;\theta_{\mathrm{mlp}})=f(x)\qquad\forall x\in{\mathcal{ X}},\quad|\xi|\leq\Delta/4.$ $$

Letting ${\mathcal{X}}_{i}$ denote the set of unique values in coordinate $i$,
the inner MLP dimensions are as follows:

$$ $d_{1}=4\sum_{i\in[d_{\mathrm{in}}]}|\mathcal{X}_{i}|,\quad d_{2}=|{\mathcal{X} }|.$ $$

The weights satisfy

$$ $\left\|W_{1}\right\|_{\infty}\leq\frac{4}{\Delta},\quad\left\|b_{1}\right\|_{ \infty}\leq\frac{4B_{x}}{\Delta}+2,\quad\left\|W_{2}\right\|_{\infty}\leq 1, \quad\left\|b_{2}\right\|_{\infty}\leq d_{\mathrm{in}},\quad\left\|W_{3}\right \|_{\infty}\leq B_{y},\quad b_{3}=0.$ $$

Then, the MLP at the last position computes the sparse parity over the $k$ coordinates while ignoring the others.
Hence the effective input set is $|\mathcal{X}|=2^{k}$.
Setting $B_{x}=1$, $B_{y}=1$, and $\Delta=1$,
there exists a 3-layer MLP with width $2^{k}$ and norm bound $2^{k+2}$ by Lemma C.4.
∎

###### Proposition C.1 (Attention support selection) .

###### Proof.

###### Lemma C.2 (1D discrete function interpolation with an MLP (Lemma 1 in Liu et al. ( 2022 ) )) .

###### Proposition C.3 (No attention selection) .

###### Proof.

###### Lemma C.4 (General discrete function interpolation with an MLP; (Lemma 2 in Liu et al. ( 2022 ) )) .

###### Preliminary interpretability analysis: Transformer does utilize attention in practice

We observe that the model focuses attention on relevant tokens and that the amount of attention weights put on the support is tightly correlated with the accuracy, which suggests that the model indeed utilizes the attention mechanism in learning sparse parity.

Specifically, Figure 11 shows the results on 2-layer 16-head GPT-2 models.
The attention weights are for the final position,
whose logits are used for computing the binary parity label for the entire sequence.
We track the attention weights along length-2 paths from the first and the second layer.
For example, for a single-head model,
let $\mathbf{a}^{(l)}_{i}\in\Delta^{d-1}$ denote the $l_{th}$-layer attention vector at the $i_{th}$ position;
then, the on-support attention for a given sample is computed as $\langle\mathbf{a}^{(2)}_{d}),\mathbf{v}^{(1)}_{\mathcal{T}}\rangle$,
where $[\mathbf{v}^{(1)}_{\mathcal{T}}]_{i}:=\sum_{j\in\mathcal{T}}\mathbf{a}^{(1)}_{
i}[j]$ is the total amount of
first-layer attention weights that the $i_{th}$ position puts on the support $\mathcal{T}$.
For multi-head models, $\mathbf{a}^{(l)}_{i}\in\Delta^{d-1}$ is defined as the sum of attention vectors from all heads, and the rest is computed similarly.

#### C.3 A hierarchical generalization of sparse parity

This section considers an extension of sparse parity, where the labels are given by a decision tree.
Sparse parity can be considered as a special case with tree depth 1.

Figure: (a) Width-100 student.
Refer to caption: x9.png

Figure: Figure 16: An illustration of hierarchical data generation, for a $3$-level tree with $3$ variables per feature. A feature corresponds to a tree node, each marked by a rectangle. The product of the binary variables in a feature determines which child to take: the left child is chosen if the product evaluates to $-1$, and the right child is chosen if the product is $+1$. The final label for an example is decided based on the tree leaf reached.
Refer to caption: x11.png

###### Definition:

The input $\mathbf{x}$ is a boolean vector picked uniformly at random from the $d$-dimensional hypercube $\{\pm 1\}^{d}$,
and the label $y\in[K]$ where $K:=2^{D}$ for some fixed $D\in\mathbb{N}$.
The underlying labeling function for $y$ follows a binary decision tree of depth $D$,
whose leaves correspond to class labels.
The branching at a node depends on a sparse parity problem.
An example visualization is provided in Figure 16.

More formally, the nodes in the decision tree are represented by a set of sparse parity problems $\mathbb{S}=\{\mathcal{T}_{1},\mathcal{T}_{2},\cdots,\mathcal{T}_{K-1}\}$, where $\mathcal{T}_{j}$ is determined by product of a subset of size $k$ variables selected from the dimensions of the input $\mathbf{x}$ (e.g. $x_{1}x_{2}\cdots x_{5}$ for $k=5$). An input $\mathbf{x}$ belongs to the class $i\in[K]$ iff

$$ $\displaystyle[\prod_{j=1}^{D}\mathbb{I}\left[c(i,j)\mathcal{T}_{v^{(i)}_{j}}( \mathbf{x})>0\right]>0,\quad\text{where}$ $\displaystyle c(i,j)=\begin{cases}1,&\text{ if }i\geq 2^{D-j}\\ -1,&\text{otherwise}\end{cases}$ $$

Here, $v^{(i)}_{1},\cdots v^{(i)}_{D}$ denote the features in $\mathbb{S}$ that lie on the path joining the root of the decision tree to the leaf representing the label $i$. An example is given in Figure 16.

Figure: Figure 17: Setting: 8-way classification using a hierarchical decision tree of depth 3, with each node represented by 5-sparse parity. The relevant features for class $y=1$ are $x_{1}\cdots x_{5},x_{6}\cdots x_{10},x_{16}\cdots x_{20}$ at tree levels $3,2,$ and $1$ respectively (Figure 16). The irrelevant features are $x_{36},\cdots,x_{100}$. Here we plot the magnitude of correlation to degree-1 monomials $\mathbb{E}_{\mathbf{x},y}[p_{\mathcal{T}}(\mathbf{x})]_{1}x_{i}$ for each $i$ in the relevant feature groups for class 0 0. Because the degree-1 monomials show noisy correlations, we also report the magnitude of correlation to degree-2 monomials $\mathbb{E}_{\mathbf{x},y}[p_{\mathcal{T}}(\mathbf{x})]_{1}x_{i}x_{j}$ for each $i,j$ in the relevant feature groups for class $1$. For degree-2 monomials, rest refers to correlation to monomials of the form $x_{i}x_{j}$ where atleast one variable is outside support variables ($x_{3}6,\cdots,x_{1}00$). The correlations to degree-1 (or 2) monomials on the relevant features spike at different training steps.
Refer to caption: x12.png

Figure: Figure 18: Setting: $8$-way classification using a hierarchical decision tree of depth $3$, with each node represented by $5$-sparse parity. $(3,2M)$-progressive distillation from $3$ checkpoints on a 1000 width student; $2$ intermediate teacher checkpoints are used each for $2M$ steps, and then the final checkpoint is used till end of training. Observations: (a) Teacher shows a phase transition in accuracy during training. $6$ candidate checkpoints for $(3,2M)$-progressive distillation have been marked, out of which $2$ are selected in each setting. The checkpoint at $6M$ lies outside the phase transition of the teacher. (b): We show the behavior of a few representative settings. Two main observations: (1) Selecting only a single checkpoint during the phase transition of the teacher is sub-optimal, as shown by plots that contain $6M$ checkpoint as an intermediate checkpoint, (2) $2$ checkpoints during the stage transition suffice to train the student to $100\%$ accuracy, however the performance can heavily depend on their selection. Figure 17 shows that the teacher learns the low-level features at $4.5M$ checkpoint, making it crucial for distillation. (c): Even with extremely low temperature, the benefit of the phase transition checkpoint persists, suggesting that the monomial curriculum, not regularization, is the key to the success of progressive distillation.
Refer to caption: x14.png

Figure: Figure 19: Same experiments as Figure 18 for a width-100 student.
Refer to caption: x17.png

###### Experiment Setup:

In this section, we focus on $8$-way classification, where the data is generated by a tree of depth
$3$.
Each feature in $\mathbb{S}$ is given by a product of $5$ variables.
We keep the variables distinct in each feature, i.e., $\mathcal{T}_{1}=x_{1}x_{2}\cdots x_{5}$, $\mathcal{T}_{2}=x_{6}x_{7}\cdots x_{10}$ and so on.

###### Experiments and Observations:

We conduct similar experiments as our sparse parity experiments.
In Figure 15, we show that progressive distillation helps train a smaller student as fast as the teacher, and even reach $100\%$ accuracy.

###### Low-degree curriculum:

We show the correlations of the teacher’s logits for a particular label and its relevant features in Figure 17. We observe similar spikes in the degree-1 monomials involving the support of the features. However, because there are multiple features defining a label class, with features at level $1$ being shared among multiple labels, we see a difference in the time-frames at which the spikes appear in the degree-1 monomials of the features. As such, a single teacher checkpoint won’t give information of entire support to a student to learn from.

###### Effectiveness of ( 3 , T ) 3 𝑇 (3,T) ( 3 , italic_T ) -progressive distillation:

We consider progressive distillation with $3$ checkpoints, where the student only uses $2$ intermediate teacher checkpoint in addition to the final one. We show in Figure 18 that there exists a $(3,2M)$-progressive distillation that can help train a student successfully. Furthermore, we demonstrate that these two intermediate checkpoints must be positioned within the phase transition to achieve $100\%$ accuracy in training the student. This supports the hypothesis that a low-degree curriculum is crucial for progressive distillation since the correlations with degree-1 monomials are high only during the phase transition period. Additionally, we find that a distillation strategy with only a single intermediate checkpoint and the final checkpoint is insufficient for the student to achieve $100\%$ accuracy, which aligns with our observation that degree-1 monomials for different features emerge at different steps. However, we also note that even within the phase transition, the optimal selection of the two checkpoints can significantly impact the student model’s performance.

### Appendix D Extensive study on PCFGs

#### D.1 A formal description of PCFGs

We study progressive distillation using probabilistic context free grammar (PCFG).
Compared to sparse parity and hierarchical data, PCFG is a more realistic proxy for natural languages and has been commonly used as a sandbox for mechanistically understanding the training of language models (Zhao et al., ; Allen-Zhu & Li, ).
A PCFG consists of a set of non-terminals (NTs) and grammar rules involving the non-terminals that specify the generation process of a sentence.
For example, for the sentence The cat ran away, the grammatical structure dictates words the, cat, ran, away as determinant, noun, verb, and adverb. ran and away together represent a verb phrase, and the, cat together represent a noun phrase (see Figure 3).
For a language model to generate grammatically correct sentences, it needs to learn the underlying grammatical rules.

A probabilistic context-free grammar (PCFG)
is defined as a 4-tuple ${\mathcal{G}}=({\mathcal{N}},v,{\mathcal{R}},{\mathcal{P}})$, where

- •
${\mathcal{N}}$ is the set of non-terminals, which can be considered as internal nodes of a parse tree. There is a special non-terminal $S$, known as the start symbol.
- •
$[v]$ is the set of all possible words, corresponding to parse tree leaves.
- •
${\mathcal{R}}$ denotes a set of rules. For all $A,B,C\in{\mathcal{N}}$, there is a rule $A\to BC$ in ${\mathcal{R}}$. Furthermore, there are rules $A\to w$ for all $A\in{\mathcal{N}},w\in[v]$.
- •
${\mathcal{P}}$ specifies the probability of each rule to be used in the generation process. For a rule $r\in{\mathcal{R}}$, if ${\mathcal{P}}[r]=0$, then the rule is an invalid rule under the generation process. Furthermore, for each non-terminal $A\in{\mathcal{N}}$, on all rules $r\in{\mathcal{R}}$ of the form $A\to\cdot$, $\sum_{r\in{\mathcal{R}}:r=A\to\cdot}{\mathcal{P}}(r)=1$. We denote ${\mathcal{R}}(A)$ as the set of all non-zero rules from $A$.

A concrete example of PCFGs is to model grammars of natural languages (Jurafsky, ). In this case, language tokens form the vocabulary of PCFG, while parts of speech such as nouns, verbs or noun phrases, verb phrases form the non-terminals.
Rules like noun phrases being composed of a determinant and a noun form the core of such PCFG, while the probability of each rule is determined by their occurrences across sentences in the language.

###### Data generation from PCFG

Given a PCFG ${\mathcal{G}}=({\mathcal{N}},v,{\mathcal{R}},{\mathcal{P}})$, a string is generated in a recursive fashion as follows:
we start with $s_{1}=\text{ROOT}$ at step 1, and maintain a string $s_{t}\in([v]\cup{\mathcal{N}})^{*}$ at step $t$.
At step $t$, if all characters in $s_{t}$ belong to $[v]$, the generation process terminates, and $s_{t}$ is the resulting string. Otherwise, for each character $A\in s_{t}$, if $A\in{\mathcal{N}}$, we sample a rule $r\in{\mathcal{R}}$ of the form $A\to\cdot$ with probability ${\mathcal{P}}(r)$ and replace $A$ by characters given by $r(A).$

###### Tracking n 𝑛 n italic_n -grams

As outlined in Section 4, we track the behavior of trained models by measuring the behavior of their output on the neighboring $n$-gram context.
In the context of PCFGs and masked language modeling for BERT, Zhao et al. () theoretically demonstrate that one of the optimal algorithms for predicting masked tokens is a dynamic programming algorithm based on the inside-outside algorithm (textbook reference: Jurafsky ()).
This algorithm computes “inside probabilities” for spans of tokens of various lengths, representing pairwise token dependencies within those spans. For example, in the setting of Figure 3, the inside probability for the span “The cat” indicates the likelihood that these two tokens co-occur. The dynamic programming approach calculates these inside probabilities hierarchically, with smaller spans forming the basis for larger spans. The model’s performance ultimately depends on how accurately it represents span probabilities across different lengths. For instance, if the token “cat” is masked in the sentence “The cat ran away”, the success of the model depends on the representation of the likelihood of the spans “The cat”, “cat ran”, “The cat ran”, and “The cat ran away”. We denote the neighboring tokens in the $n$-gram window span of a token as its $n$-gram context.

#### D.2 Variants of progressive distillation

Comparisons at different lengths We follow common practices for training self-attention models for both one-shot distillation and progressive distillation. We use Adam optimizer (Kingma & Ba, ), $512$ batch size training (to imitate large batch training), and a cosine learning rate schedule (Loshchilov & Hutter, ) which is generally used to train large language models.
As cosine learning rate depends on the total training horizon, in order to show that progressive distillation converges faster than one-shot distillation,
we compare the two algorithms by varying the number of training samples for the student. That is, we train the teacher model with $4\times 10^{6}$ training samples (equal to $8000$ steps), and compare the two algorithms for a student model at $\{1,2,4,8\}\times 10^{6}$ training samples (equal to $\{2000,4000,8000,16000\}$ steps).

Progressive Distillation choices Because we are considering comparisons at different training lengths for the student, we have to consider a more general version of progressive distillation introduced in Definition 2.2. In Definition 2.2, progressive distillation is defined by two parameters, (a) number of teacher checkpoints (${N}$) for supervision, and (b) training steps per checkpoint. We define our selection criteria for the ${N}$ checkpoints later. However, after selecting the ${N}$ checkpoints, we have the following two variants of progressive distillation.

- 1.
${N}$-shot Equal-split distillation: Here, we simply split the entire student’s training length into ${N}$ equal intervals, where the student is supervised by the $i$th teacher checkpoint in interval $i\in[{N}]$.
- 2.
${N}$-shot $\kappa T_{0}$-Equal-split distillation: Here $\kappa\in(0,1]$, and $T_{0}$ refers to the total training length of the teacher.
The idea is to decide the allocation on the basis of the training length of the teacher, instead of the training length for the student.
We train the student under the supervision of each checkpoint for $\kappa T_{0}/{N}$ training steps.
Teacher checkpoints that fail to fit into the student’s supervision schedule are ignored (corresponding to a large $\kappa$), and the final checkpoint is kept till the end of training if the student is trained for longer than $\kappa T_{0}$. We can view $\frac{1}{\kappa}$ as the amount of “speed up”; for instance, we recover one-shot distillation with $\kappa\rightarrow 0$.
Our experiments (Section D.2) suggest that $\kappa=1/2$ is a reasonable rule of thumb that can help the student learn faster than the teacher at any given training length.

In the main paper, in Figures 1, 6 and 5, we have reported performance on PCFG and Wikipedia for ${N}$-shot $T_{0}$-Equal-split distillation as progressive distillation. We conduct more ablation studies on $\kappa$ in Section D.2.
We keep the exploration of optimal strategies of progressive distillation to future work.

Selection criteria for ${N}$ teacher checkpoints: While there are multiple ways in which one can pick the reference checkpoints to train the student model, we use a simple strategy which is sufficient to demonstrate the benefit of progressive distillation. Similar to our observation of transition phase for parity in Section 3, we search for transition phases in the loss behavior of the teacher and select the first teacher checkpoint roughly in the middle of the transition phase. The rest are picked at multiples of this initial checkpoint.

#### D.3 Details on Non-terminal prediction with
Multi-head linear probing

Following Allen-Zhu & Li (), we train a position-based linear attention on the model’s embeddings to predict the non-terminals at each level of underlying PCFG. We consider a set of linear functions $f_{r}:\mathbb{R}^{d}\to\mathbb{R}^{|{\mathcal{N}}|}$, where $r\in[H]$ and $H$ is the number of “heads” in the linear attention model. If ${\bm{e}}_{1},\cdots,{\bm{e}}_{L}$ denote the model’s output embeddings for a sequence ${\bm{x}}_{1},\cdots,{\bm{x}}_{L}$, then the prediction of the model at each index $i\in[L]$ is given by

$$ $\displaystyle G_{i}(x)$ $\displaystyle=\sum_{r\in[H],k\in[L]}w_{r,i\to k}f_{r}({\bm{e}}_{k}),$ $\displaystyle w_{r,i\to k}=\frac{exp(\langle P_{i,r},P_{k,r}\rangle)}{\sum_{k^ {\prime}\in[L]}exp(\langle P_{i,r},P_{k^{\prime},r}\rangle)},$ $$

for trainable parameters $P_{i,r}\in\mathbb{R}^{d}$. We train the parameters with logistic regression on $51200$ examples and test on a validation set of $1024$ examples.

#### D.4 Details on the synthetic PCFGs

We use $5$ synthetic PCFGs considered by Allen-Zhu & Li () (please see Figure 20 for the rules involved in the PCFGs). These $5$ PCFGs differ in difficulty, based on the number of rules per non-terminal and the ambiguities in the rules per non-terminal. Under a PCFG, each string is generated by generation trees of depth $7$. We give differences in the PCFGs, as outlined by Allen-Zhu & Li () below.

- •
In cfg3b, the PCFG is constructed such that the degree $\left|{\mathcal{R}}(A)\right|=2$ for every non-terminal $A$. In any generation rule, consecutive pairs of symbols on the generated symbols are distinct. The $25\%,50\%,75\%,$ and $95\%$ percentile string lengths generated by the PCFG are $251,278,308,342$ respectively.
- •
In cfg3i, $\left|{\mathcal{R}}(A)\right|=2$ for every non-terminal $A$. However, the consecutive pairs of symbols needn’t be distinct in generation rules. he $25\%,50\%,75\%,$ and $95\%$ percentile string lengths generated by the PCFG are $276,307,340,386$ respectively.
- •
In cfg3h, $\left|{\mathcal{R}}(A)\right|\in\{2,3\}$ for every non-terminal $A$.
he $25\%,50\%,75\%,$ and $95\%$ percentile string lengths generated by the PCFG are $202,238,270,300$ respectively.
- •
In cfg3g, $\left|{\mathcal{R}}(A)\right|=3$ for every non-terminal $A$. he $25\%,50\%,75\%,$ and $95\%$ percentile string lengths generated by the PCFG are $212,258,294,341$ respectively.
- •
In cfg3f, $\left|{\mathcal{R}}(A)\right|\in\{3,4\}$ for every non-terminal $A$. he $25\%,50\%,75\%,$ and $95\%$ percentile string lengths generated by the PCFG are $191,247,302,364$ respectively.

Figure: Figure 20: The synthetic PCFGs considered from Allen-Zhu & Li (). Vocabulary is $\{1,2,3\}$ in each setting. More details on the differences between the PCFGs are in Section D.4.
Refer to caption: x20.png

#### D.5 Extensive experiments on BERT

We first give some details on the architecture of BERT and its pre-training loss function.

##### D.5.1 A primer on BERT

BERT (Devlin et al., ) is an encoder-only transformer that is trained with masked language modeling (MLM) (Figure 21). In encoder-only architecture, the contextual information are shared across the tokens using bidirectional self-attention layers. During pre-training, the model is trained with MLM loss, that perturbs certain fraction of the tokens in the input at random and the model is trained to predict the original tokens at positions of the perturbed tokens. The pre-training recipe follows a 80-10-10 principle, where tokens at $80\%$ of the perturbed positions are replaced by a special $\langle mask\rangle$ token, while tokens at $10\%$ of the perturbed positions are replaced by random tokens from the vocabulary, while remaining positions are filled with the original tokens themselves. We stick to this principle, while creating data for training from different PCFGs.

###### Model architecture considered:

We train depth-4 BERT models with $\{8,16,32\}$ attention heads, each of which operates on $8$ dimensions, using a $30\%$ masking rate. The head dimension is fixed to $8$, with the corresponding width of the $4$ models being $\{64,128,256\}$ respectively.

Figure: Figure 21: An informal representation of BERT (Devlin et al., ). The model uses bidirectional attention layers to share contextual information across the tokens. During pre-training, few of input tokens are replaced by special $<mask>$ tokens, and the model is trained to predict the masked tokens.
Refer to caption: x21.png

##### D.5.2 Data Generations

Data for masked language modeling:
We generate $8\times 10^{6}$ random sequences for each PCFG.
We follow Devlin et al. () to create masked input sequences and output labels, i.e. for each sampled sequence we mask $p\%$ of tokens for input and the labels are given by the tokens in the masked positions of the original sequence. We also follow the 80-10-10 principle, where for input, the tokens in $80\%$ of the masked positions are represented by a special mask token $[mask]$, while $10\%$ of the masked positions are represented by a randomly sampled token from the vocabulary and the remaining $10\%$ are represented by tokens from the original sequence.

#### D.6 Hyperparameter details

We use a batch size of $512$ in each setting. We use Adam (Kingma & Ba, ) optimizer with 0 0 weight decay, $\beta_{1},\beta_{2}=(0.9,0.95)$. We use cosine decay learning rate. We extensively tune the learning rate in the grid $\{10^{-2},7.5\times 10^{-3},5\times 10^{-3},2.5\times 10^{-3},10^{-3}\}$ in each setting. We train the teacher on $4\times 10^{6}$ training samples (equal to $8\times 10^{3}$ steps).

###### Distillation experiments at different training horizons:

To thoroughly compare the sample complexity requirements of one-shot and progressive distillation, we evaluate both algorithms using a smaller student model across various training sample sizes. The smaller student is trained with $\{1,2,4,8\}\times 10^{6}$ training samples (equal to $\{2\times 10^{3},4\times 10^{3},8\times 10^{3},16\times 10^{3}\}$ training steps) and the performance is compared in each horizon. For example, Figure 1 (right) plot contains $4$ distinct points for each method which represents the performance of the smaller model under the $4$ different training steps (sample sizes).

###### Training split for ( 2 , T ) 2 𝑇 (2,T) ( 2 , italic_T ) -progressive distillation for PCFGs:

We report the performance in Figure 4 for $4000$ training steps. We find the best training time split $T$ between the intermediate checkpoint and the final checkpoint in the grid $\{500,1000,15000,2000\}$, i.e. the student is trained with the logits of the first intermediate teacher checkpoint till step $T$ and then the teacher is switched to the final teacher checkpoint.

Low-temperature distillation:
We focus on distillation with a small temperature of $\tau=10^{-4}$ (in Equation 1), for the following reasons.
First, as discussed in Section 3, it removes any potential regularization effects induced by soft labels.
Moreover, using such a small temperature corresponds to training with the top-$1$ predictions of the teacher model, which is more memory-efficient compared to training with the full teacher logits, especially when the vocabulary size is large.

#### D.7 Additional Curriculum probing on the teacher’s checkpoints

Figure: Figure 22: We conduct additional probing experiments on the teacher’s ($4$ layer, $32$ attention head BERT) logits during training to indicate curriculum learning. (left) TV distance between model’s predictions with full context and context with only $n$-gram tokens ($M_{\text{close}}$). We observe that the teacher’s logits get closer to higher $n$-gram context predictions, and the inflection appears at the middle of the second phase (our first selected checkpoint for progressive distillation) (right) Performance of linear classifier probe on teacher’s intermediate checkpoints to predict the non-terminals at different levels of the PCFG generation tree. We observe that the probe’s performance is $>95\%$ of the final probe performance by the middle of the second phase, indicating the model has almost learned the underlying PCFG features by this time.
Refer to caption: x22.png

In this section, we study the performance of different progressive distillation variants and compare them to one-shot distillation. As per our experiments in Figure 4, we use the $8$ teacher checkpoints selected for supervision. In Figure 24, we compare one-shot distillation to the two variants of progressive distillation, i.e. $8$-shot Equal-split and $8$-shot $\frac{T_{0}}{2}$-Equal-split distillation.
We observe that both variants of progressive distillation help the student learn faster than one-shot distillation, and the gap diminishes as the students are trained for longer.
The optimal strategy for progressive distillation depends on the training budget for the student.
For training steps lower than the teacher’s $T_{0}$ budget, $\frac{T_{0}}{2}$-Equal-split distillation slightly performs better than $T_{0}$-Equal-split distillation, which changes as we train longer. To keep things simple, we focus on $\frac{T_{0}}{2}$-Equal-split progressive distillation in all of our subsequent experiments.

Figure: Figure 23: Comparison of BERT’s training behavior on cfg3b with varying numbers of attention heads (where the embedding dimension scales linearly with the number of attention heads) over $8\times 10^{3}$ training steps. The x-axis represents the number of training steps and is in log scale. Larger BERT models show an earlier and more pronounced drop in loss/increase in accuracy compared to smaller models. For reference, each training curve is annotated at the point where the model reaches $80\%$ of its performance at the final step.
Refer to caption: x24.png

Figure: Figure 24: Experiments on BERT (Left to right/top to bottom): (a), (b) show the comparisons for an 8-attention head student, (c), (d) show the comparisons for a 16-attention head student. We observe differences between the different variants of progressive distillation at different training steps. For training steps lower than the teacher’s (marked by $T_{0}$), $T_{0}/2$-Equal-split progressive distillation is better, implying that for shorter training, we shouldn’t try to fit all the teacher’s checkpoints. The trend reverses as the training sample budget approaches $T_{0}$ and beyond.
Refer to caption: x26.png

#### D.8 Ablations with hyperparameters

###### Ablation with temperature

Here, we compare progressive distillation and one-shot distillation at temperature $1$ and temperature $10^{-4}$ (representing hard label supervision) (Figure 25). We observe that progressive distillation at temperature $10^{-4}$ performs better than one-shot distillation at both temperatures. However, progressive distillation at temperature $1$ can perform worse than one-shot distillation for a stronger student. We keep explorations on the effect of temperature on the algorithms as future work.

Figure: (a) Number of heads=8
Refer to caption: x30.png

###### Ablation with mask rate

In Figure 26, we compare progressive distillation with one-shot distillation at different masking rates. We observe that at all masking rates, progressive distillation performs better than one-shot distillation.

Figure: Figure 26: The experiments above compare progressive distillation and one-shot distillation for PCFGs cfg3b at different masking rates using a BERT model with $8$ attention heads, per head dimension $8$, and $4$ layers. The relative gap between the performance of progressive distillation and one-shot distillation have been reported on the bar plots. We observe that progressive distillation performs better than one-shot distillation at all masking rates, with the gap diminishing with the number of training steps. Here, we use $\frac{T_{0}}{2}$-Equal-split progressive distillation as progressive distillation, where $T_{0}=8000$ is the total number steps used for teacher training.
Refer to caption: x32.png

###### Ablation with difficulty of PCFG

In Figure 27, we compare progressive distillation with one-shot distillation with increasing difficulty of the underlying PCFG. The benefit of progressive distillation over one-shot distillation is influenced by the model’s capacity and the specific PCFG being trained.

Figure: (a) Number of attention heads=$8$
Refer to caption: x33.png

### Appendix E Autoregressive training with GPT2

Setting: Similar to experiments on BERT, we train GPT2 models of depth $4$ with $\{8,16,32\}$ attention heads, while keeping the dimension per attention head fixed at $8$.

A brief introduction into GPT models:
GPT models are trained with the auto-regressive loss. The teacher and student models operate on sequences of input domain $f_{\mathcal{T}}:{\mathcal{X}}^{h}\to{\mathbb{R}}^{C}$ and $f_{\mathcal{S}}:{\mathcal{X}}^{h}\to{\mathbb{R}}^{C}$, where the input sequence length $h$ can be arbitrary.
Denote the length-$h$ input sequence as $\mathbf{x}:=[x_{1},\cdots,x_{h}]$,
and denote $\mathbf{x}_{i:j}$ as the subsequence $[x_{i},\cdots,x_{j}]$ (i.e. the indexing is inclusive on both ends).
The cross entropy loss for next-token prediction training on $\mathbf{x}$ is given by

$$ $\frac{1}{h}\sum_{i=1}^{h}\text{KL}({\bm{e}}_{x_{i}}\|p_{\mathcal{S}}(\mathbf{x }_{1:i-1}))),$ $$

where ${\bm{e}}_{x_{i}}$ denotes a one-hot vector with $1$ in $x_{i}$th coordinate.
We take a different approach, where we compare the algorithms at different difficult levels, by training on a subset of tokens in each sequence. The subsets that we consider are the boundary tokens at different levels of PCFG generation (recall Figure 3).

Formally, if $\mathcal{C}^{(\ell)}({\bm{x}})$ represents the set of level-$\ell$ boundary tokens, then we define the cross entropy loss and the distillation loss corresponding to boundary tokens at any level $\ell$ of the PCFG as

$$ $\displaystyle\ell^{(\ell)}(\mathbf{x};f_{\mathcal{S}})=$ $\displaystyle~{}\frac{1}{\left|\mathcal{C}^{(\ell)}({\bm{x}})\right|}\sum_{i:x _{i}\in\mathcal{C}^{(\ell)}({\bm{x}})}\text{KL}({\bm{e}}_{x_{i}}\|p_{\mathcal{ S}}(\mathbf{x}_{1:i-1}));$ (9) $\displaystyle\ell_{\text{DL}}^{(\ell)}(\mathbf{x};f_{\mathcal{S}},f_{\mathcal{ T}})=$ $\displaystyle~{}\frac{1}{\left|\mathcal{C}^{(\ell)}({\bm{x}})\right|}\sum_{i:x _{i}\in\mathcal{C}^{(\ell)}({\bm{x}})}\text{KL}(p_{\mathcal{T}}(\mathbf{x}_{1: i-1};\tau)\|p_{\mathcal{S}}(\mathbf{x}_{1:i-1})).$ (10) $$

There are a few remarks that need to be made about the above loss function. First, note that the subsets satisfy the condition $\mathcal{C}^{(\ell_{1})}({\bm{x}})\subseteq\mathcal{C}^{(\ell_{2})}({\bm{x}})$ for all $\ell_{1}\geq\ell_{2}$.
Hence, the loss $L^{(\ell_{2})}$ includes loss $L^{(\ell_{1})}$ for all $\ell_{1}\geq\ell_{2}$ and losses $L\in\{\ell,\ell_{\text{DL}}\}$. Second, $L^{(1)}$ will average the losses at all tokens, which is the standard auto-regressive loss used in practice to train large language models.

We focus on cfg3f that has 6 levels in the generation process, and we report the behavior of the models when trained with losses $L^{(2)},L^{(3)},L^{(4)}$, with $L\in\{\ell,\ell_{\text{DL}}\}$.
We focus on $\frac{T_{0}}{2}$-Equal-split progressive distillation.

###### Definitions for M robust subscript 𝑀 robust M_{\text{robust}} italic_M start_POSTSUBSCRIPT robust end_POSTSUBSCRIPT and M close subscript 𝑀 close M_{\text{close}} italic_M start_POSTSUBSCRIPT close end_POSTSUBSCRIPT .

Similar to our experiments on BERT, we track the change in the model’s predictions with and without the $n$-gram context tokens.
However, as the model is trained autoregressively, we need to change our definitions of $M_{\text{robust}}$ and $M_{\text{close}}$ from Equations 5 and 6, as well as the definition of $n$-grams.

For a $h$ length sentence ${\bm{x}}\in v^{h}$ and for $i\in[h]$, we define the $n$-gram neighboring context around the $i_{th}$ token as the set of tokens at positions within $n-1$ distance to the left from $i$, i.e. the set $\{x_{j}\}$ for $i-n<j<i$.

For $M_{\text{close}}$ on a teacher $f_{\mathcal{T}}$ and ngram length $n$, we measure the TV distance between the model’s probability distributions of the model at any position $i$ when all the tokens at positions $1,2,\cdots,i-1$ are available, and when only the tokens in the neighboring $n$-gram context window are available (i.e. at positions $i-n+2,\cdots,i-1$)(^16^1616others are simply masked out during attention score computation to avoid shifts in position embeddings.)

$$ $\displaystyle M_{\text{close}}(f_{\mathcal{T}},\mathbf{x},i,n)$ $\displaystyle=\text{TV}(p_{\mathcal{T}}(\mathbf{x}_{1:i-1}),p_{\mathcal{T}}( \mathbf{x}_{i-n+1:i-1})).$ (11) $$

For $M_{\text{robust}}$ on a teacher $f_{\mathcal{T}}$ and an n-gram length $n$, we measure the total variation (TV) distance between the model’s probability distributions at any position $i$, considering two scenarios: one where all tokens at positions $1,2,\dots,i-1$ are available, and another where the tokens within the $n$-gram context window are masked. However, since the attention mechanism in GPT requires a token at position $i-1$ before it can predict $x_{i}$ and we don’t have a special token to replace the masked tokens, we cannot remove that specific token from the context. Therefore, we keep the token at position $i-1$ intact while masking the other tokens within the $n$-gram context window. We refer to this modified approach as “skip $n$-gram.”

$$ $\displaystyle M_{\text{robust}}(f_{\mathcal{T}},\mathbf{x},i,n)$ $\displaystyle=\text{TV}(p_{\mathcal{T}}(\mathbf{x}_{1:i})),p_{\mathcal{T}}( \mathbf{x}_{\{1,\cdots,i-n+1,i\}}))).$ (12) $$

#### E.1 Observations

Teacher’s behavior during training Figure 29 shows the loss behavior of a teacher run.
We observe $2$ distinct phases of training: a rapid loss drop phase in the first $~{}10\%$ of training, and a final phase of slow loss drop till end of training. In Figure 28, we compare the training accuracy behavior across models of different sizes. At log scale, we observe a very small dormant phase in the training behavior at the start of training. Larger models transition to the rapid loss drop phase faster than smaller models and also show a more prominent change in this phase.

Teacher’s checkpoint selection for progressive distillation As outlined in the previous section, we select the first supervision checkpoint at roughly the middle of the first phase ($1/20_{\text{th}}$ fraction of training), and the other checkpoints are selected at $\{i/20\}_{i=2}^{20}$ fractions of training.

Similar inflection points in loss as BERT and an implicit curriculum:

We observe inflection points in the model’s behaviors at the first selected checkpoint. Similar to our observations on BERT, we observe a curriculum on the reliance of the model’s predictions on $3$-gram predictions (Figure 29). Hence, we check whether progressive distillation can help train a smaller model faser.

(R7) Progressive distillation helps train smaller model faster
In Figures 30 and 31, we compare one-shot distillation to $\frac{T_{0}}{2}$-Equal-split progressive distillation.
We observe that progressive distillation help the student learn faster than one-shot distillation, and the gap diminishes as the students are trained for longer. However, the gap between progressive distillation and distillation decreases as more tokens are involved in the loss function i.e. the gap is smaller for loss $L_{0}^{(2)}$ compared to loss $L_{0}^{(4)}$. We conjecture that auto-regressive training with all tokens involved provides a strong curriculum for the model to learn the structure of the language. We keep a thorough study of this analysis to future work.

Figure: Figure 28: (left to right) Models are trained with the cross entropy loss $\ell^{(4)},\ell^{(3)},\ell^{(2)}$ respectively. Here, we compare GPT’s training behavior with cross entropy loss on cfg3f with varying numbers of attention heads (where the embedding dimension scales linearly with the number of attention heads) over $8\times 10^{3}$ training steps. Larger models show an earlier and more pronounced increase in performance compared to smaller models. For reference, each training curve is annotated at the point where the model reaches $80\%$ of its performance at the final step.
Refer to caption: x35.png

Figure: (a) Loss behavior of teacher model
Refer to caption: x36.png

Figure: (a) Loss: $\ell_{\text{DL}}^{(4)}$
Refer to caption: x39.png

Figure: (a) Loss: $\ell_{\text{DL}}^{(4)}$
Refer to caption: x42.png

Figure: Figure 32: The experiments above compare progressive distillation and one-shot distillation for PCFGs cfg3h, cfg3g, and cfg3f on GPT models with 8 attention heads (each head having a dimension of 8) and 4 layers. The models were trained using the distillation loss $L_{0}^{(3)}$. The relative performance gap between progressive and one-shot distillation is presented in the bar plots. Notably, the advantage of progressive distillation over one-shot distillation depends on the specific PCFG being trained. For example, with cfg3f, the student model can achieve beyond $90\%$ top-1 accuracy, and progressive distillation allows it to reach this more quickly. In contrast, for cfg3g, the student model’s top-1 accuracy plateaus at $84\%$, and after $500$ steps, progressive distillation shows only marginal gains over one-shot distillation. All comparisons were made at a temperature $\tau=10^{-4}$. Here, progressive distillation refers to $\frac{T_{0}}{2}$-Equal-split progressive distillation, where $T_{0}=8000$ denotes the total number of steps for teacher training. The teacher model is a GPT with 32 attention heads, each with a dimension of 8, and 4 layers.
Refer to caption: x45.png

### Appendix F Details on Wikipedia + Books experiments

We use the same hyperparameters for Adam training as our experiments on BERT and PCFG in Section D.6. However, we fix the peak learning rate to $10^{-4}$ (Devlin et al., ) in each case to minimize computation costs.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: No questions beyond suggestions above:
soundness: 3
strengths: Originality - The paper presents a novel perspective on progressive distillation by identifying and formalizing the concept of an "implicit curriculum." While prior work has explored progressive distillation empirically, this study delves deeper into the underlying mechanisms and provides theoretical grounding for its efficacy. The connection between intermediate teacher checkpoints and an implicit curriculum is a fresh insight that contributes to a better understanding of knowledge distillation.    

Quality - The research is technically sound, employing rigorous methodology and comprehensive experiments. The authors combine theoretical analysis with empirical validation, drawing on diverse tasks like sparse parity, PCFGs, and natural language modeling. The use of multiple progress measures to quantify the implicit curriculum further strengthens the quality of their analysis. The study is well-designed, and the results are convincing.    

Clarity -The paper is clearly written and well-organized. The authors present their ideas in a logical progression, starting with a clear motivation and gradually building up their analysis. The concepts are well-explained, and the figures effectively illustrate key findings. The paper is accessible to readers with a background in knowledge distillation and deep learning.


Significance - The findings have significant implications for the field of knowledge distillation. By elucidating the role of an implicit curriculum in progressive distillation, the study provides valuable insights for designing more effective distillation strategies. The theoretical results on sample complexity offer a deeper understanding of the optimization benefits of progressive distillation. The practical implications of this work are substantial, particularly for training efficient and capable models in resource-constrained settings.
summary: Knowledge distillation is a widely used technique for training smaller "student" models by leveraging the knowledge captured by larger, pre-trained "teacher" models. This paper focuses on progressive distillation, where a student model is trained on a series of intermediate checkpoints from the teacher's training process, as opposed to one-shot distillation, which relies solely on the final teacher checkpoint.

The authors provide both empirical and theoretical evidence that progressive distillation accelerates student learning and leads to better generalization compared to one-shot distillation. They attribute this improvement to an "implicit curriculum" embedded within the intermediate teacher checkpoints. This curriculum emphasizes easier-to-learn aspects of the task, facilitating the student's learning process.
Two main distillation strategies are compared: one-shot distillation and progressive distillation.  One-shot distillation involves training the student with a fixed, converged teacher model.  In contrast, progressive distillation utilizes multiple checkpoints from the teacher's training trajectory.  The authors also explore a variant of progressive distillation where only a single, carefully selected intermediate checkpoint is used.    

The authors delve deeper into the mechanisms behind progressive distillation by utilizing the sparse parity task, a well-established benchmark for studying feature learning in neural networks.  They employ teacher and student models with identical architectures but varying sizes.  For MLPs, the model width is adjusted, while for Transformers, the number of attention heads is modified.  Increasing either parameter effectively increases the number of "parallel search queries" the model can perform during training.    

A key finding is that the intermediate teacher checkpoints implicitly provide a "degree curriculum."  This means that the checkpoints guide the student model to learn features in a progressive manner, starting with simpler, lower-degree features. Remarkably, progressive distillation using just a single, well-chosen intermediate checkpoint can surpass the performance of one-shot distillation.  Furthermore, the authors demonstrate that progressive distillation reduces the sample complexity of learning the sparse parity task.    


The authors conclude by highlighting the effectiveness of progressive distillation in improving feature learning through the implicit curriculum present in intermediate teacher checkpoints.  They discuss the importance of teacher temperature as a hyperparameter in knowledge distillation and acknowledge limitations in their exploration of this aspect.  Further investigation into the precise role of temperature, particularly its impact on optimization, is proposed as a promising direction for future research.    

Another avenue for future work is extending progressive distillation to the setting where student models are trained on synthetic data generated by teacher models.  This approach has shown significant potential in recent studies. The authors identify key differences between their current work and generation-based methods, primarily in the type and quantity of supervision provided.  Bridging this gap and developing a unified framework for progressive distillation in various training scenarios is an important challenge for the field.
weaknesses: Some possible improvements I can see are the following :-

a) more investigation of impact of temeprature on knowledge distillation. this seems to be a bit missing in the main sections of the paper
b) analysis of how implicit curriculum learning varies across model layers, across datasets, trainign objecives etc

c) exploring more tasks and architectures

d ) explore interaction of optimization algorithms, batch size etc with curriculum learning

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: 1. For experiments in Figure 2, how do you explain the results that the best correlation (Middle) with in-support variable does not lead best accuracy (Left)?
2. L406, what's the formula for total variation?
3. How do we pick the most appropriate teacher checkpoints in other more complicated tasks?
soundness: 4
strengths: 1. The paper is well written, and despite the complexity of the narrative, it is generally easy to follow, and I enjoyed the reading.
2. Though only applied to a simple use case, the mathematical analysis does provide useful insight about sample efficiency of progressive distillation.
3. The metrics selected in the analysis such as $\mathcal{M}_{robust}$ is quite useful to understand the feature learning aspect of the method.
4. The authors run experiments in various settings including three datasets, MLPs, BERT and GPT-2 (in the appendix) to show the gains can be generalized.
summary: This paper provides theoretical and empirical analysis on how progressive distillation can be helpful to speed up knowledge distillation. Specifically, the author studies a toy use case in sparse parity with synthetic data to show both mathematically and empirically how using intermediate teacher checkpoints can assist student models to learn faster. Then they run progressive distillation experiments in PCFGs and BERT masked token prediction using Wikipedia and Books data to further verify their findings.
weaknesses: Despite the strength, I think the paper can be improved.
1. I understand the necessity to use a toy use case (sparse parity) to show rigorous mathematical analysis, but the following experiments can be more practical in order to provide stronger empirical evidence of the effectiveness of progressive distillation.
- Instead of masked token prediction, can run experiments in challenging NLP tasks such as QA, summarization and long-form generation.
- Can also experiment with more recent LLMs - GPT-2 in the appendix is a good start, but it is still a very outdated model.
2. Some writing (particularly Theorem 3.2) can be made even clearer. For example, L291-292, I didn't quite follow where higher degree odd polynomials come from. L296-297 "This gap allows .. to grow quickly with only ... samples." This statement isn't clear if I don't read the entire proof in the appendix. Please consider writing it in a more intuitive way in the main text.
3. Probably unfair as this is more of an analysis paper, but the overall contribution appears to be limited considering the scope of its experiments.

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 4
questions: * How were the sizes of student models decided? Can the authors show some results on one task (preferably the natural language modeling OR the PCFG tasks) for what happens when the sizes of student models are varied while the size of the teacher size is kept constant?
* Can the authors run similar experiments on a simple multiclass classification task in the visual domain? Even results on something simple such as multiclass classification in CIFAR-100 with an ImageNet pretrained ResNet-18 finetuned on CIFAR-100 as the teacher, and a smaller CNN as the student would be interesting to see.
soundness: 4
strengths: * The paper is well-written and easy to read.
* The paper includes results on tasks across different complexity levels - going from a toy setting of sparse parity to PCFGs and then to a non-synthetic task of natural language modeling.
* Authors also run experiments across multiple model architectures, name MLPs and transformers of different sizes.
* The induced curriculum is discussed from a human interpretability point of view (i.e. showing the correlation between degree 1 monomials and the logits of the intermediate teacher checkpoint in the sparse parity task, and drawing similar analogy in the PCFG task).
* The paper (more specifically; the appendix) includes further extensive experimentation on the settings discussed in the main paper.
summary: The paper demonstrates how progressive distillation helps in better training of the student models by inducing an implicit curriculum. The experimental results demonstrate that progressive distillation results in a higher sample efficiency in all cases as well as a higher performance in some cases, as compared to vanilla knowledge distillation (referred to as "one-shot distillation" in the paper). The results also show that progressive distillation induces an implicit curriculum wherein the intermediate checkpoints provide a stronger learning signal and act as "stepping stones" for the student models during the learning process. These results are validated by experimenting across two different model architectures and 3 different tasks. In the case of the sparse parity task, authors also provide a theoretical proof of how progressive distillation with 2 checkpoints (one intermediate and one final) leads to a better sample complexity as compared to one-shot distillation.
weaknesses: * There is a typo in Definition 4.3: I believe it should be "boundary of span(n^{(i)})" instead of boundary of n^{(i)}
* Discussion about how the relative sizes of teacher and student models were decided is missing. It would be interesting to see a study of how the performance is affected w.r.t the size of the student models
* Empirical analysis on tasks in the vision domain and with other model architectures such as CNNs and recurrent networks would strengthen the paper significantly.

---

confidence: 4
contribution: 4
initial_rating: 8
presentation: 4
questions: The only perhaps unanswered question in this paper is: are simpler features learned first because they're easier, or because they're sufficient for initial loss reduction? Does the progression represent increasing task difficulty or natural optimization paths as the student discovers incrementally winning subnetworks?

As discussed above, it would be interesting to at least provide an analysis of how progressive distillation differs from or extends the Lottery Ticket Hypothesis (and the variants of progressive stacking/learning subnetworks etc). Would be (may be) interesting to discuss whether there could be experiments to show if the observed acceleration is due to narrowing the search space via subnetworks and how this impacts the interpretation of an implicit curriculum.

**Future experiments to isolate effects/figure out the right interpretations**

Below are just some ideas, probably mostly for future work. 

It would be interesting to evaluate (in the experiments of Figure2), the corresponding sizes of the winning subnetworks as per the lottery ticket hypothesis. 

One could also analyze the sparsity patterns of successful networks at different checkpoints, compare with explicit lottery ticket pruning approaches, then try to isolate whether the benefits come from parameter space guidance or feature complexity. 

**Quick check of the literature**   
The following is (slightly) related from a quick search, mainly for your interest:
https://arxiv.org/pdf/2402.05913 too recent of course. 
Older work on progressive stacking: https://proceedings.mlr.press/v202/j-reddi23a.html  also only slightly related
But more generally, it might be useful to reprobe the related work, with the lens of using winning subnetworks to accelearate learning, perhaps checking how they form and how they help accelerating learning (whether there's an increase in task complexity ...)
soundness: 3
strengths: I liked the spirit of this paper, which I found complete, well-written, carefully designed and executed. Overall, I enjoyed the following strengths:

- **Experimental completeness:** The paper is generous in providing extensive empirical evidence across synthetic tasks (sparse parity, PCFGs) and real-world datasets (Wikipedia, Books).

- **Theoretical Analysis:** Offers mathematical proofs demonstrating sample complexity benefits in specific cases like sparse parity learning. 

- **Memorable Observations:** Beyond the idea that checkpointed learning leads to faster optimization, it identifies phase transition in the teacher's training where intermediate checkpoints can be most beneficial to the student. These correspond to acquring new skills of increasing complexity.

- **Impact and Practical and actionable implications**
summary: The paper investigates how progressive distillation can accelerate the training of neural networks by leveraging an implicit curriculum provided in the form of intermediate teacher checkpoints. The authors conduct experiments on tasks like sparse parity, probabilistic context-free grammars (PCFGs), and real-world datasets ("Wikipedia and Books") using models like MLPs, Transformers, and BERT. The main claimed findings are:

1. Progressive distillation accelerates student learning compared to one-shot distillation.
2. An implicit curriculum emerges from intermediate teacher checkpoints, guiding the student through increasingly complex subtasks.
3. This implicit curriculum results in an observable empirical acceleration, and stems from provable benefits.
weaknesses: - **Alternative intepretations, e.g. winning subnetworks and the Lottery Ticket Hypothesis:**

The first thing I thought about, as a possible intepretation of the empirical (and theoretical) findings of the paper is the lottery ticket hypothesis (LTH), which could alternatively explain the benefits observed in progressive distillation. The hypothesis posits that within a large neural network, there exist smaller subnetworks (winning tickets) that can learn the tasks efficiently. Searching for these subnetworks takes long, but once they are identified, training only on them makes the learning faster. 

So while the paper frames the intermediate checkpoints as providing an implicit curriculum of increasing task complexity, this could be reinterpreted as the teacher progressively revealing parts of the winning subnetwork, narrowing the student's search space at each step. Hence a crucial question is: could the novelty in using intermediate checkpoints be just an operationalization of the lottery ticket hypothesis in a distillation context (i.e. Guided Search) rather than a fundamentally new concept (implicit curriculum)? 
There, the student model is being guided to explore progressively smaller regions of the solution space, as per LTH. These correspond to learning features of increasing complexity as the paper points out, but that's because that's how networks progress in their learning of the best parameters to solve a problem. By emphasizing the curriculum aspect, the paper might divert the "reader" from other factors contributing to accelerated learning, such as the inherent properties of the optimization landscape or the effects of network pruning (implicit or explicit).

And both interpretations would be aligned with the empirical and theoretical findings. 

First, the fact that not all checkpoints provide good performance could be  due to the model learning more and more complex skills as it discovers the winning tickets, and not because the tasks are more and more complex (curriculum). Matter of fact, the training data is not going from simple tasks to complex ones, what goes from simple to complex is what the model has learned, not what is was trained on. Said differently, the discovery of progressively complex features could be the result/consequence of a guided search to efficient parameter configurations.  

Second, looking at the sample complexity improvement that the authors prove:
"the total sample complexity needed for the student to reach ϵ-loss using progressive distillation with 2 checkpoints is Õ(2^k d^2 ϵ^−2 + k^3). However, one-shot distillation requires at least Ω(d^k−1, ϵ^−2) samples"
could perhaps be reinterpreted as: The student benefits from getting direct signal about which features are important (winning tickets), rather than having to discover them from scratch like in one-shot distillation.
Same goes for the theorem about intermediate checkpoints having stronger correlations with degree-1 monomials: could be read as a curriculum of increasing task complexity, or about how the teacher naturally learns (simple correlations first) and why intermediate checkpoints help (they provide clearer signal about important features).

Seen this way, calling this an "implicit curriculum" might be misleading because the task complexity is constant, and what is changing is the model's internal learning progression. 

-  **Other minors**

The specific temperature values, as well as the choice of dramatically different temperatures (10^-4 vs 10^-20) based on vocabulary, could benefit from more rigorous exploration. Ok, the authors still acknowledge this as a limitation they defer to future work.

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 4
questions: * **Teacher Checkpoint Selection Across Domains**: What guidelines or heuristics can assist in selecting intermediate teacher checkpoints effectively for diverse tasks such as visual classification, image generation, or reinforcement learning?
* **Joint Training of Student Models:** What are the effects of training small student models jointly with large teacher models, instead of using progressive distillation with intermediate checkpoints? Does this approach provide a similar implicit curriculum that benefits the student’s learning?

I am willing to improve my score if the authors demonstrate that progressive distillation remains beneficial compared to one-shot distillation in the long run for large models, such as GPT-2.
soundness: 4
strengths: Strengths
* **Intuitive Motivation and Theoretical Foundation:** The paper is well-motivated, addressing a significant challenge in the effective distillation from large to small models. The theoretical underpinnings are well grounded, with rigorous proofs using the sparse parity example demonstrating why progressive distillation is effective.
* **Empirical Validation Across Diverse Tasks:** The authors conduct comprehensive experiments on both synthetic tasks (sparse parity and PCFGs) and realistic settings (training BERT on Wikipedia and Books datasets). This breadth of evaluation underscores the generalizability of their findings.
summary: Traditional knowledge distillation relies on a single, powerful teacher model to train a smaller student model. However, it has been observed that stronger teachers do not always yield better-performing students. To address this issue, the authors explore progressive distillation, where the student model is incrementally guided by a sequence of increasingly capable teacher checkpoints. Through theoretical analysis and extensive experiments on tasks such as sparse parity and probabilistic context-free grammars (PCFGs), the paper demonstrates that progressive distillation accelerates the optimization process, achieving improved performance with fewer training steps compared to one-shot distillation and direct learning from data.
weaknesses: **Weaknesses**

- **Scalability to Larger Models and Diverse Architectures**: While the experiments include models like BERT, the paper does not thoroughly investigate how progressive distillation scales with increasingly large models (in the main paper).

- **Effectiveness in GPT Models**: In Appendix E, the paper examines autoregressive training with GPT-2. Although progressive distillation accelerates learning speed, the performance plateaus around 8,000 training steps. It remains unclear why this convergence occurs and what the outcomes would be if training continued beyond 8,000 steps (e.g., up to 20,000 steps).

- **Potential for Degenerate Features**: While progressive distillation leverages an implicit curriculum to identify key patterns, there is a concern that this curriculum might lead to degenerate features that could hinder long-term generalization. This issue could be further investigated by extending the training duration in GPT-2 to ensure that no negative consequences arise from prolonged training.

Meta-review: The paper studies progressive distillation, where the student learns from a series of intermediate teacher checkpoints, as opposed to learning from a single, fully trained teacher. The authors propose that the improvement from progressive distillation stems from an "implicit curriculum" embedded within these intermediate teacher checkpoints, accelerating the optimization process of the student. This curriculum starts with easier-to-learn aspects of the task and gradually increases complexity as the student progresses through the checkpoints.Interestingly, a better teacher model does not always translate to a better student model. Progressive distillation, with its use of intermediate checkpoints, offers a way to mitigate this challenge.

Strengths: The paper moves beyond the traditional view of knowledge transfer and identifies the implicit curriculum for progressive distillation. The paper is generally well-written and easy to follow. The authors demonstrate the effectiveness of progressive distillation across different tasks and architectures, including sparse parity with MLPs and Transformers, PCFGs, and real-world pre-training datasets. This suggests the generalizability of their findings.

Weaknesses include lack of experiments on models larger than GPT-2 scale, particularly scaling the size of the student and teacher, raising questions about how these findings generalize to modern LLMs of much larger scale. Furthermore, the scope of contribution is limited due to analyzing an existing technique that heavily relies on heuristics to select intermediate teacher checkpoints.

Decision: Accept (Oral)