Elamur Research

Using Optimal Transport as Alignment Objective for fine-tuning Multilingual Contextualized Embeddings

Paper · 2021 · Sawsan Alqahtani, Garima Lalwani, Yi Zhang et al.

Summary

A system trained to work in several languages can still represent the same idea differently depending on the language in which it appears. That matters when the system learns a task from English examples and then has to perform it in German, Greek, or another language. Alqahtani and colleagues study whether an extra training stage can make contextual word representations more compatible across languages. Their approach uses optimal transport, a way to compare weighted collections of points by finding a low-cost distribution of correspondences between them. The work addresses a problem in multilingual and cross-lingual NLP.

Earlier approaches to word-level alignment often started with a list of matches produced by a separate aligner. Keeping only one-to-one matches makes that list easy to use, but it can leave out relationships such as a German compound whose English translation takes several words. The new procedure, called WordOT in its word-level form, starts with pairs of translated sentences and works out the correspondences during fine-tuning. It encodes each sentence with multilingual BERT, or mBERT, then distributes matching weight among the contextual vectors on either side. As the vectors change, the correspondences can change with them. Each non-English language has a separate transport calculation with English, and a penalty keeps English representations close to their starting positions.

The authors then teach each task using English labels and evaluate it across languages. In the reported averages for languages involved in alignment, WordOT reaches 75.4 F1 on XNLI, an entailment benchmark, compared with 73.5 for the authors’ mBERT baseline. On XQuAD, WordOT reaches 74.7 F1 and 59.0 exact match, against 73.4 and 57.8 for that baseline. WordOT also improves on the corresponding L2 alignment baseline on those averages. AMBER scores higher on XNLI, and the same transport procedure yields mixed results when applied to XLMR base. The evidence for improvement is strongest when the starting point is mBERT and the evaluation concerns entailment or extractive question answering.

The additional experiments show where the method is sensitive. Adding alignment languages helps XNLI across the broad evaluation set, while the average XQuAD scores fail to improve. Smaller textual units slightly improve the reported entailment averages and lower the corresponding question-answering averages. Reducing the amount of parallel text also has different effects on the tasks. Inspection of the transport plans shows that the method can connect a compound to its translation, but also that it assigns weight to words in poorly paired sentences and can confuse repeated words across clauses. Those examples make clear what the benchmark results establish. A soft correspondence cost can help train representations for transfer, while the quality of individual word links remains a separate empirical question.

Deep dive: Using Optimal Transport as Alignment Objective for fine-tuning Multilingual Contextualized Embeddings

How optimal transport fine-tunes multilingual word embeddings from paired sentences, and where that improves entailment and answer extraction. · about 36 minutes to read

The problem and its context

Knowing a language and reusing a task across languages

Suppose an entailment classifier has learned from English examples how to decide whether a statement follows from another statement. To reuse that decision procedure on a different language, the system must produce representations on which the English-trained distinctions still make sense. A shared encoder provides a place to learn such representations. The alignment problem is how to make equivalent or related expressions occupy compatible positions within that shared space. The paper situates this problem in the development of contextual representations and the extension of that work across languages. Deep Contextualized Word Representations and BERT.

The motivation is partly practical. Some languages have much less annotated or unannotated material available than English, and maintaining a separate task-training pipeline for each language requires additional resources. Reusing English annotations changes the kind of cross-language evidence required. A collection of translated sentences can help bring representations into correspondence even when it contains no entailment judgments or annotated answer spans. The paper asks whether that evidence can be used to adjust the representation of individual occurrences.

A contextual representation is a vector calculated for a particular use of a word. The same spelling can therefore give rise to different vectors in different sentences. The authors illustrate this with the English form match. In a remark about whether clothes go together, it has a use whose German counterpart is a verb such as passen. In a question about a cricket event, the same English spelling has a different meaning. An alignment based on one vector per spelling cannot make this distinction through the context of each occurrence. That is the important difference between the objects compared here and the fixed lexical vectors discussed in earlier work on word embeddings.

Context also changes what counts as a useful link. Equivalent sentence content can be distributed differently on either side of a translation. One language may package an idea as a compound, and another may express it as a phrase. Part of a word can carry information expressed by an independent word elsewhere. A procedure that accepts word occurrences as input still has to decide whether those occurrences may share counterparts. The choice directly affects which relationships can influence the training objective.

Mapping existing spaces and changing the encoder

In the paper’s account of earlier research, some methods operate on representation spaces after the vectors have been learned. For fixed word representations, a bilingual lexicon or an induced collection of links can provide anchors between the spaces. The relationships among the remaining vectors then guide extension beyond those anchors. The paper places both learned correspondences and mappings constrained to preserve the geometry of the original space in this line of work. Exploiting Similarities among Languages for Machine Translation and Offline Bilingual Word Vectors.

Related approaches apply transformations to contextual vectors. The paper discusses Procrustes alignment, which seeks a rotation that brings representations from one language into correspondence with those of another. The result is a transformation associated with a language pair. Where a downstream setup involves several pairs, handling the separate transformations can be inconvenient. Direct fine-tuning instead changes the shared encoder that produces the vectors in the first place. Signals originating with different language pairs can thus affect the same parameters. Cross-Lingual Alignment of Contextual Word Embeddings and Cross-Lingual BERT Transformation.

A direct alignment objective also needs evidence about what should come together. In one of the closest comparisons, Cao and colleagues use word pairs identified in parallel sentences. An L2 objective brings together the representations of the paired occurrences, with regularization to protect the reference side. The paper also describes contrastive training in which known pairs are compared against other pairings within the batch. In these approaches, a word aligner supplies weak supervision. Its output guides learning even though it can include mistaken matches or omit real ones. Multilingual Alignment of Contextual Word Representations.

The authors are especially concerned with a filtering step that keeps individual matches. If a separate aligner and its filters have already chosen the eligible pairs, subsequent encoder training has no way to recover an omitted correspondence through that objective. The procedure can make selected vectors closer, but it operates within the earlier selection. WordOT changes when and how that selection occurs. The match for an occurrence depends on the vectors available during the current training step, and matching weight can be shared across several occurrences.

What the sentence pair supplies

Other earlier methods use the sentence itself as the unit of alignment. The paper describes LASER as learning multilingual sentence representations from a large collection of parallel text. It also discusses a dual-encoder approach trained to rank translations among candidates in a batch. Those methods address questions such as whether one entire sentence is the translation of another. That comparison can be successful without specifying which particular parts carry corresponding information. LASER and Language-agnostic BERT Sentence Embedding.

Alqahtani and colleagues retain the sentence pair as the external signal and put the loss at the level of its constituents. The pairing supplies a reason to compare the two pieces of text. It does not say where the translation of any individual word lies, or whether the translation is localized to a single word. The authors use that gap as the place for optimal transport. The local comparison operates on word or sub-word vectors rather than on a single summary vector for each sentence.

The paper also distinguishes several prior uses of optimal transport. Some applications seek the mapping itself. Work on bilingual lexicon induction, for example, uses the mapping to propose translations for words. Other uses take the value of the best transport solution as a measure of how different two distributions are. The paper cites applications to document comparison and translation training in that broader family. WordOT uses the value to adapt representations and can inspect the mapping after it has been calculated.

A closely related approach by Chi and colleagues also uses transport on contextual word representations. In the paper’s description, that work turns the correspondences into self-generated labels and uses them in predicting masked words, alongside masked and translation language objectives. The distinction is in what the encoder is asked to learn from. Predicting an aligned masked item uses a correspondence as a target. WordOT instead uses a scalar discrepancy obtained by optimizing the whole correspondence plan. The paper discusses other combinations of word, sentence, and prediction objectives, while its own experiment concentrates on the transport signal and preservation of the English reference.

The method, step by step

From translated sentences to a training signal

The starting point is a multilingual encoder that can process both members of a parallel sentence pair. The authors call English the target and the other language the source. These roles describe the direction of their alignment setup. Both sentences are already available, and the encoder reads each independently. There is no step in which it has to produce the English text from the source.

Imagine that an English sentence uses a phrase where the related German sentence uses a compound. Once the encoder has read both sentences, there is a vector for the compound and a vector for each represented English word. The transport calculation considers the cost of connecting the compound occurrence to the English occurrences. It can distribute its weight across the words of the phrase. At the same time, all the other source and target vectors have weights to account for. The solution therefore depends on the two distributions as a whole, including the other possible links.

The process yields both a transport plan and a numerical cost. The plan describes the distribution of weight, while the cost contributes to the adjustment of the encoder. On later training steps, the same word forms can be encountered in new sentences, and the encoder itself has also changed. The next comparison uses the vectors then available. A list of translations saved before fine-tuning would serve a different role because it would fix which occurrences can be brought together.

An alignment update in WordOT

The steps in order.

An alignment update in WordOTStep 1: Draw parallel batches separately for each language pair1. Draw parallel batches separately for each language pairStep 2: Encode the source and English sentences independently2. Encode the source and English sentences independentlyStep 3: Select final-layer vectors for the comparison units3. Select final-layer vectors for the comparison unitsStep 4: Compute Sinkhorn divergences within each language pair4. Compute Sinkhorn divergences within each language pairStep 5: Add the penalty for English representation drift5. Add the penalty for English representation driftStep 6: Sum the losses and update the shared encoder6. Sum the losses and update the shared encoder

Which vectors enter the comparison

The main experiments start with mBERT, pretrained jointly on 104 languages using a common vocabulary. The authors take contextual vectors from its final layer. They say that they looked at other layers and obtained the best results with the last one. They do not give a series of layer-specific scores, so this is a reported selection within their development process.

In WordOT, a word supplies one vector even if the encoder has broken it into several pieces. The vector used is that of its last sub-word. This is the convention in the L2 work used for comparison, and retaining it keeps the choice of word representation consistent across those approaches. A final-subword vector is still contextual. Its value reflects the sentence as processed by the encoder, even though its position is associated with a particular piece of a word.

The authors point out why the choice could matter. Linguistic information can be unevenly distributed across a word. The examples they give include inflection carried by suffixes and the position of the head in Germanic compounds. A final piece, an initial piece, and an average of pieces are therefore distinct choices. The paper’s main setup does not require that the final piece be the most informative one in every language or for every word.

SubOT exposes the pieces themselves to the transport procedure. A word split into several pieces can now contribute several points. The paper motivates this with an Arabic form in which part of the word corresponds to the English object pronoun it. If the relevant part has its own representation, the correspondence problem can express a link at that size. The paper does not assume that every piece produced by subword tokenization coincides with a meaningful linguistic component.

Weights, costs, and admissible plans

For the mathematical description, take the points under comparison to be the contextual vectors of the source and target units. In the word-level version these are word occurrences, including potentially several occurrences of the same word form. The weights on the two sides are written α and β. The main setup uses uniform weights within each side. Each distribution has total mass 1, so a sentence with more units can still be compared with a shorter translation. The individual weights are then smaller on the side with more units.

Σᵢ αᵢ = Σⱼ βⱼ = 1

Here αᵢ is the mass of source occurrence i and βⱼ is the mass of English target occurrence j. The sums run over the units on their respective sides. The symbol Σ means to add the indexed quantities, and 1 is the required total for either distribution. Uniformity concerns the weights within each side. The allocation of those weights across pairs is what the optimization decides.

The authors also report trying an initialization based on TF-IDF, which uses how terms occur in a corpus to assign their weights. This helped some languages in their investigation. They point out that a corpus with limited material may provide an inadequate basis for those statistics. The reported method uses uniform weighting, and the paper gives no detailed set of downstream comparisons for the alternative initialization.

To measure the cost of a possible correspondence, the authors use Euclidean distance between the two occurrences’ contextual vectors. This is the straight-line distance in the representation space. Collecting these distances gives the matrix C. Each row represents a source occurrence and each column a target occurrence. In the authors’ notation, there are n source units and m target units, so the matrix has shape n × m.

The transport plan π uses the same rows and columns as C. An entry in π is the amount of weight the plan sends between its associated occurrences. Entries must be non-negative. Every row must distribute all of its source weight, and each column must receive exactly its assigned target weight. The constraints can be written together as follows.

Π(α, β) = {π ∣ π ≥ 0, π𝟙 = α, πᵀ𝟙 = β}

The symbol Π names the set of allowable plans for the marginal weights α and β. The vertical bar means “such that.” The inequality applies to all entries of π. Multiplication by a vector 𝟙 of ones of the appropriate length adds up entries within each row. The transpose πᵀ exchanges rows and columns, so multiplying it by the other vector of ones gives the column totals. The paper’s mathematical line for the lower bound is ambiguous. Nonnegativity is the reading consistent with fractional assignments and the stated unit totals.

These constraints explain how soft matching works without removing the requirement that the mass be fully accounted for. A row can put weight in several columns. A column can take weight from several rows. When sentence lengths differ, their unit counts pose no obstacle to this allocation. Every positively weighted unit still participates. The plan has no built-in option to leave an occurrence without a counterpart simply because all the candidate links are poor.

Regularized optimal transport

The cost of a plan depends on the distances and on how much weight it assigns to each distance. Sending a large share of the weight along an expensive link contributes more to the objective than sending a small share along the same link. Assignments are coupled by the constraints. Giving a target most of its required weight from one source leaves less room for other sources to use that target, even if it is close to them as well.

The authors add a regularization term to this transport problem. It measures the departure of the plan from the joint weights that would arise if the sides’ weights were multiplied independently. The authors use the regularization to smooth the assignments and make the optimization more suitable for repeated use during fine-tuning.

OTε(α, β) = min over π ∈ Π(α, β) of [⟨π, C⟩ + ε KL(π, α ⊗ β)]

The expression OTε is the optimal regularized cost, with ε controlling the contribution of the regularization. The minimum ranges over the admissible plans Π for α and β. The angle brackets denote the entrywise inner product, which multiplies each entry of π by the corresponding entry of the ground-cost matrix C and then adds the products. KL stands for Kullback–Leibler divergence. Its arguments are the plan and α ⊗ β, where ⊗ forms the independent joint weights from the source and target marginals. The two terms inside the brackets together determine which plan gives the smallest objective.

For this calculation the paper uses ε = 0.05, the reported default in its Geomloss setup. The authors say that they tried other values and found this one to work best, without reporting the full set of comparisons. They place the chosen formulation between the geometry of Wasserstein transport and the behavior of Maximum Mean Discrepancy, another way to compare distributions. The role of ε in the displayed optimization is specific. It assigns weight to the KL penalty relative to the cost derived from vector distances.

The method uses the Sinkhorn algorithm to obtain the regularized solution. In the paper’s description, the algorithm works in the dual formulation of the problem. It alternately updates a vector associated with the source and a vector associated with the target until convergence. These updates solve the joint allocation problem while taking both sets of required totals into account. The output plan π can subsequently be examined for the correspondences it assigns.

From the transport value to the Sinkhorn divergence

WordOT uses the Sinkhorn divergence as the alignment discrepancy. The construction compares the two distributions and corrects that cross-distribution value with the regularized costs of comparing each distribution to itself. For a self-comparison, the distance matrix is built within the relevant side. The calculation still follows the same regularized transport definition.

Sε(α, β) = OTε(α, β) − ½ OTε(α, α) − ½ OTε(β, β)

Here Sε is the Sinkhorn divergence. The first OTε term compares the source α with the English target β. The next compares the source with itself, and the final one compares the target with itself. In each term the weights refer to their associated contextual points, so the costs depend on those vectors as well as on α and β. The coefficient ½ applies to each self-comparison. Subtracting these terms corrects for the contribution that regularized transport can produce even when a distribution is compared to itself. The paper chooses this variant for smoother weights and more stable gradients.

The discrepancy offers a route from the transport calculation back to the encoder. Changing the vectors changes the ground costs, which changes the transport solution and its value. Back-propagation uses the value as the signal for changing the encoder’s parameters. The correspondences are implicit in the computation. They need no conversion into a set of fixed word labels before the encoder can learn from them.

Keeping the English reference recognizable

Because mBERT encodes both sides with shared parameters, changes made in alignment training can affect English too. The authors compare the English contextual vectors produced during training with the vectors produced by the starting encoder for the same occurrences. The objective includes a charge for their displacement. This gives English the status of an anchor while still allowing its representations to move.

The pair-specific expression printed in the paper has the following form, with a consistent index for the English occurrences.

l(c; Pₖ) = −Sεᵏ(α, β) + λ Σₜ∈Pₖ Σⱼ₌₁ˡᵉⁿ⁽ᵗ⁾ ‖c(j, t) − c⁰(j, t)‖₂²

The symbol l denotes the objective for the parallel data Pₖ associated with language pair k. The semicolon inside its arguments separates the current encoder, written c, from those data. The superscript k on the Sinkhorn term identifies the discrepancy for that pair. The outer sum uses t to denote an English sentence on the target side of Pₖ. The inner sum ranges over its occurrences from 1 through len(t), the sentence length in represented units. For occurrence j in t, c(j, t) is its current vector and c⁰(j, t) is its vector at initialization. The subscript 2 and superscript ² on the norm mean squared Euclidean displacement. The coefficient λ, set to 1, weights this penalty.

The displayed expression places a minus sign on the Sinkhorn term, while the prose describes training as reducing the transport discrepancy and penalizing English drift. The paper leaves the sign convention connecting that expression to the optimizer unresolved. The printed expression and the intended effect of the training signal consequently have to be read with this ambiguity in mind.

What happens across languages is specified separately. Each non-English language is paired with English in its own transport calculation. After those calculations, the pair-specific objectives are added for the shared update.

L(c) = Σᵢ₌₁ᴷ l(c; Pᵢ)

The capital L denotes the aggregate objective, c again denotes the encoder, and K is the number of participating language pairs. The summation index i runs from 1 to K. Each term l uses the parallel data Pᵢ belonging to its pair. The encoder receives gradients from the aggregate. Thus the place where languages interact is the parameter update, after the respective transport problems have been solved.

How the training data enter an update

The parallel material comes from Europarl, MultiUN, the IIT Bombay collection, Tanzil, GlobalVoices, and OpenSubtitles. The overall inventory contains approximately 32M sentence pairs. The main experiments select 250K for training per language pair and upsample pairs whose inventories fall below that amount. The authors shuffle the sentence pairs to remove chronological ordering where present and use the tokenizer cited with the Moses toolkit. The parallel corpora provide the alignment stage with translated sentences, while the benchmark corpora later provide labeled task examples. MultiUN, The IIT Bombay English-Hindi Parallel Corpus, and OpenSubtitles2016.

In the main configuration, Bulgarian, German, Greek, Spanish, and French each supply a source side with English as the other member. The authors chose English for the availability of parallel text and evaluation resources. The method is defined in terms of a source and target distribution and can in principle be applied with another reference, but this training setup gives English a fixed role in every pair.

The authors draw equal-sized batches of parallel examples from the participating pairs. They calculate the alignment losses and then backpropagate through their combination. Working with mini-batches limits the size of the transport calculation. A contextual vector describes an individual occurrence, so calculating a single plan over the full inventory would require comparing far more points than in a word-type lexicon. The experiment also depends on which observations enter a comparison together, which is why the paper tests changing how languages are grouped.

The model is fine-tuned for a single epoch using a learning rate of 5 × 10⁻⁵. The main configuration uses batch size 24 and a gradient accumulation step of 2. Gradient accumulation allows gradients from successive batches to contribute before a parameter update. The authors chose these settings to balance memory, runtime, and observed performance. They use Geomloss to calculate the Sinkhorn divergence and Adam for the parameter updates.

Once alignment training is complete, the adapted encoder serves as the starting point for the task experiments. English task examples, with their entailment classes or annotated answer spans, supply the supervision for that stage. The parallel sentence collection has already done its work through the alignment objective. This sequence allows the benchmark comparisons to ask whether a change made before learning a task helps that task transfer.

Experiments and results

What the two benchmarks ask

The authors use the XTREME benchmark implementation for their main task evaluations. XNLI presents a sentence pair and asks which of the entailment, contradiction, or neutral relations holds. The output is a class for the pair. XQuAD presents a question and a passage and asks for a span from the passage. Finding related content may get the system close to an answer, but it still has to identify the span that answers the question. XQuAD is discussed in the cited study of representation transfer and is connected to SQuAD. On the Cross-lingual Transferability of Monolingual Representations.

The authors train the tasks using English labels and cross-entropy loss. In this context, zero-shot transfer means using the learned task on other languages without training on task labels in those languages. A language can be zero-shot for a task and still have contributed parallel sentences to representation alignment. In discussions of “seen” languages, the paper uses participation in the alignment stage as the criterion. English appears in the main reported averages as the common reference.

The paper reports F1 on XNLI. For XQuAD it reports F1 as an overlap measure and exact match, abbreviated EM, for complete agreement with the answer. The two metrics can move separately. A predicted span that overlaps the answer but includes extra words can receive credit for overlap without scoring an exact match. For internally run experiments, the figures average runs with three seeds. Published comparisons and internal runs are identified separately in the main results.

The benchmark coverage differs between the two tasks. In the main alignment group, XNLI results include English and the Bulgarian, German, Greek, Spanish, and French sides. The corresponding XQuAD comparison uses English, German, Greek, and Spanish. Thus the two seen-language averages represent different sets of evaluations. Even when the same alignment training precedes both tasks, each benchmark can reflect only the languages for which its data supply a score.

Which comparisons address the alignment objective

The unadapted mBERT baseline provides the most direct comparison with starting from the same pretrained encoder and adding the transport stage. L2 supplies a comparison with another explicit word alignment objective. Since L2 relies on prior word matches, the two alignment methods differ in both their correspondence mechanism and the loss computed from those correspondences. The results compare complete training procedures.

XLM provides a published multilingual baseline described as using a larger architecture and vocabulary than mBERT, with a similar underlying objective. AMBER is included for XNLI as a comparison with an approach that uses several forms of cross-language training. The authors select the published AMBER variant without its sentence-alignment component as the closer comparison. It still uses signals beyond the transport objective tested here, including translation language training.

For XQuAD, the authors reproduce a version of MAD-X with mBERT at its core, to give the adapter approach the same main encoder family as WordOT. They also report adapter results using XLMR base. Their reproduction follows the XQuAD scripts from AdapterHub because of package incompatibilities with the XTREME setup. It uses a learning rate of 1e-4 for the adapters, trains for 4 epochs, and uses batch size 4 with gradient accumulation of 4. These facts help identify which result was obtained under which procedure. MAD-X and AdapterHub.

Entailment scores

WordOT improves on the authors’ mBERT and L2 comparisons in the XNLI average for the main alignment group. Its average also exceeds the reported XLM score. AMBER is higher in this comparison. The chart marks WordOT as the paper’s method.

XNLI F1 averaged over the main alignment group

WordOT exceeds the mBERT and L2 comparisons, while AMBER has the highest score shown.

XNLI F1 averaged over the main alignment groupPublished mBERT: 71.9Published mBERT71.9Internal mBERT: 73.5Internal mBERT73.5XLM: 74.6XLM74.6Internal L2: 74.6Internal L274.6WordOT (this paper): 75.4WordOT (this paper)75.4AMBER: 76.4AMBER76.4
The numbers
System or settingF1
Published mBERT71.9
Internal mBERT73.5
XLM74.6
Internal L274.6
WordOT (this paper)75.4
AMBER76.4

The two baseline mBERT figures make it important to identify the comparison behind any claim of improvement. The internal mBERT result of 73.5 is the relevant baseline for the paper’s reported +1.9% F1 on the main XNLI average. The authors suggest AMBER’s translation language objective could help explain its stronger average. The experiment compares the published configurations, so it leaves the contribution of that component unresolved.

Language-level results expose variation within the WordOT gain. Bulgarian XNLI F1 is 73.6 with WordOT, 69.3 with internal mBERT, and 73.3 with L2. For German, the corresponding scores are 73.7, 72.0, and 72.8. In Greek, WordOT reaches 70.6, above the internal mBERT score of 67.7 and below the L2 score of 70.9. The English reference score is 82.1 for WordOT and 82.6 for mBERT. The alignment penalty protects vectors by charging for displacement, and these English scores show why preservation of vectors and preservation of task performance are distinct outcomes.

Answer extraction scores

On XQuAD, WordOT leads the mBERT-based configurations shown below in the main-group comparison. L2 and the mBERT adapter configuration score below the internal unadapted encoder. The question-answering result is therefore evidence that the choice of alignment procedure matters on this task, since the two explicit word alignment methods behave differently relative to the common baseline.

XQuAD F1 averaged over the main alignment group

WordOT leads the comparisons shown, and L2 falls below unadapted mBERT.

XQuAD F1 averaged over the main alignment groupInternal L2: 68.0Internal L268.0Internal MAD-X with mBERT: 70.2Internal MAD-X with mBERT70.2Published mBERT: 73.1Published mBERT73.1Internal mBERT: 73.4Internal mBERT73.4WordOT (this paper): 74.7WordOT (this paper)74.7
The numbers
System or settingF1
Internal L268.0
Internal MAD-X with mBERT70.2
Published mBERT73.1
Internal mBERT73.4
WordOT (this paper)74.7

The exact-match average for WordOT is 59.0. Internal mBERT reaches 57.8, L2 reaches 51.6, and the mBERT version of MAD-X reaches 53.8. The result against the unadapted baseline is visible in both the overlap and exact-match metrics. The paper reports the F1 improvement over internal mBERT as +1.3% on this set.

German and Greek illustrate what contributes to the averages. On German XQuAD, WordOT obtains 73.6 F1 and 57.8 EM, against 72.0 F1 and 55.9 EM from internal mBERT. On Greek, WordOT reaches 65.6 F1 and 48.5 EM, compared with 62.3 F1 and 45.3 EM. Spanish shows a different pattern. WordOT records 75.5 F1 and 57.1 EM, while internal mBERT records 75.6 F1 and 57.5 EM. English exact match is 72.4 for both, even though the F1 figures are 84.2 for WordOT and 83.7 for internal mBERT.

The broader XQuAD average gives another view. It includes languages outside the main alignment group and is 63.8 F1 and 48.8 EM for WordOT. The internal baseline reaches 64.3 F1 and 49.6 EM across that broader set. The high-level conclusion therefore depends on which population the average describes. The main result is positive on the group that contributed to alignment. Adding languages to the evaluation without adding them to the main training setup produces a less favorable question-answering comparison.

A different starting encoder

The paper also compares with XLMR, which comes from a different multilingual pretraining setup. Its comparison of alignment before and after uses XLMR base, chosen for efficiency and described as close to mBERT in size while having a larger vocabulary and much more pretraining material. The paper gives 2.5TB as the amount of data used for this pretraining. The named comparison is with XLMR.

In that internal evaluation, the XNLI F1 score is 77.5 for XLMR base and 77.6 after applying WordOT. Its XQuAD measures go from 77.0 F1 and 61.4 EM to 76.4 F1 and 60.8 EM after alignment. These results average three runs, and the paper gives 5e − 6 as the learning rate for its XLMR task evaluations. A small upward movement in one metric alongside lower scores on the other task gives no consistent evidence that the extra stage improves this starting point.

This comparison is informative because it asks whether an intervention that helps mBERT also helps an encoder with stronger unadapted scores. The authors suggest that XLMR’s extensive pretraining could leave less for the explicit alignment term to add. The experiment changes the entire starting encoder, including its vocabulary and learned representations, so the results cannot single out pretraining volume as the explanation. The paper treats more extensive alignment data and changes to the objective as possible avenues for further investigation.

The cost of learning the correspondences

For the main alignment setup, with 250K parallel sentences per pair, the paper reports roughly 8 hours for one epoch on a single NVIDIA V100 GPU. L2 takes roughly 6 hours under the same stated settings. The authors describe the extra time as relatively 30%. They also report that on that hardware, fine-tuning takes about 8 hours with batches of 24 and at least 5 days with batches of one. These figures describe alignment training.

The computational difference follows from which candidate links enter each procedure. L2 can work through the word links already supplied. Transport must consider distances across the two sets of eligible occurrences. The authors give the cost of considering those combinations as at least the following order.

O(n ∗ m)

The O notation describes the order of growth in the work as the number of units grows. Here n counts source units, m counts target units, and ∗ is multiplication. This bound concerns the consideration of source–target combinations. It does not specify the full cost of contextual encoding or the number of Sinkhorn iterations. At task evaluation the adapted encoder is already available, so the reported training cost does not become a fresh transport calculation for each entailment decision or answer span.

What the ablations show

Adding languages changes the outcome by task

LargeWordOT extends the alignment setup to the paper’s broader set of 15 languages including English. The additional source sides are Russian, Arabic, Mandarin, Hindi, Thai, Turkish, Urdu, Swahili, and Vietnamese. Each is paired with English. The paper asks whether this broader exposure improves downstream transfer, including for languages that had no parallel examples in the main WordOT setup.

The expansion changes what fits in memory. The authors use batch size 8 and gradient accumulation of 3 for LargeWordOT, compared with batch size 24 and accumulation of 2 for WordOT. They also train the smaller language group with batch size 8 and accumulation of 3, calling it WordOT* in the results. This gives them a comparison between smaller and larger language coverage at the same stated batch settings. Comparing WordOT with WordOT* addresses a different question about changing the batch configuration while keeping the main language group.

On the broader XNLI evaluation, the mBERT baseline averages 67.1 F1 and WordOT averages 67.8. WordOT* averages 67.7, while LargeWordOT reaches 69.7. On the main alignment group, WordOT* records 75.1 and LargeWordOT records 74.8. Enlarging the training group at the smaller batch settings therefore helps the broader average while slightly lowering the average on the original group. The result shows why coverage and the performance of the original group have to be read separately.

Some of the largest changes in the reported XNLI rows are in languages added during expansion. Swahili has 51.0 F1 for mBERT, 48.3 for WordOT*, and 62.2 for LargeWordOT. Turkish has 62.9 for mBERT, 61.3 for WordOT*, and 68.6 for LargeWordOT. Hindi also improves in the expanded setup. The paper discusses these results in relation to limited Wikipedia material for some languages. They provide direct evidence for the tested alignment configurations, while the degree to which pretraining scarcity accounts for the changes remains unresolved.

The broad XQuAD averages tell a different story. LargeWordOT reaches 63.3 F1 and 48.2 EM, compared with 63.0 F1 and 48.0 EM for WordOT*. Internal mBERT remains higher at 64.3 F1 and 49.6 EM. On the main alignment group, LargeWordOT obtains 73.1 F1 and 57.6 EM, while WordOT* obtains 73.8 F1 and 57.9 EM. Individual languages can benefit in this experiment without reversing the average. For example, the expanded setup reaches 59.2 F1 and 44.4 EM for Turkish XQuAD, where mBERT has 54.1 F1 and 39.5 EM.

The authors suggest that differences among languages, including their scripts and word order, may be more consequential when the output is a span of text. This is an interpretation of the different task results. The expanded setup brings more languages into alignment together, so its outcome does not isolate a particular property of any one language. The two measures of XQuAD performance also track answer output, without diagnosing which internal changes to the representations caused that output.

Changing the batch changes more than its size

The comparison between WordOT and WordOT* holds the main training language set fixed. WordOT generally has the better reported averages, including 75.4 against 75.1 F1 on the main XNLI group and 74.7 against 73.8 F1 on the corresponding XQuAD group. The authors suggest that more memory-efficient transport could allow larger batches and potentially improve the expanded setup.

There are two changes in the comparison. The transport problems see batches of different sizes, and the update procedure accumulates gradients for different numbers of steps. A change to the former can affect the examples available together in each calculation. A change to the latter affects when the aggregate gradient is applied. The comparison establishes a difference between the tested settings. It cannot determine which change explains the gap. The paper also reports that smaller batches or overly frequent updates hurt performance slightly in development, and suggests sensitivity to noisy or irregular examples as a possible reason.

Mixing languages inside the transport calculation

The standard setup keeps each non-English language in an independent transport calculation with English. In a separate experiment, the authors draw equally from the training languages but put the resulting examples in the same transport optimization. They describe the remaining parameters and the number of computations used for the loss update as unchanged. This tests where sharing should occur, since the encoder receives a multilingual update in both cases.

The pooled calculation lowers XNLI performance across the reported languages. For German the paper gives a drop of approximately 5.1%, for Spanish 3.8%, for French 5.1%, and for Bulgarian 9.1%. The comparison supports keeping a restricted correspondence problem for each language pair under this batching scheme. The same set of languages can contribute to the encoder after the losses are calculated, without their occurrences having to compete for assignments inside a single problem.

The authors relate the degradation to the difficulty of optimizing across languages with different linguistic properties in a mixed batch. The design supports the observed effect of pooling. It does not establish how much of that effect comes from syntax, from differences in the vectors’ geometry, or from the composition of the candidate set within the transport calculation. What is measured is the downstream XNLI consequence of changing that calculation.

Matching units smaller than words

SubOT uses the same general transport procedure but supplies a vector for each sub-word piece. This comparison is different from substituting a mean of pieces for the final-piece vector in WordOT. SubOT changes the points among which weight can move, so a potential correspondence can involve a part of a word.

On the main XNLI group, SubOT records 75.7 F1 and WordOT records 75.4. The corresponding broad averages are 67.9 for SubOT and 67.8 for WordOT. The paper reports that Greek and German gain 0.65% and 0.47% F1, respectively, in the XNLI comparison with sub-word information. The authors connect these cases to compounding. The unit change applies throughout the corpus, however, so the results do not isolate sentences with compounds or test how much those particular correspondences contribute.

The XQuAD comparison favors word-level alignment on the averages. In the main group, SubOT reaches 74.0 F1 and 58.3 EM, while WordOT reaches 74.7 F1 and 59.0 EM. Across the broader set, SubOT reaches 63.5 F1 and 48.5 EM, compared with 63.8 F1 and 48.8 EM for WordOT. The authors nevertheless report an individual XQuAD gain for Thai with sub-word alignment, giving +2.4% F1 and +1.6% EM. Alongside the averages, that case shows that the task-level direction does not describe every language.

The authors suggest that span prediction may respond differently to the information learned through sub-word comparison. They also raise the possibility that language-specific vocabularies or greater vocabulary capacity could alter the contrast. The tests use the given encoder vocabulary. They measure the effect of choosing its pieces as alignment units, with the downstream tasks already defined. Neither the vocabulary proposal nor the proposed span explanation is tested separately.

Using less parallel data

To vary the amount of parallel material, the authors use LargeWordOT and train with different quantities of pairs. They compare the results with the unadapted mBERT encoder, which receives no parallel data for this alignment stage. The XNLI series below uses the reported main-group average, even though the alignment configuration is the expanded one. This distinction matters because a broader training group does not make every reported average a broad evaluation average.

XNLI main-group F1 by LargeWordOT parallel-data budget

The intermediate budgets exceed unadapted mBERT and approach the highest reported average.

XNLI main-group F1 by LargeWordOT parallel-data budgetInternal mBERT without alignment: 73.5Internal mBERT without alignment73.5LargeWordOT with 1k pairs: 72.7LargeWordOT with 1k pairs72.7LargeWordOT with 10k pairs: 74.1LargeWordOT with 10k pairs74.1LargeWordOT with 50k pairs: 74.4LargeWordOT with 50k pairs74.4LargeWordOT with 250k pairs (this paper): 74.8LargeWordOT with 250k pairs (this paper)74.8
The numbers
System or settingF1
Internal mBERT without alignment73.5
LargeWordOT with 1k pairs72.7
LargeWordOT with 10k pairs74.1
LargeWordOT with 50k pairs74.4
LargeWordOT with 250k pairs (this paper)74.8

Among the tested quantities for XNLI, the smallest yields a lower average than unadapted mBERT. The authors emphasize that the 50k condition is close to the 250k condition. The language results again show different responses to the change in data. Greek XNLI rises from 67.3 F1 at 1k to 69.2 at 50k and 69.8 at 250k. Bulgarian reaches 72.7 at 50k and 72.6 at 250k. The average gives a view of the training budget as a whole, while individual scores show why it does not prescribe one useful quantity for every language.

For XQuAD, using the expanded training configuration, the best reported main-group average in the data-volume series occurs with 1k parallel pairs, at 74.1 F1 and 58.3 EM. The 10k setting reaches 73.4 F1 and 57.8 EM, matching the corresponding mBERT averages. The 50k setting has 73.6 F1 and 57.8 EM, while the 250k setting has 73.1 F1 and 57.6 EM. The authors see no clear degradation as the data are reduced. The result describes this setup, in which the number of examples goes together with the amount of alignment training. It does not identify a general optimum for question answering.

The two series put the low-data conclusion on a specific footing. Entailment retains much of the benefit at a smaller parallel-data budget, and its smallest tested budget averages below the unadapted baseline. Question answering behaves differently and can benefit from the smallest tested budget in this experiment. Both series start with an encoder pretrained across the languages under examination. The varied quantity is the text added for alignment, distinct from the material on which the starting vocabulary and representations depend.

Inspecting the correspondences themselves

The paper inspects alignment examples in German–English and Arabic–English. German compounds make visible a kind of relationship that exclusive word pairing tends to suppress. The method connects Rahmengesetzgebung to the words in framework legislation. One example in the appendix also shows Wechselkursrisiko associated with the English occurrences expressing exchange rate risk. These are concrete cases of a source occurrence distributing correspondence weight across components of its translation.

The Arabic examples illustrate a wider notion of contextual matching. In the phrase the authors discuss for armed intervention, the word corresponding to intervention has a direct link. The other word connects with material in the larger English expression, including the dependent relationship described by the authors. A plan derived from contextual distances may therefore express more than dictionary equivalence. A useful connection for the aggregate objective can concern how words participate together in the sentence.

The same flexibility can yield doubtful assignments. One Arabic occurrence is linked to two instances of hours in English, with the plan failing to respect which clause supplies the appropriate counterpart. Another Arabic form is associated with both facilitate and Facilitating. These examples reveal ambiguity about occurrence identity and grammatical role. The representation can distinguish occurrences in principle, since the vectors come from context. The transport objective itself imposes no clause or dependency constraint that would settle the assignment.

There are also cases where the sentence pair gives the solver poor evidence from the outset. In an appendix example, a short German form of address is paired with an English sentence that continues into material about excluded sectors. The English continuation provides target mass that must be accounted for even though it has no counterpart in the German. The optimization can still return a plan. The plan in such a case reflects both the available vector similarities and the requirement to distribute all the mass. That result explains how corpus defects can affect the learning signal without requiring a programming error in the solver.

Limitations

Limits identified by the authors

The authors identify imperfect parallel data as a direct source of erroneous alignments. The method assumes that comparing two designated sentences furnishes meaningful evidence of correspondence. The appendix shows pairs that plainly violate this assumption as well as pairs with material missing on one side. Uniform weights and balanced transport still require occurrences in these sentences to participate. Even a well-optimized solution can then create links for content that lacks a plausible equivalent.

The other explicit alignment limitation is structural. The solver compares contextual points through their distances without directly representing order or syntactic constraints. Contextual vectors may already encode aspects of structure, which is part of their appeal as inputs. But implicit information can lose out to other forces in the optimization, and there is no condition requiring a source occurrence to align within the corresponding clause. Repeated forms are a case where this gap is visible.

Computation limits the scope of the experiments too. The authors reduce batch size for the expanded configuration because of memory demands and use XLMR base for the experiment that applies transport to XLMR. They say that applying the procedure to the larger version would require further parameter tuning to handle memory. The runtime figures are measurements of particular configurations on the reported hardware. They establish the cost there, while leaving the cost of further changes in encoder size, sentence length, or language coverage open.

The authors propose trying Gromov–Wasserstein variants to account for relationships within embedding spaces when mapping points across them. They also discuss combining transport with further cross-language objectives and testing more languages and tasks. Those directions follow from what the paper observes about geometry, training signal, and coverage. Its experiments do not establish that the proposed variants solve the repeated-word problem or recover gains from XLMR.

Limits visible in the evaluation

The term unsupervised applies here to the word correspondences. The supplied sentence pairing remains cross-language supervision at a coarser scale. Accordingly, the study does not show how the procedure would perform using unrelated monolingual text. Likewise, a target language with no task labels can be well represented in mBERT and can have contributed considerable parallel material. The task protocol measures reuse of English labels under these conditions.

The paper’s low-resource question has a correspondingly narrow definition. It concerns languages covered by mBERT’s vocabulary for which the experiments have limited parallel material. That design permits a useful comparison of alignment budgets with a common starting encoder. It leaves open what can be done for languages inadequately represented by that encoder, including whether their words would be segmented into units suitable for this kind of matching.

The English anchor is another part of the design. Parallel resources and task labels make English a practical reference, and the English vectors have a dedicated preservation term. A different choice of reference would change both the data available and the representation to which that penalty applies. The method can be stated for another language pair, but the experimental results do not establish how the full training and evaluation sequence would behave with a different reference.

The outcome measures cover entailment and answer extraction. They give downstream evidence about cross-language transfer in those settings. They do not measure whether the correspondence plans would improve a translation system, a parser, or a bilingual lexicon. The plan inspection presents examples of useful links and mistakes. It supplies no quantitative evaluation against annotated word alignments, so the prevalence of each kind of behavior is unknown.

This distinction also limits causal interpretations of the downstream gains. WordOT changes the comparison to a soft plan, replaces a fixed alignment source, and uses a divergence as the objective. The contrast with L2 tests the resulting procedures, while the paper does not separately disable each of these differences. Likewise, there is no reported comparison that removes only the English penalty. The measured task gains establish the performance of the complete setup and leave its components’ individual contributions partly unresolved.

How to read small differences and reproduce the comparisons

The internal averages across three seeds reduce dependence on an individual run, but the principal results give no run-to-run dispersion. Small gaps, such as the XNLI result for XLMR base before and after transport, are best read as observed differences in the reported averages. Their stability across runs cannot be assessed from those figures alone. The paper’s stronger claims rest on the direction and pattern of results across several comparisons.

The numbers also come from procedures that differ in how tightly they can be compared. Internal mBERT results give a common starting encoder for the main before-and-after question. Published XLM and AMBER figures describe their own training setups. The internal adapter comparison shares a starting encoder in its mBERT version but uses a distinct training mechanism and, because of software compatibility, different task scripts. These are legitimate comparisons of reported outcomes. They offer less control over the source of a difference than the experiment that adds transport to a given pretrained encoder.

For reconstruction of the training procedure, the transport marginals, ground cost, accumulation scheme, and English penalty give substantial detail. The typography of the transport constraint and the unresolved sign of the divergence in the pair loss still leave an implementation ambiguity. The latter matters because the sign determines what an ordinary minimization step would favor. The prose communicates the intended reduction in discrepancy with a charge for moving English vectors. The equation and that description do not by themselves establish the exact convention used in training.

What came after

A later citing study from 2023 takes optimal transport into cross-language retrieval for low-resource languages, with distillation as the stated learning setting. Retrieval changes the downstream problem from assigning a relationship or extracting a span to finding relevant material across languages. The documented connection establishes that transport is studied in this setting. It does not specify which transport objective the study uses or which parts of WordOT, if any, carry over to the distillation procedure. Cross-lingual Information Retrieval via Optimal Transport Distillation.

Another citing study from 2023 puts the word alignment problem itself in the foreground. Its title identifies unbalanced optimal transport as the approach to unbalanced word alignment. This connects to a restriction visible in WordOT: splitting weight across several links allows flexible correspondences, while fixed marginal totals still require the solver to account for all positively weighted content. The citing work’s title establishes the change in emphasis towards unbalanced alignment. The available description leaves open how it handles unmatched content and whether it examines the specific errors found by Alqahtani and colleagues. Unbalanced Optimal Transport for Unbalanced Word Alignment.

Cite

Cite as Sawsan Alqahtani, Garima Lalwani, Yi Zhang, Salvatore Romeo and Saab Mansour. 2021. Using Optimal Transport as Alignment Objective for fine-tuning Multilingual Contextualized Embeddings. Findings of the Association for Computational Linguistics: EMNLP 2021.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.findings-emnlp.329

@inproceedings{alqahtani2021using,
  title = {{Using Optimal Transport as Alignment Objective for fine-tuning Multilingual Contextualized Embeddings}},
  author = {Sawsan Alqahtani, Garima Lalwani, Yi Zhang, Salvatore Romeo and Saab Mansour},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2021},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.329},
  url = {https://doi.org/10.18653/v1/2021.findings-emnlp.329}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/alqahtani-2021-optimal-transport-as-alignment-objective/