Enforcing Encoder-Decoder Modularity in Sequence-to-Sequence Models

Siddharth Dalmia, Abdelrahman Mohamed, Mike Lewis, Florian Metze, Luke ZettlemoyerarXiv 2019

Introduction

Sequence-to-sequence (seq2seq) models, the backbone of modern speech recognition and translation, typically suffer from a lack of modularity. Because the encoder and decoder are trained jointly, they develop a "tightly coupled" relationship where the encoder produces abstract continuous vectors that only its specific paired decoder can interpret. This paper introduces a method to decouple these components, making them truly independent and interchangeable, similar to modular software components.

Methodology: Creating a Common Language

The core of the proposed approach is the creation of an information bottleneck at the interface between the encoder and decoder. This forces both modules to communicate using a shared, real-world vocabulary.

Discretization via CTC

The encoder is grounded in a discrete vocabulary (such as sub-word units) by applying a Connectionist Temporal Classification (CTC) loss. Instead of abstract vectors, the encoder outputs a probability distribution over these tokens.

Attention Preparation (AttPrep)

To allow the decoder to process these probability distributions, the authors propose two "AttPrep" mechanisms:

  • Weighted Embedding (WEmb): The decoder computes an expected embedding by taking a weighted average of vocabulary embeddings based on the encoder's output probabilities.
  • Beam Convolution (BeamConv): The decoder uses a convolutional layer to aggregate information from the top-k most likely hypotheses and their ranks.

This setup ensures the entire system remains fully differentiable while maintaining a modular interface.

Experimental Results

The researchers evaluated their modular architecture on the Switchboard speech recognition benchmark (300 hours of audio), using the HUB5 Eval2000 set for testing.

Performance Benchmarks

The modular models achieved Word Error Rates (WER) competitive with state-of-the-art non-modular systems. For instance, a modular configuration with 100 CTC units and 2000 CE units achieved a WER of 7.8% on the Switchboard (SWB) subset.

Performance of modular baseline implementations compared to state-of-the-art systems.

The Swap Test: Proving Interchangeability

The defining test for modularity is the "Swap Test." In standard seq2seq models, swapping an encoder from one training run into a decoder from another (even with identical architectures) results in catastrophic failure, with WERs often exceeding 500%.

As shown in the table below, the proposed modular approach (using BeamConv or WEmb) maintains stable performance when encoders and decoders are swapped between different models. This confirms that the modules have learned to communicate via a common, standardized interface.

Interchangeability across different models and architectures. Swapping encoders and decoders between Model 1 and Model 2 results in minimal performance degradation for modular interfaces (BeamConv, WEmb).

Modular Upgrades and Ensembling

Beyond simple swapping, this modularity enables "hot-swapping" components for upgrades. A more powerful encoder can be integrated into an existing system without retraining the decoder. Additionally, the authors demonstrated that "modular ensembling"—mixing and matching components from different training runs—can further drive down error rates.

Conclusion

This research proves that modularity in seq2seq models is achievable without sacrificing performance. By enforcing a discrete interface grounded in a known vocabulary, the authors provide a path toward more interpretable, flexible, and maintainable large-scale machine learning systems. Future work will explore extending these modular benefits to other domains like machine translation and multi-modal tasks.

Summary updated

BibTeX
@misc{dalmia2019enforcing,
  author = {Siddharth Dalmia and Abdelrahman Mohamed and Mike Lewis and Florian Metze and Luke Zettlemoyer},
  title = {{Enforcing Encoder-Decoder Modularity in Sequence-to-Sequence Models}},
  year = {2019},
  eprint = {1911.03782},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03782},
}
Figure