Bitext Mining for Low-Resource Languages via Contrastive Learning

Weiting Tan, Philipp KoehnarXiv 2022

Abstract

Mining high-quality bitexts for low-resource languages is a critical bottleneck in developing effective machine translation systems. This paper demonstrates that sentence representations from language models fine-tuned with Multiple Negatives Ranking (MNR) loss—a contrastive learning objective—significantly improve the retrieval of clean parallel data. By incorporating "hard negatives" from document neighbors during training, the proposed approach effectively mitigates common issues like "hubness." Experimental results on Khmer (km) and Pashto (ps) show that parallel data mined using this method leads to NMT models that substantially outperform previous state-of-the-art systems, including those based on LASER and the top-performing entries in the WMT 2020 shared task.

Introduction

Modern Neural Machine Translation (NMT) requires vast amounts of parallel data. While high-resource languages benefit from abundant digital translations, low-resource languages like Khmer and Pashto rely on noisy web-mined data. Projects like ParaCrawl attempt to bridge this gap by crawling the web and aligning documents, but the resulting sentence pairs are often misaligned or topically related but not translations. Existing tools often suffer from "hubness," where a single sentence vector appears similar to many others, leading to poor filtering and reduced translation quality.

Methodology

The authors propose a refined sentence scoring function for the bitext mining pipeline. The core of the approach is fine-tuning a Sentence-BERT (SBERT) model using Multiple Negatives Ranking (MNR) loss. To increase the model's discriminative power, they employ a "smart negative sampling" strategy. For each positive sentence pair $(s_i, t_i)$, "hard negatives" are selected from sentences that appear in the same document as the target sentence. This forces the model to distinguish between a true translation and a neighboring sentence that might share context or keywords but lacks semantic equivalence. The final pipeline utilizes Vecalign for initial alignment and a margin-based scoring function to filter the candidates, effectively addressing the hubness problem.

Visualizing the Alignment Precision

The impact of this fine-tuning is most evident when visualizing similarity matrices.

Heatmap comparison showing the improved precision of SBERT embeddings (right) over LASER (left).

As shown in the comparison above, traditional multilingual embeddings like LASER can become "confused," assigning high similarity scores to unrelated terms such as "Archive" and "Regulation." In contrast, the contrastively fine-tuned SBERT model produces a sharp diagonal, indicating a much higher precision in identifying true translations.

Key Results

The effectiveness of the mined data was evaluated by training NMT models and measuring their performance using BLEU scores. The results consistently outperformed established benchmarks across different data scales.

BLEU score comparison for Pashto (ps) and Khmer (km) across various token sizes, comparing SBERT Align to LASER and WMT20 benchmarks.

As illustrated in the charts, the SBERT-based approach achieved BLEU scores of 10.43 for Pashto and 11.83 for Khmer, representing a gain of approximately 1 BLEU point over the winning systems from the WMT 2020 competition. Furthermore, when compared directly to LASER-based alignment and filtering, the proposed method yielded an improvement of roughly +2 BLEU points in specific configurations, a significant margin in machine translation research.

Conclusion

This work highlights the power of contrastive learning for bitext mining in low-resource settings. By specifically training models to distinguish translations from their document-level neighbors, researchers can extract higher-quality training data from noisy web crawls. Future work includes scaling this approach to a broader range of language pairs and improving the initial quality of document-aligned corpora.

Summary updated

BibTeX
@misc{tan2022bitext,
  author = {Weiting Tan and Philipp Koehn},
  title = {{Bitext Mining for Low-Resource Languages via Contrastive Learning}},
  year = {2022},
  eprint = {2208.11194},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.11194},
}
Figure