MASS: Masked Sequence to Sequence Pre-training for Language Generation

Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, Tie-Yan Liu

TL;DR

MASS (MAsked Sequence to Sequence) is a pre-training framework designed specifically for encoder-decoder models used in language generation. By masking a continuous fragment of a sentence in the encoder and forcing the decoder to reconstruct only that fragment, MASS jointly trains the encoder and decoder to excel at tasks like translation, summarization, and conversational response generation.

What Problem Does This Paper Address?

In recent years, pre-training has revolutionized Natural Language Processing (NLP). However, a dichotomy emerged in the architectures used: BERT (an encoder-only model) excelled at language understanding tasks like sentiment analysis, while GPT (a decoder-only model) excelled at language generation.

Most sequence-to-sequence (seq2seq) tasks—such as Neural Machine Translation (NMT) or text summarization—rely on an encoder-decoder architecture. Directly applying BERT-like pre-training to these tasks is suboptimal because BERT only trains an encoder. Previous attempts to bridge this gap often involved pre-training the encoder and decoder separately or using simple denoising auto-encoders. These methods frequently failed to teach the encoder and decoder how to work together effectively, often leading to a decoder that simply ignores the encoder's input.

Methods

The authors propose MASS, which generalizes the masking logic of BERT to the seq2seq framework.

The MASS framework: masking a continuous fragment in the encoder and predicting it in the decoder.
  1. The Objective: Given an unlabeled sentence, a fragment of $k$ consecutive tokens is masked.
  2. The Encoder: Takes the sentence with the masked fragment as input. Its job is to build a representation of the surrounding context.
  3. The Decoder: Takes the encoder's output and attempts to predict the missing $k$ tokens. Crucially, the decoder's input tokens that are not part of the masked fragment are also masked.

Why is this clever? * Forces Encoder Understanding: To help the decoder, the encoder must extract high-level meaning from the unmasked tokens. * Forces Decoder Modeling: The decoder must learn to generate coherent text (language modeling). * Forces Joint Coordination: By masking the "known" parts of the sentence in the decoder, the model is forced to rely on the encoder's representations to fill in the blanks, rather than just looking at the previous tokens in the decoder's own stream.

The paper notes that MASS is a general framework: if $k=1$, it functions similarly to BERT; if $k$ equals the sentence length, it functions like GPT.

Datasets

  • Pre-training: Monolingual data from WMT News Crawl (190M English, 62M French, 270M German sentences).
  • Fine-tuning/Evaluation:
  • NMT: WMT14 (English-French), WMT16 (English-German, English-Romanian).
  • Text Summarization: Gigaword corpus (3.8M article-title pairs).
  • Conversational Response: Cornell Movie Dialog corpus (140K conversation pairs).

Key Insights and Ideas

  • The "Sweet Spot" for $k$: The authors found that masking roughly 50% of the sentence length ($k \approx m/2$) yields the best performance. This provides enough context for the encoder to be useful while giving the decoder a challenging enough generation task.
  • Unification: MASS provides a theoretical bridge between BERT and GPT, showing they are special cases of a broader seq2seq pre-training objective.
  • Breaking the "Copy" Habit: In standard denoising auto-encoders, decoders often learn to simply copy unmasked tokens from the encoder. MASS prevents this by masking those tokens in the decoder, forcing it to actually "understand" the encoder's latent representation.

Key Results

MASS achieved significant improvements across multiple generation tasks, particularly in low-resource and unsupervised settings:

BLEU scores comparing Baseline and MASS across different low-resource settings.
  • Low-Resource NMT: As shown in the charts above, MASS dramatically outperforms baselines when fine-tuned on small amounts of parallel data (e.g., 10K or 100K sentence pairs) across various language pairs.
  • Unsupervised NMT: On English-French translation, MASS achieved a 37.5 BLEU score, outperforming the previous state-of-the-art (XLM) by over 4 points and even beating some early supervised models.
  • Text Summarization: In low-resource settings (using only 10K training pairs), MASS outperformed baselines by over 10 ROUGE points, demonstrating incredible sample efficiency.
  • Conversational Response: MASS achieved significantly lower perplexity (PPL) compared to baselines, leading to more fluent and relevant responses.

Limitations and Future Work

While the paper demonstrates the empirical power of MASS, the authors suggest several areas for further exploration:

  • Broader Task Application: Testing MASS on other generation tasks like sentence paraphrasing and text style transfer.
  • Theoretical Depth: Further empirical and theoretical analysis is needed to fully understand why the specific masking of consecutive fragments (rather than random discrete tokens) is so effective for seq2seq coordination.
  • Computational Cost: Like all large-scale pre-training, MASS requires significant compute (the paper used 8 NVIDIA V100 GPUs), which may be a barrier for smaller research teams.

Summary updated

BibTeX
@inproceedings{song2019mass,
  author = {Kaitao Song and Xu Tan and Tao Qin and Jianfeng Lu and Tie-Yan Liu},
  title = {{MASS: Masked Sequence to Sequence Pre-training for Language Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=H1EkFhZd-H},
}
Figure