---
title: "Embedding Structure Matters — paper by Downey et al. (2023)"
description: "Downey and colleagues test how to give XLM-R a smaller vocabulary for a target language while preserving useful structure in its embeddings."
canonical: "https://research.elamur.ai/free/en/papers/downey-2023-embedding-structure-matters-comparing-methods/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **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/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/downey-2023-embedding-structure-matters-comparing-methods/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2023](https://md.research.elamur.ai/free/en/papers/2023/) / Embedding Structure Matters: Comparing Methods to Adapt Multilingual Vocabularies to New Languages

# Embedding Structure Matters: Comparing Methods to Adapt Multilingual Vocabularies to New Languages

Paper · 2023 · C.M. Downey, Terra Blevins, Nora Goldfine et al.

**Authors:** [C.M. Downey](https://md.research.elamur.ai/free/en/authors/c-m-downey/), [Terra Blevins](https://md.research.elamur.ai/free/en/authors/terra-blevins/), [Nora Goldfine](https://md.research.elamur.ai/free/en/authors/nora-goldfine/) and [Shane Steinert-Threlkeld](https://md.research.elamur.ai/free/en/authors/shane-steinert-threlkeld/) · **Year:** 2023 · **Venue:** Proceedings of the 3rd Workshop on Multi-lingual Representation Learning (MRL) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 3rd Workshop on Multi-lingual Representation Learning (MRL) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.mrl-1.20/)
- [PDF](https://aclanthology.org/2023.mrl-1.20.pdf)
- [DOI 10.18653/v1/2023.mrl-1.20](https://doi.org/10.18653/v1/2023.mrl-1.20)

## Summary

A multilingual system can have plenty of vocabulary for languages it will never see in a particular application, while still dividing words in the language it needs into inconveniently small pieces. Downey and colleagues study how to specialize XLM-R by replacing its shared vocabulary with a smaller one trained on the target language, or on a small group of target languages. The difficult part comes after [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/). Every piece in the new vocabulary needs a numerical representation, and many pieces have no exact counterpart in the old vocabulary. The authors ask how those new [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) should be initialized so that the pretrained network can learn to use them.

The authors first examine the geometry of XLM-R’s original embedding table. In a low-dimensional projection, tokens from several common writing systems occupy visibly different regions. Another division roughly tracks whether a token can begin a word. The authors turn these observations into an initialization procedure. They copy embeddings for exact matches and draw embeddings for other tokens from distributions estimated for the corresponding script, optionally distinguishing word beginnings from other positions. They compare these simple rules with FOCUS, which uses similarities from separately trained FastText representations to combine existing XLM-R embeddings for each new token.

The experiments continue pretraining on target-language text and then evaluate [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/) and [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/). Across the experiment averages, updating the transformer after an initial period of embedding training gives better results than leaving it frozen. Fully random initialization performs poorly, particularly when the transformer stays frozen throughout adaptation. FOCUS generally leads the compact alternatives on average, while the script-based approaches are competitive for individual languages and sometimes come out ahead. In monolingual adaptation, the authors report improvements over off-the-shelf XLM-R in 5/8 languages for tagging and 5/7 for entity recognition.

Keeping the original vocabulary during continued pretraining frequently gives slightly better scores, at a reported cost of two to three times more floating-point operations during adaptation. Erzya tagging is a case where the score advantage of the full vocabulary is substantial. Several languages already well covered by XLM-R also tag better with the off-the-shelf system than with any of the compact alternatives. The experiments give a practical account of when vocabulary replacement is worthwhile and how to initialize a replacement. They also show that a smaller vocabulary, a better starting embedding table, and permission to update the transformer are separate choices with different effects.

## Deep dive: Embedding Structure Matters: Comparing Methods to Adapt Multilingual Vocabularies to New Languages

Downey and colleagues test how to give XLM-R a smaller vocabulary for a target language while preserving useful structure in its embeddings. · about 32 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

#### A shared vocabulary serves many languages at once

A multilingual pretrained system learns from text pooled across languages. This is especially relevant to [low-resource languages](https://md.research.elamur.ai/free/en/topics/low-resource-languages/), where there may be too little text to make training a separate system from scratch attractive. A shared system also gives a practitioner a starting point for a target language that was poorly represented during pretraining. The paper describes language-agnostic tokenization and larger vocabularies as common design choices in such systems. XLM-R, the starting point for the experiments, is one example of that design. [Unsupervised Cross-lingual Representation Learning at Scale](https://md.research.elamur.ai/free/en/papers/conneau-2020-unsupervised-cross-lingual-representation-learning/)

A tokenizer converts text into a sequence of vocabulary items. Its inventory may include a whole word, a recurring part of a word, or a smaller unit that can be used when the larger piece is unavailable. The same allocation of vocabulary entries serves very different texts. A useful unit in one language may never be used in another. Some writing systems may receive poor coverage, and a language can be covered in principle while still requiring many small units to represent ordinary text. The authors cite earlier work on both problems, including studies of inefficient segmentation and of systems encountering scripts that the original vocabulary handles poorly. [UNKs Everywhere](https://md.research.elamur.ai/free/en/papers/pfeiffer-2021-unks-everywhere-adapting-multilingual-language/)

The paper also draws on work showing uneven performance across languages in multilingual BERT. Pooling data made multilingual pretraining possible, but it gave developers reason to look more closely at what an individual language received from the shared system. The set of languages being served by the original checkpoint matters, as does the amount and kind of text contributed by each language. An application dedicated to a single language has a different vocabulary requirement from the original multilingual system. A smaller application-specific inventory can spend more of its entries on that language’s text. [Are All Languages Created Equal in Multilingual BERT?](https://md.research.elamur.ai/free/en/papers/wu-2020-are-all-languages-created-equal/)

#### Continued pretraining leaves the vocabulary in place

Language-adaptive pretraining, abbreviated LAPT, starts with existing pretrained parameters and continues the pretraining objective on text from the target language or languages. For XLM-R, the objective is masked language modeling. Some input tokens are masked, and the system learns to predict their identities from the surrounding text. The target corpus can therefore teach it about the new language before labeled examples are introduced for a particular task. Downey and colleagues treat continued pretraining as an established, strong comparison. Their related-work discussion connects it to adapting to a new domain and to prior experiments using small corpora for multilingual adaptation. [Don’t Stop Pretraining](https://md.research.elamur.ai/free/en/papers/gururangan-2020-don-t-stop-pretraining-adapt/) · [Parsing with Multilingual BERT, a Small Corpus, and a Small Treebank](https://md.research.elamur.ai/free/en/papers/chau-2020-parsing-multilingual-bert-small-corpus/)

Earlier work also adapted multilingual encoders using language-specific layers. An adapter introduces trainable parameters into a network whose existing layers can stay frozen. Training a separate specialized system from scratch is another option discussed by the paper. These approaches differ in how much they reuse and which parameters they change. Vocabulary replacement addresses a different part of the system, the interface that converts pieces of text into vectors and supports prediction over the token inventory. The authors use continued pretraining to compare ways of rebuilding that interface. [MAD-X](https://md.research.elamur.ai/free/en/papers/pfeiffer-2020-mad-x-adapter-based-framework/)

With ordinary LAPT, the system continues to carry the full multilingual vocabulary. Even if target-language sentences use a small portion of it, the full embedding and prediction machinery contributes to the cost of training. The authors emphasize both the forward pass, which produces predictions, and the backward pass, which computes the updates. For XLM-R-base, the vocabulary-associated matrices account for a large fraction of the trainable parameters. This makes vocabulary size a distinct cost consideration even when the transformer architecture itself is held fixed.

#### Replacing the vocabulary also replaces learned inputs

Training a tokenizer on target-language text yields an inventory and a way to segment new text. It leaves open how the inventory should connect to the pretrained [transformer](https://md.research.elamur.ai/free/en/concepts/transformer/). The transformer receives vectors, while the tokenizer supplies identifiers for vocabulary entries. The embedding table is the lookup that connects the two. A newly created token identifier has no useful association with the vector formerly stored at that index. An exact shared token offers an obvious way to recover the association, but new pieces need another starting point.

One approach in earlier work was to expand a multilingual vocabulary and train embeddings for the added entries. That retains the old inventory and adds support for pieces the target language needs. Other studies replaced the whole vocabulary when moving from a pretrained monolingual system to a different language. In the version that motivates this paper’s controlled comparison, the new embeddings are trained while the original transformer is held fixed. Freezing the transformer protects its parameters from being overwritten, and places the burden of adapting to the new input entirely on the new table. The monolingual transfer studies gave Downey and colleagues a reason to test whether that approach also works for a multilingual starting point. [Extending Multilingual BERT to Low-Resource Languages](https://md.research.elamur.ai/free/en/papers/wang-2020-extending-multilingual-bert-low-resource/) · [On the Cross-lingual Transferability of Monolingual Representations](https://md.research.elamur.ai/free/en/papers/artetxe-2020-cross-lingual-transferability-monolingual-representations/) · [As Good as New](https://md.research.elamur.ai/free/en/papers/vries-2021-as-good-as-new-how/)

Prior approaches also reused existing embeddings more selectively. They could copy exact matches, use a smaller system trained on the target language to inform the new representation, or find correspondences using auxiliary data. WECHSEL, for instance, used aligned static embeddings for cross-lingual initialization. The concurrent FOCUS work adapted this general idea to specialization from a multilingual vocabulary. Exact copying transfers a known vector directly. Similarity-based initialization extends transfer to items whose strings have no exact match, using additional information to decide which old vectors to combine. [WECHSEL](https://md.research.elamur.ai/free/en/papers/minixhofer-2022-wechsel-effective-initialization-subword-embeddings/)

The paper’s other starting point is that script matters for transfer. Earlier work discussed by the authors found that coverage of a related language was helpful when the target shared its script, and that transliteration could help an otherwise poorly covered target. This makes writing system relevant even when there is a known relationship between the languages. Downey and colleagues ask how much can be recovered by respecting a token’s broad location in the existing embedding space, using properties available from its written form. That sets up a comparison between transferring the starting representation of a specific token and giving a new token a plausible starting region. [When Being Unseen from mBERT Is Just the Beginning](https://md.research.elamur.ai/free/en/papers/muller-2021-when-being-unseen-mbert-is/)

### The method, step by step

Vocabulary replacement and language-adaptive pretraining The steps in order.

#### Inspecting the embedding table

An embedding is a list of numerical coordinates. The authors ask whether groups of tokens have systematically different coordinates before any adaptation takes place. They use principal component analysis, or PCA, to project the original XLM-R vectors into a plane. The projection uses directions of variation in the embedding table so that patterns among many vectors can be inspected visually. The authors color the projected points using properties that can be recovered from the tokens themselves.

Figure 1 begins with the 12 most common Unicode script groups in the table. The Common, Latin, and Cyrillic groups are particularly distinct in the projection, while several other groups lie closer to one another. The authors isolate those prominent groups in a separate panel to make the separation easier to see. Their use of Unicode categories gives them an operational approximation to script that they can also apply to tokens in the new tokenizer. Common is one of the resulting categories alongside named writing systems.

Another panel colors tokens according to their position in a word. SentencePiece preserves an indication of preceding whitespace in the token string. The paper illustrates this with `_the` and `the`. The former carries the leading marker and can begin a word following a space. The latter is treated as word-medial in the analysis. The script-based method can put both pieces in the same broad category, while the position-sensitive version gives them different categories. The observed division is roughly along the second principal component.

These plots supply a hypothesis about where to start when no pretrained vector is available. If a new token belongs to a category whose existing vectors tend to occupy a particular part of the space, the authors can use their distribution as a guide. They estimate that distribution from the original embeddings. PCA helps them discover categories worth considering and inspect the resulting initialization visually. The new vectors themselves live in the original high-dimensional space used by the transformer.

#### Creating the replacement vocabulary

For each monolingual transfer, the target corpus contains text from the language being adapted. The authors also prepare a general multilingual target from the monolingual experiment languages and a family-oriented target centered on Uralic languages. Each setting gets a replacement tokenizer trained on the corresponding text. The multilingual settings share one tokenizer among their target languages.

The tokenizer is trained with SentencePiece. Under the paper’s sampling rule, a monolingual target with less than 1GB of training text uses its entire corpus for this step. For targets with more, the authors take a random sample of about 250MB. For a multilingual tokenizer they sample 5 million lines according to the distribution used for training. In each compact setting, the replacement inventory has 32,770 entries, including special tokens. The vocabulary size is thus comparable across the initialization conditions and across the different target groupings.

Training the tokenizer and initializing the embeddings are separate operations. The tokenizer fixes which pieces can appear in the segmented text. The initializer assigns a vector to each piece. Because several initializers can be applied to the same replacement inventory, their downstream scores can be compared without also changing the segmentations received during training. By contrast, comparisons with the original vocabulary change both the segmentation and the set of available pretrained embeddings.

#### Copying shared tokens and handling new ones

The identity rule, REINIT-IDENT, finds tokens with exactly matching strings in the original and replacement inventories. It copies each corresponding vector. The match is between token strings, so a word-boundary marker can distinguish entries that otherwise have the same letters. The rule is also independent of where the old token was indexed in the table.

```
v_new(t) = v_old(t)
```

Here `t` is an exact shared token, `v_new(t)` is its vector in the replacement table, and `v_old(t)` is its pretrained XLM-R vector. The equals sign indicates that copying preserves the entire vector at initialization. When another method is used alongside identity, this equality takes precedence for shared entries.

Identity alone still leaves a choice for tokens unique to the new vocabulary. The paper gives those tokens a standard Normal initialization. Its completely random condition, REINIT-RANDOM, uses that same rule throughout the replacement table, including for entries whose old vectors could have been copied. This is the least constrained initialization in the experiment. It discards the original embedding coordinates at the start while retaining the pretrained transformer parameters.

The distinction between identity alone and full random initialization is important for interpreting what training is being asked to do. In the identity condition, tokens already known to XLM-R begin with the original representations the transformer received before adaptation. The optimizer must still adjust to a new segmentation and learn the embeddings of unmatched pieces. In the fully random condition, even a familiar piece of text reaches the transformer through an unrelated initial vector. These conditions give the authors a comparison of the value of retaining exact matches without training an auxiliary representation.

#### Drawing from script and position distributions

REINIT-SCRIPT assigns tokens in the original table to Unicode categories as an approximation to writing system. The authors calculate the mean and standard deviation of the embeddings within each category. For a token assigned to a given category in the new vocabulary, they draw its embedding from a Normal distribution with the corresponding statistics. The draw locates the vector using information about an entire group, so the procedure can initialize a token without finding a similar word or sub-word in the source vocabulary.

```
v_new(t) ∼ Normal(μ_g, σ_g)
```

In this expression, `t` is the token being initialized and `v_new(t)` is its new embedding. The symbol `∼` means that the embedding is drawn according to the distribution on the right. `Normal` denotes the Normal sampling rule used by the authors, `g` is the category assigned to the token, and `μ_g` and `σ_g` are the mean and standard deviation estimated from pretrained embeddings in that category. These are the statistics specified by the paper. The visual analysis motivates the category choice.

With script alone, `g` is the Unicode category. With REINIT-SCRIPT + POSN, the category is the combination of writing system and position status. A word-initial token then uses the statistics of the word-initial group for its script, while a word-medial token uses that script’s word-medial group. The authors test position as a refinement within script because the projected positional divisions appear within the script clusters. The experiments therefore include a script and position rule, and they include a version of that rule in which identity copying overrides sampling for exact matches.

Script and position supply broad information. A new piece can start near the other members of its category while its coordinates remain a random draw within that distribution. The rule uses the same group statistics for any other unmatched piece assigned to that category. This is precisely where it differs from the method based on semantic similarity. Similarity-based initialization can choose a different combination of source vectors for each new item, even for items with identical script and boundary status.

#### Using token-specific similarities with FOCUS

FOCUS also copies vectors for tokens shared by the new and original inventories. For unmatched tokens it trains an auxiliary FastText representation on the same target-text sample used to train the tokenizer. This representation supplies similarities between vocabulary items. The initializer uses the similarity scores to weight existing XLM-R vectors for tokens that appear in both inventories. FastText provides the similarity information, and the vectors being combined come from the pretrained XLM-R table. [Enriching Word Vectors with Subword Information](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/)

```
v_new(t) = Σ_s w(t, s) · v_old(s)
```

Here `t` is an unmatched token in the new vocabulary, and `v_new(t)` is its initial XLM-R embedding. The summation symbol `Σ_s` adds the contributions of shared tokens `s` used in the combination. For each of those tokens, `v_old(s)` is the pretrained vector, `w(t, s)` is the weight obtained from the auxiliary similarity information, and `·` denotes multiplication of the vector by its weight. The expression describes the weighted combination compared in the paper.

The script-based methods can obtain their statistics from XLM-R’s existing table and identify the category of a new piece from its form. FOCUS has the additional step of training FastText, which lets it use evidence about individual pieces from their occurrences in target text. Both approaches use the source embedding space and can preserve exact matches. The comparison asks whether the additional token-specific evidence yields enough downstream benefit to distinguish it from the simpler initialization rules.

#### What the initialized spaces look like

The authors visualize a compact vocabulary trained for their Uralic-oriented setting. They compare the initialized embeddings against the original Common, Latin, and Cyrillic distributions. Identity copying retains visible pieces of the original structure, alongside a spread of randomly initialized vectors for unmatched tokens. Sampling by script produces visibly separate distributions around the script centers. When position is added, the projection shows six clusters instead of three, corresponding to the subdivisions of the script groups.

The closest visual matches to the original geometry occur with script, position, and identity combined, and with FOCUS. An appendix view colors the new vectors by their position status. It shows the expected positional separation more clearly for the script variants that explicitly use position. The FOCUS projection appears to permit somewhat more overlap between the positional groups. These visualizations concern the initial embeddings. Downstream evaluation is what establishes how useful these starting conditions are after additional training.

#### Continuing pretraining and selecting a checkpoint

All comparisons begin with base-size XLM-R. The authors run continued masked pretraining for 100k steps and evaluate checkpoints every 1000 steps. In LAPT-EMB, the transformer blocks stay frozen while the embeddings are trainable. LAPT-FULL keeps the transformer blocks frozen through step 10k and allows them to train over the remaining 90k steps. This gives replacement embeddings time to adjust before the network above them can change. The authors introduce the delay to limit the risk of fitting the transformer to poor initial representations.

For multilingual continued pretraining, the language of each sentence is sampled from a multinomial distribution. The paper gives the parameter setting as follows.

```
α = 0.2
```

The symbol `α` denotes the parameter used for the multilingual sampling distribution, and `0.2` is the setting used in the experiments. The authors sample languages at the sentence level. They cap the amount of training text per language in these multilingual runs at roughly 2GB. The cap and the sampling rule matter when interpreting the outcome for a language whose cleaned corpus is much smaller or larger than the other corpora in the mixture.

The paper reports a masked-token probability of 0.15, a maximum sequence length of 256, and a batch size of 200 for continued pretraining. It uses a learning rate of 1e-5 with a linear schedule and a maximum gradient norm of 1.0, reduced to 0.5 if the loss becomes numerically undefined. The experiments use Nvidia Quadro RTX 6000 GPUs and the Adam optimizer. The authors identify their experiment software as `cmdowney88/EmbeddingStructure`. [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/)

The checkpoint chosen for each adaptation setting is the one with the best masked language modeling loss on development text. This is the selection criterion for the end of continued pretraining. The authors then run separate supervised [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) for tagging and entity recognition. Each task has its own labeled training data and convergence criterion. This sequencing keeps the comparison between starting embeddings distinct from selection on a supervised downstream task.

For task fine-tuning, the maximum sequence length is 256 and the batch size is 72. The authors use a constant learning rate of 5e-6 and a maximum of 64 epochs, with evaluation every 2 epochs. The patience is 8 epochs for tagging and 4 for entity recognition. The fine-tuning training data is capped at 32,768 sequences. Each task and language is run across four random seeds so that the reported averages can be read alongside the variation from run to run.

### Experiments and results

#### Adaptation corpora and evaluation splits

Eight languages feature in the monolingual experiments: Armenian, Basque, Erzya, Estonian, Hebrew, North Sami, Russian, and Telugu. These targets vary in writing system, linguistic affiliation, and amount of available text. They also differ in what XLM-R saw during original pretraining. The paper lists 0 GB for both Erzya and North Sami in XLM-R’s pretraining data. After cleaning and deduplication, the authors have 0.006 GB of adaptation data for Erzya and 0.004 GB for North Sami. For comparison, their adaptation corpus for Basque is 0.35 GB, and the one for Telugu is 0.9 GB.

Russian illustrates a different starting point. The paper lists 278.0 GB of Russian for XLM-R’s original pretraining and 10.0 GB in the cleaned adaptation corpus. Hebrew has 31.6 GB in the original data and 7.7 GB for adaptation. These are corpus amounts, with the separate per-language cap applying to multilingual training. The differences help explain why a vocabulary change can have different consequences for different languages. A well-covered language has useful pretrained representations to give up, while a language absent from pretraining may have more to gain from a tokenizer trained directly on its text.

The primary corpus is OSCAR v.22.01. For the lowest-resource targets, the authors supplement it with monolingual text from OPUS and the Johns Hopkins University Bible Corpus. They clean and deduplicate the training text with OpusFilter. They also remove any Erzya or North Sami line classified as English with at least 90% probability. Their rationale is that automatic identification of the intended languages is unreliable, so detecting high-confidence English gives them a way to remove some unsuitable text. [Towards a Cleaner Document-Oriented Multilingual Crawled Corpus](https://md.research.elamur.ai/free/en/papers/abadji-2022-towards-cleaner-document-oriented-multilingual/) · [The Johns Hopkins University Bible Corpus](https://md.research.elamur.ai/free/en/papers/mccarthy-2020-johns-hopkins-university-bible-corpus/)

The data appendix describes filters for lines with less than 2 tokens, average token length greater than 16 characters, a token longer than 32 characters, or fewer than 50% alphabetic characters. The resulting text is used for target-language pretraining and supplies the material for learning the new vocabulary. The paper distinguishes this unlabeled corpus from the annotated data used to train and evaluate the downstream tasks.

The part-of-speech task assigns grammatical categories to words. Its evaluation metric is accuracy, the proportion of evaluated labels assigned correctly. The authors use [Universal Dependencies](https://md.research.elamur.ai/free/en/concepts/universal-dependencies/) treebanks, which supply the annotations and, for most of the targets, the standard training, development, and test splits. Erzya has a standard training and test split. Its development set is formed by sampling 300 sentences from the training split.

For named entity recognition, the authors use WikiAnn and report entity-wise F1. The metric rewards recovering annotated entities while avoiding unsupported entity predictions. Correctly labeling ordinary non-entity tokens does not by itself earn entity credit. The authors create random 85/5/10% training, development, and test splits for each language, with a minimum of 256 development sentences and 512 test sentences. North Sami has insufficient data for entity fine-tuning and appears only in the tagging comparison. [Cross-lingual Name Tagging and Linking](https://md.research.elamur.ai/free/en/papers/pan-2017-cross-lingual-name-tagging-linking/)

During entity fine-tuning, the loss from non-entity tokens is down-weighted so that it has the same influence in a batch as the loss from entity tokens. The aim is to discourage the system from assigning the frequent outside label, `O`, to every token. Some runs still collapse to that behavior. An entity F1 of 0.0 in the paper’s tables reflects this failure to predict entities. That distinction matters when comparing it with tagging accuracy, where correct labels for frequent categories can still contribute many correct predictions.

#### What the baselines control

Off-the-shelf XLM-R goes directly to supervised task fine-tuning. It establishes how well the starting checkpoint serves each target without additional masked pretraining. Full-vocabulary LAPT keeps XLM-R’s original tokenizer and pretrained embeddings and continues masked pretraining on the target text. It establishes what additional target-language text can do when the original interface to the transformer is preserved.

The compact candidates change that interface and vary how the new vectors are assigned. They allow comparisons under a common replacement vocabulary, including whether the transformer is eventually unfrozen. The original-vocabulary comparison addresses accuracy and compute jointly. The compact-versus-original contrast combines changes in vocabulary size, segmentation, and the amount of direct embedding reuse. Comparisons among initializers hold the compact inventory fixed and are more specific about the effect of the starting vectors.

The full-vocabulary monolingual runs cover Erzya, Telugu, and Hebrew because of the computational budget. The paper uses them to span very low, low, and medium resource availability. A full-vocabulary mean across all the monolingual targets is therefore unavailable. The two multilingual settings have a shared full-vocabulary run that can be evaluated across the languages in their respective groups.

#### Monolingual adaptation

The tagging averages show the benefit of a structured start when the transformer can eventually adapt. The chart uses the paper’s cross-language averages of downstream test accuracy. All replacement settings shown use the same compact vocabulary size, with a separate tokenizer learned for each target.

Monolingual adaptation on Universal Dependencies test sets by mean POS accuracy Copying and structure-aware initialization keep compact adaptation competitive, with FOCUS recording the highest mean in this comparison.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Off-the-shelf XLM-R | 86.4 |
| Full adaptation with random initialization | 72.4 |
| Full adaptation with identity copying | 80.9 |
| Full adaptation with script and position | 88.3 |
| Full adaptation with script, position, and identity | 91.3 |
| Full adaptation with FOCUS and identity (this paper) | 91.7 |

The ordering of the averages obscures some interesting language-level cases. For Basque, FOCUS with identity reaches 96.0 ± 0.6 on the monolingual Universal Dependencies tagging test, compared with 95.1 ± 0.7 for off-the-shelf XLM-R. For North Sami, the corresponding means are 92.1 ± 0.8 and 71.2 ± 1.8. Both improve, with a very different starting point and scale of improvement. The North Sami result also illustrates what a monolingual compact run can recover on a target with little adaptation text and no original pretraining data listed for that language.

Armenian shows why the paper reports variability alongside each mean. With the monolingual tagging setup, script, position, and identity yield 93.1 ± 1.7, against 92.3 ± 1.9 for FOCUS and identity and 93.4 ± 2.2 for off-the-shelf XLM-R. The authors determine the best result in their tables using the mean less a standard deviation and also highlight nearby results. The cross-language averages in the chart are means. In an individual case such as Armenian, the choice of whether to read the mean alone or follow the paper’s selection rule changes the ordering of closely spaced results.

For monolingual WikiAnn entity recognition, the off-the-shelf mean test F1 is 90.5. With full adaptation, FOCUS and identity reach 91.0, script with position and identity reaches 89.6, and script with identity reaches 89.5. These averages illustrate a smaller overall change from the starting checkpoint for this task. Individual languages still benefit. For instance, the Basque WikiAnn test score is 94.3 ± 0.1 with the off-the-shelf checkpoint and 94.9 ± 0.4 after full monolingual adaptation with FOCUS and identity. For Telugu, the corresponding figures are 85.4 ± 0.5 and 87.7 ± 0.5.

The paper reports that compact monolingual adaptation improves on off-the-shelf XLM-R in 5/8 languages for tagging and 5/7 for entity recognition. These counts summarize where a compact option succeeds. They are compatible with individual compact settings trailing the baseline on their cross-language mean. The particular method that serves one language best can be different from the one with the best mean, and the baseline itself can already be strong.

#### Retaining the full vocabulary

The full-vocabulary runs show what the authors trade for a smaller embedding table. For Hebrew, the off-the-shelf and full-vocabulary adaptation means for monolingual tagging are both 97.5 ± 0.1 on the Universal Dependencies test set. FOCUS and identity produce 97.2 ± 0.1 with the compact vocabulary. That is a setting in which the already strong baseline leaves little room for a measured gain. On the Telugu tagging test, full-vocabulary adaptation gives 91.4 ± 4.3. The compact script, position, and identity setting gives 88.5 ± 3.2, and the off-the-shelf checkpoint gives 83.8 ± 0.1.

Erzya gives the clearest counterexample to the idea that a compact vocabulary always stays close to the full one. Full-vocabulary continued pretraining gives a substantially higher tagging score, even though Erzya is absent from XLM-R’s original pretraining data. The best compact mean in the monolingual Erzya comparison comes from the authors’ script, position, and identity method.

Monolingual Erzya adaptation on the Universal Dependencies test set by POS accuracy Script and position with identity lead the compact settings shown, while retaining the original vocabulary gives the highest mean overall.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Off-the-shelf XLM-R | 56.3 |
| Full adaptation with random initialization | 53.3 |
| Full adaptation with FOCUS and identity | 76.1 |
| Full adaptation with script, position, and identity (this paper) | 79.0 |
| Full adaptation with original XLM-R vocabulary | 85.1 |

The tradeoff is less pronounced in the monolingual Erzya entity test. On WikiAnn, retaining the original vocabulary gives 91.8 ± 0.5 F1. Full adaptation with script, position, and identity gives 90.2 ± 0.7, and direct fine-tuning of XLM-R gives 89.5 ± 0.6. A decision about the value of retaining the full vocabulary depends partly on what the system must do in the target language. The two tasks give different pictures of how much Erzya gains from the expensive baseline.

The paper expresses adaptation cost in floating-point operations, or FLOPs. Its compute figure relates downstream scores to the total operations counted for continued pretraining in the reduced- and full-vocabulary settings. According to the authors, adapting with the full vocabulary takes two to three times more FLOPs and usually yields only a modest gain in scores. They identify a large vocabulary-associated share of XLM-R-base’s parameters and argue that retaining this inventory also carries costs after LAPT. The plotted comparison is an adaptation compute comparison. It gives the accuracy achieved on the downstream tasks at the reported cost of reaching the adapted checkpoint.

#### Adapting to multiple target languages

The general multilingual run trains jointly on the languages from the monolingual experiment. For Universal Dependencies tagging, the full-vocabulary adaptation mean accuracy is 90.1 and the off-the-shelf mean is 86.4. The compact FOCUS and identity setting with full adaptation reaches 90.0. Script and identity reaches 89.7, and adding position gives 89.0. On this average, the strongest compact initialization comes close to the full-vocabulary baseline. That closeness still leaves room for substantial differences among languages.

For Telugu in the same multilingual tagging experiment, the compact script and identity variant reaches 91.7 ± 0.8. FOCUS and identity gives 89.4 ± 3.2, and the full-vocabulary adaptation baseline gives 89.7 ± 3.6. For Erzya the FOCUS and identity score is 72.5 ± 1.3, the script and position score is 70.5 ± 1.5, and the compact script, position, and identity score is 63.6 ± 9.8. The latter result contrasts with the strong performance of the combined heuristic on monolingual Erzya. The same initialization rule can behave differently when a small corpus is part of a shared training mixture.

The general multilingual entity evaluation gives a second view of how closely the compact methods approach the expensive baseline. The mean test F1 differs relatively little among the strongest compact initializers. The gap between those initializers and fully random initialization is much larger in the same setting.

General multilingual adaptation on WikiAnn test sets by mean entity F1 FOCUS and the strongest script-based settings approach the full-vocabulary score, while fully random initialization falls well behind.

**The numbers**

| System or setting | entity-wise F1 |
| --- | --- |
| Off-the-shelf XLM-R | 90.5 |
| Full adaptation with original XLM-R vocabulary | 90.9 |
| Full adaptation with random initialization | 63.6 |
| Full adaptation with script, position, and identity | 89.9 |
| Full adaptation with script and identity | 90.0 |
| Full adaptation with FOCUS and identity (this paper) | 90.1 |

The family-oriented run includes Erzya, Estonian, Finnish, Hungarian, and North Sami, together with Russian. The authors include Russian to support the Cyrillic embeddings used by Erzya. The full-vocabulary mean on Universal Dependencies tagging is 90.3, against 85.9 off the shelf. With a compact vocabulary, the full adaptation means are 89.6 for FOCUS and identity and 89.3 for script, position, and identity. On WikiAnn, the full-vocabulary mean is 91.8, the off-the-shelf mean is 91.4, and the compact FOCUS and identity mean with full adaptation is 90.7.

In the Uralic-oriented tagging evaluation, compact full adaptation with script, position, and identity gives 94.8 ± 0.7 for Hungarian, ahead of the full-vocabulary result of 94.1 ± 1.9. For Erzya, the same heuristic gives 73.0 ± 1.4, FOCUS and identity gives 73.8 ± 2.7, and full-vocabulary adaptation gives 72.5 ± 2.6. The paper highlights the script, position, and identity result for Erzya. The higher FOCUS mean and the lower spread of the heuristic make sense of that assessment under the paper’s best-result criterion.

### What the ablations show

#### Updating the transformer matters most when the input changes sharply

The freezing comparison asks how much of the adaptation can be done in the embedding table. LAPT-EMB restricts continued pretraining to the embeddings throughout. LAPT-FULL begins with the same restriction and then lets the transformer change. Across the averages for the initialization methods, the latter regime performs better. For monolingual tagging with FOCUS and identity, the paper reports a 6.9 average accuracy drop when using embedding-only adaptation in place of full adaptation. This comparison uses the same initializer and compact vocabulary on both sides.

The price of freezing depends on how the vectors were initialized. In monolingual tagging, the script and position setting without identity has an average accuracy of 88.3 under full adaptation and 69.4 under embedding-only adaptation. Identity alone gives 80.9 with full adaptation and 75.9 with embedding-only adaptation. In this example, identity on its own is more helpful than adding a broad distribution and a boundary distinction when the transformer is fixed. Exact overlap appears particularly valuable when the transformer has to interpret its inputs using the original weights throughout the adaptation phase.

The language-level results allow exceptions to the average pattern. For Armenian in the general multilingual tagging experiment, FOCUS and identity reach 93.1 ± 2.2 with embedding-only adaptation and 91.0 ± 0.1 with full adaptation. The averages still favor unfreezing. This example helps distinguish the consistent direction of the aggregate comparison from the behavior of a specific language and initialization pair.

The authors relate this finding to earlier work that successfully reused a frozen transformer in monolingual-to-monolingual transfer. In their multilingual experiments, fully random replacement with a frozen transformer performs poorly. Their explanation is that the original embedding space is heterogeneous, so the same random distribution for every token offers little alignment with the regions the transformer learned to use. The results are consistent with that explanation. They also directly show that allowing the transformer to adapt can recover performance from several starting conditions that are weak under a freeze.

#### Exact reuse and broad structure each contribute

The fully random condition tests whether continued pretraining can learn a useful compact table from an unstructured start. The authors report that, across full adaptation experiments, random initialization averages 19.4 points below the next-best initializer and 24.7 points below off-the-shelf XLM-R. These are the paper’s aggregate comparisons across its full adaptation experiments. The task-specific tables show where that loss appears, including the especially low entity recognition averages.

With the compact monolingual tokenizer and full adaptation, identity alone attains a mean entity F1 of 81.9, while full random initialization attains 63.7. Because the unmatched tokens in the identity condition still receive the same kind of random start, this comparison gives evidence for the value of the exact matches. Those matches preserve pretrained coordinates even when the rest of the table has to be learned during adaptation.

A script distribution can help even without identity. In the same compact monolingual entity experiment, the script-only run reaches 85.9 with full adaptation. Combining script sampling with identity raises the mean to 89.5. The comparison shows how a useful broad location for unmatched tokens and preservation of old embeddings for matched tokens can reinforce each other. The paper does not need to assume that a random draw within a script captures a new piece’s meaning. It only needs that starting point to support better learning in the subsequent adaptation.

The general multilingual tagging averages illustrate why the conditions need to be read jointly. With full adaptation, identity alone gives 86.7, script alone gives 82.2, and script with identity gives 89.7. Here the exact-copy rule is the better individual intervention, while combining it with script sampling improves over either on its own. This is also the kind of result that would be concealed by comparing only a fully random baseline with the most elaborate initializer.

#### Token position is visible in the embeddings, but its task benefit varies

The position ablation subdivides the script distributions using the SentencePiece word-boundary marker. In the projection, the mechanism behaves as proposed. The script-only method leaves the positional division largely unrepresented, while the position-aware versions show a separation resembling the one seen in the original embeddings. The downstream comparison asks a narrower practical question. Does the position cue improve the outcome when exact matches and continued pretraining are already available?

For full adaptation with identity, the paper reports that adding position improves the across-language mean in 2/3 tagging settings and in 1/3 entity recognition settings. General multilingual tagging favors script and identity without position, with 89.7 mean accuracy against 89.0 for the version with position. Monolingual tagging shows the reverse ordering, with 89.4 for script and identity and 91.3 when position is included. Thus a real and reproducible-looking visual distinction can provide useful initialization information without giving the same downstream gain in every setup.

Part of the value of this comparison lies in what it holds fixed. Both versions use exact copying for overlapping items and preserve the same tokenizer. Position changes the group used to draw an embedding for a new piece. A comparison between the corresponding task scores is therefore more directly about this modeling choice than a comparison between entirely different tokenizers. The variable results show that it is possible to recover a recognizable feature of the source distribution without obtaining a consistently better average for a given task.

#### FOCUS helps more when the transformer has to stay fixed

The authors compare FOCUS with the strongest heuristic variants to ask whether a token-specific weighted combination is worth the extra FastText training. With full adaptation, FOCUS generally has a small average lead among the compact options. Armenian and Telugu furnish instances of comparable or stronger tagging with heuristic initialization. Erzya supplies both directions of the comparison, depending on the training mixture. The simple rules are therefore credible alternatives under the study’s full adaptation schedule, especially when an auxiliary training stage is costly.

The FOCUS advantage becomes clearer under embedding-only training. In the Uralic-oriented tagging evaluation, the compact embedding-only means are 87.3 for FOCUS and identity and 86.2 for script, position, and identity. With full adaptation the corresponding means are 89.6 and 89.3. The weight-based procedure may give the frozen transformer vectors closer to what it can already use. That is the interpretation the authors favor. The comparison covers complete initialization procedures, so it leaves open which features of the weighted combinations contribute most.

The projections provide a complementary observation. Both FOCUS and the combined heuristic approximate important aspects of the source space, but they reach that geometry in different ways. The heuristic imposes the script and position categories explicitly. FOCUS uses token-level similarities and produces positional structure with more overlap in the appendix view. The supervised scores assess the consequences of these different starts after training. They do not require the better-performing method to reproduce every visible feature of the original plot exactly.

#### A related-language mixture changes scores more clearly than method rankings

The broad multilingual group and the Uralic-oriented group let the authors see whether the same initializer remains competitive with a different set of neighboring languages in training. In the family-oriented setup, several compact Erzya tagging scores improve over their counterparts in the general multilingual setup. The script, position, and identity comparison is an example, with 73.0 ± 1.4 in the family-oriented run and 63.6 ± 9.8 in the general run. The same argument for a benefit from the family-oriented mixture is less clear for North Sami.

The paper treats this comparison as suggestive for Erzya and finds that the overall relative ranking of initialization approaches broadly survives the change of mixture. The family-oriented corpus includes Russian in part to strengthen Cyrillic training, so the comparison brings several plausible influences together. It changes which other languages are available, what the tokenizer learns, and the distribution of text used during adaptation. The finding about ranking is consequently more direct than an explanation based on relatedness alone.

### Limitations

#### Limits identified by the authors

The authors identify the narrow set of downstream tasks as a limitation. The experiments test the ability to assign grammatical labels and find named entities. Those are relevant measures of transfer, and they are what suitable standard datasets make possible for much of the language selection. The paper points to natural language inference, [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/), and paraphrase detection as higher-level tasks that could broaden the comparison if suitable data were available. The evidence in this study supports the tagging tasks directly.

The starting checkpoint is another limit. The study uses only base-size XLM-R. The authors call for testing other scales and architectures, including causal and sequence-to-sequence systems. The initialization techniques depend on properties of the pretrained embedding distribution and on how the rest of the network responds to changes at its input. How much similar script and position structure appears elsewhere, and how useful it is for adaptation, remain open.

They also test a single replacement vocabulary size. It makes comparisons among the initialization procedures easier to read, but gives little evidence about how to set the size for a new language or language group. The authors point to Erzya as a reason to explore this. A different inventory might provide better target-language segmentation or overlap more usefully with the original Cyrillic vocabulary. The study leaves these possibilities unresolved because changing vocabulary capacity and measuring overlap systematically were outside its experimental comparison.

#### Limits visible in the experimental design

The scope of the full-vocabulary monolingual baseline limits the compute claim’s language-by-language interpretation. For the covered languages, the cost comparison gives a concrete view of how much extra adaptation computation can accompany the original vocabulary and what was gained on the measured tasks. The monolingual targets lacking that baseline cannot be assessed in the same way. The reported FLOPs are for continued pretraining. FOCUS has a separate auxiliary training stage, and the reduced settings require a new tokenizer. The paper’s FLOP comparison therefore answers a narrower question than an end-to-end accounting of setup, adaptation, downstream fine-tuning, and deployment.

The off-the-shelf and original-vocabulary baselines also answer different questions. Improvements over direct fine-tuning establish that the combination of target-language pretraining and vocabulary replacement can be useful. In the compact-versus-full adaptation comparison, the new tokenizer changes the text units at the same time as the embedding table is rebuilt. This makes the comparison appropriate for choosing between complete adaptation procedures. Isolating how much of the change in score comes from better segmentation would require another comparison that measures or controls segmentation more directly.

The visual analysis uses a projection of the embeddings, which makes the script and position distinctions easy to see. It leaves much of the geometry unobserved. The experiments establish that initializing from the identified groups can help in this setup. They do not identify which coordinates the transformer uses, or how faithfully samples from those groups resemble the original vectors along other directions. Likewise, the average benefit of updating the transformer measures downstream performance. It does not show how much of XLM-R’s competence on other languages survives that update, even though preserving existing knowledge is a motivation for freezing.

The variation reported across fine-tuning seeds also matters for the strength of the comparisons. The paper’s bolding convention uses a score and its variability to identify its preferred result and nearby alternatives. It is a useful way to read a table in which some runs vary markedly. The comparisons still belong to the particular corpus samples, benchmark splits, and pretrained starting checkpoint used by the authors. FOCUS and the heuristic methods are frequently close, so the averages and the reported spread are more informative together than a ranking of methods that treats closely spaced means as decisive.

Finally, the Uralic-oriented training comparison does not disentangle relatedness, shared script, and available text. Russian is deliberately included to improve the coverage of Cyrillic, and changing the mixture also changes the data from which the tokenizer is learned. The Erzya observations motivate a closer look at training with related languages and script-sharing languages. The results support an association with the chosen mixture while leaving the separate contributions of those factors open.

### What came after

The later papers that cite Downey and colleagues bring the vocabulary problem into three settings. Their titles identify the direction of the connection. More specific claims about adoption of the script-based initializer, replication of the experiments, or downstream gains would require evidence about their methods and results.

[MaLA-500](https://md.research.elamur.ai/free/en/papers/lin-2024-mala-500-massive-language-adaptation/) (2024) places language adaptation in a much broader multilingual setting. Downey and colleagues examine specialization from a shared checkpoint to a single target or a small group. MaLA-500’s stated subject is language adaptation on a massive scale, where deciding what vocabulary to share and what to change concerns many targets at once. Its citation relates that larger adaptation agenda to the problem of modifying a multilingual system’s vocabulary while reusing pretrained parameters.

[How Can We Effectively Expand the Vocabulary of LLMs with 0.01GB of Target Language Text?](https://md.research.elamur.ai/free/en/papers/yamaguchi-2026-how-can-we-effectively-expand/) (2026) frames the problem around vocabulary expansion under a small target-text budget. Expansion retains existing entries and introduces additional ones. Downey and colleagues train a replacement vocabulary, so the choices about which units to keep are different. The shared question is how to provide useful embeddings for pieces introduced during adaptation, particularly when little target text is available. The newer paper’s stated budget makes the available text a central constraint on that decision.

[Bringing Mapudungun into the Modern MT Ecosystem](https://md.research.elamur.ai/free/en/papers/thompson-2026-bringing-mapudungun-into-modern-mt/) (2026) addresses Mapudungun through morphology-aware tokenization for NLLB-200 fine-tuning. It brings the question of what text units a pretrained system should use into [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/). Downey and colleagues use writing system and word position to guide the initialization of embeddings after learning a tokenizer. The Mapudungun study’s stated focus is the role of [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/) in choosing the segmentation itself. That connection illustrates how adapting the text interface can involve decisions about both the pieces the system sees and the numerical representations it uses for them.

## Cite

Cite as C.M. Downey, Terra Blevins, Nora Goldfine and Shane Steinert-Threlkeld. 2023. Embedding Structure Matters: Comparing Methods to Adapt Multilingual Vocabularies to New Languages. Proceedings of the 3rd Workshop on Multi-lingual Representation Learning (MRL).

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

```bibtex
@inproceedings{downey2023embedding,
  title = {{Embedding Structure Matters: Comparing Methods to Adapt Multilingual Vocabularies to New Languages}},
  author = {C.M. Downey, Terra Blevins, Nora Goldfine and Shane Steinert-Threlkeld},
  booktitle = {Proceedings of the 3rd Workshop on Multi-lingual Representation Learning (MRL)},
  year = {2023},
  doi = {10.18653/v1/2023.mrl-1.20},
  url = {https://doi.org/10.18653/v1/2023.mrl-1.20}
}
```

> 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)
