WECHSEL: Effective initialization of subword embeddings for cross-lingual transfer of monolingual language models
Abstract
Large pretrained language models (LMs) have become the central building block of many
NLP applications.
Training these models requires ever more computational resources and most of the existing models are trained on English text only.
It is exceedingly expensive to train these models in other languages.
To alleviate this problem, we introduce a novel method – called WECHSEL – to efﬁciently and effectively transfer pretrained LMs to new languages.
WECHSEL can be applied to any model which uses subword-based tokenization and learns an embedding for each subword.
The tokenizer of the source model (in English) is replaced with a tokenizer in the target language and token embeddings are initialized such that they are semantically similar to the
English tokens by utilizing multilingual static word embeddings covering English and the target language.
We use WECHSEL to transfer the English RoBERTa and GPT-2 models to four languages (French, German, Chinese and Swahili).
We also study the beneﬁts of our method on very low-resource languages.
WECHSEL improves over proposed methods for cross-lingual parameter transfer and outperforms models of comparable size trained from scratch with up to 64x less training effort.
Our method makes training large language models for new languages more accessible and less damaging to the environment.
We make our code and models publicly available.
Introduction
Large LMs based on the Transformer architecture (Vaswani et al., 2017) have become increasingly popular since GPT (Radford et al., 2018) and BERT (Devlin et al., 2019) were introduced, prompting the creation of many large LMs pretrained on English text (Yang et al., 2019; Clark et al., 2020; Lewis et al., 2020; Ram et al., 2021).
There is a tendency towards training larger and larger models (Brown et al., 2020; Fedus et al., 2021) while the main focus is on the English language.
Recent work has called attention to the costs associated with training increasingly large LMs, including environmental and ﬁnancial cost (Strubell et al., 2019; Bender et al., 2021).
If training large
LMs for English is already costly, it is prohibitively expensive to train new, similarly powerful models to cover other languages.
One approach to address this issue is creating massively multilingual models (Devlin et al., 2019;
Conneau et al., 2020; Xue et al., 2021) trained on a concatenation of texts in many different languages.
These models show strong natural language understanding capabilities in a wide variety of languages, but suffer from what Conneau et al.
(2020) call the curse of multilinguality : beyond a certain number of languages, overall performance decreases on monolingual as well as cross-lingual tasks.
Consistent with this ﬁnding, Nozza et al.
(2020) observe that monolingual LMs often outperform massively multilingual models.
This might be attributed to superior quality of monolingual tokenizers over their multilingual counterparts (Rust et al., 2021).
It is thus desirable to train monolingual models in more languages.
Training monolingual models in non-English languages is commonly done by training a new model with randomly initialized parameters (Antoun et al., 2020; Louis, 2020; Martin et al., 2020; Rekabsaz et al., 2019).
However, to train a model with capabilities comparable to that of an English model in this way, presumably a similar amount of compute to what was used to train the English model would be required.
To address this issue, we introduce WECHSEL,a novel method to transfer monolingual language models to a new language.
WECHSEL uses multilingual static word embeddings between the source language and the target language to initialize model parameters.
WECHSEL ﬁrst copies all inner (non- embedding) parameters of the English model, and exchanges the tokenizer with a tokenizer for the target language.
Next, in contrast to prior work doing random initialization (de Vries and Nissim, 2021), the token embeddings in the target language are initialized such that they are close to semantically similar English tokens by mapping multilingual static word embeddings to subword embeddings.
The latter step is particularly important considering that token embeddings take up roughly 31% of the parameters of RoBERTa (Liu et al., 2019) and roughly 33% of the parameters of GPT2 (Radford et al., 2019).
Intuitively, semantically transferring embeddings instead of randomly initializing one third of the model should result in improved performance.
Our parameter transfer provides an effective initialization in the target language, requiring signiﬁcantly fewer training steps to reach high performance than training from scratch.
As multilingual static word embeddings are available for many languages (Bojanowski et al., 2017), WECHSEL is widely applicable.
We conduct our experiments on RoBERTa and
GPT-2 as representative models of encoder and decoder language models, respectively.
We transfer the English RoBERTa model to four languages (French, German, Chinese and Swahili), and the
English GPT-2 model to the same four plus another four very low-resource languages (Sundanese, Scottish Gaelic, Uyghur and Malagasy).
We evaluate the transferred RoBERTa models on Named Entity Recognition (NER), and Natural Language Inference (NLI) tasks in the respective languages.
The transferred GPT-2 models are evaluated in terms of Language Modelling Perplexity (PPL) on a held-out set.
We compare WECHSEL with randomly initialized models (denoted as FullRand), as well as the recently proposed TransInner method which only transfers the inner (non-embedding) parameters (de Vries and Nissim, 2021).
All mentioned models are trained under the same conditions (around 4 days on a TPUv3-8).
We also compare our model with models of comparable size trained from scratch under signiﬁcantly larger training regimes, in particular CamemBERT (Martin et al., 2020) (French), GBERT Base (Chan et al., 2020) (German), and BERT Base -Chinese (Devlin et al., 2019).
Results show that models initialized with
WECHSEL outperform randomly initialized models and models initialized with TransInner across all languages and all tasks, for both RoBERTa and
GPT-2.
In addition, strong performance is reached at a fraction of the training steps of other methods.
Our contribution is summarized as follows.
• We propose WECHSEL, a novel method for transferring monolingual language models to a new language by utilizing multilingual static word embeddings between the source and the target language.
• We show effective transfer of RoBERTa and GPT-2 using WECHSEL to four and eight languages, respectively, achieved after minimal training effort.
• We release more effective GPT-2 and RoBERTa models than previously published non-English models, achieved under our more efﬁcient training setting.
Our code and models are publicly available at github.com/ cpjku/wechsel .
In the following, we review related work in Section 2.
We introduce the WECHSEL method in
Section 3, followed by explaining the experiment setup in Section 4.
We
show
and
discuss
results in
Section 5.
Related Work
Large Language Models.
Training Language
Models is usually done in a self-supervised manner i. e. deriving labels from the training text instead of needing explicit annotations.
One optimization objective is Masked Language Modelling (Devlin et al., 2019, MLM), where randomly selected tokens in the input are replaced by a special [MASK] token, and the task is to predict the original tokens.
Another common objective is Causal Language
Modelling (CLM), where the task is to predict the next token.
These two objectives highlight a fundamental distinction between language models: models can be trained as encoders (e.g. with MLM) or as decoders (e.g. with CLM).
Instead of words, the vocabulary of recently proposed language models commonly consists of subwords (Clark et al., 2020; Liu et al., 2019; Devlin et al., 2019).
Multilingual representations.
There has been a signiﬁcant amount of work in creating multilingual static word embeddings.
A common method is learning embeddings from scratch using data in multiple languages (Luong et al., 2015; Duong et al., 2016).
Alternatively, multilinguality can be achieved by aligning existing monolingual word embeddings using a bilingual dictionary, so that the resulting embeddings share the same semantic space (Xing et al., 2015; Joulin et al., 2018).
Recent studies improve on this by reducing (or completely removing) the need for bilingual data (Artetxe et al., 2017, 2018; Lample et al., 2018).
Beside static word embeddings, multilinguality is also well studied in the area of contextualized representations.
One approach to learn multilingual contextualized representations is through training a model on a concatenation of corpora in different languages.
Some models created based on this approach are mBERT (Devlin et al., 2019),
XLM-R (Conneau et al., 2020) and mT5 (Xue et al., 2021), trained on text in 104, 100, andlanguages, respectively.
As shown by Pires et al.
(2019), a multilingual model such as mBERT can enable cross-lingual transfer by using task-speciﬁc annotations in one language to ﬁne-tune the model for evaluation in another language.
Despite the beneﬁts, recent studies outline a number of limitations of massively multilingual LMs.
Wu and Dredze (2020) empirically show that in mBERT “the 30% languages with least pretraining resources perform worse than using no pretrained language model at all”.
Conneau et al.
(2020) report that beyond a certain number of languages in the training data, the overall performance decreases on monolingual as well as cross-lingual tasks.
These studies motivate our work on introducing an efﬁcient approach for creating effective monolingual LMs for more languages.
Cross-
lingual
transfer
of monolingual
LMs
Studies in this area can be divided into two categories:
• Bilingualization of a monolingual LM is concerned with extending a model to a new language while preserving its capabilities in the original language.
Artetxe et al.
(2020) approach this problem by replacing the tokenizer and relearning the subword embeddings, while freezing other (non-embedding) parameters.
Such a model becomes bilingual, since the initial tokenizer and embeddings can be used for tasks in the source language, while the new tokenizer and embeddings can be used for tasks in the target language.
Thus, a model can be ﬁnetuned on annotated task data in the source language, and then zero-shot transferred to the target language.
Tran (2020)
follow a similar approach, while instead of randomly initializing embeddings, they utilize static word embeddings to initialize embeddings in the target language close to semantically similar English tokens.
They then continue training the model on an English text corpus as well as on the target language in order to preserve model capabilities in English.
• Creating a new monolingual LM in the target language is, in contrast, concerned with transferring a model from a source to a target language without the necessity to preserve its capabilities in the source language.
Zoph et al.
and Nguyen and Chiang (2017) show that cross-lingually transferring a machine translation model can improve performance, especially for low-resource languages.
Zoph et al.
(2016) use embeddings of random tokens in the original vocabulary to initialize token embeddings in the new vocabulary, while Nguyen and Chiang (2017) utilize vocabulary overlap between the source and target language.
More recently, de Vries and Nissim (2021) follow a similar approach to the one of Artetxe et al.
(2020) for transferring a GPT-2 model to a new language.
de Vries and Nissim (2021) add an additional step, where they train the entire model for some amount of steps to allow adapting to the target language beyond the lexical level.
We refer to the method of de Vries and Nissim
(2021) as
TransInner and consider it as a baseline in our experiments.
Our WECHSEL method belongs to the second category.
WECHSEL can be seen as an extension to the method proposed by Tran (2020) with the goal of creating a new monolingual LM instead of bilingualizing the LM.
This allows removing the constraints imposed by the need to preserve the model’s capabilities in the source language.
In addition, we generalize the semantic subword mapping done by Tran (2020) to consider an arbitrary number of semantically similar subword with an arbitrary temperature.
We are the ﬁrst to show that a cross-lingually transferred model can outperform monolingual models which have been trained extensively from scratch in the target language, while requiring substantially less computational resources.
Methodology
To initialize the model in the target language, we copy the inner (non-embedding) parameters from the source model.
Our goal, then, is given the tokenizer T s in the source language with vocabulary
U s , the corresponding token embeddings E s , and a tokenizer T t in the target language with vocabulary
U t , to ﬁnd a good initialization of the embeddings
E t by using E s .
To this end, we use existing bilingual word embeddings enriched with subword information, containing a set of words and subword n-grams in the source and target language and their aligned vectors.
We denote the set of words and n-grams in the source and target language as V s and V t respectively, and the aligned static embeddings as W s and W t .
In Appendix D we consider an alternative method if no subword information is available in the bilingual word embeddings.
First, independently for both languages, we compute static subword embeddings for tokens in the tokenizer vocabulary in the same semantic space as the static word embeddings (Section 3.1).
This results in subword embeddings U s and U t for the source and target language, respectively.
Next, we use U s and U t to compute the semantic similarity of every subword in U s to every subword in
U t .
Using these semantic similarities, we initialize the embeddings in E t through a convex combination of embeddings in E s (Section 3.2).
By applying WECHSEL, the vectors of E t are in the same semantic space as E s , where a subword in the target language is semantically similar to its counterpart(s) in the source language.
These steps are summarized in Figure 1 and explained in more detail in the following.
3. Subword Embedding Computation
The process of mapping word embeddings to subword embeddings is done individually for the source and the target language.
Given a tokenizer
T with vocabulary U and embeddings W , the goal is to ﬁnd subword embeddings U for subwords in
U in the same semantic space as W .
To this end, we decompose subwords in U into n-grams and compute the embedding by taking the sum of the embeddings of all occuring n-grams, equivalent to how embeddings for out-of-vocabulary words are computed in fastText (Bojanowski et al., 2017).
[Equation]
[Figure]
where G ( x ) is the set of n-grams occuring in the subword x and w g is the embedding of the n-gram g .
Subwords in which no known n-gram occurs are initialized to zero.
3. Subword similarity-based Transfer
Applying the previous step to both source and target language results in the subword embeddings
U s and U t over the subword vocabularies U s and
U t , respectively.
Our aim is to leverage these embeddings to ﬁnd an effective transformation from
E s to E t .
We ﬁrst compute the cosine similarity of every subword x ∈ U t to every subword
y ∈
U s , denoted as s x,y .
[Equation]
We now exploit these similarities to initialize embeddings in E t by a convex combination of embeddings in E s .
In particular, each subword embedding in E t is deﬁned as the weighted mean of the k nearest embeddings in E s according to the similarity values.
The weighting is done by a softmax of the similarities with temperature τ .
[Equation]
where J x is the set of k neighbouring subwords in the source language.
Subword embeddings for which U t is zero are initialized from a random normal distribution N ( E [ E s ] , Var[ E s ]) .
Experiment Design
We evaluate our method by transferring the English RoBERTa (Liu et al., 2019) and the English
GPT-2 model (Radford et al., 2019) to French, German, Chinese and Swahili.
We refer to these languages as medium-resource languages .
In addition, we study the beneﬁts of our method on four lowresource languages , namely Sundanese, Scottish
Gaelic, Uyghur and Malagasy.
We evaluate WECHSEL-RoBERTa by ﬁnetuning on XNLI (Conneau et al., 2018), and on the balanced train-dev-test split of WikiANN (Rahimi et al., 2019; Pan et al., 2017) to evaluate NLI and
NER performance, respectively.
The hyperparameters used for ﬁne-tuning are reported in Appendix B.
GPT-2 is evaluated by Perplexity (PPL) on a heldout set from the same corpus on which the model was trained on.
Due to the difﬁculty of extrinsic evaluation on low-resource languages, we only train GPT-2 models in these languages, and evaluate their performance intrinsically via Language
Modelling Perplexity on a held-out set.
We use the pretrained models RoBERTa Base with 125M parameters, and the small GPT-2 variant with 117M parameters provided by HuggingFace’s
Transformers (Wolf et al., 2020) in all experiments.
Since under limited training regimes such as ours, using a smaller corpus does not in general degrade performance (Martin et al., 2020), we use a subset of 4GiB from the OSCAR corpus for German, French and Chinese.
For the other languages, we use data from the CC-100 corpus (Conneau et al., 2020) which contains 1.6GiB, 0.1GiB, 0.1GiB, 0.4GiB and 0.2GiB for Swahili,
Sundanese, Scottish Gaelic, Uyghur and Malagasy, respectively.
To obtain aligned word embeddings between the source and the target language we use monolingual fastText word embeddings 2 (Bojanowski et al., 2017).
We align these embeddings using the Orthogonal Procrustes method (Schönemann, 1966; Artetxe et al., 2016) with bilingual dictionaries from MUSE 3 (Conneau et al., 2017) for French, German and Chinese and a bilingual dictionary from FreeDict 4 (Ba´nski and Wójtowicz, 2009) for Swahili.
For the low-resource languages, we use bilingual dictionaries scraped from Wiktionary.
https
.cchttps
[Table]
We choose temperature τ = 0 . 1 and neighbors k = 10 for WECHSEL by conducting a parameter search over a grid with varying values for k and τ using linear probes (Appendix A).
We train tokenizers in the target languages using a vocabulary size of 50k tokens and byte-level BPE (Radford et al., 2019).
After applying WECHSEL, we continue training RoBERTa on the MLM objective and
GPT-2 on the CLM objective.
We compare against two baseline methods.
• TransInner: Randomly initializing E t while transferring all other parameters from the English model as in de Vries and Nissim
After training only embeddings for a ﬁxed amount of steps while freezing other parameters, the entire
model is trained for the remaining steps.
In preliminary experiments reported in Appendix E, we compare the method by Zoph et al.
(2016) with TransInner, observing superior performance of TransInner, so we choose TransInner as the baseline for crosslingual transfer in all our experiments.
• FullRand:
Training from scratch in the target language, as is commonly done when training BERT-like or GPT-like models in a new language (Antoun et al., 2020; Louis, 2020; Chan et al., 2020; Martin et al., 2020).
All models are trained for 250k steps with the same hyperparameters across all languages (reported in Appendix B).
Training one model takes around 4 days on a TPUv3-8.
For WECHSEL and FullRand we use a learning rate (LR) schedule with linear warmup from zero to the peak LR for the ﬁrst 10% of steps, followed by a linear decay to zero.
For TransInner, we perform two warmup phases from zero to peak LR, once for the ﬁrst 10% of steps for training embeddings only, then again for the remaining steps while training the entire model.
In addition to the mentioned baselines trained under this setting we compare the results of
[Table]
RoBERTa models with existing comparable models trained from scratch with more training effort.
We consider the total number of tokens the model has encountered in the target language, computed as the product of batch size × sequence length × train steps (shown in Table 1) as a proxy for training effort.
We evaluate the performance of CamemBERT (Martin et al., 2020) (French),
GBERT Base (Chan et al., 2020) (German), and
BERT Base -Chinese (Devlin et al., 2019) as existing monolingual LMs, 6 as well as XLM-R Base (Artetxe et al., 2020) as a high-performing multilingual LM.
Results
We present our results on transferring RoBERTa and GPT-2 from English to other languages, followed by analyzing training behavior.
In Appendix C, we provide a qualitative assessment of how well subword tokens are mapped between the source and the target languages.
5. Transferring RoBERTa
Table 2 reports the evaluation results of RoBERTa.
As shown, models initialized with WECHSEL outperform models trained from scratch and models initialized with TransInner across all languages.
Surprisingly, close relatedness of the source and target language is not necessary to achieve effective transfer, as e. g. on NLI WECHSEL improves absolute accuracy by 7 . 15% , 6 . 31% , 6 .
94% and 4 .
71% over models trained from scratch for French, German, Chinese and Swahili, respectively.
We observe that our parameter transfer-based model consistently outperforms the previously released LMs on both monolingual and multilingual settings, while these models beneﬁt from much larger training resources in terms of computation time and corpus size.
In particular, the results show an improvement over XLM-R Base by an average 3.54% accuracy for NLI and 1.14% micro
F1 score for NER.
For NLI, we improve over the prior monolingual models by 1 .
55% , 3 . 15% and 1 .
77% absolute accuracy for French, German and
Chinese, respectively.
For NER, we observe improvements over monolingual models with 0 .
62% and 0 .
26% absolute micro F1 score improvement for French and German, respectively.
For Chinese, the monolingual model BERT Base -Chinese still outperforms our method by 1 . 5% absolute micro F score.
We suspect that the discrepancy between
NLI and NER is due to the limited training corpus size (max. 4GiB), while a larger corpus can potentially improve NER as more named entities appear (Martin et al., 2020).
[Figure] [Figure]
[Table] [Table]
German WECHSEL
[Table]
GPT
[Table]
7e
[Table] [Table]
[Table]
TransInner
[Table] [Table]
5e
[Table] [Table]
The ﬁrst two columns of Figure 2 show the performance of RoBERTa models on downstream tasks after each 12.5k training steps.
Models initialized with WECHSEL reach high performance in signiﬁcantly fewer steps than models initialized with FullRand or TransInner
[Table]
We expect FullRand-RoBERTa to approach performance of the respective prior monolingual models when trained on the same amount of tokens.
For French, WECHSEL-RoBERTa outperforms
CamemBERT after 10% of training steps, reducing training effort by 64x.
For German, WECHSELRoBERTa outperforms GBERT Base after 10% of training steps, reducing training effort by 39x.
For Chinese, WECHSEL-RoBERTa outperforms
BERT Base -Chinese on NLI, but does not outperform BERT Base -Chinese on NER.
5. Transferring GPT5.2. To Medium-Resource Languages
Results on medium-resource languages are shown in Table 3.
Similar to the results for WECHSELRoBERTa, the GPT-2 models trained with WECHSEL consistently outperform the models trained from scratch and with TransInner across all languages.
The rightmost column of Figure 2 depicts the performance of GPT-2 models after each 12.5k training steps.
Comparing the results across all languages throughout training, we observe a stronger dependence on similarity of the source to the target language than for downstream tasks such as
NLI or NER.
In particular, for French and German,
WECHSEL is consistently better than TransInner and FullRand throughout the entire training, while for Chinese, a decrease in perplexity towards the end of training causes WECHSEL to surpass training from scratch.
5.2. To Low-Resource Languages
Table 4 reports the perplexity of Language Modelling on the low-resource languages.
Again, we observe consistent improvements using WECHSEL on all languages.
Furthermore, we ﬁnd that the improvement from WECHSEL tends to increase as the amount of training data decreases by conducting a sensitivity analysis w. r. t. the amount of available training data (Appendix F).
In Figure 3 we report the performance of the low-resource LMs on the held-out set throughout training.
One difference of the low-resource models with the ones trained on medium-resource languages is that the low-resource LMs are prone to overﬁtting, and require appropriate model selection even in the early steps of training.
Notably,
TransInner-GPT2 takes more steps to overﬁt since all non-embedding parameters are frozen for the ﬁrst 25k steps (c. f. Section 4).
[Figure] [Figure]
und a n e s e
Language Modelling Perplexity
S c o tt i s h
G a e li c
U
[Figure]
hu
[Figure] [Figure]
5. Is freezing necessary?
Previous work using the TransInner method freezes non-embedding parameters for a ﬁxed amount of steps before training the entire model (de Vries and Nissim, 2021).
This is done to prevent catastrophic forgetting at the beginning of training.
To evaluate if freezing non-embedding parameters is still necessary with our method, we conduct an additional experiment.
We train a German GPTmodel with WECHSEL and a model with TransInner without freezing any parameters, and the same models with freezing of non-embedding parameters for the ﬁrst 10% of steps.
We match hyperparameters of the main experiments except training for 75k steps only.
Based on the results shown in Figure 4, we conclude that freezing is necessary when using
TransInner, but there is no need for freezing when using WECHSEL.
[Figure]
Limitations and Potential Risks 6. Limitations
We conduct our experiments on up to eight languages, showing the beneﬁts of our parameter transfer method to both medium- and low-resource languages.
However, there are many more languages with diverse linguistic characteristics on which our
WECHSEL method is not tested.
This is a limitation forced by computational constraints, as we can not ascertain whether transfer to all other languages would result in similar improvements.
In addition, our extrinsic evaluation is limited to two tasks (NLI and NER).
While this choice is due to the limitations on the available collections in various languages, this evaluation does not necessarily provide a comprehensive view of language understanding tasks.
6. Risks
It is well-known that existing LMs trained on English text encode societal biases (Bolukbasi et al., 2016; Caliskan et al., 2017; Rekabsaz et al., 2021b) and stereotypes and using them in downstream tasks might lead to unfair treatment of various social groups (Zerveas et al., 2022; Krieg et al., 2022;
Ganhör et al., 2022; Rekabsaz et al., 2021a; Melchiorre et al., 2021; Rekabsaz and Schedl, 2020;
Elazar and Goldberg, 2018).
Since we propose a method to transfer the English LMs to new languages, it is highly probable that the existing biases are also transferred to the target LMs.
We therefore advocate a conscious and responsible use of the transferred LMs in practice.
Conclusion
We introduce WECHSEL, an effective method to transfer monolingual language models to new languages.
WECHSEL exploits multilingual static word embeddings to compute an effective initialization of subword embeddings in the target language.
We conduct experiments by transferring RoBERTa and GPT-2 models from English to French, German, Chinese and Swahili, as well as English GPT2 to four low-resource languages.
The evaluation results show that the transferred RoBERTa and
GPT-2 models are more efﬁcient and effective than strong baselines, and consistently outperform prior monolingual models that have been trained for a signiﬁcantly longer time.
WECHSEL facilitates the creation of effective monolingual LMs for new languages with medium to low resources, particularly in computationally-limited settings.
In addition, our work provides strong evidence towards the hypothesis by Artetxe et al.
that deep monolingual language models learn abstractions that generalize across languages.
Acknowledgments
Research supported with Cloud TPUs from
Google’s TPU Research Cloud (TRC).
We thank
Andy Koh and Artus Krohn-Grimberghe for providing additional computational resources.
The ELLIS
Unit Linz, the LIT AI Lab, the Institute for Machine Learning, are supported by the Federal State Upper Austria.
We thank the project INCONTROLRL (FFG-881064).
Research also supported in part by the NSF (IIS-1956221), the State of Upper Austria and the Austria’s Federal Ministry of Education, Science, and Research through the project FAIRFLOW (LIT-2021-YOU-215).
A Grid search over k and τ
To choose number of neighbors k and temperature τ for WECHSEL we conduct a grid search over linear probes of models with different initialization shown in Table 7.
For RoBERTa, we compute scores on NLI (using XNLI) and POS tagging (using the French, German and Chinese GSD corpora in Universal Dependencies) using linear probes of the last hidden state.
We probe on NLI by taking a concatenation of the mean of all token representations in the premise with the mean of all token representations in the hypothesis.
We probe on
POS tagging by taking the mean of all token representations belonging to each word.
For GPT2, we compute Language Modelling Perplexity on the held-out set also used to evaluate performance of the trained models.
B Hyperparameters
Hyperparameters used to ﬁne-tune RoBERTa on downstream tasks are shown in Table 5.
Hyperparameters used to train models in our main experiments are shown in Table 6.
[Table] [Table]
C Qualitative subword correspondence
We show a small random sample of tokens in the target language and their closest English token (according to WECHSEL) in Table 8.
D Using Word Embeddings without subword information
As an alternative to n-gram decomposition, we introduce a method for mapping word embeddings to subword embeddings without using any subword information (shown in Figure 5).
For this method, we require word frequency information in addition to the word embeddings.
We apply the tokenizer T to every word v in V resulting in a set of subwords for each word.
We deﬁne V ( x ) as the set of words containing the subword x when tokenized.
The embedding u x of the subword x is then deﬁned as the average of the embeddings of words in V ( x ) , weighted by the word frequencies.
[Equation]
∈ V ( x ) f v where w v is the embedding and f v is the frequency of word v .
[Table]
We call this variant of our method WECHSEL TFR .
We evaluate WECHSEL TFR by training the same models as for WECHSEL.
Results are shown in
Table 9 for GPT2 and in Table 10 for RoBERTa.
We ﬁnd that, on average, performance is on par with WECHSEL.
E
Choosing a transfer baseline
We consider two baseline methods to transfer models to a new language without using any languagespeciﬁc information.
One method copies nonembedding parameters to the target language and initalizes embeddings from a random normal distribution as done by de Vries and Nissim (2021).
We refer to this method as TransInner.
Another option copies non-embedding parameters and assigns the embedding of a random token in the source language to each embedding in the target language (effectively "shufﬂing" the embeddings) as done by
Zoph et al.
and Nguyen and Chiang (2017).
We refer to this method as TransInnerShufﬂeEmb.
We evaluate these two methods using a setup equivalent to the experiments in Section 5.3 and ﬁnd that
TransInner performs slightly better than TransInnerShufﬂeEmb (Figure 6), so we use TransInner for subsequent experiments.
Tokens Vector Frequency [ex, citing] [teach, ing] [ex, position] [teach, able]
Token Vector Frequency ex citing teach ing ex position teach able ﬂatten (frequency-weighted) tokenize reduce
Embeddings
Word
Vector Frequency exciting teaching exposition teachable + word frequencies
Token
Vector ex citing teach ing position able
Embeddings (in the same semantic space as ) Tokenizer
[Figure]
F Sensitivity Analysis w. r. t. training data size
Evaluating on languages with different amounts of available data only indirectly measures the effect of training data size on WECHSEL since other factors (e.g. language similarity to English) are also involved.
We conduct a sensitivity analysis to make the relation to the amount of training data explicit (Table 11).
Due to computational constraints we only do this for French.
We ﬁnd that the improvement from WECHSEL increases as the amount of training data decreases.
In addition, we ﬁnd that using fastText embeddings trained on less data deteriorates performance, but still leaves a clear margin to TransInner and FullRand
[Table] [Table]
[Table]
WECHSEL-RoBERTa
[Table]
WECHSEL TFR -RoBERTa 78.
[Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
WECHSEL
[Table] [Table]
WECHSEL TFR -RoBERTa 77.00 84.70 80.85 80.71 89.09 84.90 82.
[Table]
Chinese WECHSEL-RoBERTa 63.23 72.79 68.01 77.19 79.
[Table] [Table]
[Table] [Table]
WECHSEL TFR -RoBERTa 62.75 72.87 67.81 77.07 78.
[Table]
[Table] [Table]