Learning Language-Specific Layers for Multilingual Machine Translation

Telmo Pessoa Pires, Robin M. Schmidt, Yi-Hsiu Liao, Stephan PeitzarXiv 2023 · DOI

Introduction

Multilingual Neural Machine Translation (MNMT) has emerged as a powerful paradigm, enabling a single model to translate across dozens of language pairs. This approach is particularly beneficial for low-resource languages, which can leverage knowledge from high-resource counterparts. However, MNMT systems often face a "capacity bottleneck" known as parameter competition. As more languages are added to a single model, they compete for the same fixed set of parameters, which can degrade performance—especially for high-resource languages.

While increasing the total number of parameters (making the model "wider" or "deeper") can alleviate this, it introduces significant drawbacks: higher inference latency, increased computational costs (FLOPs), and difficulty deploying models on resource-constrained edge devices. This research introduces Language-Specific Transformer Layers (LSLs), a method to increase model capacity without increasing the computational cost of a single translation pass.

The LSL Architecture

The core innovation is the replacement of standard shared Transformer layers with LSLs. An LSL contains a "dictionary" of sub-layers. During inference, the model does not activate every sub-layer; instead, it routes the input through a specific sub-layer based on the source or target language.

Key features of this architecture include:

  • Constant Inference Cost: Because only one sub-layer is active at any given time, the number of FLOPs required for a forward pass remains identical to a standard, smaller model.
  • Dense Pre-training: To ensure stable convergence, the LSLs are initialized with weights from a standard, fully-shared model. This "warm-start" significantly improves final translation accuracy compared to training from scratch.
  • Routing Logic: Sentences are routed through the encoder based on linguistic metadata, allowing the model to specialize its internal representations for specific language families or directions.

Neural Architecture Search (NAS)

Determining which layers should be shared and which should be language-specific is a complex combinatorial problem. To solve this, the researchers employed a Neural Architecture Search (NAS) strategy. They trained a "super-net" where every layer was a weighted mixture of shared, source-specific, and target-specific components. After training, the model was pruned to keep only the most critical component for each layer, resulting in a specialized, high-performance architecture.

The "Sandwich" Pattern

The NAS process revealed a consistent structural preference that the researchers termed a "sandwich" architecture:

  1. Bottom Layers: The model preferred source-specific layers at the beginning of the encoder to capture unique features of the input language.
  2. Middle Layers: The model utilized shared layers in the center to handle language-agnostic semantic mapping.
  3. Top Layers: The model opted for target-specific layers at the end of the encoder to prepare the representation for the decoder.

Experimental Results

The researchers evaluated the LSL approach using the Flores-101 dataset, covering a diverse set of 10 languages including German, English, Spanish, French, Italian, Japanese, Korean, Portuguese, Swahili, and Chinese.

Quality and Efficiency

The LSL-NAS architecture demonstrated substantial gains over standard baselines:

  • Translation Quality: It achieved an improvement of up to 2.2 spBLEU (1.9 chrF) over a standard shared-decoder architecture.
  • Zero-Shot Performance: The model showed significant improvements in translating language pairs it had never seen together during training (e.g., Swahili to French).
  • Efficiency: The LSL model (with 804M total parameters) outperformed a standard dense model that had 15% more parameters and a higher inference cost. Essentially, it provided the "intelligence" of a large model with the "speed" of a base model (186M parameters active during inference).

Limitations and Future Directions

While LSLs represent a significant step forward, the study identified several areas for future exploration. The current focus was primarily on the encoder; initial tests adding LSLs to the decoder did not yield the same level of improvement, suggesting the decoder may require a different sharing strategy. Additionally, while the model scales well to 10 languages, further research is needed to see how this routing logic handles "massively" multilingual contexts (100+ languages) where the total storage size of the parameters might become a bottleneck. Finally, the researchers suggested that moving from static, sentence-level routing to more granular word-level routing could further enhance performance, albeit with added training complexity.

Summary updated

BibTeX
@misc{pires2023learning,
  author = {Telmo Pessoa Pires and Robin M. Schmidt and Yi-Hsiu Liao and Stephan Peitz},
  title = {{Learning Language-Specific Layers for Multilingual Machine Translation}},
  year = {2023},
  eprint = {2305.02665},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.02665},
}
Figure