Skip to main content
QUICK REVIEW

[Paper Review] Pervasive Attention: 2D Convolutional Neural Networks for Sequence-to-Sequence Prediction

Maha Elbayad, Laurent Besacier|arXiv (Cornell University)|Aug 11, 2018
Natural Language Processing TechniquesComputer Science43 references53 citations
TL;DR

Proposes a 2D CNN model that jointly encodes source and target sequences with masked convolutions, achieving competitive translation quality to encoder-decoder models with fewer parameters and built-in attention-like behavior across layers.

ABSTRACT

Current state-of-the-art machine translation systems are based on encoder-decoder architectures, that first encode the input sequence, and then generate an output sequence based on the input encoding. Both are interfaced with an attention mechanism that recombines a fixed encoding of the source tokens based on the decoder state. We propose an alternative approach which instead relies on a single 2D convolutional neural network across both sequences. Each layer of our network re-codes source tokens on the basis of the output sequence produced so far. Attention-like properties are therefore pervasive throughout the network. Our model yields excellent results, outperforming state-of-the-art encoder-decoder systems, while being conceptually simpler and having fewer parameters.

Motivation & Objective

  • Motivation to move beyond traditional encoder-decoder architectures with attention for MT.
  • Develop an autoregressive, fully convolutional model that re-encodes the source conditioned on the partial target sequence at every layer.
  • Demonstrate that 2D CNNs with masking can achieve competitive translation quality on IWSLT’14 German–English and English–German tasks.
  • Show that the model implicitly learns alignment through pooling and optionally attention mechanisms, with fewer parameters and parallelizable training.

Proposed method

  • Represent source and target tokens as a joint 2D grid of embeddings, forming a tensor X of shape (|t|, |s|, f0) where f0 = ds + dt.
  • Use DenseNet-style 2D convolutional blocks with masked convolutions to ensure autoregressive factorization across the target sequence.
  • Apply max-pooling over the source dimension at the final block to obtain a per-target-position representation, which is projected to the output vocabulary via a linear layer and softmax.
  • Optionally augment with a self-attention mechanism over the source dimension and/or concatenate with pooled features to improve performance.
  • Train with label-smoothed cross-entropy and Adam; decoding via beam search with length and coverage penalties.
  • Experimentally assess pooling vs. attention variants, embedding sizes, depth, growth rate, and receptive field on IWSLT’14 De-En and En-De tasks.

Experimental results

Research questions

  • RQ1Can a 2D CNN operating on a joint source-target grid, with masked convolutions, serve as a competitive alternative to encoder-decoder MT models with attention?
  • RQ2How do pooling strategies and network depth/width affect translation quality and implicit alignment in a 2D CNN MT model?
  • RQ3What is the impact of embedding size, network depth, and kernel size on BLEU scores for De-En and En-De translations with pervasive attention?
  • RQ4How does the 2D CNN-based approach compare to state-of-the-art recurrent and Transformer models in terms of BLEU, parameters, and computational cost?

Key findings

  • The proposed pervasive attention 2D CNN model achieves competitive BLEU scores on IWSLT’14 German–English and English–German translations, with fewer parameters than several baselines.
  • Max-pooling across the source dimension substantially outperforms average-pooling and self-attention in this setup (roughly +2.3 BLEU over average-pooling).
  • Deeper networks (up to ~24 layers) and reasonable embedding/growth configurations yield substantial improvements in BLEU, highlighting the benefit of deep feature hierarchies with masked 2D convolutions.
  • The model induces implicit sentence alignments analogous to attention maps, visible in qualitative analyses, and can pair well with optional self-attention to yield marginal gains.
  • Compared to RNN-based attention models and ConvS2S, the pervasive attention approach is competitive and, in some configurations, closer in performance to Transformer models while using fewer parameters.
  • The authors provide an open-source PyTorch implementation and demonstrate favorable BLEU results against several baselines on the target dataset.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.