XLNet: Breaking BERT's Pre-training Limitations via Permutation Language Modeling
Long-term reading · 《XLNet: Generalized Autoregressive Pretraining for Language Understanding》(2019)
In the field of natural language processing, unsupervised pre-training is key to improving downstream task performance. For a long time, autoregressive (AR) language models and denoising autoencoder-based models (such as BERT) have been the two most successful approaches. However, each has distinct limitations. Traditional AR models can only encode context unidirectionally, making it difficult to capture deep bidirectional information; while BERT leverages bidirectional context, its reliance on mask tokens leads to a data distribution inconsistency between the pre-training and fine-tuning stages (the "pre-training/fine-tuning discrepancy"), and it assumes that predicted words are independent of one another, ignoring the long-range dependencies prevalent in natural language.
To address these pain points, the Carnegie Mellon University and Google AI teams proposed XLNet. This is a generalized autoregressive pre-training method designed to combine the strengths of AR models and BERT while avoiding their defects. XLNet's core innovation lies in "permutation language modeling." Unlike traditional AR models with fixed forward or backward decomposition orders, XLNet maximizes the expected log-likelihood across all possible permutation orders. This means that for every position in the sequence, the context can include words from both the left and right sides. Statistically, the model learns to utilize information from all positions, thereby achieving bidirectional context capture without compromising the autoregressive nature.
Furthermore, because XLNet maintains an autoregressive form, it does not rely on input data corruption (such as BERT's [MASK] operation), thus eliminating the discrepancy between pre-training and fine-tuning. Simultaneously, the autoregressive objective allows the use of the product rule to decompose joint probabilities, naturally modeling dependencies between words and overcoming the simplification problem of BERT's independence assumption. To further enhance performance, XLNet integrates the segment-recurrence mechanism and relative positional encoding from Transformer-XL, enabling better performance when processing long text sequences. Experiments show that under comparable settings, XLNet outperforms BERT in 20 tasks including question answering, natural language inference, sentiment analysis, and document ranking, often with significant advantages.
Recommended reading: "XLNet: Generalized Autoregressive Pretraining for Language Understanding" (2019). This paper provides an in-depth analysis of the pros and cons of BERT and traditional autoregressive models, and demonstrates how clever design through permutation language modeling enables bidirectional context learning while maintaining autoregressive characteristics. For readers hoping to understand the evolution of large-scale language model pre-training mechanisms, particularly how to balance bidirectionality and autoregressive advantages, this is a must-read classic technical literature.
Sources:《XLNet: Generalized Autoregressive Pretraining for Language Understanding》(2019)