Cross-Lingual Transfer and Alignment › Worked Example: Zero-Shot NLI from English to French

Michael BrenndoerferNovember 26, 20262 min read
Language AI HandbookAll chapters
Part 26 of 67Multilingual Language Models and Cross-Lingual Transfer
Chapter 186Cross-Lingual Transfer and Alignment › Worked Example: Zero-Shot NLI from English to French
Reading section 7 of 11 · Worked Example: Zero-Shot NLI from English to French · 2 minSection 7 of 11 · 2 min

Section 7 of 11 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

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 pp be the premise embedding and hh the hypothesis embedding. Both have dimension dd. Concatenate three blocks to make a 3d3d-dimensional vector:

  • pp carries information about the premise.
  • hh carries information about the hypothesis.
  • ∣p−h∣|p - h| 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 ∣p−h∣|p-h| 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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy