Learning Multilingual Word Representations using a Bag-of-Words Autoencoder

Stanislas Lauly, Alex Boulanger, Hugo LarochellearXiv 2014

Abstract

Recent work on learning multilingual word representations usually relies on the use of word-level alignments (e.g. inferred with the help of GIZA++) between translated sentences, in order to align the word embeddings in different languages. In this workshop paper, we investigate an autoencoder model for learning multilingual word representations that does without such word-level alignments. The autoencoder is trained to reconstruct the bag-of-word representation of a given sentence from an encoded representation extracted from its translation. We evaluate our approach on a multilingual document classification task, where labeled data is available only for one language (e.g. English) while classification must be performed in a different language (e.g. French). In our experiments, we observe that our method compares favorably with a previously proposed method that exploits word-level alignments to learn word representations.

Introduction

In natural language processing (NLP), word embeddings are fundamental for capturing semantic meaning. While learning these for a single language is straightforward, aligning them across multiple languages traditionally requires expensive word-level alignments—knowing exactly which word in an English sentence corresponds to which word in its French translation. This process is computationally expensive and prone to errors.

This paper introduces a Multilingual Bag-of-Words (BoW) Autoencoder that learns aligned word embeddings across different languages without requiring such alignments. By training a model to reconstruct a sentence in one language from its translation in another, the authors create a shared semantic space that outperforms previous methods on cross-lingual document classification tasks.

Methodology

The core of the proposed approach is a Multilingual Bag-of-Words (BoW) Autoencoder consisting of two primary components:

  1. The Encoder: A sentence is represented as the sum of the embeddings of its constituent words. This bag-of-words approach ignores word order but captures the overall semantic content.
  2. The Decoder (Hierarchical Softmax): To handle large vocabularies efficiently, the model uses a probabilistic tree decomposition. Word prediction is treated as a series of binary branching decisions in a tree, reducing complexity from linear to logarithmic relative to vocabulary size.
Architecture of the Multilingual Bag-of-Words Autoencoder with Hierarchical Softmax.

The model is trained on four simultaneous tasks for a pair of translated sentences $(x, y)$:

  • Reconstruction: Predict $x$ from $x$ and $y$ from $y$ (monolingual).
  • Translation-Reconstruction: Predict $y$ from $x$ and $x$ from $y$ (cross-lingual).

By forcing the model to predict the words of a French sentence from the representation of an English sentence, the embeddings for semantically equivalent words are naturally pushed toward the same region in the vector space.

Experimental Setup

The model was trained using the Europarl-v7 dataset, which contains approximately 2 million sentences from European Parliament proceedings, aligned in English/French and English/German pairs. Evaluation was conducted on the Reuters RCV1/RCV2 corpus, a collection of news stories categorized into four top-level hierarchies. The task involved training a classifier on labeled data from one language and testing it on another.

Results and Discussion

The model creates a language-agnostic representation where a classifier trained on English data can be applied directly to French or German data. Quantitatively, the BoW Autoencoder significantly outperformed the baseline by Klementiev et al. (2012), which utilized word-level alignments.

Quantitative error rates on cross-lingual classification and qualitative word translation examples.
Task (Train / Test) Klementiev et al. (Error %) BoW Autoencoder (Error %)
French / English 34.9% 27.7%
English / French 49.2% 32.4%
German / English 42.7% 29.8%
English / German 59.5% 37.7%

Qualitatively, the model successfully mapped synonyms across languages. For example, the nearest neighbor in the English embedding space for the French word "Soleil" was "Sun", and for "Voiture" it was "Car".

Conclusion

While the bag-of-words approach ignores syntax, it proves highly effective for cross-lingual alignment. The model successfully aligns semantic spaces by leveraging the bottleneck of translation-reconstruction. Future work may explore bag-of-ngrams to capture local context or the integration of massive monolingual datasets to further refine the reconstruction tasks.

Summary updated

BibTeX
@misc{lauly2014learning,
  author = {Stanislas Lauly and Alex Boulanger and Hugo Larochelle},
  title = {{Learning Multilingual Word Representations using a Bag-of-Words Autoencoder}},
  year = {2014},
  eprint = {1401.1803},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1401.1803},
}
Figure