Learning Joint Multilingual Sentence Representations with Neural Machine Translation

Holger Schwenk, Matthijs Douze

Abstract

Researchers from Facebook AI Research (FAIR) demonstrate that Neural Machine Translation (NMT) can be used to create a "continuous space interlingua"—a single, fixed-size vector space where sentences with the same meaning have nearly identical representations, regardless of the language they are written in. By training a system with multiple encoders and decoders, they achieved a cross-lingual similarity search error rate of just 1.2% across six diverse languages.

Introduction: The Quest for a Universal Interlingua

While word embeddings like Word2Vec are standard in NLP, representing entire sentences remains a significant challenge. Most existing methods create embeddings optimized for a single language. However, tasks like multilingual search or cross-lingual document classification require a "universal" representation where the vector for "The cat sits on the mat" is nearly identical to the vector for "Le chat est sur le tapis."

Conceptual overview of a universal sentence representation mapping multiple languages and modalities into a shared vector space.

The core challenge is creating a fixed-size representation that captures underlying semantics while remaining independent of a language's specific syntax or grammar. While modern NMT systems often use attention mechanisms to improve translation, these mechanisms prevent the formation of a standalone sentence vector because they require the decoder to reference the entire source sequence. This research explores building high-quality multilingual embeddings by intentionally avoiding attention to create a bottleneck representation.

Methodology

The authors employ a multi-encoder, multi-decoder NMT framework where each language has its own dedicated encoder and decoder, all feeding into a shared "universal sentence representation" layer.

Architectural Constraints and Pooling

To ensure the sentence representation is a fixed-size vector—essential for efficient similarity search—the authors omit the standard attention mechanism. They compared two primary pooling strategies:

  1. Last Hidden State: Using the final state of a stacked LSTM.
  2. Max-Pooling over BLSTM: Using a Bidirectional LSTM (BLSTM) followed by max-pooling across all time steps. This strategy effectively "picks out" the most salient features of the sentence.

Training Strategies

The research evaluates several training configurations to determine which best regularizes the shared space:

  • One-to-One (1:1): Standard translation from one source to one target.
  • One-to-Many (1:N): Translating one source into multiple target languages simultaneously.
  • Many-to-One (M:1): Training multiple source languages to reach a single target.
Comparison of different training strategies: one-to-one, two-to-one, three-to-one, and one-to-many.

Experimental Setup

The models were trained and evaluated on two major datasets:

  • UN Parallel Corpus: Approximately 11 million sentences across English (En), French (Fr), Spanish (Es), Russian (Ru), Arabic (Ar), and Chinese (Zh).
  • Europarl: Used for "out-of-domain" evaluation, featuring 1.5 million sentences in English, French, and Spanish.

Key Insights

  • Max-Pooling Superiority: Max-pooling over BLSTM states significantly outperformed using the final LSTM state, as it captures the semantic "gist" more effectively for cross-lingual tasks.
  • The 1:N Advantage: Training a single encoder to satisfy multiple decoders (1:N) produced the most robust embeddings. This forces the encoder to strip away language-specific syntax in favor of a language-agnostic semantic core.
  • Semantic Clustering: The embeddings successfully grouped sentences by meaning even across vastly different grammatical structures.
  • Scalability and Diversity: The system remained stable as more languages were added. Even Chinese, with its distinct morphology, achieved error rates below 1.7% in similarity searches.

Results and Performance

On the UN Dev set, the BLSTM + max-pooling model achieved an average similarity error rate of 1.2% across 21 language pairs. In a similarity search task, the model could identify the exact translation of a source sentence among thousands of candidates with 98.8% accuracy. On the larger Europarl corpus, the error rate was 7.7%, demonstrating strong performance at scale.

Limitations and Future Outlook

The primary limitation of this approach is the "information bottleneck." Fixed-size representations without attention struggle with very long sentences (typically 50+ words). Additionally, because the model is optimized for representation quality rather than generation, its BLEU scores for translation are lower than state-of-the-art systems that utilize attention. Future work may involve more sophisticated ways of combining source languages in M:1 strategies beyond simple averaging.

Summary updated

BibTeX
@inproceedings{schwenk2017learning,
  author = {Holger Schwenk and Matthijs Douze},
  title = {{Learning Joint Multilingual Sentence Representations with Neural Machine Translation}},
  booktitle = {Rep4NLP @ ACL},
  year = {2017},
  doi = {10.18653/v1/w17-2619},
}
Figure