Adaptive Sparse Transformer for Multilingual Translation

Hongyu Gong, Xian Li, Dmitriy GenzelarXiv 2021

Introduction

Multilingual Neural Machine Translation (MNMT) aims to create a single model capable of translating between many language pairs. This approach facilitates "positive transfer," where high-resource languages improve the translation quality of low-resource ones. However, MNMT is frequently hindered by the "curse of multilinguality": as more languages are added, they compete for the model's fixed capacity, leading to "negative interference." While scaling models to be deeper or wider can mitigate this, it often results in prohibitive inference costs. Researchers at Meta AI have developed the Adaptive Sparse Transformer to solve this trade-off by learning to activate language-specific sub-networks.

The Adaptive Sparse Approach

The Adaptive Sparse Transformer treats the architecture as a collection of modular components, learning an adaptive sub-network for each language pair. Unlike standard models where every parameter is used for every input, this approach activates only the necessary components, effectively increasing capacity without increasing the computational tax during inference.

Multi-Level Sparsity

The model implements sparsity at three distinct levels:

  1. Attention Heads: Specific heads can be bypassed or activated.
  2. Feed-Forward Network (FFN) Blocks: The model can skip specific blocks within the FFN.
  3. Transformer Layers: Entire layers can be deactivated based on the language pair.
The Adaptive Sparse Transformer architecture, illustrating how specific sub-components like attention heads and FFN blocks are selectively activated within the encoder and decoder layers.

To make these discrete choices differentiable during training, the authors employ the Gumbel-Softmax trick. The training objective is guided by a three-pronged loss function: a Sparsity Loss to minimize parameter usage, a Disparity Loss to ensure different languages utilize distinct parameters (reducing interference), and a Top-k Loss to enforce a strict inference budget.

Experimental Evaluation

The model was evaluated on two primary benchmarks: Public-24 (24 languages, medium scale) and OPUS-100 (100 languages, large scale). These datasets allowed for testing One-to-Many (O2M), Many-to-One (M2O), and Many-to-Many (M2M) translation, as well as zero-shot capabilities.

Results and Discussion

The Adaptive Sparse Transformer demonstrates significant performance gains over standard Transformers and popular "Adapter" baselines. On the massive OPUS-100 dataset, the model achieved a +2.1 BLEU improvement in O2M and a +1.3 BLEU improvement in M2O tasks.

Performance comparison on the OPUS-100 dataset. The sparse model significantly outperforms the baseline Transformer across all metrics, with a particularly dramatic gain in zero-shot translation.

The most remarkable result was observed in zero-shot translation, where the model achieved a +6.2 BLEU boost (8.9 vs 2.7). By reducing interference in the shared parameter space, the model maintains a cleaner internal representation that generalizes more effectively to unseen language pairs.

Crucially, these gains do not come at the cost of speed. As shown in the experimental results, the decoding speed (tokens per second) remains comparable to or better than the baseline Transformer, because the active sub-network size is constrained to match the original model's dimensions.

Conclusion

The Adaptive Sparse Transformer provides a scalable solution to the curse of multilinguality. By learning language-specific pathways through a shared architecture, it achieves superior translation quality—especially in zero-shot scenarios—while maintaining high inference efficiency. While the total parameter count (the sum of all sub-networks) is higher, requiring more storage and VRAM, the computational efficiency during execution makes it a viable candidate for large-scale multilingual deployment.

Summary updated

BibTeX
@misc{gong2021adaptive,
  author = {Hongyu Gong and Xian Li and Dmitriy Genzel},
  title = {{Adaptive Sparse Transformer for Multilingual Translation}},
  year = {2021},
  eprint = {2104.07358},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.07358},
}
Figure