The first part of this resource pool summarizes the resources used to solve text generation tasks using the language model GPT2, including papers, code, demo demos, and hands-on tutorials. The second part shows the application of GPT2 in the text generation tasks of machine translation, automatic summary generation, migration learning and music generation. Finally, the 15 major language models based on Transformer between 2018 and 2019 are compared.
本資源匯第一部分匯總了使用語言模型GPT2來解決文本生成任務的資源,包括論文、代碼、展示demo和動手教程。第二部展示了GPT2在機器翻譯、自動摘要生成、遷移學習和音樂生成這些文本生成任務上的應用。最後對比了2018-2019年間重要的基於Transformer的15個語言模型

GPT-2 is a large transformer-based language model released by OpenAI in February 2019. It contains 1.5 billion parameters and is trained on a 8 million web dataset. According to reports, the model is a direct extension of the GPT model, training on more than 10 times the amount of data, the parameter amount is also 10 times more. In terms of performance, the model is capable of producing coherent text paragraphs and achieves SOTA performance on many language modeling benchmarks. Moreover, the model can perform preliminary reading comprehension, machine translation, question and answer and automatic summarization without task-specific training.
GPT-2是OpenAI於2019年2月發布的基於transformer 的大型語言模型,包含15 億參數、在一個800 萬網頁數據集上訓練而成。據介紹,該模型是對GPT 模型的直接擴展,在超出10 倍的數據量上進行訓練,參數量也多出了10 倍。在性能方面,該模型能夠生產連貫的文本段落,在許多語言建模基准上取得了SOTA 表現。而且該模型在沒有任務特定訓練的情況下,能夠做到初步的閱讀理解、機器翻譯、問答和自動摘要。
GPT-2_Explorer Demo It can give the next ten words of the possibility ranking and their corresponding probabilities according to the currently input text. You can select one of the words, then see the list of the next possible word, and so on, and finally complete one. Article.
GPT-2_Explorer Demo 它可以根據當前輸入的文本給出可能性排名前十的下一個單詞及其對應概率,你可以選擇其中一個單詞,然後看到下一個可能單詞的列表,如此往復,最終完成一篇文章。

點擊體驗Click to GPT-2 Explorer Demo
GPT-2-simple Python package to easily retrain OpenAI's GPT-2 text-generating model on new texts.
GPT-2-simple Python包可以輕鬆地在新文本上重新訓練OpenAI的GPT-2文本生成模型。
GPT-2-simple Demo Writes a follow-up story based on the current input text. GPT-2-simple Demo 根據當前輸入文本編寫後續的故事。

點擊體驗Click to gpt-2-simple Demo
Grover is a model for Neural Fake News -- both generation and detection. Grover是神經虛假新聞的模型- 生成和檢測。
Generate articles based on information such as title, author, and more. Grover can also detect if text is generated by the machine.
根據標題、作者等信息生成文章。 grover 還可以檢測文本是否由機器生成。

點擊體驗Click to GROVER
Click to read the English version
只包含解碼器的transformer (比如GPT2)不斷地表現出在語言建模之外的應用前景。在許多應用程序中,這類模型已經取得了成功:機器翻譯、自動摘要生成、遷移學習和音樂生成。讓我們一起來回顧一下其中的一些應用。
進行翻譯時,模型不需要編碼器。同樣的任務可以通過一個只有解碼器的transformer 來解決:

這是第一個訓練只包含解碼器的transformer 的任務。也就是說,該模型被訓練來閱讀維基百科的文章(沒有目錄前的開頭部分),然後生成摘要。文章實際的開頭部分被用作訓練數據集的標籤:

論文使用維基百科的文章對模型進行了訓練,訓練好的模型能夠生成文章的摘要:

在論文Sample Efficient Text Summarization Using a Single Pre-Trained Transformer中,首先使用只包含解碼器的transformer 在語言建模任務中進行預訓練,然後通過調優來完成摘要生成任務。結果表明,在數據有限的情況下,該方案比預訓練好的編碼器-解碼器transformer 得到了更好的效果。 GPT2 的論文也展示了對語言建模模型進行預訓練後取得的摘要生成效果。
音樂transformer 採用了只包含解碼器的transformer 來生成具有豐富節奏和動感的音樂。和語言建模相似,「音樂建模」就是讓模型以一種無監督的方式學習音樂,然後讓它輸出樣本(我們此前稱之為「隨機工作」)。
GPT2只是基於Transformer 的模型的滄海一粟,2018-2019年的15個重要的基於Transformer 的模型的對比可以參見後BERT時代:15個預訓練模型對比分析與關鍵點探索
