Freezing Subnetworks to Analyze Domain Adaptation in Neural Machine Translation

Brian Thompson, Huda Khayrallah, Antonios Anastasopoulos, Arya McCarthy, Kevin Duh, Rebecca Marvin, Paul McNamee, Jeremy Gwinnup, Tim Anderson, Philipp Koehn · DOI

Abstract: To better understand the effectiveness of continued training, we analyze the major components of a neural machine translation system (the encoder, decoder, and each embedding space) and consider each component's contribution to, and capacity for, domain adaptation. We find that freezing any single component during continued training has minimal impact on performance, and that performance is surprisingly good when a single component is adapted while holding the rest of the model fixed. We also find that continued training does not move the model very far from the out-of-domain model, compared to a sensitivity analysis metric, suggesting that the out-of-domain model can provide a good generic initialization for the new domain.

Introduction

Domain adaptation via "continued training" (fine-tuning) is the standard method for adapting a general-purpose Neural Machine Translation (NMT) model to a specific target domain, such as legal or medical text. While highly effective, the internal mechanics of how different parts of the neural architecture contribute to this adaptation have remained largely unexplored. This research provides a surgical analysis of the NMT "black box" by systematically freezing subnetworks during the fine-tuning process.

Methodology

The researchers decomposed a standard RNN-based NMT system into five functional components:

  1. Source Embeddings: Input word lookup tables.
  2. Encoder: Processes the source sentence.
  3. Decoder: Generates the target sentence, including the attention mechanism.
  4. Softmax: Output embeddings and biases.
  5. Target Embeddings: Output word lookup tables.
Diagram of the NMT architecture decomposed into functional components used for freezing experiments.

Two primary experimental regimes were tested across German–English (De–En), Russian–English (Ru–En), and Korean–English (Ko–En) language pairs:

  • Freeze One: One component is held at its original out-of-domain values while the rest of the model is fine-tuned.
  • Freeze All But One: Only a single component is allowed to adapt to the new domain while the rest of the model remains locked.

Key Insights and Results

Component Redundancy and Robustness

The most striking finding is the model's ability to compensate for frozen components. In the "Freeze One" experiments, freezing any single major component resulted in a performance drop of less than 1.0 BLEU point compared to full fine-tuning. This suggests that NMT models are highly flexible, routing necessary domain information through whatever parameters remain trainable.

BLEU score results for freezing experiments across three language pairs. The solid line represents full fine-tuning; the dashed line represents the out-of-domain baseline.

The Encoder as the Primary Adapter

Despite containing a small fraction of the total parameters (3.7M out of 56M), the encoder proved to be the most effective single component for adaptation. In the De–En task, adapting only the encoder recovered nearly 85% of the BLEU gains seen in full fine-tuning. Conversely, target embeddings were found to be the least critical for domain-specific shifts.

Fine-tuning as a Local Adjustment

By comparing weight changes to sensitivity metrics, the authors found that fine-tuning does not move the model very far from its starting point. The out-of-domain model provides an excellent "generic" initialization that is already close to a good local minimum for the new domain. When a component is adapted in isolation, it "bears the responsibility" for the entire process, showing significantly higher weight movement than during joint training.

Conclusion and Future Work

This study reveals that NMT domain adaptation is remarkably robust to structural constraints. The finding that adapting a single subnetwork—particularly the encoder—can achieve near-optimal performance suggests significant opportunities for parameter-efficient adaptation. Future research should explore if these principles hold for Transformer architectures and how these insights can be leveraged to build more efficient, modular translation systems.

Summary updated

BibTeX
@inproceedings{thompson2018freezing,
  author = {Brian Thompson and Huda Khayrallah and Antonios Anastasopoulos and Arya McCarthy and Kevin Duh and Rebecca Marvin and Paul McNamee and Jeremy Gwinnup and Tim Anderson and Philipp Koehn},
  title = {{Freezing Subnetworks to Analyze Domain Adaptation in Neural Machine Translation}},
  booktitle = {WMT},
  year = {2018},
  doi = {10.18653/v1/w18-6313},
}
Figure