Vecalign: Improved Sentence Alignment in Linear Time and Space

Brian Thompson, Philipp KoehnEMNLP 2019

Abstract

Sentence alignment, the task of matching translated sentences across languages, is fundamental to training machine translation (MT) systems. Traditional alignment methods often rely on simple heuristics or computationally expensive quadratic algorithms, limiting their utility for large-scale or low-resource datasets. This paper introduces Vecalign, a novel approach that combines multilingual sentence embeddings with a recursive dynamic programming approximation. Vecalign achieves state-of-the-art accuracy while maintaining linear time and space complexity ($O(N)$). Our evaluations demonstrate significant improvements in alignment F1 scores and downstream MT performance, particularly for low-resource language pairs.

Introduction

The development of high-quality Machine Translation (MT) systems requires "bitext"—large corpora of paired sentences. However, raw data typically exists as parallel documents where sentences may be split differently, omitted, or reordered. Sentence alignment is the process of recovering these pairings.

Sentence alignment challenges including many-to-one mappings.

Traditional methods like Hunalign or Gale-Church primarily use sentence length heuristics. While efficient, they lack semantic depth. More recent state-of-the-art (SOTA) methods often require an existing MT system to perform alignment, creating a "chicken and egg" problem for low-resource languages. Furthermore, many existing algorithms have $O(N^2)$ complexity, making them impractical for modern web-scale datasets.

Methodology

Vecalign addresses these challenges through two primary innovations: embedding-based scoring and a recursive dynamic programming (DP) approximation.

1. Embedding-Based Scoring

Vecalign utilizes multilingual sentence embeddings (specifically LASER) to map sentences into a shared vector space. Similarity is calculated based on the distance between these vectors. To mitigate "hubness"—a common problem where certain vectors appear close to many others—the system employs a normalization technique using randomly sampled sentences.

2. Recursive DP Approximation

To achieve linear complexity, Vecalign employs a "coarse-to-fine" strategy. It recursively reduces document resolution by averaging adjacent sentence embeddings to create "blocks."

The recursive coarse-to-fine alignment strategy.

The algorithm aligns these blocks at the lowest resolution, projects the resulting path to a higher resolution, and constrains the subsequent search to a narrow window around that path. This process continues until individual sentence alignment is reached, ensuring the computational cost scales linearly with document length.

Evaluation and Results

Vecalign was evaluated across several diverse benchmarks:

  • Text+Berg: On this German-French corpus, Vecalign outperformed the previous SOTA by 5 F1 points.
  • The Bible: Across 10 language pairs, Vecalign improved F1 scores by an average of 28 points over Hunalign, showing particular strength in low-resource scenarios like Somali and Tagalog.
  • Paracrawl: On noisy web data, using Vecalign-aligned text improved downstream NMT performance by 1.7 BLEU for Sinhala→English and 1.6 BLEU for Nepali→English.

In terms of efficiency, the algorithm scales linearly. It can align documents with 32,000 sentences in approximately 30 seconds on standard hardware, a feat impossible for quadratic algorithms.

Discussion and Conclusion

A key insight of Vecalign is that sentence embeddings are additive; blocks of sentences can be represented effectively by the average of their individual embeddings. This allows the recursive algorithm to maintain semantic meaning even at very low resolutions. By leveraging these properties, Vecalign breaks the dependency on pre-existing MT systems, facilitating the growth of translation technology for low-resource languages.

While performance is dependent on the quality of the underlying embedding model and assumes a generally monotonic sentence order, Vecalign provides a fast, accurate, and scalable solution for modern machine translation needs.

Summary updated

BibTeX
@inproceedings{thompson2019vecalign,
  author = {Brian Thompson and Philipp Koehn},
  title = {{Vecalign: Improved Sentence Alignment in Linear Time and Space}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1136},
}
Figure