A Convolutional Encoder Model for Neural Machine Translation

Jonas Gehring, Michael Auli, David Grangier, Yann Dauphin · DOI

TL;DR

This paper introduces a novel convolutional neural network (CNN) based encoder for neural machine translation (NMT) that offers significant speedups over traditional recurrent neural network (RNN) based encoders. By leveraging parallelizable convolutional operations, their architecture achieves competitive translation accuracy while being more than twice as fast for decoding.

What Problem Does This Paper Address?

Neural machine translation (NMT) has seen great success with the encoder-decoder architecture, typically using bidirectional Long Short-Term Memory (LSTM) networks as the encoder. While effective, LSTMs process sequences serially, creating a bottleneck for parallel computation and thus limiting decoding speed. This paper addresses this limitation by proposing a convolutional encoder that can process the entire source sentence simultaneously, leading to faster computation and potentially improved translation quality.

Methods

The core of the proposed method is a convolutional encoder architecture. Instead of relying on recurrent connections, the model uses stacked convolutional layers to process the source sentence. Key aspects of their approach include:

  • Simultaneous Encoding: Convolutional layers operate on fixed-size windows, allowing for parallel computation across the entire input sequence, unlike the sequential nature of RNNs.
  • Position Embeddings: To compensate for the loss of inherent sequential information in CNNs, position embeddings are added to word embeddings to inform the model about word order.
  • Two CNN Stacks (CNN-a and CNN-c): The architecture employs two distinct CNN stacks. CNN-a is used to compute attention scores, and CNN-c is used to generate the conditional input for the decoder. This separation allows for different architectural choices (e.g., depth) for each task, as attention requires a broad context while conditional input benefits from a more local representation.
  • Residual Connections: To enable the training of deep convolutional networks, residual connections are incorporated, allowing gradients to flow more easily through the layers.
  • Soft Attention: The decoder uses a soft attention mechanism, similar to existing NMT models, to weigh the importance of different parts of the encoded source sentence.

Datasets

The authors evaluated their models on several standard NMT benchmarks:

  • IWSLT'14 German-English: Used for ablation studies and hyperparameter tuning due to its smaller size and faster experimental turnaround.
  • WMT'16 English-Romanian: Used for evaluating competitive accuracy against state-of-the-art systems.
  • WMT'15 English-German: Used for performance comparison.
  • WMT'14 English-French: Used to compare against a very deep LSTM setup.

Key Insights and Ideas

  • Parallelism is Key for Speed: The fundamental insight is that replacing the inherently sequential RNN encoder with a parallelizable CNN encoder can drastically improve decoding speed without sacrificing translation quality.
  • CNNs Can Be Competitive: Contrary to previous attempts, this work demonstrates that CNN-based encoders can achieve competitive, and in some cases superior, performance to state-of-the-art bi-directional LSTMs.
  • Depth and Structure Matter: The effectiveness of the convolutional encoder is highly dependent on its depth and the specific configuration of the CNN layers (e.g., the number of layers in CNN-a vs. CNN-c). Deep architectures with residual connections are crucial for achieving high accuracy.
  • Position Embeddings are Essential: For convolutional encoders, explicit position embeddings are vital for capturing word order information, which is naturally handled by RNNs.
  • Separate CNNs for Attention and Context: Using distinct CNNs for attention score computation (CNN-a) and conditional input generation (CNN-c) proves more effective than using a single CNN for both tasks.

Key Results

  • Competitive Accuracy: The convolutional encoder achieved competitive accuracy on WMT'16 English-Romanian and outperformed several published results on WMT'15 English-German. It also closely matched the performance of a very deep LSTM on WMT'14 English-French.
  • Significant Speedup: The convolutional encoder sped up CPU decoding by more than two times compared to a strong bi-directional LSTM baseline, while maintaining similar or higher accuracy.
  • IWSLT'14 Performance: On the IWSLT'14 German-English task, a deep convolutional encoder (6/3 layers) outperformed a bi-directional LSTM by 0.7 BLEU.
  • Attention Visualization: Attention scores from CNN encoders were observed to be less sharp than those from BiLSTMs but still indicated approximate source alignments.

Limitations and Future Work

  • Training Speed: While decoding is faster, the authors note that SGD training for convolutional models can be slower than Adam training for LSTMs, though this is a training optimization issue rather than an architectural limitation.
  • Character-Level Translation: The authors suggest that the convolutional architecture's ability to process long sequences in parallel could be particularly beneficial for character-level NMT, where input sequences are much longer.
  • Other Sequence-to-Sequence Tasks: They propose exploring the effectiveness of their architecture on other tasks like summarization, constituency parsing, and dialog modeling.
  • Further Training Optimization: Future work could focus on better training strategies to accelerate convergence for convolutional encoders.

Summary updated

BibTeX
@inproceedings{gehring2017convolutional,
  author = {Jonas Gehring and Michael Auli and David Grangier and Yann Dauphin},
  title = {{A Convolutional Encoder Model for Neural Machine Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2017},
  doi = {10.18653/v1/p17-1012},
}
Figure