Conference Paper
Machine Learning

UniLMv2

Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, H. Hon
February 1, 2020International Conference on Machine Learning429 citations

429

Citations

40

Influential Citations

International Conference on Machine Learning

Venue

2020

Year

Abstract

Utilizes a pseudo-masked language model (PMLM) for both autoencoding and partially autoregressive language modeling tasks,significantly advancing the capabilities of language models in diverse NLP tasks.

Analysis

Why This Paper Matters

UniLMv2 addresses a fundamental challenge in language model pre-training: how to combine the bidirectional context understanding of models like BERT with the sequential generation capability of autoregressive models like GPT. Previous attempts either required separate models or complex multi-stage training. By introducing Pseudo-Masked Language Modeling (PMLM), the authors create a single framework that learns both inter-token relations (via autoencoding) and intra-span dependencies (via partially autoregressive modeling). This unified approach leads to significant gains across a wide range of NLP benchmarks, making it a practical solution for practitioners who need a single model for both understanding and generation tasks.

How It Works

Figure 1

The core innovation is PMLM, which replaces traditional mask tokens with pseudo masks. In standard masked language models, tokens are replaced with a special [MASK] token, which creates a mismatch between pre-training and fine-tuning. PMLM keeps the original tokens unchanged and instead adds a pseudo token [P] at the same position. This pseudo token has the same position embedding as the original token, allowing the model to learn from the actual token while still predicting it.

Overview of PMLM pre-training. The model parameters are shared across the LM objectives.

The training process jointly optimizes two objectives on the same input sequence. The autoencoding objective (similar to BERT) predicts masked tokens using all other tokens as context. The partially autoregressive objective introduces a factorization order that determines which tokens to predict at each step. This order can predict single tokens or continuous spans, controlled by a blockwise masking policy that masks 15% of tokens, with 40% of those being spans and 60% single tokens.

Figure 3

To prevent information leakage, self-attention masks are carefully designed. For the autoencoding objective, all tokens can attend to each other. For the partially autoregressive objective, the mask ensures that each token can only attend to previous tokens in the factorization order and to all source tokens (in sequence-to-sequence settings). This prevents both explicit and implicit leakage of future token information.

Results

Results of BASE-size pre-trained models on the SQuAD v1.1/v2.0 development sets.

On question answering, UniLMv2 BASE achieves higher F1 and Exact Match scores than BERT, RoBERTa, and XLNet on both SQuAD v1.1 and v2.0. The gains are particularly notable on v2.0, which includes unanswerable questions.

Results of BASE-size models on the development set of the GLUE benchmark.

On the GLUE benchmark, UniLMv2 BASE outperforms RoBERTa BASE on 6 of 8 tasks, with an average improvement of 0.8 points. For example, on MNLI it achieves 88.4 accuracy versus RoBERTa's 87.6.

Abstractive summarization results on CNN/DailyMail and XSum.

For abstractive summarization, UniLMv2 BASE surpasses other BASE-sized models on both CNN/DailyMail and XSum datasets, despite having fewer parameters than some competitors. This demonstrates the effectiveness of the partially autoregressive objective for generation tasks.

Results on question generation.

On question generation, UniLMv2 BASE outperforms even the larger UniLM LARGE model and several specialized baselines that incorporate additional features or techniques.

Significance

UniLMv2's unified pre-training approach offers a practical advantage: a single model can handle both understanding tasks (like classification and QA) and generation tasks (like summarization and question generation) without needing separate architectures. The PMLM technique elegantly avoids the pre-training/fine-tuning mismatch of traditional masked language models while enabling flexible control over context. This work has influenced subsequent unified language models and demonstrates that combining autoencoding and autoregressive objectives is a fruitful direction for future research. For AI practitioners, UniLMv2 provides a strong baseline that can be fine-tuned for a wide variety of applications with minimal task-specific engineering.