Elamur Research

MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers

Paper · 2021 · Wenhui Wang, Hangbo Bao, Shaohan Huang et al.

Summary

A large pretrained Transformer can provide a good starting point for many language tasks, but its size makes it expensive to adapt and slow to run. MiniLMv2 asks what a smaller Transformer needs to learn from a larger one before it can take over those tasks. The authors use knowledge distillation, in which a trained teacher supplies targets for a student. In this case the targets come from inside the teacher. They describe how its self-attention mechanism relates positions in a text. The same distilled student can then be adapted to different tasks through fine-tuning.

Self-attention produces query, key and value vectors at each position. MiniLMv2 measures how queries relate to other queries, how keys relate to other keys, and how values relate to other values. It turns each set of pairwise scores into probability distributions and trains the student to reproduce them using KL divergence, a measure of how distributions differ. Before computing the scores, the method joins the vectors from the ordinary attention heads and divides them into new groups called relation heads. The teacher and student have to agree on the number of these groups. They can have different numbers of ordinary attention heads and different hidden widths. The relation head count also need not be a multiple of the ordinary head counts.

The authors supervise the student’s last layer from a single teacher layer. The choice depends on the teacher. The final layer worked best for BERT BASE in the layer comparison, while the larger teachers favored a layer in the upper part of the network below the final layer. The other comparisons show that finer grouping through more relation heads helped in the tested settings. Adding relations between different kinds of vectors also improved results on most tasks in that experiment, at a higher training cost. The main method keeps the query–query, key–key and value–value terms.

The experiments compress BERT, RoBERTa and the multilingual XLM-R. At a commonly used student size, MiniLMv2 improves on DistilBERT, TinyBERT and the original MiniLM across most tasks in the development comparison on GLUE and SQuAD 2.0. Compared with BERT BASE, the 6 × 768 student derived from BERT LARGE fares well and runs 2.0× as fast in the reported comparison. Students from RoBERTa LARGE improve further in the compact development comparison, and the 12 × 768 RoBERTa student surpasses RoBERTa BASE with a smaller batch and fewer training steps during distillation. A multilingual 6 × 384 student improves on mBERT in the cross-lingual comparison with a reported 5.3× speedup. A separate 25M-parameter student is faster than MobileBERT and does better on most of their shared tasks, with grammatical acceptability on CoLA as a notable exception. The authors announced a public release of the distilled checkpoints and code.

Deep dive: MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers

MiniLMv2 trains smaller Transformers to match how larger ones relate tokens in self-attention, even when teacher and student use different head counts. · about 37 minutes to read

The problem and its context

The cost of a reusable starting point

Pretraining gives a Transformer a shared starting point for language tasks that can look very different at evaluation time. A system that will eventually judge whether a sentence is acceptable and a system that will find an answer inside a passage can start from the same pretrained weights. They then adapt those weights to their respective training examples. This is the setting in which the paper discusses language model pretraining.

The authors describe pretrained Transformers with hundreds of millions of parameters and a trend toward still larger architectures. That creates costs at different stages. During fine-tuning, a practitioner needs enough computation to adapt the network to a task. During online serving, each new request has to pass through the network within a useful time. A pretrained system can be an appealing starting point on quality grounds while remaining difficult to use within those constraints. The paper studies compression because the student can be the artifact that gets adapted and served.

Pretraining itself varied substantially across the systems discussed in the paper. BERT uses masked language modeling, which asks the network to predict material hidden in a text from the surrounding context. The authors describe RoBERTa as obtaining stronger results by using more data, larger batches and longer training. They also point to multilingual pretraining as a way to improve cross-lingual understanding and generation. MiniLMv2 starts with teachers produced by these lines of work. The immediate question is how to transfer what a teacher has already learned into a less costly network.

The timing of that transfer matters. A task-specific teacher can guide a student after the teacher has been adapted to a particular task. MiniLMv2 concentrates on an earlier stage. Its student learns from the pretrained teacher on a large text collection, before adapting to an individual benchmark. A practitioner can subsequently fine-tune the student directly. The authors also describe the distilled checkpoint as a possible starting point for another round of distillation specific to a task.

This distinction clarifies the purpose of the data. The distillation corpus supplies text on which the teacher can produce internal training targets. It does not have to supply separate annotations for the eventual tasks. A passage can therefore teach the student something about the teacher’s attention even though the passage comes with no question, answer or judgment of grammatical acceptability. Whether that training transfers is a separate matter, tested by fine-tuning and evaluating the student on task data.

What earlier students learned to copy

The paper presents knowledge distillation as a choice about what information to transfer. One option is to teach the student with probabilities from the teacher’s predictions. Those probabilities are often called soft targets. A single target answer identifies the expected output, whereas a distribution also tells the student how much probability the teacher gives to alternatives. Earlier work discussed by the authors also used hidden states and attention distributions. These targets describe intermediate computations and can be available even when the teacher produces no prediction for the eventual downstream task.

DistilBERT combines information from masked language predictions with information from embedding outputs. Its starting weights also come from the teacher by retaining alternate layers. The initialization and the training targets play different roles. One sets the student’s initial parameters. The other gives it something to reproduce after training begins. MiniLMv2’s students start from random weights, so its relational objective is central to how the teacher guides them.

TinyBERT uses hidden states and information from attention. Its general distillation procedure assigns student layers to teacher layers with a uniform mapping. That arrangement supplies intermediate targets at several depths. TinyBERT also has task-specific distillation and data augmentation procedures. The MiniLMv2 authors use fine-tuning results from TinyBERT’s public task-agnostic checkpoint for the comparison relevant to their own setup.

MobileBERT takes a more architectural approach to making an internal correspondence possible. It uses a teacher constructed with inverted bottleneck modules and a student constructed with bottleneck modules. In the paper’s account, that paired design lets teacher and student share their layer count and align their hidden sizes for layer-by-layer transfer of hidden states and attention information. The teacher and student are designed to work together. MiniLMv2 is motivated by the case in which the teacher is an existing pretrained Transformer that the practitioner wants to compress into a standard student architecture.

The original MiniLM is the closest predecessor. It supervises the student with the teacher’s attention distributions and with relations among value vectors. It also concentrates supervision at the last Transformer layer of each network. The earlier work had found this last-layer transfer preferable to layer-by-layer distillation in its comparisons. MiniLMv2 retains the idea of supervising the last student layer from one teacher layer and revisits which teacher layer should supply the target.

Why attention heads complicate the match

An attention head is a part of a Transformer layer that computes its own pattern of interactions among input positions. If a distillation rule directly compares the teacher’s attention maps with the student’s, it needs to specify which map to compare with which. The standard head-by-head arrangement used in the earlier methods discussed by the authors assumes equal numbers of heads. Different internal widths are manageable if the resulting attention maps have the same shape, but a different number of maps disrupts their direct pairing.

This raises a question about the target rather than the underlying attention mechanism. The networks already produce the queries, keys and values used for attention. Those vectors can be grouped for purposes of measurement independently of how each network groups them to compute its own attention. The distillation target can then be indexed by the new groups and by positions in the input, which gives the loss a common set of comparisons even when the networks’ original sets of heads differ.

The layer decision is distinct. A compatible attention target tells the student what it can compare. A layer mapping tells it where the teacher should provide that target. Choosing the final teacher layer because supervision lands at the final student layer assumes that the two depths are a suitable match. MiniLMv2 treats that assumption as an experimental question, especially when the teacher is substantially deeper than the student.

The method, step by step

From a piece of text to a distillation target

The training process starts with a piece of text and sends the corresponding input through both networks. Each network produces a sequence of hidden vectors at each layer, with a row for every position. At the chosen teacher layer and the final student layer, the method takes the query, key and value vectors computed inside self-attention. These are contextual vectors, so the comparison concerns a position as it appears in this particular input.

A query and a key normally work together to produce an attention score. The query at one position is compared with keys at positions in the same sequence. The resulting weights govern how value vectors from those positions are mixed. MiniLMv2 uses the same ingredients to ask separate questions. For a query at a given position, which other positions have query vectors that score highly against it? The method asks parallel questions about keys and values. These are relationships among positions as represented in a particular layer, and they can be measured without comparing the teacher’s raw vector coordinates directly with the student’s.

To do that across architectures, the method first rearranges the vectors within each network. Consider the queries at a particular position. Each ordinary attention head supplies part of the query representation. MiniLMv2 puts those parts in order alongside one another, producing a single long query vector. It divides that vector into the chosen number of relation heads. The method does this at every position, and performs the same operations separately for keys and values.

The new groups belong to the training target. They leave the teacher’s and student’s ordinary attention calculations in place. Cutting a group across a native head boundary changes which vector components help determine a particular distillation score. In the forward computation of the Transformer itself, those components still belong to their original heads. Thus increasing the number of relation heads refines the measurements used during training without adding ordinary attention heads to the student.

Within a relation head, the method takes the dot products for every pair of input positions. A particular pair of positions gets one score in the query–query matrix, one in the key–key matrix and one in the value–value matrix. That is repeated in every relation head. Each score matrix is scaled and normalized row by row. A row is now a probability distribution over the positions in the sequence, conditioned on the position that supplied the vector on the left side of the comparison.

The teacher and student both perform these operations. They may begin with vectors of different lengths, and even at the relation head stage their vectors may still have different lengths. Yet the final distributions range over the same positions. For each head and each row, the loss asks whether the student puts probability on the positions that the teacher favors. A training update changes the student so its distributions come closer to the teacher’s on the training text.

How MiniLMv2 constructs and matches attention relations

The steps in order.

How MiniLMv2 constructs and matches attention relationsStep 1: Run the same input through teacher and student1. Run the same input through teacher and studentStep 2: Take projections from the chosen teacher layer2. Take projections from the chosen teacher layerStep 3: Take projections from the final student layer3. Take projections from the final student layerStep 4: Join vectors across each network’s attention heads4. Join vectors across each network’s attention headsStep 5: Split vectors into a shared relation head count5. Split vectors into a shared relation head countStep 6: Score token pairs and normalize each row6. Score token pairs and normalize each rowStep 7: Match teacher and student distributions with KL divergence7. Match teacher and student distributions with KL divergenceStep 8: Update the student parameters8. Update the student parameters

Ordinary attention in the paper’s notation

The paper begins with the usual attention projections. A projection multiplies the hidden state at each input position by a learned matrix so that the head has a shorter vector to use for a particular role. Here is the query projection.

Q[l,a] = H[l−1] W^Q[l,a]

Q[l,a] is the query matrix of ordinary attention head a in Transformer layer l. Its rows correspond to input positions. H[l−1] is the sequence of hidden states entering that layer, written as the output from the preceding layer. The index l−1 denotes the preceding layer, and a runs over the Aₕ ordinary heads, where Aₕ is the head count. W^Q[l,a] is the learned query projection for this layer and head. Juxtaposition denotes matrix multiplication. If x is the input sequence, |x| denotes its length. H[l−1] has |x| rows and dₕ columns, with dₕ the hidden width. W^Q[l,a] has dₕ rows and dₖ columns, where dₖ is the width of an ordinary head. Q[l,a] consequently has |x| rows and dₖ columns.

The key projection uses the same incoming hidden states and its own learned matrix.

K[l,a] = H[l−1] W^K[l,a]

K[l,a] is the key matrix for layer l and ordinary attention head a. H[l−1] is the incoming hidden-state matrix. W^K[l,a] is the key projection of that head and layer, with dₕ rows and dₖ columns. The product gives one key vector of width dₖ per input position. The superscript K identifies the projection as the key projection.

The value projection completes the inputs to ordinary attention.

V[l,a] = H[l−1] W^V[l,a]

V[l,a] is the value matrix for ordinary attention head a at layer l. H[l−1] again supplies the incoming hidden states. W^V[l,a] is the learned value projection, with input width dₕ and output width dₖ. The superscript V identifies the kind of vector it produces. The result has |x| rows, one for every input position, and dₖ columns.

The query and key matrices determine the weights, while the value matrix determines what those weights combine.

O[l,a] = softmax(Q[l,a] K[l,a]ᵗ / √dₖ) V[l,a]

O[l,a] is the output of ordinary head a in layer l. Q[l,a], K[l,a] and V[l,a] are its query, key and value matrices. The superscript ᵗ means transpose, which exchanges a matrix’s rows and columns. That allows each query row to be multiplied against every key row to obtain a dot product. The slash denotes division and √dₖ is the square root of the head width. The softmax function transforms the scores in each row into probabilities by exponentiating them and normalizing by their sum. Multiplication by V[l,a] then forms the weighted combination of value vectors. The row of O[l,a] at a given position stores the result of that combination for that position.

The attention weights in this equation live on the input positions. The vectors live in the head’s own coordinate space. That distinction is important for what comes next. A teacher and a student can each calculate a score for the same pair of positions even if they use different numbers of coordinates to calculate it. Conversely, reproducing the attention weights of a teacher does not by itself require the student to produce the same value vectors. The weights give the mixing proportions. The value vectors supply the material being mixed.

Building comparable relation matrices

The paper uses A for the regrouped vectors. The vector type index can be 1 for queries, 2 for keys or 3 for values. The relation type is an ordered pair of these indices. A query–key relation uses queries on the row side and keys on the column side. A key–query relation changes those roles. Row normalization in particular makes those distinct distributions. In each of the main same-type relations, both sides draw from the same set of vectors within a head, but each row still gets its own normalization.

For the teacher, the score and normalization are as follows.

Rᵀ[i,j,l,a] = softmax(Aᵀ[i,l,a] Aᵀ[j,l,a]ᵗ / √dᵣ)

Rᵀ[i,j,l,a] is the teacher’s relation matrix for vector types i and j, teacher layer l and relation head a. The superscript T, written ᵀ, identifies the teacher. Aᵀ[i,l,a] and Aᵀ[j,l,a] hold the regrouped vectors of the two indicated types. They each have |x| rows and dᵣ columns, where dᵣ is the teacher’s relation head width. The superscript ᵗ on the second factor denotes transpose. Their matrix product contains the dot products between the left-side vectors and the right-side vectors at all pairs of positions. Division by √dᵣ scales these scores by the square root of the teacher’s relation head width. Softmax normalizes each row. The resulting matrix has |x| rows and |x| columns.

The student relation matrix has the same position axes, with its own underlying vectors and dimension.

Rˢ[i,j,m,a] = softmax(Aˢ[i,m,a] Aˢ[j,m,a]ᵗ / √dᵣ′)

Rˢ[i,j,m,a] is the student’s matrix for vector types i and j at layer m and relation head a. The superscript S, written ˢ, identifies the student. The index m denotes the student layer used for supervision, which is its final Transformer layer. Aˢ[i,m,a] and Aˢ[j,m,a] are the student’s regrouped vector matrices, with |x| rows and dᵣ′ columns. The prime in dᵣ′ distinguishes the student’s relation head width from the teacher’s dᵣ. The superscript ᵗ, the division by the square root and the row-wise softmax play the same roles as for the teacher. Both relation matrices end up indexed by the same input positions.

For a given type pair, stacking the relation matrices across heads adds a head axis to the two position axes. Aᵣ denotes the count along that axis. Since the two networks use the same Aᵣ, the loss can compare head a in the student with head a in the teacher. This correspondence is between groups produced by the chosen partition. It does not assume that the original head with a particular index has an equivalent head in the other network.

A useful special case is query–key. When the grouping matches the original head partition, the query–key relation has the same computation as the attention weights before they are applied to values. This shows how the paper’s relation definition includes the familiar attention map as a possible target. It also shows what changes in the main objective. The student matches relationships within each vector type, while its own forward computation continues to use queries and keys together to weight values.

The paper’s claim about head flexibility is specifically about the ordinary head counts. The described partition assigns equal widths to all relation heads within a given network. For that partition to work as written, the concatenated width must split into the chosen number of equal groups on each side. The group width can differ between the networks. What need not line up are the boundaries of the relation groups with the boundaries of the ordinary heads. A group can lie within an original head or include components from neighboring heads.

How the student is scored

The loss for a type pair measures the gap between the corresponding teacher and student distributions. The paper uses KL divergence with the teacher’s distribution as the first argument.

ℒ[i,j] = (1 / (Aᵣ |x|)) ∑(a=1…Aᵣ) ∑(t=1…|x|) Dₖₗ(Rᵀ[i,j,l,a,t] ∥ Rˢ[i,j,m,a,t])

ℒ[i,j] is the loss for vector types i and j. Aᵣ is the shared relation head count, and |x| is the input length. The sums, denoted by ∑, run over the relation head index a and the source position index t. Each runs from 1 through the upper limit shown. Rᵀ[i,j,l,a,t] is row t of the teacher’s matched relation matrix in layer l, and Rˢ[i,j,m,a,t] is row t of the student’s matrix in layer m. Dₖₗ is the Kullback–Leibler divergence, and the double bar separates the distribution used as the target from the distribution being trained to match it. The factor in front takes the mean over heads and source positions.

KL divergence gives a penalty for disagreement that depends on the teacher’s probabilities. If the two distributions agree, that row contributes no divergence. If the teacher places substantial weight on a position and the student gives it little weight, the disagreement matters to the loss. Each comparison concerns a whole row. A student that finds the teacher’s favorite position can still incur a penalty if it distributes the rest of the probability differently.

The overall objective adds the losses for the enabled type pairs.

ℒ = ∑(i=1…3) ∑(j=1…3) α[i,j] ℒ[i,j]

ℒ is the total relation distillation loss for the input. The indices i and j each run from 1 through 3, over queries, keys and values in that order. The two ∑ signs enumerate the ordered pairs. ℒ[i,j] is the loss for a pair, and α[i,j] is its binary weight. A weight of 1 includes the term and a weight of 0 excludes it. In the main setup a pair is included when both sides are queries, both are keys or both are values.

The loss supplies a target at the final student layer, and training updates the student parameters through that computation. Earlier student layers still affect the result because they determine the hidden states on which the last layer operates. They receive training through that dependency. The method therefore supervises one student layer directly while allowing the rest of the network to adjust in service of the same objective.

Choosing a teacher layer and running training

For BERT LARGE and BERT LARGE-WWM, the authors choose layer 21, counting the first layer as 1. For RoBERTa LARGE and XLM-R LARGE, the choice is layer 19. These are teachers in the large-size class, described as having 24 layers and a hidden width of 1024. For base-size teachers, the authors use the last layer. The selected layer supplies all the relation types used in a given run. The method does not use a different teacher depth for queries, keys and values.

The BERT experiments use the uncased teachers and train from English Wikipedia and BookCorpus. The RoBERTa student experiments use corpora similar to those in the teacher’s pretraining setup. The multilingual students use the same datasets as XLM-R. These are data choices for distilling a reusable student. The labeled data used later to adapt the student to a benchmark have a different role.

The student weights are randomly initialized. For the BERT training recipe, the batch size is 256, the peak learning rate is 6e-4 and the training length is 400,000 steps. The learning rate rises linearly over the first 4,000 steps and then decays linearly. The batch size describes how much input is grouped for an update, while the learning rate governs the scale of that update. The warmup schedule gives the run time to reach the peak rate before decay begins.

The optimizer is Adam, using a first-moment coefficient of 0.9 and a second-moment coefficient of 0.999 in the BERT recipe. These coefficients govern how the optimizer carries forward estimates based on past gradients. The sequence limit is 512, the dropout rate is 0.1 and weight decay is 0.01. The RoBERTa 12 × 768 student uses 0.98 for Adam’s second-moment coefficient, with 0.9 for the first and the remaining hyper-parameters following the BERT recipe. The multilingual distillation runs for 1,000,000 steps.

All the students are configured with 12 ordinary attention heads. The main relation head settings are 48 with base-size teachers and 64 with large-size teachers. These counts describe the training comparison. Each student still uses its ordinary attention heads when it processes an input for a task. The paper reports mixed-precision distillation on 8 V100 GPUs, giving the hardware context for training. It announces the intended public availability of both the distilled weights and the implementation.

Experiments and results

What the downstream evaluations measure

The experiment tests the value of the distilled checkpoint by adapting it to actual language tasks. In the English experiments those tasks come from GLUE and the extractive question answering benchmark SQuAD 2.0. The multilingual experiments use XNLI for sentence-pair classification and MLQA for finding answers in passages. In each case a useful internal match is one that leaves the student able to learn the downstream task.

GLUE brings together tasks that require different judgments from a sentence representation. SST-2 asks for a sentiment classification, and CoLA asks for a judgment of grammatical acceptability. MRPC and QQP concern paraphrases, while STS-B evaluates semantic similarity. The inference group consists of MNLI, QNLI, RTE and WNLI. This mix lets an overall comparison cover different uses of the same checkpoint. It also matters when interpreting an exception on an individual task. A change that helps a student decide whether two sentences convey similar content can behave differently on judgments about whether a sentence is acceptable.

The paper’s tables use task-specific metrics and distinguish development results from test results. In the main compact-student development comparison, it reports F1 for SQuAD 2.0 and Matthews correlation coefficient for CoLA, with accuracy for the other entries. Accuracy counts correct predictions. Matthews correlation coefficient measures agreement between predicted and actual labels, accounting for the pattern of correct and incorrect classifications across labels. In the 12 × 768 development comparison the paper also specifies Pearson correlation for STS-B, which assesses linear agreement with the benchmark’s similarity judgments. Those development tables average fine-tuning results across 4 runs.

The reported GLUE test comparison for the 6 × 768 BERT students uses F1 on QQP and MRPC, Spearman correlation on STS-B and Matthews correlation coefficient on CoLA. Spearman correlation evaluates agreement in ordering. The other GLUE entries in that comparison use accuracy, and SQuAD 2.0 is still evaluated by F1 on its development set. The switch in metrics matters if a reader compares results across tables. Even on the same task, a development accuracy entry and a test F1 entry summarize different information.

In extractive question answering, the answer, when present, is a continuous stretch of the passage. SQuAD 2.0 also contains questions for which the passage provides no answer. F1 gives credit for overlap between a predicted span and an answer rather than requiring every prediction to match a reference exactly. The task thus probes whether the student can make useful position-sensitive decisions in a passage, a different use of the distilled representation from classifying an entire sentence pair.

XNLI tests inference across 15 languages. The paper reports accuracy separately by language and average accuracy across languages. It chooses a single checkpoint on the joint development set over the languages in the benchmark. For MLQA, which evaluates extractive question answering in 7 languages, the authors fine-tune using SQuAD 1.1 and use the English portion of the MLQA development set for early stopping. They report F1 and exact match for each language. Exact match requires agreement with an accepted answer as a whole, so the combination of the metrics distinguishes complete matches from overlap.

The appendix gives the adaptation settings used for these comparisons. GLUE uses a sequence limit of 128 and a batch size of 32. The candidate learning rates are 1e-5, 1.5e-5, 2e-5, 3e-5 and 5e-5. The authors choose among 3, 5 and 10 epochs for different students, with a longer schedule of 25 epochs for CoLA. The warmup proportion is 0.1 and weight decay is 0.01. An epoch is a pass through the training data, so the CoLA setting gives the task more such passes in spite of using the same distilled starting point.

For SQuAD 2.0 the sequence limit is 384 and the batch size is 32. The learning rate is chosen from 3e-5, 6e-5, 8e-5 and 9e-5, and fine-tuning lasts 3 epochs. The warmup proportion is 0.1 and the weight decay is 0.01. XNLI uses a sequence limit of 256, a batch size of 64 and 10 epochs. MLQA uses a limit of 512, a batch size of 32 and 4 epochs. The multilingual tasks both draw their candidate learning rates from 3e-5, 4e-5, 5e-5 and 6e-5. This benchmark-specific stage is where the task’s labels or answer spans supervise the student.

Compact English students and stronger teachers

The main development comparison includes 6 × 768 and 6 × 384 students, where the figures indicate layer count and hidden width. The wider of the two is important because previous methods frequently turned BERT BASE into a student of that size. The paper can therefore ask how training objectives compare in a familiar architecture. It can also ask whether reducing the hidden width further changes the usefulness of access to a large teacher.

The earlier distilled systems in the development comparison include DistilBERT, TinyBERT and the original MiniLM. The paper uses published results for several of these baselines. It also includes BERT SMALL, trained with masked language modeling without distillation, and a truncated BERT BASE. Truncation drops the top 6 layers from the base network. This baseline asks how far one can get by using existing pretrained weights and removing computation from the top, while BERT SMALL provides a comparison with small-scale masked language training.

Using BERT BASE as the teacher and a 6 × 768 student, MiniLMv2 outperforms the earlier distilled systems and the small and truncated BERT baselines across most tasks in the development comparison. This result locates the method against alternatives at a common student size. It is distinct from the separate question of whether a larger teacher improves what that same student can learn.

The authors answer that second question by training students of both widths from BERT LARGE. At each width the large-teacher student improves on the corresponding one from BERT BASE in the development comparison. The 6 × 768 version compares favorably with BERT BASE in task performance while running at a reported 2.0× its speed. The paper also evaluates the BERT students on GLUE test sets with SQuAD 2.0 development results. For the 6 × 768 student distilled from BERT BASE, it reports retention of more than 99% of the teacher’s accuracy in that comparison while using 50% of its Transformer parameters. The parameter figure applies to the Transformer portion, and the accuracy statement is a reported comparison with the teacher instead of an accuracy value for a particular dataset.

The RoBERTa LARGE students improve further in the compact development comparison. That extends the result beyond choosing between versions of BERT. It shows that the same kind of attention supervision can produce useful students from a different pretrained family. The experiments also change the teacher’s pretraining setting when they change families. The improvement is therefore a result for the complete teacher-and-student arrangement, with the teacher’s training history part of the comparison.

Distilling to base size and comparing with MobileBERT

The authors also train 12 × 768 students from the large teachers. These preserve the size class of the base systems that they are compared with. The BERT student surpasses BERT BASE in the reported development comparison, and the RoBERTa student surpasses RoBERTa BASE. A base-size student gives the method another use. A practitioner with an existing size budget can use a larger trained teacher to improve the student within that budget.

The RoBERTa comparison also concerns the amount of data processed during student training. The authors describe the student’s training batch as nearly 32× smaller than RoBERTa BASE’s and report that the student trains for fewer steps. On that basis they say its training uses fewer examples. The large pretrained teacher still contributes to the procedure by producing the targets. The comparison measures the student training schedule against the base pretraining schedule, with the teacher already available.

A separate experiment compresses BERT LARGE-WWM, the whole-word masking teacher, into a 12 × 384 student with an embedding width of 128. The embedding width describes the representation of an input token before the wider Transformer computations. This student has 25M parameters, putting it alongside MobileBERT in parameter count. Both approaches use English Wikipedia and BookCorpus for this comparison. The paper describes the public BERT LARGE-WWM teacher as attaining performance similar to MobileBERT’s teacher.

The authors first use this size and teacher to compare MiniLMv2 with a reimplementation of MiniLM. They report development results on SQuAD 2.0, MNLI-m and SST-2. MNLI-m is the matched portion of the inference benchmark. MiniLMv2 comes out ahead in that comparison. The reimplementation also allows the authors to test an upper-middle teacher layer with the original MiniLM objective. That change helps MiniLM as well, giving the layer result a significance beyond the new loss.

The comparison with MobileBERT uses GLUE test sets and SQuAD 2.0 development results. The MiniLMv2 student does better on most tasks and has a reported inference speed advantage. It is weaker on CoLA. The authors calculate MobileBERT’s speedup from MobileBERT’s reported latency, and the systems differ in architectural design. MobileBERT’s student uses 24 layers and bottleneck modules, while the MiniLMv2 student uses a standard Transformer with the dimensions above. The parameter match makes this a comparison of similarly sized outcomes under different designs.

Multilingual performance and reported speed

The multilingual evaluation asks whether the same objective can transfer a representation useful across languages. It includes students trained from XLM-R BASE and XLM-R LARGE. On the inference side, the relation target has to lead to a student that can be adapted to judge sentence pairs across the benchmark languages. On the question answering side, the student has to adapt from the SQuAD 1.1 training examples and retain the ability to find answer spans in the languages covered by MLQA.

The paper reports that its XLM-R students outperform the original MiniLM in the multilingual comparisons. It also reports an advantage over multilingual BERT, or mBERT, for the 6 × 384 student, alongside a 5.3× speedup relative to mBERT. These findings extend the task-agnostic distillation result to multilingual evaluation. The reported language-by-language accuracies for XNLI and the F1 and exact match reporting for MLQA give each benchmark a more detailed view than a single multilingual score would.

The English and multilingual speed claims use different baselines. The English result compares a wider BERT student with BERT BASE in the experiments associated with GLUE and SQuAD 2.0. The multilingual result compares a narrower XLM-R student with mBERT in the experiments associated with XNLI and MLQA. The values are inference speedups reported in those evaluation contexts. They are not task scores, and the reference systems are part of what each value means.

Reported student inference speedups in the GLUE and SQuAD and XNLI and MLQA comparisons

Both students run faster than their respective reference systems.

Reported student inference speedups in the GLUE and SQuAD and XNLI and MLQA comparisonsMiniLMv2 6 × 768 from BERT LARGE vs BERT BASE (this paper): 2.0MiniLMv2 6 × 768 from BERT LARGE vs BERTBASE (this paper)2.0MiniLMv2 6 × 384 from XLM-R vs mBERT: 5.3MiniLMv2 6 × 384 from XLM-R vs mBERT5.3
The numbers
System or settinginference speedup ×
MiniLMv2 6 × 768 from BERT LARGE vs BERT BASE (this paper)2.0
MiniLMv2 6 × 384 from XLM-R vs mBERT5.3

What the ablations show

Which vector relationships help

The relation ablation holds the student architecture and teacher fixed while changing the targets in the loss. The student is 6 × 384, the teacher is BERT BASE and the relation head count is 12. The comparison examines development results on three tasks. This setup is narrower than the main experiments, which run across several teachers and sizes. Its value is that differences between runs can be read against a more specific change to the supervision.

The authors find a positive contribution from the query–query, key–key and value–value relations. These targets each constrain a different input to self-attention. The query term concerns the similarities among the representations used to seek information. The key term concerns similarities among the representations on which that search is scored. The value term concerns the material that can be combined by the attention output. Matching the resulting distributions gives the student a training signal about each set of vectors in its own right.

The paper also compares the three same-type terms with query–key plus value–value supervision. Query–key is the natural point of comparison because the ordinary attention computation uses queries against keys to choose weights. Pairing it with value–value supervision makes the setup resemble the information transferred in the original MiniLM. The same-type combination performs better in the controlled comparison. One reading is that separate query and key geometries supply useful information beyond a teacher’s already combined query–key scores.

The comparison changes both the kinds of relations and the number of enabled terms. It gives evidence for the chosen combination as a usable objective. It does not establish that one can explain the entire gain by identifying a single property of query–query or key–key scores. The method also compares softmax-normalized distributions, so its result concerns patterns of relative scores as used by the loss. It gives no direct measurement of how closely the raw coordinates of the student’s projections resemble the teacher’s.

The discussion presents a broader comparison that adds the cross-type relations. The additions are query–key, key–query, query–value, value–query, key–value and value–key. Improvements appear on most tasks in those runs and are especially evident for students distilled from BERT. Cross-type supervision is therefore compatible with the idea behind the method, and the diagonal choice of type pairs is a practical decision about how much relation computation to perform.

Every added term requires the construction of more pairwise scores and normalized distributions during distillation, on both the teacher and student sides. The authors choose the three same-type terms for the main experiments to balance that expense against the extra performance. The wider objective tests what happens when they buy more supervision with more computation. Their reported gains motivate the comparison, while the added training work explains the default.

How to read the teacher-layer comparison

The teacher-layer analysis fixes the student size at 6 × 384 and varies the source of the training target. The paper plots this comparison for BERT BASE, BERT LARGE and XLM-R LARGE. In BERT BASE, supervision from the last layer gives the strongest result among the depths evaluated. BERT LARGE and XLM-R LARGE favor an upper-middle layer. The authors observe the same broad pattern for BERT LARGE-WWM and RoBERTa LARGE.

The exact choices emphasize that the useful depth is teacher-dependent. Layer 21 is the chosen source for BERT LARGE and BERT LARGE-WWM, and layer 19 is the chosen source for RoBERTa LARGE and XLM-R LARGE. Both are well into a large teacher, with further layers still above them. The student receives the target at the same place in every case, its final Transformer layer. The comparison changes where the teacher provides the signal while keeping the student’s supervised endpoint fixed.

A layer in a trained teacher can be valuable in at least two distinct senses. It can support good performance as part of the teacher’s own full computation, and it can give a compact student a useful training target. The experiments measure the latter by fine-tuning the resulting students. In the large-teacher setups the final layer is farther along the teacher’s computation, but the empirical result favors a lower target. The paper does not give a direct measurement of what knowledge makes the chosen layers easier or more useful to imitate.

The reimplemented MiniLM comparison helps identify the scope of the layer result. Moving the source to an upper-middle layer improves MiniLM when the teacher is BERT LARGE-WWM. The benefit therefore appears even with the older attention and value targets. It is evidence that teacher depth is a choice in its own right, alongside the selection of which internal quantities to match.

What increases when there are more relation heads

The relation head count varies in experiments with a 6 × 384 student and base teachers from BERT and RoBERTa. Higher counts give better downstream performance in the tested settings. With a fixed concatenated width, splitting into more groups gives each group fewer components and provides more separately scored comparisons. Each comparison has its own normalization over input positions. The effect is therefore more detailed supervision of how groups of components distinguish positions.

For intuition, consider a query vector whose components contribute different patterns of dot products. A score formed from a wide group combines all of those contributions before normalization. Smaller groups expose separate patterns to the loss. A student can then receive a penalty for missing one of those patterns even if the agreement would have looked adequate in a combined score. This explains what the paper means by finer-grained knowledge at a computational level. Whether any group acquires a human-interpretable role is a different question.

The study also finds useful configurations whose relation head count is not a positive multiple of both networks’ ordinary head counts. That observation matters because a simple subdivision of every original head into the same number of pieces would impose such a requirement. Joining all the components before cutting new groups lets a relation head take part of an ordinary head or straddle a boundary. The result demonstrates flexibility in the construction of the training target within the chosen architectures.

Finer supervision has a cost even though each group’s vectors are narrower. The method makes a normalized position-by-position matrix per group for every enabled relation. The student’s own forward attention architecture stays fixed as this training head count changes. This is why a gain from increasing the count in the ablation concerns the training signal and its cost, rather than a gain obtained by deploying a student with more attention heads.

The grammatical acceptability exception

The CoLA result against MobileBERT motivates a further comparison. The MiniLMv2 student is weaker at judging grammatical acceptability, and the authors suggest that a language modeling objective can teach detailed linguistic information useful for that task. They try additional adaptation with masked language modeling, following the approach they discuss in connection with MobileBERT.

That preliminary trial improves CoLA and leads to slight declines on other GLUE tasks. It gives a concrete case in which the training signal preferred for one downstream score is less attractive across the collection. The paper uses the result to explain the tradeoff rather than incorporate masked language modeling into the default MiniLMv2 objective. Because the trial is preliminary, it establishes a task-dependent response in that setting and leaves open how the balance would change with other teachers or student sizes.

Limitations

Qualifications the authors give

The authors treat the MobileBERT experiment as a reference comparison. The two students have similar parameter counts, but their teachers and architectures are designed differently. MobileBERT’s bottleneck design supports a different depth and layer-level correspondence. MiniLMv2 instead works with a pretrained teacher and uses a standard Transformer student. The authors’ speed comparison also uses MobileBERT’s reported latency. Together these qualifications limit what the reader can attribute to the distillation loss alone.

The authors acknowledge a computational tradeoff in using more relations. The additional cross-type terms frequently improve results, but they make training more expensive. The main objective selects the same-type terms as a compromise. This is a restriction of the recipe that produced the main results. The broader family of relation objectives contains more expensive configurations with their own performance profiles.

The paper also identifies automatic teacher-layer selection as future work. It derives the source-layer choices from experiments with particular teachers. A practitioner following the paper has evidence for those choices on the named teachers and evidence that teacher size matters in the tested group. A general rule that predicts a good layer for a new teacher is left open. The authors likewise propose trying the method on larger pretrained Transformers in future work.

Finally, the authors flag CoLA as a weakness in the MobileBERT comparison and characterize the masked language modeling follow-up as preliminary. The improvement on grammatical acceptability and declines elsewhere motivate further investigation of the objective. They supply a measured exception to a broad pattern of favorable task results and constrain claims about the value of adding language modeling supervision.

Limits of the experimental design

The evaluated student architectures all use 12 ordinary attention heads. The loss supports a student head count different from the teacher’s because it aligns regrouped tensors. That is a structural result. The reported experiments supply evidence about the chosen student head count and about varying the separate relation head count. They leave open the performance of students with other ordinary head counts after holding hidden width and the rest of the architecture fixed. Those experiments would answer an architectural question beyond whether the loss can be computed.

The selected training target is also partial. The loss compares normalized relations from one teacher layer to the corresponding relations in one student layer. Agreeing on the distributions allows different internal vectors to produce similar similarities over positions. It also leaves other layers unsupervised by a direct teacher target. This is part of what makes the loss usable across different widths and depths. The empirical support comes from downstream performance, so claims about full internal equivalence or faithful teacher behavior on untested inputs would exceed what the tests establish.

The layer comparisons evaluate a single source layer at a time. They establish that selecting an upper-middle layer can help for the large teachers in these settings. They leave open whether signals combined across several teacher layers would be more useful, or whether the best source changes with the relation types or student dimensions. The finding should also be read at the level of the evaluated tasks. An alternative layer could be preferable for a use with different downstream priorities.

The ablation for individual relation types uses one teacher, one student size and a fixed grouping. The trend with more relation heads is also based on particular teachers and the head counts the authors try. The experiments justify the choices for the tested regime. They give neither a general ranking of relation types across architectures nor evidence that further increases in relation head count will continue to help. Finer partitions, different training budgets and changing hidden widths can all affect the comparison.

Teacher strength is partly entangled with other choices. BERT and RoBERTa differ in how they were pretrained, and the distillation corpus choices for their students follow the respective setups. The conclusion that students from RoBERTa LARGE improve on the reported compact development tasks is a comparison of realized systems. It does not isolate how much of that improvement comes from the teacher’s upstream training, the distillation data or the match between teacher and student in the chosen objective.

Efficiency has several accounting boundaries in these experiments. The student can use fewer training examples than a separately pretrained base system while relying on an already trained large teacher. The teacher produces the relation targets during distillation. Relation calculations add training work, particularly as the group count and number of terms increase. A speedup after training answers a different question from the total resources needed to produce the student. Deployment latency also depends on the implementation and the conditions under which it is measured, beyond the architecture and relative numbers reported here.

The benchmarks concern language understanding and extractive question answering. The multilingual experiments test inference and answer extraction across the languages available in XNLI and MLQA, under particular checkpoint selection and early stopping protocols. These experiments leave generation and applications outside the benchmark task families open. The strongest conclusion is that relational supervision yields useful compact starting points for the tasks actually tested, including cross-lingual transfer under the reported evaluation procedures.

What came after

The later papers cite MiniLMv2 across several branches of language research. Their titles and stated subjects identify the problems for which that citation appears. Those descriptions support a distinction between a shared question, such as what knowledge to transfer, and a documented reuse of the particular query, key and value objective.

Pretraining and distillation targets

DeBERTaV3 studies ELECTRA-style pretraining and gradient-disentangled embedding sharing. The point of contact with MiniLMv2 is the training of representations that will subsequently support language understanding. MiniLMv2 has a pretrained representation to draw from and defines a target for a smaller network. DeBERTaV3 addresses how to train the representations in the first place through its pretraining procedure. The citation connects those questions without establishing use of MiniLMv2’s relation heads in that procedure.

MiniPLM addresses knowledge distillation for pretraining language models. This shares MiniLMv2’s interest in making the benefits of teacher supervision available before task-specific adaptation. MiniLMv2 makes that idea concrete for pretrained Transformers by reading targets from inside attention on general text. The later work’s stated subject puts distillation in language-model pretraining itself. The citation establishes the methodological connection, while the title alone does not identify which MiniLMv2 targets or architecture choices, if any, it uses.

MiniLLM studies on-policy distillation of large language models. Its stated focus changes the question about how distillation examples are obtained. On-policy training concerns behavior generated under the policy being trained. MiniLMv2 uses corpus inputs and compares the teacher’s and student’s internal distributions on those inputs. Both are teacher-guided training settings, and the citation links them at that level. One emphasizes the source of behavior for training, while the other makes the measurement inside self-attention the central design choice.

Towards Cross-Tokenizer Distillation presents a universal logit distillation loss for the problem of training across tokenizers. Logits are scores before conversion to prediction probabilities. A tokenizer determines the units on which a network operates, so changing tokenizers raises a question about which prediction units can be compared. MiniLMv2 solves a different compatibility problem by creating a shared set of relation heads and comparing corresponding input positions. The later paper’s stated focus is the compatibility of output targets when tokenization differs, extending the broader distillation question to another source of mismatch.

Low-Rank Compression of Language Models via Differentiable Rank Selection addresses compression through rank selection. Matrix rank concerns how many independent dimensions a matrix uses, and the title places the choice of rank inside an optimizable procedure. MiniLMv2 uses a prescribed student architecture and an objective for learning its parameters from a teacher. The connection is the problem of deciding how a smaller system should retain useful behavior. The later work identifies a way to choose a dimension of the compressed computation, while MiniLMv2 identifies an internal comparison with which to train the compact system.

Multilingual representations and their uses

Adapting Pre-trained Language Models to African Languages via Multilingual Adaptive Fine-Tuning studies adaptation to a particular set of languages. MiniLMv2’s XLM-R experiments establish a compression result on multilingual inference and question answering. The later paper’s stated focus is adapting pretrained systems to African languages through multilingual fine-tuning. The connection is that the value of a pretrained starting point ultimately depends on the languages and tasks to which it can be adapted. The citation and title do not establish a transfer of the relation loss to that adaptation procedure.

Text Embeddings by Weakly-Supervised Contrastive Pre-training concerns representations of text trained with weak supervision and a contrastive objective. A contrastive objective trains representations by comparing examples whose relationship supplies a learning signal. MiniLMv2 instead defines its supervised comparisons between positions inside the same input and takes the teacher’s distributions as targets. The later work cites MiniLMv2 in a setting where the intended representation is a text embedding. The relationship is through reusable representations, with different units of comparison and different stated sources of supervision.

MMTEB addresses evaluation through a multilingual text embedding benchmark. MiniLMv2 assesses multilingual students on XNLI and MLQA, where evaluation follows task adaptation and measures the resulting predictions. MMTEB’s stated subject is benchmarking embeddings across languages. Its citation places the compression work in the broader landscape of multilingual representations and their evaluation. It supplies no evidence by itself that the benchmark adopts MiniLMv2’s training method or its downstream evaluation protocol.

English Prompts are Better for NLI-based Zero-Shot Emotion Classification than Target-Language Prompts connects inference to another multilingual use. Its stated comparison varies prompt language for emotion classification performed through natural language inference. MiniLMv2 uses inference as a downstream benchmark to evaluate a distilled checkpoint. The later paper treats inference as machinery for a different task, with the wording and language of the prompt as the variable. This is a connection through how inference capability is used after training, with no documented change to MiniLMv2’s distillation objective.

Across these citing papers, the question closest to MiniLMv2 is how to set up teacher and student comparisons when their computations differ. Other citations connect through compressed pretraining, the uses of multilingual representations or their evaluation. The documented subjects support those links. They leave direct adoption of MiniLMv2’s relation heads and findings about teacher-layer selection open where the later work’s description does not specify either.

Cite

Cite as Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong and Furu Wei. 2021. MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers. Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.findings-acl.188 · arXiv 2012.15828

@inproceedings{wang2021minilmv2,
  title = {{MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers}},
  author = {Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong and Furu Wei},
  booktitle = {Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021},
  year = {2021},
  doi = {10.18653/v1/2021.findings-acl.188},
  eprint = {2012.15828},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2021.findings-acl.188}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/wang-2021-minilmv2-multi-head-self-attention/

References

50 references, from the paper's own bibliography.

  1. Gustavo Aguilar, Yuan Ling, Yu Zhang, Benjamin Yao, Xing Fan, and Edward Guo. 2019. Knowledge distillation from internal representations (http://arxiv.org/abs/1910.03723). CoRR, abs/1910.03723. OpenAlex ↗ · Scholar ↗
  2. Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. 2020. Unilmv2: Pseudo-masked language models for unified language model pre-training. arXiv preprint arXiv:2002.12804. our card
  3. Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, and Danilo Giampiccolo. 2006. The second PASCAL recognising textual entailment challenge. In Proceedings of the Second PASCAL Challenges Workshop on Recognising Textual Entailment. OpenAlex ↗ · Scholar ↗
  4. Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. 2009. The fifth pascal recognizing textual entailment challenge. In In Proc Text Analysis Conference (TAC’09. OpenAlex ↗ · Scholar ↗
  5. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055. OpenAlex ↗ · Scholar ↗
  6. Zewen Chi, Li Dong, Furu Wei, Wenhui Wang, Xianling Mao, and Heyan Huang. 2019. Cross-lingual natural language generation via pre-training. CoRR, abs/1909.10481. OpenAlex ↗ · Scholar ↗
  7. Zewen Chi, Li Dong, Furu Wei, Nan Yang, Saksham Singhal, Wenhui Wang, Xia Song, Xian-Ling Mao, Heyan Huang, and Ming Zhou. 2020. Infoxlm: An information-theoretic framework for cross-lingual language model pre-training. CoRR, abs/2007.07834. our card
  8. Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Unsupervised cross-lingual representation learning at scale (http://arxiv.org/abs/1911.02116). CoRR, abs/1911.02116. our card
  9. Alexis Conneau, Guillaume Lample, Ruty Rinott, Adina Williams, Samuel R Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. Xnli: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP). OpenAlex ↗ · Scholar ↗
  10. Ido Dagan, Oren Glickman, and Bernardo Magnini. 2006. The pascal recognising textual entailment challenge (https://doi.org/10.1007/11736790_9). In Proceedings of the First International Conference on Machine Learning Challenges: Evaluating Predictive Uncertainty Visual Object Classification, and Recognizing Textual Entailment, MLCW'05, pages 177–190, Berlin, Heidelberg. Springer-Verlag. OpenAlex ↗ · Scholar ↗
  11. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805. our card
  12. William B Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). our card
  13. Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. 2019. Unified language model pre-training for natural language understanding and generation. In 33rd Conference on Neural Information Processing Systems (NeurIPS 2019). our card
  14. Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. 2007. The third PASCAL recognizing textual entailment challenge (https://www.aclweb.org/anthology/W07-1401). In Proceedings of the ACL-PASCAL Workshop on Textual Entailment and Paraphrasing, pages 1–9, Prague. Association for Computational Linguistics. our card
  15. Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. 2015. Distilling the knowledge in a neural network (http://arxiv.org/abs/1503.02531). CoRR, abs/1503.02531. our card
  16. Lu Hou, Zhiqi Huang, Lifeng Shang, Xin Jiang, Xiao Chen, and Qun Liu. 2020. Dynabert: Dynamic BERT with adaptive width and depth. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. OpenAlex ↗ · Scholar ↗
  17. Minghao Hu, Yuxing Peng, Furu Wei, Zhen Huang, Dongsheng Li, Nan Yang, and Ming Zhou. 2018. Attention-guided answer distillation for machine reading comprehension (https://www.aclweb.org/anthology/D18-1232/). In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 2077–2086. OpenAlex ↗ · Scholar ↗
  18. Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2019. Tinybert: Distilling BERT for natural language understanding (http://arxiv.org/abs/1909.10351). CoRR, abs/1909.10351. our card
  19. Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. 2019. Spanbert: Improving pre-training by representing and predicting spans. arXiv preprint arXiv:1907.10529. our card
  20. Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization (http://arxiv.org/abs/1412.6980). In 3rd International Conference on Learning Representations, San Diego, CA. our card
  21. Guillaume Lample and Alexis Conneau. 2019. Cross-lingual language model pretraining. Advances in Neural Information Processing Systems (NeurIPS). OpenAlex ↗ · Scholar ↗
  22. Hector Levesque, Ernest Davis, and Leora Morgenstern. 2012. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning. OpenAlex ↗ · Scholar ↗
  23. Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2019a. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461. our card
  24. Patrick S. H. Lewis, Barlas Oguz, Ruty Rinott, Sebastian Riedel, and Holger Schwenk. 2019b. MLQA: evaluating cross-lingual extractive question answering (http://arxiv.org/abs/1910.07475). CoRR, abs/1910.07475. our card
  25. Jianquan Li, Xiaokang Liu, Honghong Zhao, Ruifeng Xu, Min Yang, and Yaohong Jin. 2020. BERT-EMD: many-to-many layer mapping for BERT compression with earth mover's distance. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 3009–3018. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  26. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692. our card
  27. Subhabrata Mukherjee and Ahmed Hassan Awadallah. 2020. Xtremedistil: Multi-stage distillation for massive multilingual models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 2221–2234. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  28. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training (https://s3-us-west-2.amazonaws.com/openaiassets/research-covers/language-unsupervised/language understanding paper.pdf). OpenAlex ↗ · Scholar ↗
  29. Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAlex ↗ · Scholar ↗
  30. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683. our card
  31. Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know what you don't know: Unanswerable questions for SQuAD. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 2: Short Papers, pages 784–789. our card
  32. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text (https://doi.org/10.18653/v1/D16-1264). In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383–2392, Austin, Texas. Association for Computational Linguistics. our card
  33. Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. 2015. Fitnets: Hints for thin deep nets (http://arxiv.org/abs/1412.6550). In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. our card
  34. Hassan Sajjad, Fahim Dalvi, Nadir Durrani, and Preslav Nakov. 2020. Poor man's BERT: smaller and faster transformer models. CoRR, abs/2004.03844. OpenAlex ↗ · Scholar ↗
  35. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019. Distilbert, a distilled version of BERT: smaller, faster, cheaper and lighter (http://arxiv.org/abs/1910.01108). CoRR, abs/1910.01108. our card
  36. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pages 1631–1642. our card
  37. Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and Tie-Yan Liu. 2019. Mass: Masked sequence to sequence pre-training for language generation. arXiv preprint arXiv:1905.02450. our card
  38. Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. 2019a. Patient knowledge distillation for BERT model compression. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pages 4322–4331. our card
  39. Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. 2019b. Mobilebert: Task-agnostic compression of bert by progressive knowledge transfer (https://openreview.net/pdf?id=SJxjVaNKwB). OpenAlex ↗ · Scholar ↗
  40. Henry Tsai, Jason Riesa, Melvin Johnson, Naveen Arivazhagan, Xin Li, and Amelia Archer. 2019. Small and practical BERT models for sequence labeling. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pages 3630–3634. OpenAlex ↗ · Scholar ↗
  41. Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Well-read students learn better: The impact of student initialization on knowledge distillation (http://arxiv.org/abs/1908.08962). CoRR, abs/1908.08962. OpenAlex ↗ · Scholar ↗
  42. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need (http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf). In Advances in Neural Information Processing Systems 30, pages 5998–6008. Curran Associates, Inc. our card
  43. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis platform for natural language understanding (https://openreview.net/forum?id=rJ4km2R5t7). In International Conference on Learning Representations. our card
  44. Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. 2020. Minilm: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. OpenAlex ↗ · Scholar ↗
  45. Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. 2018. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471. OpenAlex ↗ · Scholar ↗
  46. Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference (https://doi.org/10.18653/v1/N18-1101). In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112–1122, New Orleans, Louisiana. Association for Computational Linguistics. our card
  47. Canwen Xu, Wangchunshu Zhou, Tao Ge, Furu Wei, and Ming Zhou. 2020. Bert-of-theseus: Compressing BERT by progressive module replacing. CoRR, abs/2002.02925. our card
  48. Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. 2019. XLNet: Generalized autoregressive pretraining for language understanding. In 33rd Conference on Neural Information Processing Systems (NeurIPS 2019). our card
  49. Sergey Zagoruyko and Nikos Komodakis. 2017. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer (https://openreview.net/forum?id=Sks9\_ajex). In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. our card
  50. Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pages 19–27. our card