Elamur Research

Load What You Need: Smaller Versions of Mutililingual BERT

Paper · 2020 · Amine Abdaoui, Camille Pradel and Grégoire Sigel

Summary

An application that works in a handful of languages can still spend much of its memory on vocabulary assembled for a far wider audience. The authors ask how much of that cost can be removed from an already trained system. They study mBERT, the cased multilingual version of BERT. Its vocabulary has 119k entries, and the system has 178 million parameters. More than 51% of those parameters belong to the embedding layer, which supplies the learned numerical representation associated with each token. That concentration makes the vocabulary a practical place to reduce the size of a deployment.

The procedure starts by identifying which entries in the existing vocabulary occur regularly in each required language. The authors run the original tokenizer over separate Wikipedia collections and retain tokens that occur in at least 0.05% of a language’s paragraphs. A variant for several languages takes all the entries selected for any of those languages, storing each shared entry once. The authors copy the corresponding embeddings into a smaller table and carry over the other pretrained weights. They build 30 variants this way, including a version for all 15 XNLI languages, English-paired bilingual variants and versions for individual languages. Construction requires no fresh pretraining run. The variants then receive task-specific training for the experiments.

XNLI measures a system’s ability to determine how two sentences in a pair relate to each other. The experiments cover transfer from English training to other languages, separate training on translated material, pooled training across languages and evaluation after translating the test material into English. The reduced variants generally stay close to the original in average test accuracy. In cross-language transfer, the original and the reduced multilingual variant both score 65.8, and the bilingual family scores 65.9. With pooled multilingual training, the reduced multilingual variant reaches 74.5 against the original’s 73.4. The authors report reductions of up to 45% in parameter count. Individual language scores can move in either direction even when the average changes little.

The comparison with DistilmBERT, a smaller system obtained through distillation, shows where the savings occur. The vocabulary-reduced variants take less space, allocate less memory and load faster than the original. On the reported cloud machine, their average inference time is 0.24 seconds per XNLI item, the same displayed value as mBERT. DistilmBERT takes 0.12 seconds and has lower average accuracy than mBERT in every training arrangement evaluated. Vocabulary selection thus offers a way to fit an existing multilingual system into a smaller deployment while keeping broadly similar task accuracy. The evidence comes from mBERT on XNLI. The authors leave application to other architectures and tasks for further work.

Deep dive: Load What You Need: Smaller Versions of Mutililingual BERT

How trimming multilingual BERT’s vocabulary cuts storage, memory use and loading time while preserving similar XNLI accuracy. · about 33 minutes to read

The problem and its context

The cost of carrying a broad vocabulary

Broad language coverage gives an application options. It can process material originating in several languages, and it can benefit from supervision available in a language other than the one it ultimately serves. The paper singles out the ability to transfer from one language to another without task training in the destination language. But the same breadth presents a practical problem for an application with a fixed, much narrower remit. Its copy of the system still includes the full vocabulary learned for multilingual use. The authors frame the question as a deployment problem in multilingual and cross-lingual NLP.

An input sentence is first represented as a sequence of tokens. A token is a unit the system can look up, which can be a whole word, a word fragment or another kind of entry such as punctuation. Each entry has an associated vector, a sequence of learned numerical values. The embedding layer supplies these vectors as input to the layers that process the sentence in context. Increasing the number of vocabulary entries increases the number of vectors to store. This is how a vocabulary decision becomes a parameter-budget decision, and why the paper focuses on the input table of word embeddings.

The authors illustrate the scale of the effect by comparing cased mBERT with English BERT BASE. They report 119k vocabulary entries and 178 million parameters for mBERT. English BERT BASE has a vocabulary of 30k tokens and 110 million parameters. The two share an architecture. The difference in vocabulary capacity helps explain why the same arrangement of processing layers can come with substantially different storage requirements. A discussion of Transformer and attention architecture alone would miss a major contributor to the size of the multilingual package.

There is good reason to be careful about reducing that capacity. The introduction points to earlier work in which increasing the vocabulary from 128k to 512k improved overall XNLI accuracy by more than 3%. In the paper’s account, this is evidence that vocabulary can contribute materially to multilingual quality. A larger inventory can supply useful entries across the languages a system is expected to handle. The compression question therefore depends on which entries are removed and what input the resulting system will receive. The cited comparison comes from Unsupervised Cross-lingual Representation Learning at Scale.

The authors’ proposal turns on the difference between the language collection used to build a general-purpose system and the language collection an application actually needs. At the point of deployment, the vocabulary can be reconsidered in light of that narrower purpose. An application trained on English data and used on Spanish sentences, for example, has reason to keep entries for both activities. A system that receives all of its input in English has a different requirement. The paper makes these distinctions concrete by changing which input entries are packaged with the same pretrained weights.

Other ways to make a Transformer smaller

The paper places vocabulary selection alongside quantization and distillation. Quantization reduces the precision used to represent weights. It addresses the storage cost of each value, and the authors note that its practical advantages can depend on the hardware. In the terminology of the paper, its effect is on how the weights are represented. The vocabulary procedure addresses the number of embedding entries whose weights are carried in the first place. These are different places to intervene in efficient systems and compression.

Distillation involves a teacher and a student. The student learns to approximate behavior acquired by the teacher and can have a simpler architecture. The paper discusses prior efforts to apply this strategy to BERT, including work that builds a shallower student. The conceptual background comes from knowledge distillation, and the prior applications include Patient Knowledge Distillation for BERT. The paper also describes an earlier approach that trained teacher and student together to reduce both the vocabulary and embedding size. That example matters because it shows that vocabulary reduction already existed as a compression goal. The distinctive question here is how much can be achieved by selecting entries from an existing system.

Prior multilingual distillation had also been assessed on part-of-speech tagging, which assigns grammatical categories to tokens, and on morphology, which concerns the structure and forms of words. For that work the paper reports a distilled mBERT that was 6 times smaller and 27 times faster, with average F1 drops of 1.6% for tagging and 5.4% for morphology. F1 combines precision and recall. Those figures describe the earlier systems and tasks as the authors recount them. They help explain why speed and task quality should both enter a compression comparison. The authors also say the distilled system from that earlier study was unavailable publicly. The tasks belong to part-of-speech tagging and morphology.

The accessible distilled alternative in the present study is DistilmBERT, the multilingual relative of DistilBERT. Its shallower processing stack provides a comparison with a system whose construction changes how much computation goes into an input. The paper also mentions earlier work on reducing the embedding contribution to parameter count through a method requiring training from the beginning. The question the authors pose is more immediate for a deployment that already has mBERT available. How much can it save by specifying the languages it needs and reusing the learned representations that serve them?

The method, step by step

Choose the language material and keep the original token identities

The authors begin with the complete Wikipedia dump for each language covered by XNLI. Each language’s material supplies its own evidence about vocabulary use. Keeping the collections separate at this stage means that a token can qualify through repeated use in a particular language, even if its occurrences would be scarce in a collection pooled across languages. The choice of 15 languages follows the benchmark on which the authors intend to test the resulting variants.

The authors process each collection using the recommended tokenizer for cased mBERT. Tokenization converts written input into the units represented in the vocabulary. Here the choice of tokenizer also fixes the inventory from which the authors may select. When the tokenizer produces an entry, the authors already have a learned vector for it in the original embedding table. The Wikipedia collections supply observations about where existing entries occur. There is no vocabulary-learning stage that introduces new units and then has to estimate vectors for them.

This detail matters for interpreting the counts. A familiar written word can contribute to the frequency of a whole-word token or to the frequencies of the pieces into which it is split. The object counted is whichever original entry the tokenizer produces. As a consequence, the selected inventory is an inventory of entries in mBERT’s representation. Counting those entries answers a different question from counting distinct written words in Wikipedia. The distinction is especially relevant to subword tokenization.

Constructing and evaluating language-specific mBERT variants

The steps in order.

Constructing and evaluating language-specific mBERT variantsStep 1: Choose the language coverage1. Choose the language coverageStep 2: Collect each language’s Wikipedia dump2. Collect each language’s Wikipedia dumpStep 3: Tokenize with cased mBERT3. Tokenize with cased mBERTStep 4: Measure each token’s spread across paragraphs4. Measure each token’s spread across paragraphsStep 5: Keep qualifying entries for each language5. Keep qualifying entries for each languageStep 6: Take the union for the chosen languages6. Take the union for the chosen languagesStep 7: Rebuild the table with retained embedding rows7. Rebuild the table with retained embedding rowsStep 8: Fine-tune for the XNLI task8. Fine-tune for the XNLI task

Select entries by the share of paragraphs containing them

Within a language collection, the authors count how widely an entry occurs across paragraphs. The paper treats the lines of the collection as the paragraph units for this purpose. The relevant quantity is the share of those units in which the token appears. An entry repeated throughout a single paragraph contributes evidence of presence in that paragraph. An entry appearing in separate paragraphs contributes evidence in each of them. The cutoff therefore favors distribution across the collection over concentration in a small part of it.

An entry qualifies when it appears in at least 0.05% of the paragraphs for that language. The inclusive wording matters: an entry exactly at the threshold qualifies. The authors choose the cutoff after manually examining the distributions in the language collections. Their method is specified in prose and contains no formal equation. Its precise rule is to compare paragraph prevalence with that shared cutoff, using each language’s own paragraphs as the denominator.

For a newcomer, it may help to think through what the procedure asks of a token that occurs in both English and French Wikipedia. Its occurrences in English are evaluated against the English collection. Its occurrences in French are evaluated against the French collection. If it qualifies in both, it can be selected for both. If it qualifies in just one, it can still appear in a variant covering that language. This reasoning follows directly from choosing the inventories independently. It requires no decision about the language to which an entry ultimately belongs.

The common threshold also leaves room for different languages to retain quite different numbers of entries. English yields 28,458 selected entries, reported as 23.8% of the original vocabulary. Spanish yields 26,346 or 22.0%, German 26,031 or 21.8%, and French 24,482 or 20.5%. These results describe the inventory after selection. They measure the number and share of distinct original entries included in each set.

Other collections give smaller sets under the same procedure. Turkish contributes 19,086 entries, or 16.0% of the original vocabulary, and Vietnamese contributes 17,512, or 14.6%. The Swahili set contains 16,619 entries, reported as 13.9%. The Russian set contains 14,270, or 11.9%. The percentage in each case uses the full mBERT vocabulary as its reference, so it measures how much of that vocabulary is kept. It gives no direct reading of how frequently a sentence in the language uses a retained entry.

The paper reports 12,928 entries for Chinese, or 10.8%, and 12,121 for Bulgarian, or 10.1%. Greek has 11,616, or 9.7%. These inventories were produced from separate corpora by the same rule, and their size depends on both the original tokenizer and the observed distribution. Two languages with similar counts can retain different entries. Similarly, a language with a smaller selected set could still have much of its observed text represented by the entries that are especially common in that collection. The table supplies inventory sizes, while the downstream test addresses what the variants can do with those inventories.

At the smaller end, Urdu has 8656 selected entries, or 7.2%, and Thai has 8493, or 7.1%. Arabic has 7292, or 6.1%, and Hindi has 5664, or 4.7%. The differences are outcomes of applying a uniform prevalence criterion to language-specific material. They are useful for anticipating that packages will differ in size. Any broader interpretation would require evidence about the corpora and the entries that the original tokenizer makes available.

Assemble an inventory for each intended use

For a variant serving several languages, the authors take the union of the individually selected sets. A union includes any entry that qualifies for any of the chosen languages. A shared entry has a single place in the combined vocabulary. The authors point to names, punctuation and numbers as reasons to expect overlap. All of these can occur in corpora from different languages and be represented by the same original token.

The union over the 15 languages has 71,577 entries, reported as 60% of the starting vocabulary. The union is the relevant count for storing the combined inventory, because shared entries only need one vector in the resulting table. An English-paired variant is built by applying the same rule to English and the other selected language. A version for just one language takes the entries that met the threshold for that language’s Wikipedia material.

This gives the language sets a practical meaning. They determine what material goes into a package, without partitioning the original vocabulary into disjoint language blocks. An entry can survive because it is fairly common in one language and then also prove useful in another language covered by that package. The method deliberately allows that possibility through the way it combines the sets. The paper reports the combined size for the full XNLI collection and does not break the union down into exclusive and shared portions for each language pair.

Build a smaller embedding table from learned vectors

The authors extract the vectors associated with the retained entries and rearrange them into the embedding table of the smaller variant. The correspondence between an entry and its vector is essential. A retained entry has to lead to the learned representation associated with it before extraction. Rearranging an inventory can change the position of an entry in the smaller table. The methodological point is that the values copied for that entry come from its existing vector, regardless of where it is placed in the new table.

The other pretrained parameters are carried over intact at construction. The contextual layers therefore start with the weights acquired during the original multilingual training. They operate on input drawn from a narrower vocabulary in the extracted variants. This explains how the authors can produce a version intended for one language while still reusing parameters that were learned from training in many languages. The label describes the resources retained for the variant’s intended use.

The authors construct 30 variants. The single variant named mBERT 15langs covers the full XNLI collection. There are 14 bilingual variants, designated mBERT en-xx, in which xx stands for a language paired with English. There are also 15 monolingual variants, designated mBERT xx. English remains in the paired variants because the cross-language transfer experiment uses English to teach the task. The destination language is then needed to process the test sentences.

After extraction comes fine-tuning, the task-specific training of a system initialized with learned weights. The accuracy results are for variants that have undergone that training under the appropriate XNLI arrangement. The statement that weights are copied from mBERT applies to the construction step. The subsequent task adaptation is part of the evaluation workflow and gives the variants a chance to learn the sentence-pair decision from labeled material.

The paper reports a release of the variants through the Transformers hub, with the construction code and data made available in the Geotrend smaller-transformers repository. For task evaluation, the authors point to the scripts in Transformers. The artifacts correspond to two distinct parts of the study. The construction resources are for building a vocabulary-reduced variant, and the evaluation scripts are for adapting and testing the resulting system on XNLI.

Experiments and results

What XNLI measures and how the experiments use it

The downstream task is cross-lingual natural language inference. Each item presents paired sentences, and the system must identify the relationship assigned to the pair. Accuracy measures the share of test decisions that match the benchmark labels. XNLI extends the English sentence-inference corpus MultiNLI. The English development and test sets were manually translated into the other 14 XNLI languages. The benchmark also provides automatically translated material for arrangements that move either the training input or the evaluation input into a different language.

The distinction between a test set’s language of origin and the language the classifier receives is essential here. Under direct cross-language transfer, for instance, the French score describes decisions on French input after the system has been adapted using English. When the test material is translated into English, the column for French still identifies the originating evaluation set. The system receives English for the sentence-pair judgment. The same kind of accuracy measure is used in both cases, while the language-processing requirement changes. That is an important feature of this design for evaluation and benchmarks.

Two reference systems appear throughout the accuracy experiments. Original mBERT has 178 M parameters and retains its full vocabulary. DistilmBERT has 135 M and provides the distilled comparison. The common reduced-vocabulary system across the configurations is mBERT 15langs, with 141 M parameters. The bilingual variants shown for transfer range from 108-113 M, and the monolingual family shown for language-matched training ranges from 90-108 M. The English-only variant in the translated-test comparison has 108 M parameters. The ranges belong to families of separately constructed variants.

The authors present a score for each language and an overall average under each arrangement. The original and reduced multilingual versions can be compared directly within an arrangement because they have access to the corresponding task training setup. Comparing averages across arrangements answers a broader question about how the training and evaluation pipeline performs. Those cross-arrangement scores reflect changes in access to translated data, in which languages are seen during task training, or in which languages reach the system at test time.

Cross-lingual Transfer

In Cross-lingual Transfer, the authors fine-tune on the English training set, then evaluate on the XNLI test sets. The non-English test items come from the manual translations. Successful transfer here requires applying the task learned from English examples to sentences presented in another language. The bilingual family uses an English-plus-target package suited to this route through the data. Both the task-training input and the direct test input have a corresponding selected inventory.

XNLI Cross-lingual Transfer test accuracy averaged across languages

Both vocabulary-reduced settings finish close to original mBERT, while DistilmBERT has lower average accuracy.

XNLI Cross-lingual Transfer test accuracy averaged across languagesmBERT: 65.8mBERT65.8DistilmBERT: 59.7DistilmBERT59.7mBERT 15langs: 65.8mBERT 15langs65.8mBERT en-xx (this paper): 65.9mBERT en-xx (this paper)65.9
The numbers
System or settingaccuracy %
mBERT65.8
DistilmBERT59.7
mBERT 15langs65.8
mBERT en-xx (this paper)65.9

Original mBERT and mBERT 15langs both average 65.8 on the test sets. The bilingual row averages 65.9, while DistilmBERT reaches 59.7. For the paper’s main question, the proximity of the original and vocabulary-reduced rows matters more than their exact ranking. The reduced multilingual system has a narrower input inventory throughout fine-tuning and evaluation, yet its reported average matches that of the full multilingual system. The bilingual row shows that the same broad result can hold when deployment uses an inventory restricted to the training language and the language being assessed.

The French, Spanish and German columns help show what the aggregate can conceal. On the French test set, the original and the bilingual row both score 73.8, while mBERT 15langs scores 74.1. In Spanish, the bilingual score is 75.0, with 73.9 for the original and 73.7 for the reduced multilingual version. In German, the bilingual score is 71.6, and the original and reduced multilingual scores are 70.3 and 70.2. The authors point out that languages they characterize as relatively similar to English tend to score well. The results describe that pattern, while the experiment itself does not manipulate similarity between languages.

Swahili illustrates a small decline in both reduced settings. The original scores 50.3 on the Swahili test set, the reduced multilingual system 49.0 and the bilingual row 49.1. For Hindi, the original and bilingual row both reach 59.5, while the reduced multilingual system reaches 58.9. In Turkish, the reduced multilingual score is 61.1 alongside 60.4 for mBERT and 60.1 for the bilingual row. The relative advantage of the retained scope varies with the language. These examples also show why the bilingual family’s slightly higher average cannot stand in for an assessment of any individual language.

The largest gaps for DistilmBERT include results in Thai and Vietnamese. On Thai test input, the original scores 53.0, mBERT 15langs scores 53.1 and the bilingual row scores 53.2. DistilmBERT scores 37.2. For Vietnamese, DistilmBERT reaches 57.4, the original 70.7, mBERT 15langs 70.6 and the bilingual row 70.9. The difference between the two compression approaches is especially visible in these columns. The vocabulary-reduced systems retain closely comparable results on these inputs, while this distilled system’s scores fall substantially below the full mBERT scores.

Translate Train

Translate Train changes the training input. The English training set is translated so that a system can be adapted using examples in the same language it will receive at evaluation. The full and reduced multilingual systems are fine-tuned separately on the corresponding training sets. For this arrangement the paper also evaluates the single-language variants. Each such variant can use its own language inventory for both training and test input.

The mean test accuracies are 72.8 for mBERT, 72.9 for mBERT 15langs, 72.6 for the monolingual row and 69.2 for DistilmBERT. This is a useful setting for judging the single-language packages because they have direct task supervision in the language they are meant to serve. Their average stays close to the original. The authors treat the monolingual average differences as too small to warrant a causal explanation.

The French and German columns illustrate how different language results enter that average. The French test set gives 77.2 for the original and 77.8 for both reduced settings. In German, the original reaches 77.1, the reduced multilingual system reaches 76.5 and the German-only variant reaches 76.0. The French case favors both reduced rows numerically, and the German case favors the original. Neither language alone would adequately describe the overall comparison.

The Chinese test set gives 76.2 for mBERT, 75.6 for mBERT 15langs and 77.0 for the monolingual variant. On Swahili the respective scores are 66.8, 65.7 and 64.3. On Arabic they are 70.6, 71.5 and 71.4. The accuracy table consequently gives evidence both for the usefulness of language-targeted inventories and for checking the particular retained scope relevant to a deployment. A wide union offers more entries than a single-language inventory, but it does not produce a uniform ordering of the measured scores.

Translate Train also illustrates why the absolute values from direct transfer should be kept in their own context. Swahili scores 66.8 with mBERT under Translate Train, alongside 50.3 under Cross-lingual Transfer. Thai scores 64.9 with mBERT under Translate Train and 53.0 under transfer. In each example the system now sees training material in the evaluation language. The change in training arrangement is part of the comparison, so these figures cannot identify an effect of vocabulary size on their own.

Translate Train-all

Translate Train-all uses the language training sets together. This lets the multilingual systems adapt to the inference task with training material across the language collection before testing. The reduced multilingual version is the vocabulary-selected system evaluated in this arrangement. It retains the union of the benchmark languages and therefore has an inventory constructed to accommodate the full training mixture.

XNLI Translate Train-all test accuracy averaged across languages

The reduced multilingual variant leads the reported comparison under pooled training.

XNLI Translate Train-all test accuracy averaged across languagesmBERT: 73.4mBERT73.4DistilmBERT: 71.7DistilmBERT71.7mBERT 15langs (this paper): 74.5mBERT 15langs (this paper)74.5
The numbers
System or settingaccuracy %
mBERT73.4
DistilmBERT71.7
mBERT 15langs (this paper)74.5

The pooled-training results are 73.4 for original mBERT, 71.7 for DistilmBERT and 74.5 for mBERT 15langs. This is the clearest favorable separation between the reduced multilingual version and the full original in the reported averages. Both use the combined task-training material. The reduced version enters that process with a vocabulary selected for the languages actually appearing in the experiment.

The gain in the reported average is accompanied by favorable values across several language columns. The German test score is 77.8 for mBERT 15langs and 75.6 for mBERT. Bulgarian is 77.6 and 75.7, respectively, and Hindi is 70.2 and 68.9. Both versions score 72.9 in Turkish. The reduced version’s Chinese result is 77.9 alongside the original’s 76.3. For Swahili the figures are 67.1 and 66.7. The pattern gives more context to the average and shows that the pooled result includes languages with very different retained inventory sizes.

The authors connect the result to an earlier observation about multilingual scope. In the prior work they discuss, average accuracy declined when the language collection went from 15 to 100, with vocabulary size held at 150k tokens. Here the language selection is applied to an already trained mBERT, and the authors describe the reduced multilingual vocabulary as 40% smaller than the original vocabulary. The experiments therefore act at different stages and change different variables. The parallel encouraged the authors to ask whether retaining entries with very little use in the target languages can be unhelpful during adaptation. The pooled scores establish the observed ordering for this experiment. They leave that explanation open.

Translate Test

Translate Test uses English training data and translates test material from the other languages into English. The classifier consequently receives English input for its judgments about examples originating in those other languages. This supplies a natural role for the English-only variant. The translation stage is what makes an English inventory applicable across the benchmark’s originating language sets. The distinction depends on where the workflow uses machine translation.

The test accuracy averages are 71.2 for mBERT, 71.1 for mBERT 15langs, 71.0 for the English-only variant and 69.5 for DistilmBERT. The reduced systems again land close to the original. For this setup the important practical result is that the English-only package preserves similar task accuracy when an upstream step delivers test inputs in English. The results in columns carrying other language labels apply to those translated inputs.

For example, items from the French test set give 74.9 for mBERT, 75.3 for mBERT 15langs and 74.4 for the English-only variant after translation. The corresponding values for items from the Vietnamese test set are 68.4, 68.6 and 69.1. For items from the Urdu test set they are 63.0, 61.9 and 62.3. These language labels make it possible to track the source of the examples. Differences between the test sets may reflect what happens when their sentences are rendered in English as well as how the classifier handles those sentences.

Original English items provide another reference within the arrangement. The original scores 82.1 on the English test set, and the reduced multilingual and English-only systems both score 82.2. DistilmBERT scores 78.5. The English-only system can therefore be compared to the original on English input as well as on English translations. These are two useful parts of the translated-test evidence because the quality of translated input is a consideration only for the material originating elsewhere.

Stored size, allocated memory and loading time

The paper measures deployment costs on a Google Cloud n1-standard-1 machine with 1 vCPU and 3.75 GB. It records the size of the stored artifact, the memory allocated to the system, how long loading takes and the time for inference. The figures for the bilingual and monolingual families are averages. The measurements make the deployment claim more specific than a parameter count alone could make it.

The original mBERT artifact occupies 714 MB. The reduced multilingual version occupies 564 MB. DistilmBERT occupies 542 MB. The bilingual and monolingual families average 445 MB and 393 MB, respectively. This ordering shows how much the intended language coverage can matter to the size of a package. Even the variant that retains all XNLI languages has a smaller artifact than the one that retains the full mBERT vocabulary.

Allocated memory is 1401 MB for mBERT and 1098 MB for mBERT 15langs. DistilmBERT allocates 1070 MB. The bilingual family averages 860 MB, and the monolingual family averages 760 MB. These are separate observations from the artifact sizes. They show that a smaller vocabulary affects the running allocation as well as the stored file in the reported environment. The measurements also allow a comparison between the two compression approaches at a similar broad level of memory use, since the distilled and reduced multilingual versions are near each other on this measure.

For loading, the authors time 10 runs for each system. They report 4.18 seconds for mBERT, 3.14 seconds for mBERT 15langs and 3.08 seconds for DistilmBERT. The bilingual family averages 2.76 seconds, and the monolingual family 2.45 seconds. Faster loading is a distinct observed benefit. An application that frequently initializes a system can care about this cost even if its time per prediction after loading is the same.

Inference after loading

The inference measurement averages 100 items from XNLI with a batch size of 1. Batch size describes how many items are processed together in a call. Here the measurement represents the reported item-by-item setup. The time is 0.24 seconds per item for original mBERT and for every vocabulary-reduced row. DistilmBERT takes 0.12 seconds.

Average inference time per XNLI item on the cloud machine

DistilmBERT is faster, while the vocabulary-reduced variants match mBERT’s displayed time.

Average inference time per XNLI item on the cloud machinemBERT: 0.24mBERT0.24mBERT 15langs: 0.24mBERT 15langs0.24mBERT en-xx: 0.24mBERT en-xx0.24mBERT xx: 0.24mBERT xx0.24DistilmBERT (this paper): 0.12DistilmBERT (this paper)0.12
The numbers
System or settingseconds per item
mBERT0.24
mBERT 15langs0.24
mBERT en-xx0.24
mBERT xx0.24
DistilmBERT (this paper)0.12

The authors attribute the distilled system’s speed to its reduced depth, from 12 layers to 6. Those layers carry out the processing applied to the input after embedding lookup. The vocabulary variants keep that architecture and carry out the same sequence of processing layers. A smaller table can reduce the resources associated with supplying the input vectors, yet lookup contributes too little to the reported timing for the reduced variants to show a change at the displayed precision.

Taken together, the measurements tell an application developer what kind of constraint this intervention addresses. A smaller file, a smaller memory allocation and shorter initialization are directly observed. For a system already in memory and processing individual XNLI items on the tested machine, the measured latency is the same for the full and vocabulary-reduced versions. DistilmBERT offers the faster item processing in this comparison, coupled with lower average accuracy under the evaluated arrangements.

What the ablations show

The paper reports no formal ablation series for the vocabulary-selection rule. Its evidence about why the method works comes from comparisons against the full parent system, comparisons between retained language scopes, changes in the task-training arrangement and measurements against a distilled alternative. These comparisons support different degrees of inference. The comparison with the parent is particularly informative about the extraction procedure as a whole, while the cause of small differences between reported accuracies remains harder to identify.

Extracting embeddings from the same pretrained parent

The closest controlled comparison holds the pretrained source and the processing architecture in common. Original mBERT uses its full inventory. The extracted multilingual version begins with the retained embeddings and the same other pretrained weights. Within each training arrangement, both are then adapted to the same task under the corresponding language setup. The comparison asks what happens if task adaptation begins from those two different lexical inventories.

In direct transfer, the identical displayed averages make a strong case that the full inventory is dispensable for reproducing that aggregate result on the benchmark. The favorable pooled-training comparison adds evidence that task adaptation can work well after the inventory has been narrowed. The experiment does not require explaining each gain to support the deployment claim. It is enough that the extraction and adaptation procedure yields comparable accuracy with a substantially smaller artifact and memory allocation.

The relevant intervention includes how input is represented once the inventory is reduced. The results are end-to-end classifier scores, so they include any consequences of the input changing alongside the smaller embedding table. There is no experiment that traces an accuracy difference to a named entry being removed. The controlled part of the design establishes what the packaged change does in the tested arrangements. A finer explanation of individual predictions would require observations of which tokens were affected in those inputs and how the resulting representations differed.

Narrowing scope to fit the route through the data

The bilingual and monolingual families show why specifying the intended use matters. Bilingual transfer needs the English training input and the destination-language test input. Language-matched training and testing can use a single-language inventory. Translated testing can also use a single-language inventory, because translation turns the input reaching the classifier into English even when examples originate elsewhere. The reduced families are therefore evaluated against concrete requirements for the language of the input at each stage.

This also sets a boundary on what can be inferred from the family averages. A bilingual average under English transfer and a monolingual average under translated training arise from different systems and different training inputs. They cannot determine the effect of reducing a bilingual inventory to a monolingual one under otherwise identical conditions. The paper does offer within-arrangement comparisons with mBERT 15langs and the original. Those comparisons show that the narrower package can be viable in the setting for which the authors built it.

Overlapping vocabularies further complicate any attempt to read these results as a clean test of language isolation. An entry with evidence in several languages can survive in every relevant inventory. A nominally monolingual variant still carries the learned contextual weights of the multilingual parent. The comparisons establish how narrow the shipped input resources can be for these tests. They provide no measurement of what would happen if the original learning history itself were restricted to that language.

Testing the authors’ interpretation of pooled training

The authors suggest that retaining entries scarcely used in the target languages may sometimes work against fine-tuning. The observed basis is the pooled-training result, where mBERT 15langs performs better in the reported average and in multiple language columns. That pattern makes the interpretation worth considering. The other configurations also matter to the interpretation, since they show that the advantage is clearest in a specific use of the training data.

A direct test of the suggestion would need to separate the identity of the retained entries from the number retained. The paper gives no comparison with an equally sized subset selected by another rule. It likewise gives no series progressively restoring entries that were rare in the target corpora. Without those controls, the result characterizes the combination of corpus, selection criterion, lexical inventory and task adaptation used in the experiment. The higher pooled score cannot be assigned to a particular class of removed entries.

The threshold receives similar treatment. Manual examination produced the 0.05% rule, and the selected inventory performs well enough for the stated goal. The paper gives no sweep of cutoffs, no comparison between paragraph presence and total token occurrence, and no test of an alternative source for estimating prevalence. These absent comparisons leave open how much smaller the vocabulary could become, whether the same cutoff suits each language equally well and which selection statistic contributes most to the observed result.

Separating the costs of weights and computation

The deployment measurements show that the narrower family changes the cost of carrying and loading the weights. Across increasingly tight vocabulary scopes, the reported file sizes and allocations fall, while the per-item times stay at the same displayed value. This demonstrates that storage and working memory can improve even when the cost of the main forward computation remains effectively the same in the experiment.

The distilled comparison adds evidence about where a latency improvement can come from. DistilmBERT changes the processing depth and records a lower inference time. Its average test accuracy is also lower in every arrangement, with the weakest relative result under cross-language transfer. The comparison documents the tradeoff for this available distilled system. It is a comparison of complete systems, so the accuracy gap cannot be treated as a controlled estimate of the effect of removing layers alone.

Limitations

Limits stated by the authors

The authors give inference speed an explicit place in their limitations. The extraction method leaves the processing architecture intact, and the benchmark timings show essentially no effect from making the embedding lookup smaller. Their deployment argument therefore concerns file size, memory allocation and loading time. DistilmBERT shows why the distinction matters. Reducing the number of layers can remove computation from each request once the weights have already been loaded.

The authors propose applying vocabulary reduction to a distilled system so that both changes can be used together. The proposed combination would act on the vocabulary carried by the system and on the computation it performs. The paper gives no joint measurement of accuracy, resource use or latency for such a variant. The separate comparisons give a reason to investigate the combination, while its actual tradeoff remains an open experimental question.

The authors also identify broader empirical validation as future work. Their experiments concern smaller versions of mBERT and a single downstream benchmark, with several training and testing configurations. They mention XLM-R as a candidate for further study and propose testing other language tasks. The fact that the construction uses general operations such as selection and copying makes the idea portable in principle. Evidence about practical accuracy after adaptation still has to come from the architecture and task in question.

Limits visible in the language and task evidence

The selected entries are those observed with sufficient paragraph prevalence in Wikipedia. That gives the procedure a clearly defined basis for retention. It also ties the inventory to the distribution in that source. A specialized application could repeatedly need expressions that occur only rarely in general-language Wikipedia material. The selection rule alone gives no guarantee about those expressions, and the sentence-inference experiment does not measure coverage for a specialized deployment.

Furthermore, a vocabulary entry has no fixed relationship to the amount of benchmark input it represents. A large number of entries may be extremely infrequent in a particular corpus, while a small collection of entries may occur very often. The inventory percentages show how much of the original table remains. They do not give the percentage of test tokens preserved, the share of items affected by removal, or the distribution of such changes across languages. A token-level analysis of the benchmark input would be needed to relate those quantities to accuracy.

The paper describes selecting and rearranging embeddings but leaves details of input behavior after removal mostly unexplored. For example, the study provides no account of how often the reduced inventory changes the segmentation of difficult strings and no error grouping for cases involving formerly available entries. That matters for interpreting both success and failure. Similar sentence-pair accuracy can coexist with individual inputs receiving different representations, while an aggregate decline cannot reveal by itself which changed representations were responsible.

Restricting a variant to a named language or collection also defines its intended scope more clearly than its behavior outside that scope. Shared material can cross language boundaries, and an unsupported language might still produce some retained entries. The experiments do not measure what happens on other languages or on inputs combining languages in ways outside these test arrangements. The names of the released families describe how their inventories were built and where the paper evaluated them.

Reported averages require particular care. The cross-transfer result is a good example. Original and reduced multilingual mBERT have the same displayed average, while Swahili moves down and Chinese moves up. Actual relevance depends on whether an application shares the benchmark’s language mix and how much it values each one. The paper’s language columns supply evidence about those individual cases, but the benchmark average cannot settle a deployment decision for a particular distribution of inputs.

The accuracy tables also give no uncertainty intervals or variation across repeated fine-tuning runs. The authors acknowledge the smallness of the monolingual average differences and decline to explain them. The same caution is appropriate when judging a narrow lead elsewhere. Even the clearer pooled-training result supports an observed outcome under the reported setup. Establishing how reliably it recurs, or whether it depends on the specific retained set, would require experiments beyond the point estimates given.

Finally, the XNLI arrangements evaluate a decision about paired sentences. They provide useful evidence for that task under different language routes. They leave open the effect of extraction on other objectives, including ones for which accurate treatment of infrequent lexical material could have a different role. Likewise, the fact that a narrowed package can be adapted after broad multilingual pretraining leaves open what could be achieved with narrow language coverage from the start. The experiments inherit the original multilingual learning history in every extracted variant.

Limits visible in the systems measurements

The operational comparison is tied to the reported cloud machine, a specific inference workload and item-by-item processing. It measures how the systems behave under those conditions. Batch processing, other hardware and other serving workloads remain untested. There is no component-level timing breakdown, so the inference figures support the authors’ practical conclusion about lookup cost for the measured workload without supplying a general estimate of how much time embedding lookup consumes.

The timing study also distinguishes loading from inference. Those are separate measurements, and a full application can involve additional work between receiving a request and returning a result. Translate Test is a useful example. Its classifier scores depend on translated test material, but the reported inference table gives times for processing XNLI items. The study does not supply a timing for the complete translation-and-classification workflow. Its source of quality evidence and its endpoint for performance measurement should be kept in view when interpreting the results together.

The paper’s prose uses inconsistent percentages for DistilmBERT’s size reduction. The related-work section gives 21%, and the discussion gives 25%. The upper end of the accuracy drop is given as 6% in the abstract and 6.1% in the discussion. The tables provide the explicit parameter counts, stored sizes and benchmark scores for the systems being compared. Those measurements give a clearer basis for evaluating the results than the varying prose descriptions.

What came after

The later citations take up questions about adapting to particular languages, evaluating systems within regional or task-specific settings, and using vocabulary to manage computation. The titles establish the subject of each later study and the citation establishes a connection to the earlier paper. The details of how the later authors used vocabulary selection, if they applied it, are unspecified. The connections can be read in terms of which part of the original question each study’s stated subject touches.

Adaptation to a language collection or dialect

The African-language study names multilingual adaptive fine-tuning as its means of adapting pretrained systems. That puts its stated emphasis on further learning for a target language collection. The earlier paper also starts from pretrained resources, but its distinctive intervention at that stage is to choose which input representations are carried forward into task training. Together the subjects distinguish adaptation of learned behavior from selection of the lexical resources used during adaptation. The citation leaves open whether the later study combined these operations. Adapting to African Languages via Multilingual Adaptive Fine-Tuning

DziriBERT identifies the Algerian dialect as the target of pretraining. This narrows the linguistic remit at a different stage from the operation that gives mBERT a selected vocabulary after broad pretraining. The connection is the decision to define a system around a particular kind of input. The title establishes the dialect focus and pretraining subject. It does not establish the source of the vocabulary or whether mBERT’s retained embeddings were involved. DziriBERT

Evaluation within a language, region or task

ScandEval takes a regional language collection as the subject of a benchmark. That perspective relates to the earlier paper’s use of language-specific accuracy columns. A benchmark scoped around Scandinavian language processing can make the performance on its intended language collection the central question. The citation indicates contact with the earlier multilingual study, while the use of any particular compressed variant or vocabulary rule remains unspecified. ScandEval

The French question-answering study examines usability within a particular language and task. Its stated problem is junctional to the earlier work in a concrete way. A vocabulary targeting French could suit the language of a question, while the behavior that matters would be answering questions. The earlier paper supplies sentence-inference evidence about French, which leaves question-answering performance open. The citation supplies no direct evidence that the French study used the released variant. Transformers for French Question Answering

The French spoken-language understanding study also fixes the language while changing the task setting. Its title identifies benchmarking as the activity. This is pertinent because vocabulary selection in the earlier paper is motivated by the expected input, and the appropriate downstream quality test depends on what must be done with that input. The connection does not reveal whether the spoken-language study made vocabulary reduction part of its benchmark. French Spoken Language Understanding Benchmarking

The Russian detoxification work is another citation organized around a specific language and goal. Its stated subject is methods for detoxifying Russian text. The earlier paper provides Russian sentence-inference scores under multiple training arrangements, which establish performance for that task. The later title points to a separate application in which retaining useful vocabulary would need to be assessed against detoxification outcomes. The role of the earlier method in that work remains unspecified. Russian Text Detoxification

EmoBench-UA identifies emotion detection in Ukrainian as its benchmark task. The connection again concerns the scope over which evidence is collected. The vocabulary-reduction paper selects languages from its benchmark and judges the extracted systems on the decisions that benchmark requires. A Ukrainian emotion benchmark defines a different language and decision problem. The citation indicates a relationship between the studies without establishing use of a paragraph-based selector or a reduced mBERT variant. EmoBench-UA

Vocabulary as part of decoding

The speculative-vocabulary citation puts vocabulary inside a decoding problem. That is a different point of intervention from selecting input embeddings before a multilingual classifier is fine-tuned and packaged. The earlier paper asks which lexical entries need to be carried for a stated set of languages. The later title connects vocabulary to the process of decoding. It gives no basis for attributing to that work the Wikipedia prevalence rule, the reuse of cased mBERT embeddings or any of the reported XNLI outcomes. Speculative Decoding with a Speculative Vocabulary

Cite

Cite as Amine Abdaoui, Camille Pradel and Grégoire Sigel. 2020. Load What You Need: Smaller Versions of Mutililingual BERT. Proceedings of SustaiNLP: Workshop on Simple and Efficient Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2020.sustainlp-1.16

@inproceedings{abdaoui2020load,
  title = {{Load What You Need: Smaller Versions of Mutililingual BERT}},
  author = {Amine Abdaoui, Camille Pradel and Grégoire Sigel},
  booktitle = {Proceedings of SustaiNLP: Workshop on Simple and Efficient Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.sustainlp-1.16},
  url = {https://doi.org/10.18653/v1/2020.sustainlp-1.16}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/abdaoui-2020-load-what-you-need-smaller/