This work presents methods for learning crosslingual sentence representations using paired or unpaired bilingual texts. We hypothesize that the cross-lingual alignment strategy is transferable, and therefore a model trained to align only two languages can encode multilingually more aligned representations. We thus introduce dual-pivot transfer : training on one language pair and evaluating on other pairs. To study this theory, we design unsupervised models trained on unpaired sentences and single-pair supervised models trained on bitexts, both based on the unsupervised language model XLM-R with its parameters frozen. The experiments evaluate the models as universal sentence encoders on the task of unsupervised bitext mining on two datasets, where the unsupervised model reaches the state of the art of unsupervised retrieval, and the alternative single-pair supervised model approaches the performance of multilingually supervised models. The results suggest that bilingual training techniques as proposed can be applied to get sentence representations with multilingual alignment. Cross-lingual alignment as evaluated by retrieval tasks has been shown to be present in the representations of recent massive multilingual models which are not trained on bitexts (Pires et al., 2019; Conneau et al., 2020b). Other studies further show that sentence representations with higher crosslingual comparability can be achieved by training a cross-lingual mapping (Aldarmaki and Diab, 2019) or fine-tuning (Cao et al., 2020) for every pair of languages. These two lines of research show that, on the one hand, multilingual alignment arises from training using monolingual corpora alone, and, on the other, bilingual alignment can be enhanced by training on bitexts of specific language pairs. Combining these insights yields a question: can training with bilingual corpora help improve multilingual alignment? Given a language model encoding texts in different languages with some shared structure already, we can expect that the model further trained to align a pair of languages will take advantage of the shared structure and will therefore generalize the alignment strategy to other language pairs. From a practical point of view, bitexts for some pairs of languages are more abundant than others, and it is therefore efficient to leverage data from resource-rich pairs for the alignment of resource-poor pairs in training multilingual language models. To better understand the cross-lingual structure from the unsupervised models, we also ask the following question: how can multilingual alignment information be extracted from the unsupervised language models? Unsupervised multilingual models out-of-the-box as sentence encoders fall short of their supervised counterparts such as LASER (Artetxe and Schwenk, 2019b) in the task of bitext mining (Hu et al., 2020). The discovery of cross-lingual structure in the hidden states in the unsupervised model (Pires et al., 2019; Conneau et al., 2020b), however, raises the possibility that with relatively light post-training for better extraction of deep features, the unsupervised models can generate much more multilingually aligned representations. In this paper, we address both questions with the design of dual-pivot transfer , where a model is trained for bilingual alignment but tested for multilingual alignment. And we hypothesize that training to encourage similarity between sentence representations from two languages, the dual pivots, can help generate more aligned representations not only for the pivot pair, but also for other pairs. In particular, we design and study a simple extraction module on top of the pretrained multilingual language model XLM-R (Conneau et al., 8696 2020a). To harness different training signals, we propose two training architectures. In the case of training on unpaired sentences, the model is encouraged by adversarial training to encode sentences from the two languages with similar distributions. In the other case where bitexts of the two pivot languages are used, the model is encouraged to encode encountered parallel sentences similarly. Both models are then transferred to language pairs other than the dual pivots. This enables our model to be used for unsupervised bitext mining, or bitext mining where the model is trained only on parallel sentences from a single language pair. The experiments show that both training strategies are effective, where the unsupervised model reaches the state of the art on completely unsupervised bitext mining, and the one-pair supervised model approaching the state-of-the-art multilingually-supervised language models in one bitext mining task. Our contributions are fourfold:  This study proposes effective methods of bilingual training using paired or unpaired sentences for sentence representation with multilingual alignment. The strategies can be incorporated in language model training for greater efficiency in the future. The work demonstrates that the alignment information in unsupervised multilingual language models is extractable by simple bilingual training of a light extraction module (without fine-tuning) with performance comparable to fully supervised models and reaching the state of the art of unsupervised models. The models are tested using a new experimental design dual-pivot transfer to evaluate the generalizability of a bilingually-supervised sentence encoder to the task of text mining for other language pairs on which it is not trained. This study shows that unsupervised bitext mining has strong performance which is comparable to bitext mining by a fully supervised model, so the proposed techniques can be applied to augment bilingual corpora for data-scarce language pairs in the future. Alignment with adversarial nets This work follows the line of previous studies which use adversarial networks (GANs) (Goodfellow et al., 2014) to align cross-domain distributions of embeddings without supervision of paired samples, in some cases in tandem with cycle consistency (Zhu et al., 2017), which encourages representations translated to another language then translated back to be similar to the starting representations. Conneau et al. (2018)'s MUSE project trains a linear map from the word-embedding space of one language to that of another using GANs, the method of which is later applied to an unsupervised machine translation model (Lample et al., 2018a). Cycle consistency in complement to adversarial training has been shown to be effective in helping to learn cross-lingual lexicon induction (Zhang et al., 2017; Xu et al., 2018; Mohiuddin and Joty, 2020). Our work is the first to our knowledge to apply such strategy of adversarial training and cycle consistency to the task of bitext mining. Alignment with pretrained LMs We adopt the training strategy aforementioned on top of pretrained multilingual language models, the extractability of multilingual information from which has been studied in several ways. Pires et al. (2019) find multilingual alignment in the multilingual BERT (mBERT) model (Devlin et al., 2019) pretrained on monolingual corpora only, while Conneau et al. (2020b) identify shared multilingual structure in monolingual BERT models. Other work studies the pretrained models dynamically by either fine-tuning the pretrained model for crosslingual alignment (Cao et al., 2020) or learning cross-lingual transformation (Aldarmaki and Diab, 2019) with supervision from aligned texts. Recently, Yang et al. (2020) use multitask training to train multilingual encoders focusing on the performance on retrieval, and Reimers and Gurevych (2020) use bitexts to tune multilingual language models and to distill knowledge from a teacher model which has been tuned on paraphrase pairs. Also, Chi et al. (2021a) pretrain an alternative XLM-R on a cross-lingual contrastive objective. Our work falls in the line of exploring multilingual-ity of pretrained models with a distinct emphasis on investigating the multilingual structure induced by bilingual training without fine-tuning or alternative pretraining. Unsupervised parallel sentence mining The evaluation task of our work is bitext mining without supervision from any bitexts or from bitexts of the pair of languages of the mining task. Such experiments have been explored previously. Hangya et al. (2018) show that unsupervised bilingual word embeddings are effective on bitext mining, and Hangya and Fraser (2019) further improve the system with a word-alignment algorithm. Kiros (2020) trains a lensing module over mBERT for the task of natural language inference (NLI) and transfers the model to bitext mining. Keung et al. (2020)'s system uses bootstrapped bitexts to fine-tune mBERT, while Kvapilkov et al. (2020)'s system uses synthetic bitexts from an unsupervised machine translation system to fine-tune XLM (Con-neau and Lample, 2019). Results from the three aforementioned studies are included in Section 5 for comparisons. Methodologically, our approach differs from the above in that our system is based on another pretrained model XLM-R (Conneau et al., 2020a) without fine-tuning, for one of the goals of the study is to understand the extractability of the alignment information from the pretrained model; and our model receives training signals from existing monolingual corpora or bitexts, instead of from NLI, bootstrapped, or synthesized data. The model as an encoder generates fixed-length vectors as sentence representations from the the hidden states of the pretrained multilingual language model XLM-R (Conneau et al., 2020a). Formally, given a sentence  i, in language   { s, t } , with the pretrained language model producing features x i of l layers, sequence length q , and embedding size d , the extraction module f (  ) generates a sentence embedding y i of fixed size d based on the features x i , or f ( x i ) = y i , x i  R l  q  d and y i  R d . With the parameters of XLM-R frozen, within the extraction module f (  ) are only two trainable components. The first is an ELMo-style trainable softmax-normalized weighted linear combination module (Peters et al., 2018), and the second being a trainable linear map. The linear combination module learns to weight the hidden states of every layer l of the pretrained language model and output a weighted average, on which a sum-pooling layer is then applied to q embeddings. And then the linear map takes this bag-of-word representation and produces the final sentence representation y i of the model. Monolingual corpora in different languages with language labels provide the signal for alignment if the semantic contents of the utterances share similar distributions across corpora. In order to exploit this information, we introduce to the model adversarial networks (Goodfellow et al., 2014) with cycle consistency (Zhu et al., 2017), to promote similarity in the distribution of representations. As is usual in GANs, there is a discriminator module d (  ) , which in this model consumes the representation y i and outputs continuous scores for the language identity  of the sentence  i, . Following Romanov et al. (2019), as inspired by Wasserstein-GAN (Arjovsky et al., 2017), the loss of the discriminator L disc is the difference between the unnormalized scores instead of the usual cross-entropy loss, or L disc = d ( y si )  d ( y tj ) . Adversarial training helps learning aligned encodings across languages at the distributional level. At the individual level, however, the model is not constrained to generate encodings which are both aligned and discriminative (Zhu et al., 2017). In particular, a degenerate encoder can produce pure noise which is distributively identical across languages. A cycle consistency module inspired by Zhu et al. (2017) is therefore used to constrain the model to encode with individual-discerning alignment. Cycle consistency is also reminiscent of the technique of using back-translation for unsupervised translation systems (Lample et al., 2018b). In this model, a trainable linear map F (  ) maps elements from the encoding space of one language to the space of the other, and another linear map G (  ) operates in the reverse direction. The cycle loss so defined is used to update parameters for both of the cycle mappings and the encoder: L cycle = h ( y si , G ( F ( y si ))) + h ( F ( G ( y tj )) , y tj ) where h is the triplet ranking loss function which sums the hinge costs in both directions: h ( a, b ) = (cid:88) n max(0 ,   sim( a, b ) + sim( a n , b )) + max(0 ,   sim( a, b ) + sim( a, b n )) , where the margin  and the number of negative samples n are hyperparameters, and sim(  ) is co-sine similarity. The loss function h encourages the model to encode similar representations between positive pairs ( a, b ) and dissimilar representations between negative pairs ( a n , b ) and ( a, b n ) , where a n and b n are sampled from the embeddings in the mini-batch. Based on the findings that the hard negatives, or non-translation pairs of high similarity between them, are more effective than the sum of negatives in the ranking loss (Faghri et al., 2018), our system always includes in the summands the costs from the hardest negatives in the mini-batch along with the costs from any other randomly sampled ones. The full loss of the unsupervised model is L unsup = L adv +  L cycle , with a hyperparameter  . In addition to the completely unsupervised model, we also experiment with a model which is supervised with bitext from one pair of languages and then transferred to other pairs. In this set-up, instead of using cyclical mappings, bitexts provide the alignment signal through the ranking loss directly, so the loss for the supervised model is L sup = h ( y si , y ti ) , where y si and y ti are representations of parallel sentences. The model is trained with the Adam optimizer (Kingma and Ba, 2014) and learning rate 0 . 001 with the parameters in XLM-R frozen. Our training program is built upon AllenNLP (Gardner et al., 2018), HuggingFace Transformers (Wolf et al., 2020), and PyTorch (Paszke et al., 2019). The code for this study is released publicly. 1 For adversarial training, the discriminator is updated  times for every step of backpropagation to the encoder. Other hyperparameters include the dimension of the output representations d , number of negative samples n , margin value  , and weight of the cycle loss  . The hyperparameters and the the values which are experimented with are summarized in Table 1. We empirically determine the hyperparameters among experimented values, and report their values in specific evaluation sections. The bilingual corpora used to train the encoder is taken from OPUS (Tiedemann, 2012) as produced for the training of XLM (Conneau and Lample, 2019). 2 We experimented with two language pairs for training the modelArabic-English (ar-en) and 1 The repository at https://github.com/cctien/ bimultialign . 2 We use the script https://github. com/facebookresearch/XLM/blob/main/get-data-para.sh to get the corpora MultiUN (Eisele and Chen, 2010) and EUbookshop, where each training corpus we use is of 9 million sentences. German-English (de-en)to explore potential effects of the choice of the dual-pivots. After being trained, the encoder is evaluated on two tasks of bitext mining between texts in English and in another language. Additionally, we train the models with the pivot pair of Arabic-German (ar-de), which does not include English, to be evaluated on the second task. Four models, two unsupervised and two one-pair supervised trained on either of the two language pairs, are evaluated on two bitext mining or retrieval tasks of the BUCC corpus (Zweigenbaum et al., 2018) and of the Tatoeba corpus (Artetxe and Schwenk, 2019a). Unsupervised baselines The XLM-R (Conneau et al., 2020a) bag-of-embedding (boe) representations out-of-the-box serve as the unsupervised baseline. We identify the best-performing among the layers of orders of multiples of 4, or layer L  { 0 , 4 , 8 , 12 , 16 , 20 , 24 } , as the baseline. In the case of BUCC mining task, for example, the best-performing baseline model is of layer 16 and denoted by XLM-R L16-boe. Results from Kiros (2020), Keung et al. (2020), and Kvapilkov et al. (2020), as state-of-the-art models for unsupervised bitext mining from pretrained language models, are included for comparison (see Section 2 for a description of them). Fully supervised models LASER (Artetxe and Schwenk, 2019b) and LaBSE (Feng et al., 2020), both fully supervised with multilingual bitexts, are included for comparisons. LASER is an LSTM-based encoder and translation model trained on parallel corpora of 93 languages, and is the earlier leading system on the two mining tasks. LaBSE on the other hand is a transformer-based multilingual sentence encoder supervised with parallel sentences from 109 languages using the additive margin softmax (Wang et al., 2018) for the translation language modeling objective, and has state-of-the-art performance on the two mining tasks. Finally, XLM-R+SBERT from Reimers and Gurevych, 2020 is XLM-R fine-tuned to align representations of bitexts of 50 language pairs and to distill knowledge from SBERT (Reimers and Gurevych, 2019) fine-tuned on English paraphrase pairs. The BUCC corpora (Zweigenbaum et al., 2018), consist of 95k to 460k sentences in each of 4 languagesGerman, French, Russian, and Mandarin Chinesewith around 3% of such sentences being English-aligned. The task is to mine for the translation pairs. Margin-based retrieval The retrieval is based on the margin-based similarity scores (Artetxe and Schwenk, 2019a) related to CSLS (Conneau et al., 2018), score( y s , y t ) = margin(sim( y s , y t ) , scale( y s , y t )) scale( y s , y t ) = (cid:88) z  NN k ( y s ) sim( y s , z ) 2 k + (cid:88) z  NN k ( y t ) sim( y t , z ) 2 k , where NN k ( y ) denotes the k nearest neighbors of y in the other language. Here we use k = 4 and the ratio margin function, or margin( a, b ) = a/b , following the literature (Artetxe and Schwenk, 2019b). By scaling up the similarity associated with more isolated embeddings, margin-based retrieval helps alleviate the hubness problem (Radovanovic et al., 2010), where some embeddings or hubs are nearest neighbors of many other embeddings with high probability. Following Hu et al. (2020), our model is evaluated on the training split of the BUCC corpora, and the threshold of the similarity score cutting 8700 off translations from non-translations is optimized for each language pair. While Kvapilkov et al. (2020) and Kiros (2020) optimize for the language-specific mining thresholds as we do here, Keung et al. (2020) use a prior probability to infer the thresholds. And different from all other baselines or models for comparisons presented here, Kvapilkov et al. (2020)'s model is evaluated upon the undisclosed test split of the BUCC corpus. Results F1 scores on the BUCC dataset presented in Table 2 demonstrate that bilingual alignment learned by the model is transferable to other pairs of languages. The hyperparameter values of the unsupervised model presented in the table are n = 1 ,  = 0 ,  = 5 ,  = 2 , and those of the supervised model are n = 1 ,  = 0 . The adversarially-trained unsupervised model outperforms the unsupervised baselines and nearing the state of the art, and is thus effective in extracting sentence representations which are sharable across languages. The choice of pivot pairs shows effects on the unsupervised models, with the model trained on the de-en texts performing better than that on the ar-en texts at mining for parallel sentences between English and German by 7 points. The results suggest that while alignment is transferable, the unsupervised model can be further improved for multilingual alignment by being trained on multilingual texts of more than two pivots. The one-pair supervised model trained with bitexts of one pair of languages, on the other hand, performs within a 6-point range of the fully supervised systems, which shows that much alignment information from unsupervised pretrained models is recoverable by the simple extraction module. Noticeably, the model supervised with ar-en bitexts but not from the four pairs of the task sees a 20-point increase from the plain XLM-R, and the choice of dual pivots does not have significant effects on the supervised model. We also measure the parallel sentence matching accuracy over the Tatoeba dataset (Artetxe and Schwenk, 2019b). This dataset consists of 100 to 1,000 English-aligned sentence pairs for 112 languages, and the task is to retrieve the translation in one of the target languages given a sentence in English using absolute similarity scores without margin-scaling. Results Matching accuracy for the retrieval task of the Tatoeba dataset are presented in Table 3. Following Feng et al., 2020, average scores from different groups are presented to compare different models. The 36 languages are those selected by Xtreme (Hu et al., 2020), and the 41 languages are those for which results are presented in Kvapilkov et al., 2020. The hyperparameter values of the unsupervised model presented in the table are n = 2 ,  = 0 . 2 ,  = 10 ,  = 2 , and those of the supervised model are n = 1 ,  = 0 . The unsupervised model outperforms the baselines by roughly 20 points, and the one-pair supervised model performs close to the the supervised model LASER but falls shorts by around 10 to 20 points to the other supervised model LaBSE. When one of the two pivot languages is English, the choice of the pivot does not show much difference on this task on average. While the models trained on ar-de (where neither pivot language is English) still exhibits strong transfer performance, there is a drop of around 2 to 6 points from the models where English is one of the pivot languages (ar-en and de-en). To understand the factors affecting the performance of the model, we consider several variants. All models presented in this section are trained with the same hyperparameters presented in the evaluation section above using either de-en corpora or corpora of multiple language pairs (Section 6.3). We ablate from the model the trainable componentsthe weighted linear combination and the linear mapas well as the two training losses, L adv and L cycle , of the unsupervised model. When the weighted linear combination is ablated, we use the unweighted average of embeddings across layers. We evaluate on the average accuracy over the 36 languages of the Tatoeba corpus. The results in Table 4 show a few interesting trends. First, the cycle consistency loss is essential for the unsupervised model, as can be seen by the very low performance when only L adv is used. Secondly, the linear map plays a larger role than the linear combination in extracting alignment information in the unsupervised model: in both conditions with cycle consistency loss, the linear map alone outperforms the linear combination alone, and in the condition with only cycle consistency loss, the linear map alone does best. Finally, in the one-pair supervised model, the linear combination module alone shows gains of 13 points from the baseline but does not produce gains when trained along with a linear map. Previous studies show that representations from different layers differ in their cross-lingual alignment (Pires et al., 2019; Conneau et al., 2020b). To understand this phenomenon in the present setting, we take layers whose orders are multiples of 4 and train the model with representations from one single layer without combining embeddings from different layers. The average accuracy scores over 36 languages in Tatoeba summarized in Figure 2 show that the alignment information is most extractable deep in the middle layers, corroborating the findings from the previous work (Kvapilkov et al., 2020; Litschko et al., 2021; Chi et al., 2021b). The model trained with the best-performing layer shows similar or higher scores than the full model with learned linear combination, which is consistent with the findings from the ablation that the learned linear combination is not essential for extracting alignment information. It is possible that a model trained on texts from more pairs of languages may improve upon the multilingual alignment so far demonstrated. To test this, we trained the model with the same hyper-8702 Model F1 score ( % ) xx  en de fr ru zh Unsupervised Optimized thresholds 91 . parameters as in the previous section but on texts from multiple languages, 3 where each multi-pair model is trained on 16 million total sentences. The results are in Table 5. There is an aggregate 3 point improvement for the unsupervised model and 5 point for the supervised model. The results suggest that with our models, one bilingual pivot is capable of extracting much transferable multilingual representations from XLM-R, but using more pivots can still improve the transferability of the representations to some extent. Previous work observes that in the BUCC mining task, the thresholds optimized for different language pairs are close to one another, suggesting that one can tune the threshold on high-resource pairs and use the system to mine other language pairs (Kiros, 2020). We examine the mining performance on the BUCC dataset of two threshold schemes: optimized thresholds, where thresholds are optimized for each language pair, and the dual-pivot threshold, where the threshold optimized for the pivot pair, in this case German-English, is used to mine all languages. The scores from these two schemes on BUCC are summarized in Table 6. The results show that the thresholds optimized for the pivot pair transfer to other pairs with at most a 2-point decrease in the F1 score, and that the results of the two schemes are almost identical to the one-pair supervised model. These experiments corroborate the 3 The 16 pairs are those between en and ar, bg, de, el, es, fa, fr, hi, id, ru, sw, th, tr, ur, vi, zh . previous observation and demonstrate yet another case for leveraging texts from resource-rich pairs for unsupervised mining of other language pairs. To test whether our method of training language-agnostic sentence encoders encourages meaning-based representations, we evaluate the models on the multilingual semantic textual similarity (STS) 2017 (Cer et al., 2017) with Spearman correlation reported in Table 7. All evaluation pairs on average see about 10 percentage-point increases from baseline (XLM-R L12-boe) for both models. Yet the gaps between our models and the fully supervised systems suggest that supervision with more language pairs and more trainable parameters likely encourages sentence representations to be closer to what humans see as meaning. This work shows that training for bilingual alignment benefits multilingual alignment for unsupervised bitext mining. The unsupervised model shows the effectiveness of adversarial training with cycle consistency for building multilingual language models, and reaches the state of the art of unsupervised bitext mining. Both unsupervised and one-pair supervised models show that significant multilingual alignment in an unsupervised language model can be recovered by a linear mapping, and that combining monolingual and bilingual training data can be a data-efficient method for promoting multilingual alignment. Future work may combine both the supervised and the unsupervised techniques to attain sentence embeddings with stronger multilingual alignment through the transferability of bilingual alignment demonstrated 8703 in this work, and such work will benefit tasks involving languages of low resources in bitexts. Alexis Conneau, Guillaume Lample, Marc'Aurelio Ranzato, Ludovic Denoyer, and Herv Jgou. Word translation without parallel data. Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Naveen Arivazhagan, and Wei Wang. 2020. Language-agnostic BERT sentence embedding.
method objective method method abstain abstain abstain abstain abstain abstain method abstain method abstain abstain method objective method objective abstain abstain abstain method abstain objective objective objective objective objective method other other objective method other other other other objective abstain other other other other other other abstain other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain other abstain method abstain method abstain abstain abstain method abstain abstain abstain abstain method abstain other other method abstain abstain method abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain other method abstain method method abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain method method abstain abstain abstain abstain abstain method abstain abstain abstain method abstain abstain abstain abstain abstain method abstain abstain abstain abstain method abstain abstain result abstain abstain objective abstain abstain abstain abstain abstain