GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — XLNet - Wikipedia

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
icon
An editor has determined that sufficient sources exist to establish the subject's notability. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "XLNet" – news · newspapers · books · scholar · JSTOR
(September 2024) (Learn how and when to remove this message)
This article may contain original research. Please improve it by verifying the claims made and adding inline citations. Statements consisting only of original research should be removed. (September 2024) (Learn how and when to remove this message)
icon
This article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "XLNet" – news · newspapers · books · scholar · JSTOR
(September 2024) (Learn how and when to remove this message)
(Learn how and when to remove this message)
XLNet
Original authorGoogle AI
Release19 June 2019 (19 June 2019)
Type
  • Large language model
  • Transformer (deep learning architecture)
LicenseApache-2.0
Repositoryhttps://github.com/zihangdai/xlnet/

The XLNet was an autoregressive Transformer designed as an improvement over BERT, with 340M parameters and trained on 33 billion words. It was released on 19 June 2019, under the Apache 2.0 license.[1] It achieved state-of-the-art results on a variety of natural language processing tasks, including language modeling, question answering, and natural language inference.

Architecture

The main idea of XLNet is to model language autoregressively like the GPT models, but allow for all possible permutations of a sentence.[2] Concretely, consider the following sentence:

My dog is cute.

In standard autoregressive language modeling, the model would be tasked with predicting the probability of each word, conditioned on the previous words as its context:

We factorize the joint probability of a sequence of words x1,…,xT using the chain rule:Pr⁡(x1,…,xT)=Pr⁡(x1)Pr⁡(x2|x1)Pr⁡(x3|x1,x2)…Pr⁡(xT|x1,…,xT−1).

For example, the sentence "My dog is cute" is factorized as:

Pr⁡(My,dog,is,cute)=Pr⁡(My)Pr⁡(dog|My)Pr⁡(is|My,dog)Pr⁡(cute|My,dog,is).

Schematically, we can write it as

<𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺>→My <𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺>→My dog <𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺>→My dog is <𝙼𝙰𝚂𝙺>→My dog is cute.

However, for XLNet, the model is required to predict the words in a randomly generated order. Suppose we have sampled a randomly generated order 3241, then schematically, the model is required to perform the following prediction task:

<𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺>→<𝙼𝙰𝚂𝙺><𝙼𝙰𝚂𝙺>is <𝙼𝙰𝚂𝙺>→<𝙼𝙰𝚂𝙺>dog is <𝙼𝙰𝚂𝙺>→<𝙼𝙰𝚂𝙺>dog is cute→My dog is cute

By considering all permutations, XLNet is able to capture longer-range dependencies and better model the bidirectional context of words.

Two-Stream Self-Attention

To implement permutation language modeling, XLNet uses a two-stream self-attention mechanism. The two streams are:

  • Content stream: This stream encodes the content of each word, as in standard causally masked self-attention.
  • Query stream: This stream encodes the content of each word in the context of what has gone before. In more detail, it is a masked cross-attention mechanism, where the queries are from the query stream, and the key-value pairs are from the content stream.

The content stream uses the causal maskMcausal=[0−∞−∞…−∞00−∞…−∞000…−∞⋮⋮⋮⋱⋮000…0]permuted by a random permutation matrix to PMcausalP−1.

The query stream uses the cross-attention mask P(Mcausal−∞I)P−1, where the diagonal is subtracted away specifically to avoid the model "cheating" by looking at the content stream for what the current masked token is.

Like the causal masking for GPT models, this two-stream masked architecture allows the model to train on all tokens in one forward pass.

Training

Two models were released:[1][2]

  • XLNet-Large, cased: 340M parameters, 24-layer, 1024-hidden, 16-heads
  • XLNet-Base, cased: 110M parameters, 12-layer, 768-hidden, 12-heads.

It was trained on a dataset that amounted to 32.89 billion tokens after tokenization with SentencePiece. The dataset was composed of BooksCorpus, and English Wikipedia, Giga5, ClueWeb 2012-B, and Common Crawl.

It was trained on 512 TPU v3 chips, for 5.5 days. At the end of training, it still under-fitted the data, meaning it could have achieved lower loss with more training. It took 0.5 million steps with an Adam optimizer, linear learning rate decay, and a batch size of 8192.[3]

See also

  • BERT (language model)
  • Transformer (machine learning model)
  • Generative pre-trained transformer
  • Yang Zhilin

References

  1. 1 2 "xlnet". GitHub. Retrieved 2 January 2024.
  2. 1 2 "Pretrained models — transformers 2.0.0 documentation". huggingface.co. Retrieved 2024-08-05.
  3. ↑ Yang, Zhilin; Dai, Zihang; Yang, Yiming; Carbonell, Jaime; Salakhutdinov, Ruslan; Le, Quoc V. (2 January 2020). "XLNet: Generalized Autoregressive Pretraining for Language Understanding". arXiv:1906.08237 [cs.CL].
Retrieved from "https://en.wikipedia.org/w/index.php?title=XLNet&oldid=1368704963"
Categories:
  • Google software
  • Large language models
  • Software using the Apache license
  • 2019 software
Hidden categories:
  • Articles with short description
  • Short description is different from Wikidata
  • Articles needing additional references from September 2024
  • All articles needing additional references
  • Articles that may contain original research from September 2024
  • All articles that may contain original research
  • Articles with multiple maintenance issues
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.