A Systematic Study of Knowledge Distillation for Natural Language Generation with Pseudo-Target Training
Paper · 2023 · Nitay Calderon, Subhabrata Mukherjee, Roi Reichart et al.
Summary
A system that writes a question, summarizes an article, or rewrites a passage has to make a series of decisions. Each new token depends on what the system has already written. A large generator may handle those decisions well but take too much time or memory to serve repeatedly. Calderon and colleagues study whether a smaller generator can take over a specific task by learning from a larger teacher. The study treats human-written targets as a scarce resource and asks how much additional supervision can be obtained from task inputs that already exist without answers, summaries, or rewrites.
Their approach combines two forms of knowledge distillation. The first supplies complete generated texts, called pseudo-targets, as material for training. The second asks the student to match the teacher’s predictions about what should come next at each point in a text. The authors test pseudo-targets for both labeled and unlabeled inputs, compare a single preferred output with multiple alternatives, and vary how those alternatives are generated. In their final method, Joint-Teaching, some prefixes come from the teacher’s writing and others from the student’s. The teacher provides the next-token guidance in both cases. This gives the student practice on the kinds of partial outputs it will encounter when it generates independently.
The main experiments cover news summarization, question generation, plausible explanations for pairs of observations, and rewrites of Shakespeare into modern English. Among the pretrained systems tested for task-specific training, encoder–decoder architectures performed better than the decoder-only alternatives. In the BART pruning comparison, removing decoder layers reduced single-output latency substantially while preserving more task performance than removing encoder layers. Adding unlabeled inputs, exposing the student to several outputs per input, and sampling those outputs all helped in the staged comparison. Joint-Teaching won 25 out of 32 comparisons against the teacher-only and student-only versions of pseudo-target training. The final T5 and BART students achieved the paper’s reported 3.7-fold latency improvement over their teachers, with the extent of quality recovery depending on the task and metric.
A separate GPT-4 experiment asks how much of the approach carries over when the student’s ordinary training inputs lack human-written targets. GPT-4 receives labeled demonstrations in its prompt and generates examples for a small T5 student. Using several generated targets remains helpful overall. Transferring next-token probabilities gives mixed results across the two tasks, and the different ways the teacher and student divide text into tokens complicate that transfer. The study therefore provides stronger evidence for using multiple generated targets than for carrying the entire Joint-Teaching procedure into a setting with a costly external teacher.
Deep dive: A Systematic Study of Knowledge Distillation for Natural Language Generation with Pseudo-Target Training
Calderon and colleagues test how sampled outputs and Joint-Teaching help smaller text generators learn from larger teachers while reducing inference costs. · about 39 minutes to read
The problem and its context
The cost of answering the same kind of request repeatedly
The paper starts from the economics of a specialized generation task. Consider a service that turns news articles into short summaries. It may have enough editorial examples to adapt a capable pretrained generator, as well as many articles that lack corresponding summaries. Once deployed, the system has to generate an output for each new article. The cost of adapting it is paid during development. The time and computing resources needed to generate each summary recur throughout its use. The authors study compression under the assumption that these recurring costs dominate the initial training expenditure.
That assumption shapes what counts as a good result. Storage requirements matter, and so does the amount of calculation required to produce text. The experiment also asks how long an individual request takes and how quickly a batch of requests can be processed. A system serving an interactive request exposes its single-output latency directly to the user. A system generating a collection of outputs offline can benefit from processing examples together and may be judged by throughput. The paper measures both because the same architectural change can affect the two workloads differently.
The authors work with available pretrained systems and adapt them to particular datasets using fine-tuning. Their main setting assumes several thousand or more labeled training examples, a larger pool of task inputs without labels, and the resources to do substantial additional work during training. A label in this context is the desired output text paired with an input. A document can be available without its summary, for example. In question generation, the passage and the answer form the input, while the question is the target. A missing target leaves the rest of the input available for distillation.
The specialization matters. A student trained for one dataset is supposed to carry out its particular input-to-output transformation well. Broad imitation of a teacher’s pretrained behavior is a different objective. In the paper’s setup, the authors can first train the teacher for the task, then use its behavior on inputs from that task as supervision for the student. They can also judge both systems on held-out examples with the same requirements. This focus makes the degree of compression and the quality tradeoff measurable within each task.
What a teacher can pass on
The paper places distillation among techniques for building more efficient models. Pruning removes parts of a network, such as entire layers. The authors also describe work on sharing parameters, using lower-precision representations, and factorizing weights. Distillation addresses the training problem created by compression. A smaller system frequently performs worse when both sizes are trained using the same labeled examples. A larger, trained teacher can supply additional information that helps the smaller student narrow that gap. The paper traces this approach to Distilling the Knowledge in a Neural Network.
The authors distinguish several kinds of information that can be transferred. At a particular output position, a teacher can supply scores for the possible next tokens. Those scores give the student a richer target than a single observed token, because they describe how the teacher distributes its confidence across alternatives. A training objective can also require the student to reproduce selected internal behavior, such as relationships in the teacher’s attention layers. The paper discusses earlier work of this kind in compression for language understanding, including TinyBERT.
A third option is to transfer complete outputs. The teacher writes a possible target for an input and the student trains on that pair. The paper’s closest precedent for this procedure is Sequence-Level Knowledge Distillation. The usual procedure in the generation studies the authors discuss was to retain a single output from beam search, which searches among promising continuations for a high-probability sequence. A generated target can be stored and treated as text, and its prefixes can also be used for next-token distillation. These two uses can coexist. A single generated sequence tells the student which prefixes to practice on, while the teacher’s probabilities tell it how the teacher would continue from those prefixes.
Much of the prior work as described in the paper concentrated on distilling broadly useful pretrained systems, understanding tasks, or particular generation tasks such as machine translation. Earlier work on abstractive summarization had compared ordinary fine-tuning after pruning, next-token distillation, and training on a preferred generated target. The authors identify a question left open by that work. If human targets are limited and task inputs are abundant, how much can one gain by varying the inputs, the number of generated targets, and the procedure that generates them? Work on unlabeled inputs elsewhere in language processing motivates this question, including Unsupervised Data Augmentation for Consistency Training.
How a generation error changes the next decision
The motivation for Joint-Teaching starts with a mismatch between training and use. In ordinary supervised training, the generator predicts the next token while being given the actual earlier tokens of the training target. This procedure is called teacher forcing. For a model writing a question, it means that the beginning of the question supplied at each training position comes from the recorded target. During deployment, the beginning comes from whatever the model itself wrote. An early mistake can produce a prefix that is unfamiliar or misleading, and subsequent predictions are then conditioned on that prefix. The paper uses exposure bias for this training–inference mismatch.
Earlier research discussed by the authors linked exposure bias to problems such as error accumulation and degeneration in generated text. One response was to train at the sequence level with reinforcement learning. Another, scheduled sampling, sometimes replaced a ground-truth token with a generated token during training. A difficulty with these substitutions is deciding what the correct continuation should be after the generated text takes a different direction from the reference. The earlier work cited by the paper includes Sequence Level Training with Recurrent Neural Networks.
Distillation supplies a potential answer. The teacher can predict what comes next after reading the student’s actual prefix. Suppose a student starts a question in a different way from the wording in the dataset. The next word in the reference may be an awkward fit for this new beginning. A teacher that understands the passage, the supplied answer, and the student’s prefix can assign higher probability to continuations suited to that context. Joint-Teaching depends on the quality of that conditional judgment. Its purpose is to make the teacher’s guidance available in situations the student is likely to encounter when it writes on its own.
The method, step by step
Choose the architecture before choosing the distillation objective
The authors structure the study as a series of decisions. They start with architecture and pruning, then compare distillation objectives. After that, they vary where pseudo-targets are used, how many are generated, and how they are obtained. The next stage normally inherits the configuration selected on development data at the preceding stage. A development split is held out from training and used to choose configurations and checkpoints. The test split is reserved for reporting performance. This staged design makes the study feasible by narrowing the comparisons at each step.
The architectural comparison concerns two ways to organize a Transformer. An encoder–decoder processes the input with an encoder. Each input position can use information from across that input. A separate decoder generates output tokens in order and uses cross-attention to consult the encoder’s final representations. In a decoder-only system, input and target form a single sequence, with attention at each position restricted to earlier positions. The input still informs output generation, but its representation is built within that same causal stack. The paper relates these structures to the architecture introduced in Attention Is All You Need.
The authors compare pretrained members of the GPT2 and OPT families with pretrained members of T5 and BART. The decoder-only systems are trained on the concatenation of an input, a task-specific separator, and a target. Only the target tokens contribute to the training loss. In an encoder–decoder, the original input and the target prefix already go into separate components. The paper’s main distillation studies proceed with T5 and BART, whose pretrained systems are described in Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer and BART.
T5-S provides a student available directly in a small pretrained form. The other student comes from layer pruning in BART. Starting with BART-6:6, the authors make a version with a shallow encoder and another with a shallow decoder, retaining the first and last layers of the shortened component. In BART-2:6 the encoder has 2 layers and the decoder has 6. BART-6:2 has the reverse arrangement. The experiments reported for the later distillation stages use T5-S with T5-L and BART-6:2 with BART-L. The methods description initially names BART-2:6 as the distillation student, while the pruning results and detailed experiment rows identify BART-6:2 as the student used in those runs.
How the main Joint-Teaching experiment trains a student
The steps in order.
Understand what a target contributes to training
The same news article could support several acceptable summary sentences. In ordinary supervised learning, the annotated sentence supplies the words to predict and the context in which to predict them. If the third token is being scored, the preceding tokens supplied to the decoder come from the target sentence. Changing the target sentence changes the contexts seen in training, even if it conveys much the same information. That is the reason complete pseudo-targets matter to a method with a next-token objective.
The paper writes the supervised objective as a negative log-likelihood. The expression breaks the probability of the complete target into predictions made successively along the target.
Lₙₗₗ(x, y) = −log P(y | x) = −∑ᵢ₌₁^|y| log P(yᵢ | x, y₍₍ᵢ₎)
Here Lₙₗₗ is the negative log-likelihood loss, x is the input token sequence, and y is the target token sequence. P is the probability assigned by the generator, log takes its logarithm, and the vertical bar means “conditioned on.” The sum ∑ ranges over output positions i from 1 to |y|, the target length in tokens. yᵢ is the token at the current position. The final conditioning argument, written y₍₍ᵢ₎ in the block to represent the paper’s “less than i” subscript, is the portion of y before that position. The minus signs turn larger assigned probabilities into smaller losses. At inference time the same prediction is conditioned on the generated prefix, because the target is unavailable.
The paper then compares objectives that give the student access to the teacher on labeled examples. Plain logit distillation, called Logits KD, compares the teacher’s and student’s next-token distributions under the same input and prefix. Logits are the scores used to obtain probabilities over possible tokens. The comparison is described as minimizing a discrepancy measured by Kullback–Leibler divergence, or KL divergence. Matching distributions can tell the student which alternatives the teacher considers plausible, even if the observed target contains only one of them.
The appendix displays the Logits KD objective with a leading minus sign.
Lₗₒg(x, y) = −∑ᵢ₌₁^|y| KL(Pˢ(yᵢ | x, y<ᵢ) ‖ Pᵀ(yᵢ | x, y<ᵢ))
Lₗₒg denotes the word-level distillation objective. x, y, i, |y|, and ∑ retain their meanings from the supervised objective. y<ᵢ denotes the target prefix ending before i. Within Pˢ and Pᵀ, yᵢ ranges over possible next tokens, so the arguments of KL are distributions. The superscripts ˢ and ᵀ identify student and teacher, and ‖ separates the ordered arguments of the divergence. There is a sign inconsistency in the paper. With the usual non-negative definition of KL divergence, minimizing the displayed negative sum would increase the discrepancy. The accompanying description and implementation notes specify minimization of the discrepancy. That stated matching operation is the basis for interpreting the method.
The other objectives test different ways to supply the teacher’s information. Noisy KD perturbs the teacher’s predictions using dropout. In this study, the noise is applied to the teacher’s logits, with the inputs left as they were. Attention-Relations KD supplements the next-token objective with an internal signal. The student learns attention relationships from the last encoder and decoder layers. In the later experiments the authors use Logits KD, the objective selected at this stage on development performance.
Start with one teacher output and then widen the training set
In the initial sequence-level experiment, a fine-tuned teacher uses beam search to generate a target for each labeled input. Beam search carries several possible partial outputs forward and ranks completed sequences. The initial experiment keeps the highest-ranked candidate from a beam of size 16. The paper calls this a mode approximation because the search aims to find a particularly probable whole output under the teacher.
An ordinary sequence-level student can learn the tokens of that candidate through negative log-likelihood. The authors also retain the original labeled target and add its loss. For a labeled input, the resulting objective has a generated term and an annotated term.
Lₙₗₗ(x, ŷᵀ) + Lₙₗₗ(x, y)
Lₙₗₗ is the supervised loss above. x is the shared input, ŷᵀ is a complete sequence generated by the teacher, and y is the human-written target. The hat marks a generated sequence, and the superscript ᵀ identifies who generated it. The plus sign means that learning from the example includes contributions from both sequences. The authors report that retaining the annotated term worked better than using the pseudo-target as the sole sequence-level target.
The combined method makes a further change. At each position of the pseudo-target, it uses the teacher’s distribution over possible next tokens. It applies that same form of supervision along the human-written target as well.
Lₗₒg(x, ŷᵀ) + Lₗₒg(x, y)
Lₗₒg denotes next-token distillation. The first term compares teacher and student on prefixes from the teacher-generated sequence ŷᵀ. The second compares them on prefixes from the annotated target y for the same input x. The plus sign collects the two sources of prefixes in the objective. This distinction between a prefix source and a source of predictive guidance becomes essential later. A method can change the text being followed while retaining the teacher as the source of guidance.
The authors then extend pseudo-target generation to unlabeled inputs. A previously unused input becomes a distillation example as soon as the teacher supplies an output. That output provides a succession of prefixes for the next-token objective. An unlabeled input has only a generated term, since there is no annotated target for the second term. In the news experiment, the effect is to let the student practice on more articles while still seeing supervision from the same summary teacher.
Change the number and variety of targets
The next comparison keeps multiple final beams instead of keeping only the highest-ranked one. The paper represents the loss across the resulting candidate set with the following expression.
∑_{ŷᵀ ∈ Yₖ} Lₗₒg(x, ŷᵀ)
Yₖ is the set of final beam outputs, and ₖ marks the beam size and number of retained candidates, called K in the paper. ŷᵀ is an individual teacher output, ∈ means it belongs to that set, and ∑ adds the loss contributions over the candidates. x is fixed for this collection of outputs. Lₗₒg is the next-token objective applied using the selected output’s prefixes. The formula describes the contribution of the full candidate set. In an individual epoch, the student sees a single candidate for that input and encounters a different one in another epoch.
The authors use this rotation to keep comparisons with single-target methods more comparable. With the same number of input examples contributing per epoch, multiple-target training can vary what the student sees on a return visit to an input. It also leaves human-written targets a larger share of the training material than presenting every generated alternative for each input together. Thus “multiple targets” refers to the variety available over training. It does not require the student to process the whole collection at once.
The subsequent experiment replaces the beam collection with samples. Here the teacher draws a token from a distribution at each position, so successive outputs for an input can take different paths even when the first few words coincide. The authors use nucleus sampling with a probability threshold of 0.95. Nucleus sampling draws from the most probable tokens included up to the chosen cumulative probability threshold. They generate 48 candidate outputs for the sampling experiments and use a beam size of 16 for beam generation. Consequently, the beam and sampling configurations differ in both their decoding rule and the size of the available candidate pool.
The study also tries sampling with a higher softmax temperature, τ = 1.5, where τ denotes the temperature applied when converting scores into probabilities. This makes the distribution flatter, giving less probable alternatives more chance to appear. The intention is to expose the student to a wider range of continuations. How valuable that variation is depends on the resulting targets. A changed prefix may expose another useful way to complete the task, or it may lead into text that the teacher itself would rarely choose under ordinary sampling.
For training efficiency, teacher-generated targets are produced once and reused. Different targets are supplied to the student in different epochs, so the teacher can expand the available training material ahead of time. Student-generated targets have to be treated differently. The current student’s behavior changes as its parameters are updated. Generating its outputs during training gives the teacher prefixes that reflect the student at that point in its learning.
Let the student write some of the prefixes
In the student-only pseudo-target condition, the current student generates a sequence for the input. During the learning update, both teacher and student are evaluated along that sequence, and the student is trained towards the teacher’s distributions. A sampled token can therefore establish the prefix used at a later position even when the distillation signal at the current position favors a different token. This is how the method can provide supervision along mistakes. The student’s writing determines what context is encountered. The teacher’s judgment determines the probability target.
Teacher-only training provides a complementary kind of practice. A good set of sampled teacher targets supplies examples of how a capable generator expresses the task and reaches different parts of its output distribution. The authors expect those prefixes to become closer to ones the student is likely to produce as distillation progresses. They also expect a mixture to be valuable because student prefixes can reveal contexts missing from even a varied collection of teacher outputs. Joint-Teaching combines the two types of generated prefixes in the following objective.
α Lₗₒg(x, ŷᵀ) + (1 − α) Lₗₒg(x, ŷˢ)
α weights the teacher-generated part, and 1 − α is the remaining weight assigned to the student-generated part. x is the task input, ŷᵀ is a sample produced by the teacher, and ŷˢ is a sample produced by the current student, with the superscript ˢ indicating its origin. Lₗₒg compares teacher and student distributions along the indicated sequence in each term. The addition expresses the mixture. The reported experiments use α = 0.5 and randomly use student-generated targets in 50% of the training steps, taking teacher-generated targets in the remaining steps. Human targets are still available in the main setting.
The implementation controls how often the system is updated even when hardware permits different batch sizes. The authors use AdamW and accumulate gradients so that updates occur after 96 training examples across the experiments. Distillation runs allow up to 192 epochs and stop after 16 epochs without an improvement. Each reported run stops before the full allowance. The authors take the best distillation checkpoint, fine-tune for 10 epochs on labeled data, and consider checkpoints from both phases when choosing the final result. That final adaptation uses the human targets and can run without a teacher. The paper names KD4Gen as the repository for the code and datasets.
Why the decoder is a distinct place to prune
The paper backs up its pruning comparison with a simplified complexity argument. Consider an encoder–decoder and a decoder-only network with the same hidden size in the analysis. Input processing takes place over tokens that are all available from the beginning. Output processing is autoregressive, meaning that the next token must be selected before the step that consumes it can begin. The authors assume that earlier decoder states are cached, so each new token can reuse previous work. The encoder–decoder’s time complexity in this analysis is given as follows.
O(m²E + n(m + n)D)
O gives the order of growth in the operation count under the paper’s assumptions. m is the input length, n is the target length, E counts encoder layers, and D counts decoder layers. m²E represents work across the input in the encoder. n(m + n)D represents the combined work of attending to the input and to earlier output positions across decoder layers. The plus sign adds those contributions. Products appear by juxtaposition and the superscript ² denotes a square.
For the decoder-only architecture, the paper gives the corresponding expression below.
O(m²D + n(m + n)D)
O, m, and n have the same meanings. D counts the decoder layers, which perform both the input processing and the subsequent output processing. The first summand describes the input work and the second the target work. In this account, an encoder–decoder with equal encoder and decoder depths has the same order of growth as a decoder-only system with that decoder depth, even though the encoder–decoder has additional layers and parameter sets.
The appendix also considers idealized parallelism during input processing. For the encoder–decoder it gives the following form.
O(mE + n(m + n)D)
O now describes growth under the idealized parallel calculation. m and n are input and target lengths and E and D are layer counts. Parallel calculation changes the encoder term to mE. The part of the expression for generating the output keeps its earlier form because new output tokens depend on previous decisions.
O(mD + n(m + n)D)
This last expression is the analogous parallel case for decoder-only generation. O again indicates the order of growth, m and n denote the sequence lengths, and D denotes the shared decoder depth used to process the input and to generate the output. The first term accounts for parallel input processing and the second for output generation. These formulas explain the expectation that decoder depth has a strong effect on single-example latency. The paper measures throughput separately because batch size and memory utilization also enter the practical comparison.
Experiments and results
What the four tasks require
The main data setup contains four English-to-English transformations. Across them the design aims for a labeled-to-unlabeled training ratio of 1:4. The authors preserve the original train–test assignments for the datasets they adapt, with Shake7 as the exception because they construct that dataset themselves. They hold out development and test data for different purposes. Development data guide the selection of methods and checkpoints. Test data assess what the selected systems produce on examples they did not train on.
| Dataset | Labeled train | Unlabeled inputs | Development | Test |
|---|---|---|---|---|
| XSUM40 | 40K | 164K | 5K | 11.3K |
| SQuAD17 | 17.5K | 70K | 1.57K | 9K |
| ART10 | 10K | 40K | 1.25K | 14.3K |
| Shake7 | 7K | 28K | 0.75K | 0.8K |
In XSUM40, the input is a news article and the output is an introductory sentence that summarizes it. This is an abstractive text summarization task, meaning that the desired output is a written summary rather than a selection of supplied sentences. The experiment allows an input of up to 480 tokens and a target of up to 32 tokens. A candidate summary has to use the article to choose what goes into a short lead. The authors derive the task from XSUM.
In SQuAD17, the system receives material from Wikipedia together with an answer. Its output is a question for which that answer makes sense in the supplied context. This uses SQuAD for the reverse direction of its familiar comprehension task. The experimental cap is 320 input tokens and 32 output tokens. The important distinction for distillation is that the answer is part of the input even when the training question is withheld. The teacher’s job is to generate the missing question.
In ART10, the input consists of two observations. The target is an explanation that makes the later observation plausible in light of the earlier one. This is an abductive reasoning task. The maximum input length is 48 tokens and the maximum target length is 32. The paper gives a case in which someone tries baking bread, realizes the quantities were wrong, and starts again. The annotated explanation identifies a specific mistake with the salt. A generated explanation can make sense by describing a failure to follow the recipe, even if it leaves the ingredient unspecified. Such differences matter when interpreting a score based on similarity to the annotated wording.
In Shake7, the generator rewrites Shakespearean text into modern English. The source and target limits are both 48 tokens. The authors build the dataset from existing collections of parallel original and modernized text, adding original text from another collection to supply unlabeled inputs. The modern versions in the parallel collections are expert-written. The task involves both style transfer and simplification. A plausible modernization can require changes across a whole passage, so a trained system has to learn more than a short list of word replacements. This dataset gives the authors a pool of original passages that is available independently of the paired modernizations.
Which measurements carry which claims
The basic comparison for quality involves a teacher trained on human targets, a small student fine-tuned on the same kind of supervision, and a distilled student of the same size as that student baseline. The earlier architecture and pruning experiments also compare fine-tuned systems before distillation. Keeping the plain small student in the comparison matters because a teacher score alone cannot indicate how valuable the training procedure was. A distilled student close to its teacher may already have been competitive before distillation, or it may have started much further away.
The paper reports BLEU and ROUGE as lexical similarity measures. They compare generated text with target text using overlapping units. The reported ROUGE summary averages the F1 scores of ROUGE-1, ROUGE-2, and ROUGE-L. BERTScore, reported as its F1 measure, compares contextual representations and gives a semantic counterpart to the lexical scores. The authors use a DeBERTa-base backbone adapted on MNLI to calculate it. Perplexity, or PPL, is based on negative log-likelihood on the ground-truth target tokens. A lower perplexity means the system assigns those targets greater probability. Because it is evaluated along the human target, it assesses a different property from the overlap scores computed on the generator’s own completed output. DeBERTa
Development selection uses ROUGE-2 F1 for XSUM40 and BLEU for SQuAD17, ART10, and Shake7. During development evaluation the authors generate predictions for at most 1K examples. Thus the development aggregate used in the staged decisions combines task-specific criteria, while the test comparisons describe several aspects of quality. A stage can be favored by the development criterion even when an alternative records more wins across the full collection of metrics.
The paper expresses the benefit of distillation as the percentage of the teacher–student gap closed.
(KD − S) ÷ (T − S), expressed as a percentage
KD is the distilled student’s task score, S is the fine-tuned student baseline’s score, and T is the teacher’s score, all for the same dataset and metric. The numerator subtracts the student baseline score from the distilled student’s score. The denominator subtracts that same baseline from the teacher’s score. The division sign gives the fraction the authors report as a percentage. When a smaller score is desirable, as with perplexity, improvements towards a teacher with lower perplexity change the numerator and denominator in the same direction. A negative reported gap closure indicates that the distilled variant moved away from the teacher relative to its starting point. A result that goes beyond the teacher can yield a percentage above the entire original gap.
For each dataset, the paper averages gap closure across the four metrics and the two teacher–student pairs. A separate count records the best method across 32 setups, with a setup defined by a dataset, a metric, and a pair. These measures complement the raw test scores. A win count says how frequently a method came out ahead, while normalized gap closure expresses movement relative to the initial student and teacher scores. A raw score is still needed to see what level of performance the system reached.
Efficiency is recorded as parameter count, model memory, floating-point operations, single-output latency, and batched throughput. The authors conduct all profiling on an Nvidia GeForce RTX 4080, after a warmup of 10 steps, averaging 100 measurements. The input and target lengths for profiling use each dataset’s stated maxima. The operation counts describe a full forward step. Throughput is measured at the largest batch size that fits within 16GB during generation and is reported in examples per minute. Single-output latency is measured in milliseconds. These are distinct workloads even though both involve generation on the same device.
Architecture and pruning before distillation
The fine-tuned encoder–decoders lead the decoder-only systems on the task results reported in the architectural comparison. For instance, averaged across the four tasks, T5-L scores 16.4 BLEU and 34.6 ROUGE, while GPT2-L scores 11.9 BLEU and 27.1 ROUGE. Their parameter counts are 737 million and 774 million, respectively. The comparison therefore includes systems of similar parameter scale even though their layers are arranged differently. At the smaller end, T5-S averages 13.4 BLEU with 60 million parameters. OPT-125M averages 10.7 BLEU with 125 million parameters. These are results for task-specific fine-tuning using the pretrained systems selected for the study.
The authors suggest that encoder–decoder input representations are well suited to these tasks. In a news article or a passage accompanying an answer, information from a later part of the input can help interpret an earlier part before output generation begins. The encoder allows that interaction. The decoder also accesses the final input representations from its earliest layer. The benchmark comparison tests complete pretrained systems, so the quality advantage represents their combined architecture, pretraining, and adaptation behavior. The paper confines the claim to the tested size range and fine-tuning setting.
For the pruning comparison, dropping decoder layers yields lower single-output latency and better task metrics than dropping encoder layers. Across the four datasets, the full BART-6:6 averages 147 milliseconds. BART-2:6, with a shorter encoder, averages 146 milliseconds. BART-6:2, with a shorter decoder, averages 75 milliseconds. The differences in mean BLEU among the same fine-tuned variants follow a different ordering. The full system scores 14.5, the encoder-pruned version scores 11.4, and the decoder-pruned version scores 13.3. The shortened decoder preserves more of the full system’s task quality while delivering the faster single output.
Mean batch throughput shows why the study measures both workloads. BART-2:6 averages 16.0K examples per minute, while BART-6:2 averages 15.3K. In XSUM40 and SQuAD17, the inputs are long and the output cap is relatively short. Cutting down input processing is especially helpful for batching those workloads. The appendix’s length-sweep experiment also finds higher throughput for the pruned encoder when the input accounts for a sufficiently large fraction of the total length. The lower latency of the shallow decoder persists through that sweep. The authors take both properties into account in selecting BART-6:2 for distillation.
How much of the teachers’ performance survives compression
Joint-Teaching produces the final distilled students, T5-KD and BART-KD. T5-KD uses the small T5 architecture, and BART-KD uses the decoder-pruned BART architecture. The paper reports reductions of 92% and 75% in parameters relative to the corresponding teachers. The gain in quality can therefore be examined independently of the change in size. The smaller architecture supplies the inference savings and the distillation procedure changes how well it acquits itself at that size.
Fine-tuning and distillation compared on XSUM40 test BLEU
Joint-Teaching raises test BLEU in both student families and brings each closer to its teacher.
The numbers
| System or setting | BLEU |
|---|---|
| T5-S fine-tuned | 7.6 |
| T5-KD with Joint-Teaching (this paper) | 10.7 |
| T5-L teacher | 11.5 |
| BART-6:2 fine-tuned | 9.3 |
| BART-KD with Joint-Teaching | 12.3 |
| BART-L teacher | 13.0 |
The XSUM40 comparison illustrates the use of the small-student baseline. Distillation closes 80% of the T5 student’s BLEU gap on the test split and 79% of the BART student’s. On the same split, the BART teacher records 73.9 BERTScore F1 and its student reaches 73.5, corresponding to 84% gap closure. The normalized percentages measure recovery from the respective smaller baselines. The raw scores show how close the final generators are to the teachers on particular quality measures.
In SQuAD17, both distilled students get 20.9 test BLEU. The T5 teacher gets 22.2 and the BART teacher gets 21.5. The same student score is reported as 57% BLEU gap closure for T5 and 84% for BART. Each fraction depends on the teacher and baseline within its own family. On SQuAD17 test ROUGE, the BART student reaches 40.9 against its teacher’s 41.9, while the T5 student reaches 40.6 against its teacher’s 42.3. These comparisons give a more specific picture than the cross-task average. The procedures bring both students closer to their teachers, with the degree of recovery varying even within one dataset.
On Shake7 test BLEU, T5-KD matches T5-L at 25.7, and the paper records 100% BLEU gap closure for that pair. On test ROUGE, BART-KD reaches 45.2 against BART-L’s 44.8, recorded as 123% gap closure. Test perplexity still favors the corresponding teachers on Shake7. The fact that a student can reach or pass the teacher on one measure is compatible with retaining a weaker fit to ground-truth targets on another. It shows why the broad claim of competitive performance needs to be read with the metric in view.
ART10 has weaker recovery under automatic scoring. On its test split, T5-KD closes 49% of the BLEU gap, 50% of the ROUGE gap, 47% of the BERTScore gap, and 25% of the perplexity gap. The BART student closes 59% of the BLEU gap on the same task. In this setting, different explanations can account for the same observations, and the distance from the recorded reference can conceal improvements in plausibility. The authors investigate that possibility with ratings of the generated explanations.
The more compact students substantially reduce the time required to produce an output. For SQuAD17, T5-L takes 530 milliseconds in the profiled generation workload and T5-KD takes 143. BART-L takes 250 milliseconds and BART-KD takes 67. The paper reports x3.7 latency improvements for both pairs on that workload. Its throughput comparison on the same dataset is 2.0K to 22.3K examples per minute for T5 and 4.8K to 13.0K for BART. The relative improvement in batch work depends on family and dataset. On ART10 the reported T5 improvement is x10.3 in throughput and the BART improvement is x1.7, even though both report x3.7 in latency.
Distillation with GPT-4 and few labeled demonstrations
The authors run a separate experiment using GPT-4 as the teacher and T5-S as the student. The teacher receives a task instruction and three demonstrations with labeled examples, an instance of few-shot learning. The main student training and development samples in this condition lack human targets. The test data have targets for evaluation. The paper also runs a parallel development comparison with human targets and includes a supervised student baseline to put the pseudo-target results in context. GPT-4 Technical Report
For SQuAD17, the authors sample 3000 training inputs, 250 development examples, and 500 test examples. For Shake7, they use 1500 training inputs, 250 development examples, and 350 test examples. They compare the teacher and the supervised T5-S baseline with students trained on a single pseudo-target or multiple pseudo-targets, with and without word-level distillation. The multiple-target condition uses five generated outputs. For the student variants, they test several learning rates and report averages over them because performance varies considerably across settings.
To use Logits KD in this experiment, the authors first have to align two versions of the same text. GPT-4 and T5-S use different tokenization schemes, so an identical written continuation can occupy different token positions. The paper shows a question in which the teacher treats Roberts as a single token while the student reads Robert followed by s. The same question contains a year that the teacher splits into 201 and 0 and the student represents as 2010. The teacher’s next-token information must be interpreted relative to these different boundaries.
The first alignment uses Needleman–Wunsch dynamic programming to identify corresponding positions. The algorithm returns matches, replacements, insertions, and deletions. The authors accept an exact match or a replacement in which one token is a prefix of the other. The second alignment concerns the candidate tokens in the teacher’s distribution at a position. The version used in the experiment returns probabilities for the top five tokens. Candidates with exact matches in the student vocabulary are retained and the corresponding scores are converted into a normalized distribution. If the student’s token has no matching teacher candidate, the procedure assigns probability one to the student token. In such a case the aligned signal resembles training on a single observed token at that position.
GPT-4 distillation variants on SQuAD17 test ROUGE with pseudo-target development data
The student combining several pseudo-targets with teacher probabilities reaches the highest test ROUGE among these variants.
The numbers
| System or setting | ROUGE |
|---|---|
| T5-S with one pseudo-target | 32.6 |
| T5-S with multiple pseudo-targets | 32.7 |
| T5-S with Logits KD and one pseudo-target | 32.4 |
| T5-S with Logits KD and multiple pseudo-targets (this paper) | 32.8 |
With generated development targets, the SQuAD17 student combining several outputs and logits also records test BLEU of 11.9 and test perplexity of 2.48. When the development comparison uses human targets, that variant records 12.0 test BLEU and 32.7 test ROUGE. Under the latter comparison, the teacher’s test BLEU is 13.6 and the supervised student’s is 17.8. On test ROUGE the teacher gets 37.6 and the supervised student 36.4. The rankings depend on the metric, and the table gives a direct view of the difference between learning from generated text and having access to annotated training targets.
The Shake7 outcome is less favorable to logits transfer. With generated targets for development, the student trained on several pseudo-targets without logits records 19.2 test BLEU, 76.1 test BERTScore F1, and 2.36 test perplexity. Its counterpart with logits and multiple targets records 19.1 BLEU, 75.0 BERTScore F1, and 2.52 perplexity. With human development targets, some individual comparisons are mixed, including test BLEU of 19.1 with a single pseudo-target and 19.0 with several when logits are omitted. The overall benefit from multiple outputs is therefore a tendency in the experiment. The paper attributes the uneven effect of logits in part to token alignment and leaves that explanation for further testing.
What the ablations show
The objective matters, and the development criterion matters too
The early comparison holds the labeled inputs fixed and varies the training objective. The plain fine-tuned student supplies the starting point. Logits KD, Noisy KD, and Attention-Relations KD each try to transfer additional knowledge from the teacher. Across the study, the paper reports that plain Logits KD closes more than 34.4% of the student–teacher gap on average. The alternatives are competitive. Noisy KD has 14 wins and Logits KD has 13 across the 32 setups. Of the Noisy KD wins, 8 come from perplexity. This gives a reason to inspect which kind of performance accounts for a method’s lead.
On the aggregate development criterion, plain Logits KD scores 16.0, while Noisy KD and Attention-Relations KD each score 15.9. The authors therefore carry plain Logits KD forward. The result identifies a practical starting objective for later comparisons. It leaves room for a different choice for a particular task or metric. On ART10, for example, Noisy KD closes 35.2% of the average gap in this comparison, while plain Logits KD closes 25.7%. On Shake7 the two are almost level, with 41.8% for Noisy KD and 41.9% for Logits KD.
The second comparison asks whether supervision comes from reproducing complete teacher outputs, matching the teacher on the labeled prefixes, or combining the two. Sequence-level training with pseudo-targets alone as the distillation mechanism underperforms plain Logits KD in this study. For SQuAD17 its average gap closure is -9.1%, whereas Logits KD on labeled examples closes 39.7%. Applying Logits KD along both generated and labeled targets gives 30.8% for SQuAD17. Thus the combined objective can improve the overall development score and still trail the simpler one on a specific dataset aggregate.
Across datasets and metrics, the combined procedure wins 22 setups, and labeled-only Logits KD wins 10. XSUM40 moves from 30.2% gap closure with the plain logits objective to 33.2% with the combination. Shake7 moves from 41.9% to 49.0%. The controlled choice clarifies the function of the pseudo-target. It is valuable as a route to new prefixes on which the teacher can supply distributions. Training by likelihood on the available generated and human sequences gives a different result from asking the student to match the teacher along those sequences.
New inputs and new outputs make different contributions
The authors next apply the selected objective using a single teacher-generated target for the unlabeled inputs as well as for the labeled ones. The paper reports that including this data closes an additional 19% of the gap on average. The expanded data condition wins all 32 comparisons in this stage. In ART10 the average gap closure across systems and metrics goes from 27.9% to 41.5%. In Shake7 it goes from 49.0% to 70.0%. The test result connects the improvement to a concrete change in training: more task inputs now bring teacher-provided sequences and conditional predictions.
This stage varies the inputs on which the student gets to practice. The next stage varies the output prefixes for an input already in use. Keeping all the final beams increases the set of high-ranking sequences available for each input, with the paper reporting an additional 6.4% of gap closure on average. On XSUM40 the single-target configuration closes 55.8% of the gap and the multiple-beam configuration closes 63.6%. On SQuAD17 those configurations close 47.1% and 56.3%, respectively. The gains arise even with the single-target-per-epoch schedule. Returning to an input with a different candidate can change what the student learns from that encounter.
Replacing beam candidates with ordinary nucleus samples gives a further gain in the staged comparison. The paper reports another 5.2% of average gap closure. On XSUM40, the average rises to 73.0%; on ART10 it reaches 48.2%. Sampled text can start differently or take a different route to a compatible output. Those changed prefixes expose the student to additional conditional predictions. The results favor the tested sampling configuration over the tested beam configuration, including their different candidate counts. The study motivates diversity as an explanation and measures its practical effect through the resulting students.
High-temperature sampling is competitive and varies more by task and family. For SQuAD17 it closes 63.9% of the average gap, ahead of ordinary sampling’s 58.4%. For XSUM40 it closes 70.0%, with ordinary sampling ahead in that comparison. Ordinary sampling records 15 wins and high-temperature sampling records 12 across the 32 setups. The authors report that the higher temperature works better for T5-S overall within this comparison and that BART-6:2 favors ordinary sampling. Ordinary sampling also gave the better aggregate development result. Extra variety has a role in the procedure, but the appropriate amount depends on how a teacher’s samples behave for a particular task and student.
Why it can help to train on the student’s own writing
The Joint-Teaching comparison gives all conditions access to the teacher’s next-token guidance. What varies is the origin of the sequence on which that guidance is supplied. The teacher-only version practices along sampled outputs from the teacher. The student-only version generates training prefixes with the evolving student. Joint-Teaching mixes the two sources. This comparison focuses on a different question from the earlier comparison of sequence-level and word-level objectives. Here even the condition called “Only Student” uses teacher probabilities.
Joint-Teaching wins 25 of the 32 setups, compared with 4 wins for the teacher-only condition and 3 for the student-only condition. The paper reports that the mixture closes another 5.7% of the gap in the staged analysis. On XSUM40 the average gap closure is 80.8% for the mixture, compared with 73.0% for teacher-only prefixes and 68.7% for student-only prefixes. On Shake7 the corresponding figures are 87.7%, 81.7%, and 79.4%. The mixed approach brings the student into contact with contexts it generates while preserving practice along outputs from a more capable writer.
The comparison also has exceptions worth retaining in the interpretation. On SQuAD17 the student-only condition closes 63.9% of the gap, ahead of teacher-only training at 58.4%, and Joint-Teaching reaches 66.7%. In ART10 the mixture and the teacher-only condition each close 48.2% at the reported precision, while student-only reaches 43.9%. The result supporting the mixture is its performance over the set of comparisons. The numbers for individual tasks leave open which source of prefixes matters more under different conditions.
A separate continuation experiment examines the assumption underneath student-generated prefixes. On SQuAD17 development examples, the researchers let a T5-S student write an initial portion of an output and then let T5-L complete it. They vary how much of the final output comes from the student and repeat the comparison at different points in the student’s training. BLEU on the completed questions measures the outcome. Across almost all stages of student training in that experiment, teacher continuation improves the prediction. The completed outputs also improve as the student progresses through distillation.
The continuation experiment tests a direct consequence of the method’s premise. Once a particular student prefix has been produced, a teacher should be able to do something worthwhile with it. Finishing the sequence with the teacher gives an observable check on that ability. The Joint-Teaching comparison then asks whether training on many such contexts helps the student generate better independently. The evidence from the two comparisons is consistent with the exposure-bias account. Since generated targets also change the variety and difficulty of the contexts seen in training, the size of the overall gain cannot be attributed to correction of exposure bias alone.
Human judgments put the reasoning scores in context
The ART10 evaluation asks whether the automatic metrics have registered the full improvement in the explanatory text. The authors draw 50 inputs at random and ask two annotators to rate the reference and outputs from the fine-tuned T5-S, T5-L, and T5-KD. The five-level judgment focuses on how well the explanation connects the two observations. Its range covers incoherent text, irrelevant text or repetition, relevant statements that supply little explanation, partial explanations, and explanations that account for the observations. The reported agreement is Kendall’s τ = 0.52, where τ denotes the rank agreement statistic.
The human ratings average 4.45 for the annotated references, 2.75 for the fine-tuned student, 4.0 for the teacher, and 3.65 for the distilled student. On this scale the distilled student closes 72% of its gap to the teacher. The appendix compares this with an automatic estimate of 50%. The result supports the idea that good answers in ART10 can differ in wording and substance from the reference. In the bread example, a generated answer that identifies a failure to follow the instructions can offer a plausible cause even though the recorded version specifies a particular ingredient and quantity.
This human comparison adds a task-specific quality measure to the distillation result. It is restricted to the T5 systems and to the sampled ART10 cases. The question it addresses is whether people judging the adequacy of an explanation see the same amount of improvement as metrics tied to an annotated target. The ratings suggest a larger improvement for that sample. They leave the teacher ahead of the distilled student on the criterion the annotators were asked to judge.
Development targets affect the meaning of a comparison
The GPT-4 experiments provide another controlled comparison, this time about selecting a student when the development targets themselves are generated. The paper reports development-to-test score correlations of 0.06 on SQuAD17 and 0.12 on Shake7 when development targets come from GPT-4. With human targets for development, the corresponding correlations are 0.57 and 0.66. In both cases test scores use the human references. A development set produced by the teacher tells the experiment how well student outputs match that kind of generated text. A human-labeled test set evaluates them against a different source of wording and judgments.
This change helps explain why the authors report averages across learning rates in the GPT-4 experiments. A system with the highest score under generated development references may have a different position on the human-labeled test split. Still, the main pattern is similar under both development choices. SQuAD17 benefits most from the combination of several pseudo-targets with logits guidance. On Shake7 the added logits do not produce a comparable improvement. That convergence makes the difference between the two tasks more informative than a single winning checkpoint would be.
Limitations
Limits identified by the authors
The authors restrict the primary conclusion to task-specific generation with a fine-tuned teacher and a supply of unlabeled task inputs. Their benchmarks use English inputs and English outputs. The output is shorter than the input in the summarization and question tasks, and roughly comparable in length in the other tasks. A workload with substantially longer outputs may exhibit different patterns of exposure bias and different latency tradeoffs. The authors also identify translation between languages, multilingual generation, generation from structured data, and multimodal generation as settings where the results may change. The same uncertainty applies when labeled data are abundant or unlabeled inputs are unavailable.
The computational analysis centers on deployment. The authors do not tabulate comparable end-to-end training costs for the alternatives. They explain that producing teacher targets for all inputs can take days, and that some student distillation runs also take more than a few days. Joint-Teaching adds generation by the changing student during training. Some objectives require more calculation than others, with Attention-Relations KD more costly than plain Logits KD. The single-output and batch measurements therefore quantify gains once the student is ready. They leave the deployment volume required to recover the upfront expense undetermined.
The authors distinguish the compute cost of running a medium teacher from the financial cost of repeated requests to a large external system. They cite privacy restrictions and the difficulty of adapting an externally served teacher to a specialized domain as reasons to study a fine-tuned teacher under local control. They also discuss the possibility of a large system providing a limited amount of supervision to a medium teacher, which can then generate targets at scale for the small student. Work on an intermediate teacher motivates that possibility. The transfer sequence itself remains outside the main experiments. Improved Knowledge Distillation via Teacher Assistant
Joint-Teaching is absent from the GPT-4 comparison because it would require repeatedly querying the teacher for probabilities along newly generated student prefixes. The GPT-4 configuration used for the paper also gave the researchers access to a limited set of token probabilities. The authors distinguish that access from interfaces where probabilities are unavailable. The cost and access constraints leave a more modest transfer result in the extreme setup. Multiple generated targets are usable under those conditions. The word-level transfer result depends on the task and uses the paper’s approximate token alignment.
Limits visible in the design
The study follows a sequence of selected configurations. That provides evidence about changes made along the chosen path, with the development set guiding the next comparison. It leaves combinations elsewhere in the design untested. For instance, the finding that ordinary sampling gave the strongest average development performance was obtained after the study had moved to a particular logits objective and set of student architectures. Different pruning choices, objectives, and sampling settings could interact. The observed performance of the final recipe shows what these decisions achieve together in the reported setup.
The architecture comparison likewise changes several properties together. The pretrained systems differ in input processing and attention pathways, and their pretraining objectives differ as well. The explanation involving bidirectional input representations is plausible in the paper’s account, while definitive attribution to that component would require an experiment that varies it separately. The financial and deployment claims also depend on practical measurements from a particular device, implementation, and batch constraint. The length sweep helps explain the observed latency and throughput patterns within that setting.
Several results use metrics that compare generated text with fixed references. ART10 makes the consequence of that choice especially visible. Human judgments help assess explanatory adequacy, but they come from a small sample, cover one student family, and show imperfect agreement. Similarly, the appendix’s teacher continuation experiment uses one student–teacher pair on the development split for one task. It tests whether teacher continuations are helpful in that circumstance. A broader claim that the teacher can repair student prefixes reliably across tasks would require more evidence.
Finally, the word-level GPT-4 comparison changes the nature of the target distribution itself. An exact vocabulary match preserves some of the teacher’s alternatives. A fallback to full probability on the observed student token discards that information at the affected position. Since the experiment does not independently vary alignment quality, the Shake7 result cannot establish how better alignment would change the outcome. It shows the performance of the particular procedure available to the authors under limited data, restricted probability access, and different tokenizers.
What came after
No subsequent study is documented here as extending or testing Calderon and colleagues’ results. The authors leave a specific question about Joint-Teaching open. Their experiments keep the balance between teacher and student prefixes fixed, while the continuation analysis suggests that the prefixes a student produces change as it learns. They propose investigating a schedule that adapts that balance during training, as well as deciding which inputs or generated targets merit the teacher’s guidance. Those are research directions proposed in the paper. Their effects remain unmeasured in the reported experiments.
Cite
Cite as Nitay Calderon, Subhabrata Mukherjee, Roi Reichart and Amir Kantor. 2023. A Systematic Study of Knowledge Distillation for Natural Language Generation with Pseudo-Target Training. Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
@inproceedings{calderon2023systematic,
title = {{A Systematic Study of Knowledge Distillation for Natural Language Generation with Pseudo-Target Training}},
author = {Nitay Calderon, Subhabrata Mukherjee, Roi Reichart and Amir Kantor},
booktitle = {Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
year = {2023},
doi = {10.18653/v1/2023.acl-long.818},
url = {https://doi.org/10.18653/v1/2023.acl-long.818}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/calderon-2023-systematic-study-knowledge-distillation-natural/