Cross-Lingual Transfer and Alignment › Worked Example: Zero-Shot NLI from English to French
Language AI HandbookAll chapters Suppose you have English natural language inference (NLI) labels and want to classify French and German sentence pairs. Given a premise, predict whether it entails or contradicts the hypothesis or leaves it undecided. Train on English MultiNLI and evaluate the English, French, and German versions of the XNLI test split. For XNLI, the authors selected new English premises from the MultiNLI sources, collected new hypotheses using the MultiNLI procedure, and translated the resulting evaluation pairs. Use English development data for model selection to keep task supervision English-only. XNLI, §3.1
With a frozen multilingual sentence encoder, let be the premise embedding and the hypothesis embedding. Both have dimension . Concatenate three blocks to make a -dimensional vector:
- carries information about the premise.
- carries information about the hypothesis.
- records an absolute difference at each embedding coordinate.
Fit a logistic regression classifier to English vectors and keep both the encoder and classifier fixed for all three evaluations. An aligned encoder can put the same cue in a consistent coordinate across languages. That gives the classifier a chance to reuse the feature that helped in English. The source and target test accuracies tell you how well it transferred. The English accuracy is also a check on the task head, since a head that performs poorly even on English gives little basis for diagnosing a transfer gap.
The absolute-difference block is unchanged when the premise and hypothesis are swapped. The ordered raw blocks let the head distinguish those inputs. Neither block construction guarantees that the head can recover the relation from an arbitrary encoder. Check the result on the held-out pairs.
The generated example uses a small lexicon to assign the same coordinates across languages. The paired French test measures what happens when the encoder masks negation before normalization. The prescribed coordinates make this intervention easy to inspect.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!