Reinforced Multi-Teacher Selection for Knowledge Distillation
Paper · 2020 · Fei Yuan, Linjun Shou, Jian Pei et al.
Summary
A large text classifier can be expensive to run even when it only needs to return a class label. Knowledge distillation addresses that cost by training a smaller classifier, called the student, on predictions from a larger one, called the teacher. With several teachers available, the usual practice described in the paper is to combine their predictions with weights that stay fixed throughout training. The authors ask whether the student would learn more if it could draw on different teachers for different examples. Their starting observation is that a teacher with higher accuracy can produce a less accurate student than a teacher that scores lower on the same task.
The authors’ method, RL-KD, learns a policy for choosing the teachers that contribute to each training example. The policy sees a representation of the input, the teachers’ class probabilities, and how much probability each teacher assigned to the recorded answer. It samples a separate decision for each teacher, so several teachers can contribute to the same example. Their predictions supply a soft target, a distribution over the possible answers, which the student learns from alongside the recorded label. The policy receives feedback after a batch of examples. That feedback comes from the student’s losses and, in the most successful version, its accuracy on a separate development set.
The experiments use BERT students with 3 or 6 transformer layers and teachers with 12 layers. The tasks cover sentiment classification, paraphrase matching, and sentence-pair inference from GLUE. On most of the reported test comparisons, RL-KD gives the stronger student, including against a weighted teacher ensemble whose weights were fitted on development data. Selecting whichever teacher assigned the most probability to the correct answer also falls short of the learned policy as a general strategy. The authors identify MRPC with the 3-layer student as an exception to RL-KD’s favorable pattern. They suggest that a small training set can make the student’s feedback less reliable, and report better results on that task with the 6-layer student.
Deep dive: Reinforced Multi-Teacher Selection for Knowledge Distillation
Reinforced Multi-Teacher Selection for Knowledge Distillation trains a compact student by learning which teachers to use for each example. · about 33 minutes to read
The problem and its context
The classifier that runs after training
The paper begins with an engineering problem in natural language processing. A system can perform well on a benchmark and still require more time or graphics-processor memory per prediction than a production application can afford. The pretraining approaches the authors discuss learn general representations of text that can then be adapted to individual tasks. The size of the resulting classifier matters every time the application asks it to score an input. The paper uses deep pretrained systems as the starting point for this problem, including BERT, RoBERTa, XLNet, and ALBERT.
The authors place distillation alongside pruning and quantization as approaches to compression. Distillation gives the smaller classifier a richer training signal than it would get from the task labels alone. The teacher evaluates the same input and distributes probability across the available classes. A conventional label names the answer. A probability distribution also conveys how much support the teacher gives to the alternatives. Training can therefore ask the student to approximate the teacher’s pattern of answers while still rewarding it for predicting the annotated class. The paper traces this setup to Distilling the Knowledge in a Neural Network and earlier work on compression.
The distinction between training and prediction makes the teacher useful in a compression scheme. The teacher’s contribution is to the targets that shape the student’s parameters. Once that training is finished, the student can make a task prediction with its own parameters. The paper evaluates the resulting classifier by its predictive accuracy. The cost of running a deep teacher motivates the choice of a shallower student, while the experiment asks how much task performance the student can gain from the supervision it receives.
Earlier work described by the authors had already applied distillation to different kinds of language tasks. They cite a demonstration in machine translation, Sequence-Level Knowledge Distillation. They also discuss work that transfers task knowledge from BERT to smaller networks. The closest precedent for their experimental setup is Patient Knowledge Distillation, which supplies the point of comparison for the shallower BERT students. TinyBERT is another example they cite of distillation from BERT. In the authors’ account, these approaches use a single teacher.
What multiple teachers change
A pool of teachers gives the student access to several predictive distributions for the same input. The simplest way to use the pool is to average those distributions and train on the average. This is straightforward to implement, and every teacher remains represented in every soft target. If two teachers disagree, however, both receive the same influence under a uniform average. A fixed weighted average can give a generally stronger teacher more influence, but the same preference then applies to examples on which that teacher is confident, examples on which it is uncertain, and examples on which it favors the wrong class.
The related work discusses several ways of combining teachers before this paper. Some methods set a coefficient for each teacher and keep the coefficients fixed through distillation. The authors also describe an approach that randomly draws a teacher for a mini-batch. That procedure varies the source of supervision across updates, but the random draw applies to an entire batch and does not use the individual example to guide the choice. A multi-stage approach to web question answering first prepares a student on a distillation task and then uses equal-weight teacher supervision on downstream tasks. These precedents account for both fixed averaging and random choice in the experiments.
There are two reasons to expect that a fixed preference may leave useful information unused. First, teacher behavior can vary from example to example. The authors point to differences in the hypotheses each teacher can represent and in how each was trained. Even when teachers predict the same class, their probabilities can differ, and those probabilities are what the student sees during distillation. Second, a useful teaching distribution depends on what the student can learn. The characteristics that help a teacher make good predictions with its own parameters may be hard for a shallower student to reproduce.
The paper illustrates this second point with a comparison involving BERT-Base and RoBERTa-Base. The latter is the stronger classifier on MRPC and MNLI-mm in the motivating example. A 3-layer BERT student, however, does better on those tasks when distilled from BERT-Base. The student architecture is the same in both cases. The example separates two rankings that a multi-teacher procedure might otherwise treat as interchangeable: the ranking of teachers as independent predictors and the ranking of the students that learn from them.
The authors suggest that capacity may account for such a reversal. A deeper teacher may express distinctions that a smaller student can approximate unevenly. Some parts of the training data may be fitted too closely, while patterns useful elsewhere may be learned poorly. This is a proposed explanation for the observation. The experiment that motivates it establishes a difference in transfer outcomes, and the paper builds its method around that observable distinction.
What the selector is meant to optimize
One response would be to use the annotated class to rank teachers on each example. A teacher that gives the answer more probability seems an appealing choice, particularly when the alternatives make obvious errors. This judges the teacher’s prediction at the input under consideration. The authors want the criterion to extend to what happens after the prediction becomes a training target. An informative target has to help the student learn, and its value may become apparent only through the student’s performance.
That shift explains the use of reinforcement learning. The selector makes a choice, the student receives the resulting supervision, and the policy gets feedback on the student. The training data supply class labels, but they supply no separate label identifying the best teacher subset for a particular student. The selector instead learns from the consequences of sampled decisions. Its immediate evidence concerns individual examples and teachers, while its feedback summarizes what happened over a batch.
The research question is therefore narrower than whether an adaptive ensemble can classify text well. The paper is concerned with constructing supervision for a smaller classifier. A teacher can influence the student without ever producing the final prediction that will be scored. The central comparison is between ways of obtaining soft targets for students with the same architectural depth. That comparison leaves room for a teacher whose predictions are useful to imitate even when another teacher is more accurate on its own.
The method, step by step
What the teacher gives the student
Each task is treated as classification. The input may be a sentence or a pair of sentences, with an annotated class for each training example. The teacher pool is prepared by fine-tuning pretrained classifiers on the task. Every teacher predicts over the same task classes, so its outputs can be compared and combined. A student is a shallower BERT classifier that produces probabilities over those classes too. Both teachers and students use the Transformer and attention architecture.
Consider a paraphrase example. The label tells the student whether the texts count as equivalent. Each teacher supplies a probability for equivalence and a probability for the other outcome. Teachers can agree about the likely answer while disagreeing about how clear the example is. The student’s distillation loss responds to that difference because the target contains both probabilities. If several teachers are selected, the loss reflects their average contribution. The ordinary label continues to supply its own term in the student’s objective.
The important change is where the average comes from. In uniform distillation it always contains the entire pool. In RL-KD an input and the teacher outputs first pass through a selection policy. The policy chooses which contributions enter the average for that example. Another example in the same batch can receive a different subset.
How RL-KD trains the student and teacher selector
The steps in order.
The two terms in the student’s loss
The paper writes the training data as a collection of labeled pairs.
𝒟 = {(xᵢ, yᵢ) : i = 1, …, N}
Here 𝒟 is the training set and N is its size. The index i identifies an example, xᵢ is its input, and yᵢ is its annotated class. Class indices c run from 1 to C, where C is the number of possible classes for the task.
Each teacher supplies a vector over those classes. The superscript t in the notation indicates a teacher.
ỹᵗᵢₖ = ⟨ỹᵗᵢₖ₁, …, ỹᵗᵢₖC⟩
The vector ỹᵗᵢₖ is teacher k’s distribution for input xᵢ. A component ỹᵗᵢₖc is the probability that this teacher assigns to class c. The teacher index k ranges over K candidates. The angle brackets delimit the vector, and the ellipsis stands for its intervening class components through class C.
The authors first give the distillation loss for an equal contribution from every teacher. It uses cross-entropy, a loss that places more weight on a class when the target assigns that class more probability.
ℒ_DL = −(1/K) ∑ᵢ,ₖ,꜀ ỹᵗᵢₖc · log Pˢ(yᵢ = c | xᵢ; Θˢ)
The subscript DL identifies the distillation loss ℒ_DL. The sum ranges over examples i, teachers k, and classes c. The teacher weight for a class is its probability ỹᵗᵢₖc. The conditional expression Pˢ is the student’s probability for class c given input xᵢ and student parameters Θˢ, with the superscript s indicating the student. The dot denotes multiplication, log is the logarithm, and the minus sign makes greater probability on classes favored by the target correspond to lower loss. Dividing by K averages the teacher contributions.
Since the student’s log probability for a given input and class is the same in each teacher’s term, averaging the teacher terms has the effect of training on their averaged probability distribution. This observation connects the loss formula to the soft target in the flow diagram. In RL-KD the authors describe averaging the distillation contribution from the teachers selected for that example. The initial formula displays the case in which all candidates contribute. This distinction matters because the policy’s inclusion probabilities govern the draw, and the realized subset governs whose predictions enter the loss.
The ordinary classification loss uses the annotated answer as a hard target.
ℒ_CE = −∑ᵢ,꜀ 𝟙[yᵢ = c] · log Pˢ(yᵢ = c | xᵢ; Θˢ)
Here ℒ_CE is the student’s cross-entropy against the recorded labels. The sum runs over example indices i and class indices c. The indicator 𝟙 is 1 if the annotated class yᵢ equals c and otherwise 0, so the only class that contributes for each example is its annotated answer. Pˢ again gives the student probability at xᵢ with parameters Θˢ. The logarithm and the leading minus sign give a smaller penalty when that probability is higher.
The student is trained with a mixture of the two losses.
ℒ_KD = α · ℒ_DL + (1 − α) · ℒ_CE
The subscript KD identifies the combined distillation objective ℒ_KD. The coefficient α is a hyper-parameter, a value chosen as part of the training setup. It controls the contribution of the teacher loss ℒ_DL, while its complement, 1 − α, controls the contribution of the annotated-label loss ℒ_CE. For the adaptive method, it is the teacher term that depends on the selected subset. The class label anchors the objective to the same task across different selections.
The paper also reports trying a distillation temperature T. The displayed loss is expressed in terms of class probabilities, and the authors list the settings they try for T in the implementation description. They do not write a separate temperature transformation in these equations. Keeping the two parts of the account distinct preserves what is specified mathematically about the target and what is reported as an experimental setting.
What the selector knows when it makes a choice
The input to the selection policy is called a state. It contains an encoding of the text followed by the information collected from the teacher pool. The text encoding gives the policy a way to respond to properties of the input beyond the teachers’ task scores. The authors take the final-layer representation of the special [CLS] marker from pretrained BERT-Base. This encoder serves a different purpose from the fine-tuned BERT teacher in the pool. The encoder supplies a representation for selection, while the teacher supplies task-specific predictions.
The second type of information is the full class distribution from each teacher. The probability of a given class is written as a component of the teacher’s softmax output.
Pᵗₖ(yᵢ = c | xᵢ; Θᵗₖ) = [softmax(Wₖ · ℳₖ(xᵢ))]꜀
Pᵗₖ is the probability assigned by teacher k to class c at input xᵢ. The parameters of that teacher are Θᵗₖ. The expression ℳₖ(xᵢ) refers here to the last-layer [CLS] representation returned by teacher k. Wₖ is its trainable classification matrix, with C rows for the task classes and d columns for the representation dimensions. Multiplying by Wₖ produces class scores, and softmax converts them into a vector of probabilities. The subscript c on the brackets selects the entry for that class. This probability is the component denoted ỹᵗᵢₖc in the distillation loss.
The third type of information is how well the teacher’s distribution fits the annotated label.
ℒₖ(xᵢ) = −∑꜀ 𝟙[yᵢ = c] · log Pᵗₖ(yᵢ = c | xᵢ; Θᵗₖ)
Here ℒₖ(xᵢ) is teacher k’s label loss for example i. The sum goes over class indices c, and the indicator 𝟙 keeps the term corresponding to the label yᵢ. Pᵗₖ gives the teacher probability using input xᵢ and parameters Θᵗₖ. The negative log means that a teacher has lower loss when it puts more probability on the annotated class. This quantity describes the teacher, whereas ℒ_CE in the student objective describes the student.
The policy sees the probabilities and label losses from the other teachers as well as those from the teacher associated with the current decision. A teacher’s probability is then available in a comparative context. For instance, the policy can receive a distribution that favors one class while the other teachers favor another. The corresponding label losses give it direct evidence about which side of that disagreement agrees with the annotation. Since selection takes place on training examples, the annotation is available for constructing those features.
F(sⱼ) ∈ ℝ^{d + (C + 1)·K}
Here sⱼ is the state at decision index j and F(sⱼ) is its vector of real-valued features. The symbol ℝ indicates real coordinates. The input encoding contributes d coordinates. Each of the K teachers contributes C class probabilities and 1 label loss, giving the displayed dimension. The teacher index is written explicitly as part of the state index when the paper describes the decisions for a batch.
Concatenating the features retains the distinction between teachers. An average supplied to the selector at this point would lose information about where the probabilities came from. The retained information allows the policy to react to the combination of text, teacher predictions, and label losses. How much it actually uses any one of those sources is an empirical question. The paper evaluates the selection procedure as a whole.
How the policy turns evidence into inclusion
The paper describes an agent associated with each teacher. For an example the agent has a binary action, where 1 includes the teacher and 0 leaves it out. The logistic policy computes a probability for inclusion by transforming a linear score with a sigmoid. The policy gives the remaining probability to exclusion.
πθ(sⱼ, aⱼ) = Pθ(aⱼ | sⱼ)
= aⱼ · σ(A·F(sⱼ) + b)
+ (1 − aⱼ) · (1 − σ(A·F(sⱼ) + b))
The policy πθ is the conditional probability Pθ of action aⱼ given state sⱼ. The parameter set θ contains A, a vector of coefficients for the state features, and b, a scalar bias. The product A·F(sⱼ) is the linear score from the features. The function σ is the sigmoid, which converts that score plus the bias to an inclusion probability. With aⱼ equal to 1 the expression returns that probability. With aⱼ equal to 0 it returns its complement. The subscript j indexes the decision.
The binary decisions let a training example draw from multiple teachers. This differs in operation from the paper’s one-teacher baseline, where a winner is required for each input. A high selection probability makes a teacher more likely to contribute when the policy samples its action. Once the actions have been sampled, the training description calls for an average from the selected teachers. The adaptive mechanism is thus the choice of membership in the set used to form a target. The paper refers to the sampling probabilities as teacher weights.
Sampling also admits an empty set. The implementation description says that an example for which the selector picks no teachers receives no reward from distillation. There is no teacher distribution to average for such an example. The text specifies this consequence, while leaving the full treatment of that example in the student update implicit. In particular, the paper’s general student objective includes the ground-truth term independently of the teacher term.
Why the reward arrives after a batch
The paper treats a batch as an episode. For each input in it, the policy receives the corresponding state information and samples an inclusion decision for each teacher. The student’s loss uses the selected predictions and the labels. The usefulness of the decisions is assessed through a reward for the completed batch. The selector therefore learns from a common outcome for many choices, including choices about different teachers on different examples.
This delayed assessment is the means by which the authors try to align selection with learning. The teacher’s label loss is an input to the policy and can tell it which distribution was closest to the recorded answer. The reward judges the student. A teacher can consequently have a favorable input feature without the policy being required to choose it. Whatever a selection’s local appeal, the policy is trained through the batch-level measure.
The first reward uses only the student’s loss against the labels.
reward₁ = −ℒ_CE
Here reward₁ is the first reward option and ℒ_CE is the student’s cross-entropy against the hard labels for the training episode. The minus sign converts a smaller loss into a larger reward. This version gives the policy a feedback signal about the student’s ability to assign probability to the annotated classes.
The second version gives the student credit for fitting the selected teacher predictions as well.
reward₂ = −ℒ_CE − ℒ_DL
Here reward₂ is the second option, ℒ_CE is the label loss, and ℒ_DL is the student’s distillation loss for the selected supervision. Each loss enters with a negative sign. This reward adds the two unscaled loss terms. The coefficient α in the student’s optimization objective belongs to a separate calculation. The policy’s feedback and the student’s loss are both built from cross-entropy terms, but they need not combine those terms in the same proportions.
The last version incorporates performance on the development split.
reward₃ = γ · (−ℒ_CE − ℒ_DL) + (1 − γ) · Accuracy(𝒟′)
Here reward₃ is the third option. The coefficient γ controls the contribution from the two training losses, ℒ_CE and ℒ_DL. Its complement, 1 − γ, controls the contribution of Accuracy(𝒟′), the student’s prediction accuracy on the development set 𝒟′. The prime distinguishes that split from the training set 𝒟. The authors note that another metric on development data could also be used. Their experiments use accuracy.
The additional term addresses a specific discrepancy. A student can become better at fitting the batch targets while gaining little on separate examples. Development accuracy gives the policy a signal responsive to the second outcome. It also creates a distinction between the two uses of a development split in the experiments. Development data help select settings and checkpoints throughout the study. Under reward₃, development accuracy also enters the training signal for the selector itself. Test accuracy remains the evaluation of the resulting student.
Updating the policy and the student
The policy update uses the sampled actions and the batch reward. The paper describes this as Monte Carlo policy-gradient training. In this setting, the update uses the outcomes of decisions actually sampled during training, with the gradient taken with respect to the selector parameters. The printed rule is as follows.
θ ← θ + β · ∑ⱼ [r · ∑ₖ ∇θ πθ(sⱼₖ, aⱼₖ)]
The arrow means that θ, the selector’s current parameter set, is replaced by the expression on its right. The factor β is the selector learning rate. The outer sum runs over example indices j in the batch and the inner sum over teacher indices k. For that example and teacher, sⱼₖ is the state and aⱼₖ is the sampled action. The operator ∇θ takes the gradient of the policy probability πθ with respect to θ. The reward r is the batch feedback obtained using the chosen reward definition. As written, that reward multiplies the gradient contributions from the episode. The displayed update differentiates the policy probability itself.
Sharing the reward across the episode makes the outcome relevant to all the decisions that contributed to it. It also means that the reward carries no direct label for which specific action caused the outcome. The policy has to improve its choices across sampled batches. This is different from fitting a teacher selector to a table of predetermined correct decisions. The input features give it a description of each choice, while the accumulated feedback gives it a basis for changing the probabilities.
The authors warm up the student and selector before alternating their updates. The student starts from pretrained BERT weights. For this initial distillation stage, every teacher is included for every example, so it learns from their uniform average. This establishes the conventional multi-teacher objective as a starting point. The student later encounters the varying targets produced by the learned selection policy.
Selector pretraining uses feedback derived from the performance of an ensemble formed by averaging the selected teachers. The stated rationale is to avoid depending on an initially unstable student and to start policy learning sooner. At this stage the ensemble provides the feedback used to prepare the selector. The iterative stage then brings the student’s performance into the selection objective. The warm-up and the later reinforcement signal therefore play distinct roles.
After both warm-up stages, the student and selector are updated on alternating batches. On a student batch, the policy parameters stay fixed and the student learns using the selected supervision. On a selector batch, the student parameters stay fixed while the feedback is calculated and the policy parameters are updated. The general algorithm describes continuing for L epochs, where L denotes the iteration count at the epoch level. The implementation description specifies the order at the batch level, beginning with a student update and following it with a selector update.
What went into the training runs
Single-sentence examples are formatted with [CLS] before the sentence and [SEP] after it. For a pair, [CLS] precedes the first sentence, [SEP] separates the sentences, and another [SEP] follows the second. The input representation used for selection is produced by the original pretrained BERT-Base encoder. Fine-tuned teachers produce the separate task distributions. The authors built their training implementation on the Patient KD code.
All teachers start from openly available pretrained weights for the relevant architecture. Each has 12 transformer layers and is fine-tuned on the task-specific training split. The teacher fine-tuning settings use a batch size of 32, a maximum sequence length of 128, and 4 epochs. The learning-rate candidates are 1e-5, 2e-5, and 5e-5. Development accuracy determines the chosen teacher checkpoint or setting.
The students are initialized from the bottom 3 or 6 layers of BERT-Base, corresponding to their respective depths. The student settings also use batches of 32, a maximum sequence length of 128, and 4 epochs, with candidate learning rates of 1e-5, 2e-5, and 5e-5. The distillation temperature T is chosen from 5, 10, and 20. The mixture coefficient α for the student loss is chosen from 0.2, 0.5, and 0.7. The development-based reward coefficient γ is selected using development performance from 0.3, 0.5, 0.7, and 0.9. The student warm-up also uses batches of 32 and a maximum of 4 epochs, with the other settings drawn from the same distillation setup.
These settings distinguish architecture from training strategy. The depths identify which student is trained. A student at a given depth can be fine-tuned directly on the labels, distilled from a single teacher, distilled from an ensemble, or trained through RL-KD. The changes in supervision take place while that student is being prepared. The final accuracy is attributed to the classifier obtained from that training procedure.
Experiments and results
The tasks and what accuracy measures
The experiments follow the Patient KD evaluation setup on GLUE. Their common output is a class prediction, but the inputs and decisions vary. That variation is relevant to the question of teacher selection. A useful provider of soft targets might differ between a task that scores sentiment in a single sentence and one that compares the meaning of two sentences. The paper reports prediction accuracy, the proportion of evaluated examples assigned the correct class. Development accuracy is used during training and selection, while the main teacher and student comparisons are described on the test splits. This is the paper’s use of evaluation and benchmarks.
SST-2 supplies the single-sentence task. The input is a sentence and the output is its sentiment class. The teacher and student see the same type of classification problem, and the teachers can differ in how strongly they favor the label on an individual example. The benchmark comes from the Stanford Sentiment Treebank, and the task is an instance of text classification.
The two paraphrase benchmarks give the classifier a pair of texts and ask whether their meanings are equivalent. MRPC is the Microsoft Research paraphrase dataset discussed in Automatically Constructing a Corpus of Sentential Paraphrases. QQP asks that equivalence question about pairs of questions. MRPC also matters to the interpretation of the method because the authors single out its relatively small training set when discussing the shallower student’s results.
The sentence-pair inference experiments include MNLI, QNLI, and RTE. MNLI contains pairs drawn from different domains. The paper scores the in-domain split, MNLI-m, and the cross-domain split, MNLI-mm, separately. This lets the comparisons show whether a ranking seen in the matched setting also appears in the mismatched setting. The corpus comes from A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference.
QNLI converts question answering into a classification task. The classifier receives a question and a context sentence and decides whether the sentence contains an answer. Its underlying source is SQuAD. RTE is based on textual entailment challenges represented in GLUE. The prediction in these experiments is a class decision about the input pair, which lets the same teacher-selection and distillation machinery operate across the tasks.
The paper describes the accuracy rankings in its discussion of the test tables. The numeric comparison below shows the transformer depths used in the evaluation. Depth measures architectural size in layers and is separate from the accuracy metric used to judge learning.
Student and teacher transformer depth in the SST-2 comparison
Both students used by RL-KD are shallower than the teachers supplying their training targets.
The numbers
| System or setting | transformer layers |
|---|---|
| BERT₃ student with RL-KD (this paper) | 3 |
| BERT₆ student with RL-KD | 6 |
| Individual teachers | 12 |
What the baselines test
The direct fine-tuning baseline uses the task labels to train the BERT student. The single-teacher distillation baselines add the predictions of one teacher for the entire training run. The paper uses vanilla knowledge distillation, abbreviated V-KD, for this basic procedure and groups the non-reinforced distillation comparisons under that label in its student table. Running the individual teachers separately helps show how sensitive the student is to the source of its soft targets before any ensemble or selector is introduced.
The uniform ensemble, U-Ensemble, averages the distributions of the entire teacher pool. The randomly sampled baseline, Rand-Single-Ensemble, uses one teacher selected at random for a mini-batch. This varies the supervision over the run while sharing the same teacher choice across examples in a batch. W-Ensemble uses different coefficients for different teachers and fixes those coefficients throughout distillation. These comparisons cover uniform cooperation, random variation, and a fixed preference among teachers.
The logistic-regression ensemble, LR-Ensemble, fits global coefficients to improve the predictive performance of the combined teacher. The paper specifies the resulting class distribution as a weighted sum.
P(yᵢ = c | xᵢ) = ∑ₖ wₖ · Pᵗₖ(yᵢ = c | xᵢ; Θᵗₖ)
Here P on the left is the ensemble probability of class c for instance i with input xᵢ. The class label is denoted yᵢ. On the right, k indexes the teachers, wₖ is the fitted coefficient for teacher k, and Pᵗₖ is its class probability under parameters Θᵗₖ. The sum combines the teachers’ contributions. LR-Train-Ensemble fits the coefficients on the training set. LR-Dev-Ensemble fits them on the development set. Within either variant, the same coefficients apply across examples.
The logistic ensemble and the proposed policy both learn from data, but the learned quantities have different roles. The ensemble learns a coefficient per teacher with the predictive quality of the combined teacher as its objective. The selection policy produces an inclusion probability from the state of an individual example and is optimized using feedback about the student. A strong logistic ensemble is therefore a test of whether fitting the teacher combination at the aggregate level already captures much of the available benefit.
Best-Single-Ensemble provides a closer comparison in granularity. It finds the teacher with the lowest cross-entropy against the annotated label on each training example and uses that teacher as the source of the soft target. The rule takes advantage of the correct answer when picking the teacher. This makes it an upper-bound comparison for the specific criterion of picking the locally best teacher by labeled loss. The resulting student can be evaluated on the test set in the usual way. Scoring the teacher-selection rule itself on test inputs would require the test labels to make its choices, so the authors restrict its use as a selector to training data.
How the teachers rank on their own
The teacher comparisons first evaluate the classifiers before their outputs become student supervision. RoBERTa leads the individual teachers on MNLI-m, MNLI-mm, and QNLI. ALBERT leads on MRPC and RTE. XLNet has the highest individual teacher accuracy on SST-2. These examples establish that a choice based on overall superiority across the benchmark would obscure which teacher is strongest on a given task. The paper offers differing learned biases and optimization outcomes as possible explanations for the variation.
The authors report that teacher ensembles give better predictive results overall than the individual teachers. Weighted variants perform better than uniform averaging in their comparison. Of the ensemble variants, LR-Dev-Ensemble is identified as the strongest. The authors suggest that fitting its weights on the development split can help the combination generalize, and they use it as the main ensemble comparator in their discussion of student outcomes. This result concerns the accuracy of the ensemble’s own predictions. It establishes a strong provider of soft targets to test in a separate distillation comparison.
How the students rank after distillation
The teacher ranking sometimes reverses when the trained student becomes the object of evaluation. On the test comparisons for BERT₃, distillation from ALBERT₁₂ gives better results than distillation from LR-Dev-Ensemble on MNLI-mm, MNLI-m, and SST-2. For BERT₆, the student distilled from XLNet₁₂ is better than or on a par with the student distilled from LR-Dev-Ensemble on MRPC and SST-2. The examples matter because LR-Dev-Ensemble is the stronger teacher ensemble by the paper’s direct comparison. A better combined prediction can still yield a less effective training target for a specific student.
The Best-Single-Ensemble result shows a related reversal. With BERT₆, a student trained on the teacher closest to the recorded answer on each example trails the one trained from LR-Dev-Ensemble on nearly all of the evaluated datasets. The selector has privileged information for making its training-time choices and uses it to solve a well-defined local problem. The resulting student ranking shows that optimizing that local problem can leave room for a stronger distillation procedure.
RL-KD gives better test results in most of the student comparisons described by the authors. This is the general pattern for both BERT₃ and BERT₆, across tasks on which the different fixed or single-teacher strategies have uneven results. The reward that includes development accuracy is the strongest of the reward variants overall. The paper interprets that result as evidence in favor of judging the student by performance beyond the training episode as well as by its fit to the current targets.
The exception highlighted in the paper is the BERT₃ student on MRPC. The authors associate it with the relatively small training set and suggest that the shallower student may provide an unreliable reward under those conditions. On MRPC with BERT₆, they report a more favorable result for RL-KD. This contrast is informative because the task stays the same and the student depth changes. It supports discussing the reward in relation to the student that produces it, rather than treating the choice of reward as independent of the student architecture.
The paper’s discussion gives these accuracy comparisons as directions and rankings. The described result tables do not supply numerical accuracy entries for the comparisons here. It is possible to identify which strategies lead in the cases the authors name, and to specify the benchmark splits and student depths involved. The number of accuracy points separating those strategies remains unspecified.
What the ablations show
Adding information to the reward
The reward comparison is the closest experiment to a component ablation. The authors evaluate the selection framework with feedback from label loss, then with label loss and distillation loss, and then with a mixture that incorporates development accuracy. The first setting asks whether the student’s fit to the hard targets is enough to guide selection. The second brings in how readily it fits the selected soft targets. The last adds a measure on examples outside the training batch.
The reward with development accuracy yields the best results overall in the authors’ account. This is consistent with the goal of finding teachers whose signals carry over to other examples. A reward based completely on the training episode can increase when the student becomes better at matching the signals already available there. Development accuracy can improve only when the student’s predictions do better on the development examples used for that measure. The authors’ interpretation is that combining these signals better serves generalization than evaluating fit to the training episode alone.
The comparison changes more than the presence of a single quantity. In reward₂, the two negative losses enter directly. In reward₃, γ scales their contribution and the remaining weight goes to development accuracy. The result therefore supports the combined reward design as tested, including its chosen mixture. The paper’s narrative identifies the best overall variant without assigning a separate accuracy gain to each added component on each task. A comparison of the variants at the policy level also leaves open which teacher choices account for the gain.
Changing how teachers contribute
The baseline comparisons provide a second kind of control. Uniform averaging ensures that all teachers contribute equally. A fixed weighted ensemble tests whether different teacher strengths can be accommodated by a single set of coefficients. Random selection at mini-batch level varies the teacher across training without conditioning the draw on the examples. Best-Single-Ensemble conditions on each example and uses the teacher judged strongest by its loss against that example’s label.
This progression helps locate the claim made by the proposed method. An improvement over uniform averaging alone could be explained by the value of differentiating among teachers. The learned fixed ensemble already provides that differentiation and is strong as a predictor. An improvement over the random baseline is also more informative when considered alongside Best-Single-Ensemble, because an instance-level choice keyed to the annotation is a meaningful alternative to a random choice. The paper’s reported pattern favors selection that is adaptive and trained against a measure of student performance.
The Best-Single-Ensemble comparison also clarifies what its upper-bound interpretation covers. It settles the question of which available individual teacher put the most probability on the right answer for a training example. It leaves the shape of the rest of the distribution outside the selection criterion. An average from several teachers can carry a different pattern of probabilities. Since the student learns both from the recorded class and from the full distribution of its soft target, local agreement with the annotation is only one property relevant to the downstream result.
These are comparisons of complete strategies. The proposed approach changes the objective of the selector and the way teacher subsets are sampled, alongside its training schedule and warm-up. The paper does not report a factorial comparison that varies each of those choices independently. Its tests establish how the strategies fare as configured. The contribution of each step in the alternating training procedure remains open.
Changing the student’s capacity
The two student depths make it possible to check whether a result recurs under another capacity setting while keeping the teacher pool and task definitions in view. The single-teacher examples are instructive here. An ALBERT₁₂ teacher yields a better BERT₃ student than the development-weighted ensemble on both MNLI splits and SST-2. An XLNet₁₂ teacher matches or beats that ensemble as a source of supervision for BERT₆ on MRPC and SST-2. The paper uses results of this kind to motivate evaluating the teacher in relation to the learner it is meant to help.
MRPC tests the same issue for reinforced selection. The authors suggest that a less capable student trained with relatively little data gives weaker feedback. Their account predicts that the deeper student can already be useful enough on the task to provide a more dependable reward to the selector. The reported outcomes at the two depths are consistent with that explanation. They are also end-to-end accuracy comparisons. They do not separately quantify reward reliability or identify which teacher inclusions become more effective when depth increases.
The paper uses the state representation, teacher distributions, and teacher label losses jointly. It gives a rationale for including each piece, and the accuracy comparisons test the full selector against the baselines. Separate tests removing just the text encoding, just the teacher probabilities, or just the teacher losses would be needed to determine how much each source contributes. The paper’s comparisons therefore say more about the value of the selection procedure as a whole than about the decision rule it learns for a particular kind of input.
Checking variation across runs
The authors repeat training 5 times for their variance analysis on MRPC and RTE. They compute the mean and standard deviation of the results and apply a two-sided t-test with a significance threshold of 0.05. The comparison table identifies W-Ensemble and LR-Ensemble among the baselines assessed against RL-KD. These runs address whether a favorable result could be peculiar to a single training attempt, an important question for an approach that samples teacher actions.
The authors report variability similar to that of the baseline distillation methods and statistically significant improvements in the comparisons they highlight. The scope of that evidence is the repeated-run analysis on MRPC and RTE. Similar variability means the reported advantages in those comparisons coexist with a degree of run-to-run variation comparable to the baselines. The significance threshold is a setting of the analysis, not a measure of the size of the accuracy gain. The authors’ discussion characterizes the findings without giving the numerical means, standard deviations, or p-values for individual configurations.
Limitations
Limits discussed by the authors
The first limit is the student’s capacity to learn a teacher’s distribution. The motivating ranking reversal and the distillation results show that teacher accuracy is an incomplete guide to the quality of a student. The authors propose that a teacher can express distinctions a shallow classifier has difficulty approximating. Which distinctions are difficult, and how this relates to the amount of training data, remain questions beyond the comparisons they report. Their method addresses the practical selection problem by using the student’s performance as feedback.
The second limit concerns the reliability of that feedback under the tested conditions. The BERT₃ result on MRPC is the authors’ main example. They suggest that the relatively small training set leaves the shallower student less able to provide a dependable signal. The stronger outcome for BERT₆ on MRPC is consistent with this explanation. Establishing a data requirement or a capacity threshold would call for varying those factors independently and measuring the reward itself. The reported case identifies where the problem can arise in this setup.
The authors also identify an evaluation limit for Best-Single-Ensemble. Its selection criterion uses the answer for each example. That makes it usable as a way of building training targets, because the training labels are part of the data available to the student and teachers. The same rule would need privileged information to choose a teacher on a test input. The results therefore compare the students produced by such supervision. They cannot be used to assign the selector an ordinary test accuracy as an independent classifier.
Limits visible in the experimental setup
The evaluation covers classification on GLUE, with BERT students initialized from the same pretrained family and a particular pool of task-tuned teachers. The tasks span different input structures and class decisions, so the paper demonstrates the method across more than one classification problem. Applying the general principle to other output structures would require defining what a teacher contributes for each example and how the student’s reward is measured. The paper proposes broad applicability for teacher–student distillation while demonstrating it within this classification setup.
The evidence is also specific to the tested teacher pool. Varying architectures in the pool creates opportunities for their predictions to complement one another. The paper shows that rankings differ across tasks and that the better standalone classifier can be a less useful teacher. It does not vary the diversity of teachers as a controlled factor. The reported results consequently cannot identify the minimum diversity needed for selection to help or show how performance would respond to a differently composed teacher pool.
The policy depends on labeled training inputs for the teacher cross-entropy features. In the experiments, that information is available. Applying precisely the same state construction to unlabeled data would leave those features undefined. This follows from the formula for the teacher loss, which selects the probability of the annotated class. It is a constraint on the way the paper implements selection. The final student predicts with its own classifier, so the requirement for labels belongs to the training procedure.
The development-based reward also changes the role of the development split. The authors use development performance to choose training settings, and reward₃ uses development accuracy as feedback for the selector. The development split is thus part of the learning procedure for that variant. The test split is the appropriate place to compare final student performance. The fact that the development-based variant leads overall in the stated test comparisons supports its use in this experiment, while the paper leaves the sensitivity to a different choice of development data unmeasured.
The unit of feedback places a limit on what the method reveals about individual actions. One reward follows the batch, and all the sampled decisions for that batch enter the policy update. A favorable reward does not isolate a teacher–example pair as its cause. The paper shows that the aggregate procedure can improve student accuracy. It does not report teacher-selection traces or separate interventions that would establish why the policy prefers a particular teacher for a particular kind of sentence.
Finally, the compression motivation and the experimental outcome have different units. The student depths establish that the evaluation concerns shallower classifiers. The reported student metric is accuracy. Running-time measurements, graphics-processor memory use, and the training cost of operating the teacher pool and selector are outside the reported comparisons. The paper establishes a way to improve the accuracy of the students it trains, while the operational savings of using those students would require measurements in a deployment setting.
What came after
No subsequent study is identified that would establish how later researchers adopted, modified, or tested RL-KD. The question left by the paper is whether the advantage of judging teachers by the student they produce extends beyond these students, this teacher pool, and the GLUE classification tasks.
Cite
Cite as Fei Yuan, Linjun Shou, Jian Pei, Wutao Lin, Ming Gong, Yan Fu and Daxin Jiang. 2020. Reinforced Multi-Teacher Selection for Knowledge Distillation. arXiv:2012.06048.
@misc{yuan2020reinforced,
title = {{Reinforced Multi-Teacher Selection for Knowledge Distillation}},
author = {Fei Yuan, Linjun Shou, Jian Pei, Wutao Lin, Ming Gong, Yan Fu and Daxin Jiang},
year = {2020},
doi = {10.48550/arxiv.2012.06048},
eprint = {2012.06048},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2012.06048}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/yuan-2020-reinforced-multi-teacher-selection-knowledge/
References
- Bahdanau, D.; Brakel, P.; Xu, K.; Goyal, A.; Lowe, R.; Pineau, J.; Courville, A.; and Bengio, Y. 2016. An actor-critic algorithm for sequence prediction. arXiv preprint arXiv:1607.07086 . our card
- Buciluǎ, C.; Caruana, R.; and Niculescu-Mizil, A. 2006. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, 535–541. ACM. OpenAlex ↗ · Scholar ↗
- Chebotar, Y.; and Waters, A. 2016. Distilling Knowledge from Ensembles of Neural Networks for Speech Recognition. In Interspeech, 3439–3443. OpenAlex ↗ · Scholar ↗
- Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 . our card
- Dolan, W. B.; and Brockett, C. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). our card
- Feng, J.; Huang, M.; Zhao, L.; Yang, Y.; and Zhu, X. 2018. Reinforcement learning for relation classification from noisy data. In Thirty-Second AAAI Conference on Artificial Intelligence. OpenAlex ↗ · Scholar ↗
- Fukuda, T.; Suzuki, M.; Kurata, G.; Thomas, S.; Cui, J.; and Ramabhadran, B. 2017. Efficient Knowledge Distillation from an Ensemble of Teachers. In Interspeech, 3697–3701. OpenAlex ↗ · Scholar ↗
- Gong, Y.; Liu, L.; Yang, M.; and Bourdev, L. 2014. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115 . OpenAlex ↗ · Scholar ↗
- Han, S.; Mao, H.; and Dally, W. 2015. Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint . OpenAlex ↗ · Scholar ↗
- Han, S.; Pool, J.; Tran, J.; and Dally, W. 2015. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, 1135–1143. OpenAlex ↗ · Scholar ↗
- Hinton, G.; Vinyals, O.; and Dean, J. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 . our card
- Jiao, X.; Yin, Y.; Shang, L.; Jiang, X.; Chen, X.; Li, L.; Wang, F.; and Liu, Q. 2019. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351 . our card
- Kim, Y.; and Rush, A. M. 2016. Sequence-level knowledge distillation. arXiv preprint arXiv:1606.07947 . our card
- Lan, Z.; Chen, M.; Goodman, S.; Gimpel, K.; Sharma, P.; and Soricut, R. 2019. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942 . our card
- Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; and Stoyanov, V. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692 . our card
- Rajpurkar, P.; Zhang, J.; Lopyrev, K.; and Liang, P. 2016. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250 . our card
- Socher, R.; Perelygin, A.; Wu, J.; Chuang, J.; Manning, C. D.; Ng, A.; and Potts, C. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, 1631–1642. our card
- Sun, S.; Cheng, Y.; Gan, Z.; and Liu, J. 2019. Patient knowledge distillation for bert model compression. arXiv preprint arXiv:1908.09355 . our card
- Sutton, R. S. 1992. Reinforcement learning architectures. Proceedings ISKIT 92. OpenAlex ↗ · Scholar ↗
- Tang, R.; Lu, Y.; Liu, L.; Mou, L.; Vechtomova, O.; and Lin, J. 2019. Distilling Task-Specific Knowledge from BERT into Simple Neural Networks. arXiv preprint arXiv:1903.12136 . OpenAlex ↗ · Scholar ↗
- Wang, A.; Singh, A.; Michael, J.; Hill, F.; Levy, O.; and Bowman, S. R. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461 . our card
- Wang, A.; Singh, A.; Michael, J.; Hill, F.; Levy, O.; and Bowman, S. R. 2019. GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. our card
- Williams, A.; Nangia, N.; and Bowman, S. R. 2017. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426 . our card
- Williams, R. J. 1992. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning 8(3-4): 229–256. OpenAlex ↗ · Scholar ↗
- Wu, M.-C.; Chiu, C.-T.; and Wu, K.-H. 2019. Multi-teacher Knowledge Distillation for Compressed Video Action Recognition on Deep Neural Networks. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2202–2206. IEEE. OpenAlex ↗ · Scholar ↗
- Yang, Z.; Dai, Z.; Yang, Y.; Carbonell, J.; Salakhutdinov, R.; and Le, Q. V. 2019. XLNet: Generalized Autoregressive Pretraining for Language Understanding. arXiv preprint arXiv:1906.08237 . our card
- Yang, Z.; Shou, L.; Gong, M.; Lin, W.; and Jiang, D. 2020. Model Compression with Two-stage Multi-teacher Knowledge Distillation for Web Question Answering System. Proceedings of the 13th International Conference on Web Search and Data Mining . OpenAlex ↗ · Scholar ↗