---
title: "Exploring the Limits of Simple Learners in Knowledge Distillation"
description: "DocBERT tests how much document classification performance a recurrent network, a small convolutional network, and logistic regression…"
canonical: "https://research.elamur.ai/free/en/papers/adhikari-2020-exploring-limits-simple-learners-knowledge/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/adhikari-2020-exploring-limits-simple-learners-knowledge/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / Exploring the Limits of Simple Learners in Knowledge Distillation for Document Classification with DocBERT

# Exploring the Limits of Simple Learners in Knowledge Distillation for Document Classification with DocBERT

Paper · 2020 · Ashutosh Adhikari, Achyudh Ram, Raphael Tang et al.

**Authors:** Ashutosh Adhikari, Achyudh Ram, [Raphael Tang](https://md.research.elamur.ai/free/en/authors/raphael-tang/), [William L. Hamilton](https://md.research.elamur.ai/free/en/authors/william-l-hamilton/) and [Jimmy Lin](https://md.research.elamur.ai/free/en/authors/jimmy-lin/) · **Year:** 2020 · **Venue:** Proceedings of the 5th Workshop on Representation Learning for NLP · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 5th Workshop on Representation Learning for NLP · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2020.repl4nlp-1.10/)
- [PDF](https://aclanthology.org/2020.repl4nlp-1.10.pdf)
- [DOI 10.18653/v1/2020.repl4nlp-1.10](https://doi.org/10.18653/v1/2020.repl4nlp-1.10)

## Summary

A document classifier can be expensive even when its final decision is simple. It may need to read a long review to assign a rating, or use evidence from different parts of an article to assign several categories. Adhikari and colleagues ask how much of BERT’s effectiveness on these tasks can be retained by a cheaper classifier. They first adapt BERT to classify whole documents, producing a system they call DocBERT. They then use its predictions to train classifiers with very different capacities, from a recurrent network that reads words in sequence to logistic regression over word features. The study is about how far that transfer can go in [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

The transfer method is knowledge distillation. The larger classifier serves as a teacher and supplies probabilities for the available labels. The smaller classifier, called the student, learns from those probabilities as well as from the dataset’s labels. The probabilities provide an extra training signal because they express how strongly the teacher favors different labels. Once training ends, the student can classify documents by itself. The paper uses BERT-large as the teacher and compares the resulting students with their ordinary counterparts as well as with BERT-base. This approach builds on [Distilling the Knowledge in a Neural Network](https://md.research.elamur.ai/free/en/papers/hinton-2015-distilling-knowledge-neural-network/).

The authors evaluate DocBERT on Reuters and AAPD, where a document can have several labels, and on IMDB and Yelp 2014, where a review has a single label. BERT-large records the highest validation and test scores in the main comparison on all these datasets. After distillation, a single-layer long short-term memory network, or LSTM, approaches BERT-base on Reuters, AAPD and IMDB. Its mean Reuters test F1 is 88.9, against BERT-base’s 89.0. On Yelp 2014, the mean test accuracy of the distilled LSTM is 69.4, while BERT-base reaches 72.0. For inference on Reuters, the paper reports that the LSTM uses 3% of the BERT-base parameters and has a 40× advantage in its count of floating-point operations.

A single-layer convolutional network and logistic regression gain substantially on some datasets, with especially clear improvements on the multi-label tasks. Neither reaches BERT-base performance across the benchmark suite. Logistic regression also shows how uneven the gains can be. Its AAPD test F1 rises from 64.9 to 71.3, while its IMDB test accuracy is 43.4 before distillation and 43.3 afterward. The study therefore establishes a range of possible tradeoffs. A recurrent student can approach BERT-base on several tasks, while much simpler students can still benefit from the teacher. The savings apply when the trained student makes predictions. Producing the teacher and using it to train students still require training resources.

## Deep dive: Exploring the Limits of Simple Learners in Knowledge Distillation for Document Classification with DocBERT

DocBERT tests how much document classification performance a recurrent network, a small convolutional network, and logistic regression can learn from BERT. · about 31 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why document classification poses two different problems

Document classification starts with a fixed set of labels and a collection of texts. The system has to decide which labels apply to a new text. A review can be assigned a single class, while a news document can belong to several categories at once. That difference affects what counts as a good answer. A single-label classifier chooses among alternatives. A multi-label classifier must recover a set, and a partially correct set can contain both an omission and an incorrect addition. The paper also points out that the labels in multi-label datasets can be unevenly represented. Handling the label structure is part of the problem even when the text itself is short.

The other problem is how much text the classifier needs to read and what it needs to do with that text. A long review offers more places for relevant evidence to appear. Extra length also makes it more costly to process an input and means that a system with a length limit may have to discard part of the document. A classifier that assigns a label from prominent words can be effective if those words distinguish the classes. A system that reads in sequence has a way to use information about where words occur relative to each other. Their usefulness depends on the task and on the evidence the dataset makes available. The experiments ask what each kind of classifier can achieve when it learns from the same strong teacher.

This question has a practical side. The paper describes large pretrained systems as demanding substantial computational resources. A team might be able to train a strong classifier and still care about what it costs to run that classifier repeatedly. Long documents make that concern especially relevant. The setting makes training and deployment separate decisions. If a large teacher can improve a smaller student, the cost of obtaining supervision during training can be separated from the cost of classifying each new document. The paper places this motivation in the context of [Energy and Policy Considerations for Deep Learning in NLP](https://md.research.elamur.ai/free/en/papers/strubell-2019-energy-policy-considerations-deep-learning/).

#### Why a linear classifier was a serious baseline

The authors describe earlier comparisons in which logistic regression and support vector machines performed well using term-frequency and inverse-document-frequency features. This representation describes a document through terms and their weights. The weight reflects the presence of a term in the document and how broadly the term occurs across the collection. Terms that appear throughout the collection are less distinctive evidence than terms concentrated in particular documents. Once converted into a vector this way, a document can be classified by combining the weights of the features associated with a label. The representation omits the order in which terms occur. The paper refers to it as [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/).

A classifier over those features is a meaningful test of the need for more elaborate architectures. If classes can be recognized reliably from word use, investing computation in sequence or sentence structure may yield a limited return. The authors cite an earlier comparison in which the linear approaches challenged several neural classifiers. That comparison gives logistic regression a particular role in this study. It is an established baseline worth improving in its own right, and it tests whether supervision from BERT can help even when the student lacks the machinery to reproduce the teacher’s treatment of context.

Convolutional approaches offer a different way of using the input. A text convolution applies the same learned pattern detector at different positions, allowing the classifier to recognize local arrangements of words. The paper describes earlier success with convolutional classifiers for short texts with a single label. It also discusses XML-CNN, a variant developed for multi-label classification. For the distillation experiment, the authors choose KimCNN, the single-layer architecture from [Convolutional Neural Networks for Sentence Classification](https://md.research.elamur.ai/free/en/papers/kim-2014-convolutional-neural-networks-sentence-classification/).

Recurrent approaches process text as a sequence. The paper describes prior systems that used sequences of words or sentences to derive representations for classification. A long short-term memory network, or LSTM, carries a representation forward as it reads, giving later positions access to information accumulated earlier in the sequence. The related systems discussed by the authors also include a hierarchical attention classifier and an approach that treats multi-label prediction as sequence generation. These are examples of how prior work addressed document organization or output structure. The paper links this context to [Hierarchical Attention Networks for Document Classification](https://md.research.elamur.ai/free/en/papers/yang-2016-hierarchical-attention-networks-document-classification/) and [SGM](https://md.research.elamur.ai/free/en/papers/yang-2018-sgm-sequence-generation-model-multi/).

#### What pretraining and distillation change

Large-scale pretraining gives the classifier a starting point learned before the document categorization task. The authors describe BERT and XLNet as systems that build contextual word representations. A contextual representation can depend on the surrounding text, so occurrences of the same word can be represented differently. Their shared architectural background is the Transformer, which uses attention to combine information from different positions. The paper treats BERT as a representative of this direction and asks what it can achieve after adaptation to document classification. The earlier work includes [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/), [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) and [XLNet](https://md.research.elamur.ai/free/en/papers/yang-2019-xlnet-generalized-autoregressive-pretraining-language/).

Distillation changes the information available to the student during learning. A dataset label identifies the expected answer for a document. A teacher’s predicted probabilities give a more graded account. In a single-label task, for instance, the teacher can favor the recorded class while assigning some probability to an alternative. The student receives a signal about that alternative as well as about the favored class. A multi-label task also offers room for graded signals, because the teacher can express different levels of confidence about which categories apply. The paper describes this kind of supervision as a way for a student to generalize from the predictions of a stronger teacher.

The authors pursue an empirical question about how far that approach can be taken. A recurrent student can read in sequence. A convolutional student has a way to detect local patterns. Logistic regression learns label scores from weighted word features. These students can all receive the same kind of guidance at their outputs, even though the information they can extract from a document differs. Examining them together makes it possible to ask whether the benefit of distillation survives as the student’s representation gets simpler. It also gives the study a way to distinguish improvement over an ordinary baseline from a result close enough to substitute for BERT-base on a given task.

### The method, step by step

#### Turn BERT into a document classifier

The authors begin by adapting pretrained BERT to the label set of each dataset. They use its special `[CLS]` input token as the point from which to read a document representation. After the input has passed through BERT, the final hidden state at this position is a vector. Its components are learned features that can depend on the text the system has processed. The authors put a fully connected classification layer on top of the vector. This layer produces a score for each label available on the task. A document from another dataset may need a different output layer because the available labels change.

The paper gives the classification weight matrix the following shape.

```
W ∈ ℝ^(K×H)
```

`W` is the matrix of learned classification weights. The symbol `∈` means that the matrix belongs to the space that follows it. `ℝ` denotes real-valued entries. `K` is the number of classes, and `H` is the length of the hidden-state vector. The multiplication sign in `K×H` specifies the matrix shape, with a row for each class and a column for each hidden feature. The parentheses group the dimensions of that space. A class score is formed by combining the hidden features with the learned weights for that class.

The authors train the classification layer together with the rest of BERT. That is the adaptation meant by [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/). Each labeled document supplies an error signal, and training can change both the classifier’s weights and the way BERT represents the text that reaches it. The paper uses cross-entropy for single-label tasks. This loss penalizes low probability for the recorded class when the available classes compete for probability. It uses binary cross-entropy for multi-label tasks, where the training signal for each label indicates whether that label applies. The split between these objectives follows the way the datasets label documents.

The authors fine-tune BERT-base and BERT-large. The former later serves as the target for the practical performance comparison. The latter supplies the teacher probabilities in the distillation setup specified by the training section and the main results table. Keeping their roles clear matters when reading a result described as BERT-base parity. That comparison asks whether the student approaches the smaller BERT variant after learning from the larger one.

From pretrained BERT to a standalone document classifier The steps in order.

#### Set the input length and fine-tuning schedule

The BERT classifier receives a limited number of tokens for each document. A token is a unit of the input representation, whereas the dataset descriptions give average lengths in words. The authors tune the maximum sequence length, which is the cutoff used to truncate inputs that exceed it. This is a setting of the [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) and input pipeline that also changes what the classifier gets to see. If a document extends past the cutoff, its classification has to be made using the portion retained by the procedure.

The authors also tune training duration, batch size and learning rate. An epoch is a pass through the training data. A batch is the group of examples used together in an update, and the learning rate controls the scale of the update. The appendix reports a batch size of 16, a learning rate of 2×10⁻⁵ and a maximum sequence length of 512 tokens as the settings giving the best validation quality in their BERT fine-tuning experiments across the datasets. These settings describe the adaptation to document labels. The paper starts from pretrained BERT and gives no new pretraining procedure.

Training duration differs among the tasks. The authors use 30 epochs for Reuters, 20 for AAPD and 4 for IMDB. On Yelp they use one epoch because of resource constraints. The duration is consequential because a training schedule determines how much opportunity the classifier has to adapt to the task. The authors found the validation scores sensitive to this choice. The appendix examines the effect directly for Reuters and AAPD, where a short schedule leaves much of the attainable performance unrealized.

#### Choose students that read documents differently

The authors distill BERT-large into an LSTM, a KimCNN and logistic regression. The regularized LSTM used as the baseline has a single recurrent layer. Regularization consists of training choices intended to limit overfitting. This student reads the document as a sequence and derives label predictions from the representation it builds. Because it can carry information from earlier positions, it can in principle use some evidence whose value depends on the order in which words occur. The study also varies the number of hidden units to see how small this recurrent student can be.

KimCNN is a single-layer convolutional network. Its learned filters respond to local patterns at positions in the text. It has a richer way of recognizing word arrangements than a document vector that discards order, while its single convolutional layer gives it a different capacity from a recurrent learner that carries information through a sequence. The authors include it to test whether a small neural classifier can make productive use of BERT’s outputs. Its size makes it particularly informative when paired with the parameter and operation figures reported for Reuters.

The logistic regression student uses TF-IDF features, just like the ordinary logistic regression baseline. Its label scores are based on learned weights applied to those features. The training procedure can change those weights in response to the teacher’s predictions. It leaves the representation of each document as weighted term evidence. If a teacher gives different outputs for documents that look identical in this representation, the student has no input distinction with which to reproduce that difference. It can still learn a better way to use features that it does have.

All three students predict the labels of the original classification tasks. The teacher supplies probability targets at the output. This is a common interface across the architectures. The convolutional, recurrent and linear students have no requirement to reproduce BERT’s hidden states, and the reported training objective compares their probabilities with BERT’s. The paper uses the idea of transferring what BERT has learned to describe this process. Operationally, it asks the students to change their label predictions in the direction specified by the training objective.

#### Build the transfer set from training documents

The dataset labels give the students a supervised task. The authors expand the collection of inputs on which the teacher can provide predictions, calling the resulting collection the transfer set. The augmentations start from the training split. They use word swapping guided by part-of-speech information, random masking and random reordering of sentences within a document. A part of speech is a grammatical category, so the first transformation uses grammatical information to guide word changes. Masking hides some input material. Reordering changes the document’s sentence sequence. The relevant linguistic operation is [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/).

These changes give the student a wider collection of teacher responses than the original documents alone would provide. A masked or reordered text can elicit a probability pattern different from that of the source document. The signal available to the student is how the teacher scores that altered input. Word swapping, masking and sentence reordering affect different aspects of the evidence. Their joint use broadens the inputs presented during training. The paper describes the procedure at that level and reports the transfer-set sizes. It gives no separate contribution for each transformation in the main results.

For Reuters, the transfer set is 3× the size of the training split. For IMDB and AAPD, it is 4× the size of the respective training splits. Yelp 2014 receives no augmentation because of computational restrictions. The held-out validation and test splits serve their usual evaluation roles. In particular, the augmented versions are derived from training documents, so the enlargement of the transfer set is a change to student training. It is separate from how the systems are compared on original held-out documents.

The Yale-sized question is absent here; what matters is the distinction between the size of the original dataset and the amount of training input generated from it. A multiplier describes the transfer set relative to a dataset’s training split. It does not describe the fraction of the full corpus used for testing or the cost of storing the resulting student. The paper gives a different measure for the computation involved in deploying the student. This separation allows the training procedure to be more elaborate while the inference procedure remains that of the original student architecture.

#### Train against labels and teacher probabilities

The student’s objective contains a classification loss and a distillation loss. A loss is a quantity minimized during training. The classification component rewards predictions that agree with the labeled examples. The distillation component rewards agreement with the teacher’s probability outputs.

```
L = L_classification + λ · L_distill
```

`L` is the total loss. `L_classification` is the supervised classification loss and `L_distill` is the loss for matching the teacher. The subscripts identify the role of each term. The equals sign defines the total, and the plus sign adds the two contributions. `λ` is the weight selected for the distillation contribution. The centered dot denotes multiplication by that weight. Changing `λ` changes the influence of teacher agreement relative to the ordinary classification loss during optimization.

The classification term uses cross-entropy on the single-label tasks and binary cross-entropy on the multi-label tasks, as in BERT fine-tuning. For the teacher-matching term, the paper specifies Kullback–Leibler divergence, abbreviated KL. The paper gives the arguments in the following order.

```
KL(p ∥ q)
```

`KL` denotes the Kullback–Leibler divergence. `p` is the class probability output of the student, and `q` is the class probability output of the teacher. The parentheses contain the two arguments. The double bar separates them and records their order. KL divergence is directional, so the order is part of the specification. In this objective, the divergence supplies a measure of disagreement between the probability values. Matching the teacher therefore involves more than predicting the same highest-scoring class, because predictions can agree on a class and still differ in confidence.

The appendix gives the distillation weight as 1 for multi-label datasets and 4 for single-label datasets. Its description of LSTM training reports a batch size of 128 on the multi-label tasks and 64 on the single-label tasks. It also says that the learning rates and dropout rates from the earlier baseline study work best for distillation. Dropout is a form of training regularization that temporarily suppresses parts of a network during learning. These settings belong to the student training stage described in the appendix. The teacher has its own fine-tuning schedule and batch size.

After training, the student classifies documents with its own learned weights. The teacher does its work by supplying targets during training. Those targets influence the student’s parameters, and predictions on new documents can be produced without running the teacher again. This is the mechanism behind the proposed inference savings. A distilled LSTM remains an LSTM when it serves a prediction, just as distilled logistic regression still uses its linear score over word features. The authors identify Hedwig as the public repository for their release.

### Experiments and results

#### What the benchmarks ask the classifiers to do

Reuters-21578 and AAPD are the multi-label benchmarks. Reuters contains 10,789 documents and has 90 classes. The reported document averages are 144.3 words and 6.6 sentences. The experiments use the standard ModApté splits. AAPD is the arXiv Academic Paper dataset. It has 55,840 documents and 54 classes, with averages of 167.3 words and 1.0 sentences per document. The authors use the splits supplied by the work that introduced AAPD in their comparison. These descriptions give some sense of the inputs, independently of the need to assign potentially several labels per document.

IMDB and Yelp 2014 are single-label review benchmarks. IMDB has 135,669 documents and 10 classes. Its reported averages are 393.8 words and 14.4 sentences per document. Yelp 2014 has 1,125,386 documents and 5 classes, with averages of 148.8 words and 9.1 sentences. For each review dataset, the authors randomly sample 80% for training, 10% for validation and 10% for testing. Yelp is the largest dataset by document count. IMDB has the highest reported average length by both words and sentences, a difference that becomes relevant when the authors vary the input cutoff.

The paper reports F1 on the multi-label tasks. F1 combines precision, which concerns how often predicted labels are correct, with recall, which concerns how many applicable labels the system recovers. The paper labels the measure F1 in its main table. For the review tasks it uses accuracy, the share of documents for which the single predicted label agrees with the recorded label. The validation and test scores are given separately. Validation is where the authors examine settings such as epoch count and the input cutoff. The test columns give the corresponding held-out comparisons for the main systems.

For the neural baselines that have run-to-run variation reported, the table presents means and standard deviations from five runs. The BERT-base and BERT-large results each come from a single run per task, which the authors attribute to computational cost. Several other entries, including logistic regression and its distilled version, are printed as single values in the table. The older baseline scores are carried over from the authors’ earlier comparison. In the discussion below, a score for a distilled neural student is the reported mean when the paper provides one.

#### How DocBERT compares with the earlier baselines

The earlier systems give the BERT results a demanding point of comparison. On Reuters test F1, the support vector machine reaches 86.1, XML-CNN reaches 86.2 and the regularized LSTM reaches 87.0. Logistic regression reaches 74.8. This pattern shows why both neural and linear baselines belong in the study. A support vector machine using word features is close to the strongest earlier Reuters result, although the ordinary logistic regression score is lower. On AAPD, the support vector machine’s test F1 of 69.1 also sits close to the regularized LSTM’s 70.5. The SGM result is 71.0, given as a test entry without a corresponding validation value.

The ordinary LSTM is also strong among the comparison systems on the review tasks. Its test accuracy is 52.8 on IMDB and 68.7 on Yelp 2014. The hierarchical attention network reaches 51.2 and 67.9 on those respective test sets. The ordinary KimCNN reaches 42.7 and 66.1. These figures give the distillation experiments different starting points. For example, KimCNN trails the stronger recurrent baseline on IMDB, leaving substantial room for improvement even if the distilled convolutional student remains below the best recurrent result.

BERT-large has the highest scores in the main table on both validation and test across the benchmarks. On Reuters, BERT-base scores 90.5 on validation F1 and 89.0 on test F1. BERT-large reaches 92.3 and 90.7 on those respective splits. On AAPD, BERT-base records 75.3 validation F1 and 73.4 test F1. BERT-large records 76.6 on validation and 75.2 on test. These are the reference results for judging how much quality a less costly student retains after training.

On IMDB, BERT-base reports 54.4 validation accuracy and 54.2 test accuracy. BERT-large reaches 56.0 on validation and 55.6 on test. On Yelp 2014, BERT-base records 72.1 validation accuracy and 72.0 test accuracy, while BERT-large records 72.6 and 72.5. The fact that BERT-large leads on both splits helps motivate its use as the teacher. The deployment comparison with BERT-base then asks how close an efficient classifier can get to a strong but more modest pretrained system.

#### Where the distilled LSTM approaches BERT-base

Reuters gives a clear view of the two central comparisons. The ordinary regularized LSTM has a test F1 of 87.0 and the distilled LSTM has a mean of 88.9, with a reported standard deviation of 0.2 for the distilled result. The distilled mean sits close to BERT-base’s 89.0. On validation, the distilled LSTM’s mean F1 is 91.0 and BERT-base records 90.5. The two splits order the systems differently, so the authors’ characterization of parity reflects the close results across the task. BERT-large retains the higher Reuters test score of 90.7.

On AAPD, the ordinary LSTM’s mean test F1 is 70.5. Distillation gives a mean test F1 of 72.9 with a standard deviation of 0.3. BERT-base records 73.4 test F1. The mean validation F1 of the distilled LSTM is 75.4, compared with 75.3 for BERT-base. The relationship resembles Reuters. The validation comparison favors the student marginally in the printed scores, and the test comparison favors BERT-base. BERT-large retains its lead on validation and test.

On the IMDB test set, the distilled LSTM reaches a mean accuracy of 53.7 with a standard deviation of 0.3. The ordinary LSTM reports 52.8 and BERT-base reports 54.2. The validation figures for the distilled student and BERT-base are 54.5 and 54.4, respectively. Across Reuters, AAPD and IMDB, the authors discuss these results as average parity with BERT-base and report that individual runs can exceed it on validation and test. The printed test means themselves are all slightly below the single BERT-base scores. That distinction is important when interpreting a claim of comparable effectiveness.

Yelp 2014 gives a different picture. The LSTM goes from 69.0 validation accuracy and 68.7 test accuracy to distilled means of 69.7 and 69.4. BERT-base reaches 72.1 on validation and 72.0 on test, so the improvement over the ordinary LSTM leaves a substantial gap. The standard deviation reported for the distilled LSTM is 0.1 on each split. The underlying dataset is also the one for which no transfer-set augmentation was performed. That difference is part of the experimental setup, and the paper leaves its contribution to the result unresolved.

Ordinary and distilled LSTM versus BERT on Yelp 2014 test accuracy The distilled LSTM improves on its ordinary counterpart while both BERT variants retain a clear lead.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| LSTM | 68.7 |
| Distilled LSTM | 69.4 |
| BERT-base | 72.0 |
| BERT-large (this paper) | 72.5 |

#### What simpler students gain

The clearest improvements for the smaller students appear on the multi-label benchmarks. On Reuters, ordinary KimCNN reaches a mean validation F1 of 83.5 and a mean test F1 of 80.8. With distillation it reaches 90.0 on validation and 87.0 on test. The distilled CNN ties the ordinary regularized LSTM’s printed mean test score. Logistic regression’s Reuters validation F1 goes from 77.0 to 87.0, while test F1 goes from 74.8 to 83.7. The distilled logistic regression result remains below the support vector machine at 86.1 test F1 and below the BERT runs. Its gain shows that teacher supervision can improve the use of the weighted word features substantially on this task.

On AAPD, KimCNN begins much lower. Its mean F1 is 54.5 on validation and 51.4 on test. The distilled means are 72.7 and 70.6. Logistic regression records 67.1 validation F1 and 64.9 test F1 before distillation, then 73.1 validation F1 and 71.3 test F1 with it. The distilled linear classifier exceeds the distilled CNN on AAPD test F1 in spite of the CNN’s ability to detect local word patterns. Both have test results higher than the hierarchical attention network’s 68.0, and both are close to the 71.0 SGM entry. This is where the evidence for training a very simple student is especially concrete.

AAPD test F1 for ordinary and distilled linear and convolutional classifiers Distillation raises both students’ scores, and distilled logistic regression records the highest score in this comparison.

**The numbers**

| System or setting | F1 |
| --- | --- |
| KimCNN | 51.4 |
| Logistic regression | 64.9 |
| Distilled KimCNN | 70.6 |
| Distilled logistic regression (this paper) | 71.3 |

On IMDB, the smaller students respond differently from each other. KimCNN’s mean validation accuracy rises from 42.9 to 49.0, and its mean test accuracy rises from 42.7 to 48.3. Logistic regression goes from 43.1 to 43.8 on validation but from 43.4 to 43.3 on test. The improvement for the CNN is clear in both splits, while the held-out test result for the linear classifier shows no improvement. This makes the general claim about simple learners more precise. Suitability for distillation depends on the student and dataset, even when the teacher supplies the same kind of probability target.

On Yelp 2014, the convolutional student reports 66.5 validation accuracy with or without distillation. The mean test results are 66.1 before distillation and 66.2 afterwards. The linear classifier’s score rises from 61.1 to 62.7 on validation and from 60.9 to 62.3 on test. Both architectures remain below the ordinary LSTM on the test set. The Yelp figures show that even a relatively large gain elsewhere for a given architecture tells little about its gain on a particular new task. They also show why it is useful to compare a distilled system with its own baseline, since the ordering among students and the improvement due to training answer different questions.

#### How much inference computation the students require

The authors report parameter counts and estimated floating-point operations for inference on Reuters. A parameter count measures the number of learned values used by the architecture. The operation count estimates arithmetic work for a prediction pass. The paper gives both in millions. BERT-base has 110 million parameters. Logistic regression and the LSTM are each listed with 3.3 million parameters, or 3% of BERT-base. KimCNN has 0.4 million, listed as 0.4% of BERT-base. A classifier can therefore have fewer parameters than another while using more operations to process a particular input. These two measures describe different aspects of the cost of making predictions.

The Reuters inference estimates show that distinction. Logistic regression is listed at 6.5 million floating-point operations and KimCNN at 26.0 million, even though the CNN has fewer parameters. The LSTM is listed at 780.9 million operations and BERT-base at ∼30,000 million. The corresponding comparisons printed in the paper are 4620× for logistic regression, 1150× for KimCNN and 40× for the LSTM, relative to BERT-base. These are comparisons based on the reported operation counts. The table’s operation and parameter figures describe what the authors measure when they discuss the scale of compression.

The LSTM’s case is important because its prediction quality comes closest to BERT-base on several benchmarks. Logistic regression and KimCNN offer larger reductions in operations, with more variable results in classification. On Reuters, the distilled CNN gets the same printed mean test F1 as the ordinary LSTM while using the CNN architecture listed in the cost comparison. The distilled linear classifier has a lower Reuters test score and the smallest reported operation count. These comparisons allow cost and validation or test quality to be considered together without treating a small parameter count as a complete account of inference efficiency.

### What the ablations show

#### Input length matters differently across datasets

The appendix varies the maximum sequence length for DocBERT and plots validation performance on Reuters and IMDB. When the authors reduce the cutoff on Reuters, validation F1 falls only modestly. They suggest that Reuters documents being relatively short may explain the smaller effect. On IMDB, lowering the cutoff gives a much steeper decline in validation accuracy. The contrast is informative because these settings change how much input can reach BERT. The analysis compares how well BERT classifies when the input is restricted to different lengths, within each of the two tasks.

For IMDB, the paper notes that at a cutoff of 256 tokens, BERT’s validation accuracy falls below that of the much smaller regularized LSTM in the main comparison. The shorter permitted input changes which system leads. This is a useful qualification of an architecture comparison. A powerful classifier still depends on the evidence available in the input, and longer documents create more opportunities for truncation to remove something relevant. The authors consider both the possibility that added text matters and the possibility that a long document might retain enough clues even after truncation. The observed decline shows that the latter reasoning is insufficient for their IMDB setup.

The paper interprets its length experiments as evidence that truncation hurts document classification and that the size of the harm varies. The direct measurement is a validation result for the cutoffs and datasets considered. It shows that input length was a consequential hyper-parameter, especially on IMDB. It does not locate the words that carried the lost evidence or show how a classifier would perform if it selected excerpts from different parts of the document. The comparison concerns the truncation procedure used in DocBERT.

#### Short fine-tuning can leave a strong starting point underused

The appendix also varies the number of fine-tuning epochs for Reuters and AAPD. In both cases, the validation F1 curves show substantially worse results with four epochs than with longer training. On Reuters, the authors report that the four-epoch BERT result is lower than the logistic regression baseline in their main table. This comparison is a check on the training setup. A poor showing after a short adaptation period can reflect the amount of supervision the pretrained system has had time to absorb.

The authors contrast this behavior with the BERT work they cite, where a small number of fine-tuning epochs had been sufficient on small datasets. In their document classification experiments, the smaller benchmark datasets require more training to reach the scores used for the main comparison. The chosen durations are 30 epochs on Reuters and 20 on AAPD. IMDB is trained for 4 epochs, showing that the paper’s final schedule is specific to the task. The appendix’s epoch plots are for Reuters and AAPD. The evidence about what happens as training is extended comes from those validation curves.

These results matter for the distillation experiment because the teacher’s probabilities come from a fine-tuned classifier. A teacher trained on a weaker schedule would supply a different set of probability targets. The epoch analysis establishes that the quality of DocBERT can depend on the schedule. The paper does not run a parallel study that varies teacher training duration and then compares the resulting students. Accordingly, the appendix explains how the authors obtained a strong teacher, while the effect of teacher training duration on student quality remains unmeasured.

#### How much recurrent capacity is enough

The paper varies the LSTM’s number of hidden units. A hidden unit is a component of the learned representation inside the recurrent layer. Changing the number changes how much information the layer can represent and affects its parameter count. The authors consider widths of 32, 64, 128, 256 and 512. They compare the distilled LSTMs’ validation performance with the BERT reference scores and show how it relates to the number of parameters. This addresses what can be reduced within an architecture, in addition to what happens when the student is changed to a CNN or a linear classifier.

With 256 hidden units, the authors report validation parity with BERT-base on Reuters and IMDB. They describe that LSTM as having ∼ 1% of BERT-base’s parameters. For AAPD, they identify 512 hidden units, at ∼ 3% of the BERT-base parameters, as sufficient for parity in the plotted validation comparison. This difference gives the capacity analysis a concrete outcome. A recurrent width that gives a strong result on one dataset does not automatically suffice on another. The result concerns the observed scores of these particular students and the chosen points in the width sweep.

The width analysis also clarifies what performance parity refers to in different parts of the paper. In the main table, parity is discussed using validation and test scores across the experiments with the distilled LSTM. In the width plots, parameter count is compared with validation performance. The claim that the narrower recurrent layer can approach BERT-base on Reuters and IMDB follows from the latter comparison. It would take test scores for the narrower settings to extend the same conclusion to held-out test performance at that width.

#### What the ordinary and distilled comparisons isolate

Comparing each student with its ordinary counterpart shows what happens when the training setup changes while the basic architecture is retained. This makes the improvement of logistic regression on Reuters and AAPD particularly relevant. The classifier still operates on weighted term features. The teacher has supplied useful training information that this linear student can express through different feature weights. The same comparison for KimCNN shows that a small architecture with access to local patterns can gain enough on AAPD to reach the vicinity of the best earlier systems.

The comparison bundles the use of teacher probabilities with the transfer-set procedure on the augmented tasks. It therefore measures the effectiveness of the tested recipe as a whole. The paper provides no parallel score for a student trained on the enlarged data with only the ordinary label objective, or for a student trained with the teacher objective on the unaugmented version of every dataset. Yelp has no augmentation, but it differs from the other datasets in several additional ways. Its results show how the recipe performs in that setting and cannot by themselves identify an augmentation effect.

Results across architectures likewise describe what can be achieved with the particular representations and training settings tested. For example, the distilled linear classifier surpasses the distilled CNN on AAPD test F1, while the ordering is reversed on IMDB test accuracy. The study compares meaningful end points with different architectures. It does not independently vary word order, local pattern detection and recurrent memory within a common representation. The comparisons show where each student makes effective use of distillation, and leave open which kinds of evidence account for the different responses.

### Limitations

#### Limits the authors state

The authors distinguish inference savings from the cost of training. Distillation starts from a capable teacher, which must be fine-tuned, and then uses its predictions to train the smaller classifier. Once the student is ready, the teacher is unnecessary at inference time. The authors identify the resources needed during training as a problem that their approach leaves open. Accordingly, the study’s efficiency measurements speak to repeated use of the trained classifiers. They give no estimate of how much training is required before those inference savings would outweigh the cost of making the student.

Resource constraints also shape the evidence. The main BERT scores are each reported from a single run per task. The authors limit Yelp fine-tuning to one epoch and omit Yelp augmentation for computational reasons. These choices are part of the actual training conditions. The smaller gains on Yelp are evidence about the recipe under those conditions. The comparisons include no longer Yelp schedule or augmented Yelp transfer set from which to estimate how much either choice affected the result.

The authors also acknowledge that the simplest classifiers fall short of BERT-base overall. Logistic regression and KimCNN can improve enough to compete with some stronger earlier baselines, especially on the multi-label tasks. The LSTM is the student that approaches BERT-base on the majority of the datasets. The claimed scope of successful transfer changes with the capacity of the student. Improvement within an architecture and recovery of the stronger classifier’s performance are different outcomes, and the paper supplies examples of both.

#### Limits visible in the evaluation

Comparisons near BERT-base need to be read in light of how the runs are reported. The means and standard deviations on the student side describe variation over the repeated runs available for those students. The single BERT-base score gives no comparable estimate of how its result changes over repeated fine-tuning runs. The small numerical gaps on Reuters, AAPD and IMDB support the paper’s description of close performance under its protocol. They leave statistical equivalence unresolved. The report that a student run can exceed BERT-base adds evidence about attainable performance and cannot establish which system would win on average across matched repetitions.

The operation counts also have a specific scope. They are calculated for inference using Reuters as the reference workload. The reported parameter counts describe the architectures, while the floating-point operation counts depend on the computation done for the inputs. The table gives no measured latency for the classifiers on a particular deployment system. The study also does not present corresponding operation comparisons for the other datasets. Its efficiency result is an arithmetic comparison for the stated inference setup, with classification results elsewhere in the paper showing how the quality tradeoff varies across tasks.

The aggregate metrics summarize document classification performance, leaving label-level behavior mostly unexamined. On a multi-label benchmark, a higher F1 can arise from different changes in which categories are predicted and which are missed. The main results do not separate gains for frequent labels from gains for rare labels. The reader can judge how the systems perform on the reported F1 measure, but has no basis for identifying which labels the teacher helped the students recover. The reported accuracy on the review tasks likewise records agreement with the reference class and gives no separate account of which classes are confused.

#### Limits on what can be attributed to distillation

The experiments establish that these training setups can change held-out scores, sometimes substantially. They give no matched comparison isolating each source of additional supervision in the augmented settings. The combination of a bigger transfer set and teacher probabilities could help in different ways. Word changes, masking or reordering can expose the student to variation, and the teacher can provide different probabilities for those inputs. The reported results measure their combined use. Without parallel runs that change these components independently, a gain on AAPD or Reuters cannot be assigned to a particular transformation or to the probability loss alone.

The paper specifies the direction of KL divergence and names the probabilities used in it. It gives less detail about how multi-label probabilities enter the divergence and how the effect of the two losses varies with the chosen weight. The appendix supplies the weights used for the different task types. The reported comparisons do not sweep those weights or compare alternative ways to construct the distillation objective. The evidence therefore supports the effectiveness of the specified combination where it worked. It is insufficient to identify a generally preferable formulation for all the datasets or students.

There is also an inconsistency in the paper’s description of the teacher for the smallest students. One passage in the results discussion refers to distilling BERT-base into KimCNN and logistic regression. The training description and the main table identify the fine-tuned BERT-large as the source for the distilled entries. The table also uses BERT-base for the main efficiency comparison. The reported training setup is best read from the method and the explicit table identification. The paper does not give a separate comparison of what happens if BERT-base is used as the teacher.

Finally, output agreement and classification performance leave the content of the learned transfer open. A linear student can improve its scoring of terms after seeing BERT’s probabilities. That gives concrete evidence that some useful part of the teacher’s classification behavior can be approximated using those features. It does not demonstrate that the student has acquired BERT’s contextual representations or that it relies on the same evidence when it predicts a label. The results establish what teachers and students can achieve on these datasets, with these inputs, during the tested training and evaluation procedures. The interpretation of what the teacher has conveyed is bounded by the predictions the paper measures.

### What came after

No subsequent study is documented here. The authors leave training efficiency as an open direction. Their experiments reduce the computation needed to classify a document once a student is trained, while the teacher still has to be fine-tuned and run to produce the student’s training targets. Reducing that earlier cost would address a separate part of the workload from the inference savings measured on Reuters.

## Cite

Cite as Ashutosh Adhikari, Achyudh Ram, Raphael Tang, William L. Hamilton and Jimmy Lin. 2020. Exploring the Limits of Simple Learners in Knowledge Distillation for Document Classification with DocBERT. Proceedings of the 5th Workshop on Representation Learning for NLP.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2020.repl4nlp-1.10](https://doi.org/10.18653/v1/2020.repl4nlp-1.10)

```bibtex
@inproceedings{adhikari2020exploring,
  title = {{Exploring the Limits of Simple Learners in Knowledge Distillation for Document Classification with DocBERT}},
  author = {Ashutosh Adhikari, Achyudh Ram, Raphael Tang, William L. Hamilton and Jimmy Lin},
  booktitle = {Proceedings of the 5th Workshop on Representation Learning for NLP},
  year = {2020},
  doi = {10.18653/v1/2020.repl4nlp-1.10},
  url = {https://doi.org/10.18653/v1/2020.repl4nlp-1.10}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
