15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

磐創AI發表於2019-02-19

源:openai

轉載自:新智元,未經允許不得二次轉載

【導讀】史上最強“通用”NLP模型來襲:近日OpenAI在官博介紹了他們訓練的一個大規模無監督NLP模型,可以生成連貫的文字段落,重新整理了7大資料集基準,並且能在未經預訓練的情況下,完成閱讀理解、問答、機器翻譯等多項不同的語言建模任務。

OpenAI今天在官博上介紹了他們的新NLP模型,重新整理了7大資料集的SOTA(當前最佳結果),並且能夠在不進行任何與領域知識相關資料訓練的情況下,直接跨任務執行最基礎的閱讀理解、機器翻譯、問答和文字總結等不同NLP任務。

無需預訓練就能完成多種不同任務且取得良好結果,相當於克服了“災難性遺忘”,簡直可謂深度學習研究者夢寐以求的“通用”模型!

如果說谷歌的BERT代表NLP邁入了一個預訓練模型的新時代,OpenAI便用這一成果證明,只要擁有超凡的資料量和計算力,就能實現以往無法想象的事情

例如計算力,根據參與OpenAI強化學習研究的Smertiy透露,新模型使用了256塊谷歌TPU v3(沒有公佈具體的訓練時間),訓練價格每小時2048美元

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

史上最強“通用”NLP模型:15億引數馳騁40GB網路資料

OpenAI的這個NLP模型基於Transformer,擁有15億引數,使用含有800萬網頁內容的資料集訓練,只為一個目的:

根據當前已有的資訊,預測下一個單詞是什麼。

新模型的名字叫GPT-2,是OpenAI去年釋出的無監督NLP模型GPT的直接擴充,新模型用到的引數和訓練資料,都增長了超過10個數量級。

由於模型容量足夠大,並且訓練資料足夠多,GPT-2在擁有40GB網路資料的測試集上,僅是簡單“預測下一個單詞是什麼”,就足以完成各種不同的NLP任務,展示出了強大的泛化能力。

當前,構建機器學習系統的主流方法是監督學習——收集資料,也即餵給模型一套“理想的”輸入和輸出組合,讓模型模仿“套路”,在新的測試資料集上也給出類似的結果。這種方法在特定領域任務上表現很好,但缺點是一旦改為其他任務,比如將在問答資料集上表現很好的模型用到閱讀理解上,模型就無法適應,也即泛化能力很差。

對此,OpenAI的研究人員大膽推測:當前機器學習系統泛化能力差的原因,恰恰是因為讓模型侷限在特定領域的資料集上做特定任務的訓練

同時,現有的多工模型研究證明,單純依靠訓練樣本的增加,難以實現有效的任務擴充套件;NLP研究人員正越來越多地使用自注意力模組遷移學習來構建多工學習模型。

於是,OpenAI的研究人員結合上述兩種思路,在更通用的資料集基礎上,使用自注意力模組遷移學習,然後得到了一個無需調整任何參與或模型結構,在 zero-shot 情況下能夠執行多項不同NLP任務的模型,也即上文所說的GPT-2。

有鑑於其強大的能力和可能被濫用的危險,OpenAI並沒有公佈GPT-2模型及程式碼,只公佈了一個僅含117M引數的樣本模型及程式碼,供有興趣的研究人員學習和參考:https://github.com/openai/gpt-2

當然,GPT-2的具體模型結構OpenAI這次也沒有詳述,他們預留了半年的時間向學界徵集意見。在公佈的論文“Language Models are Unsupervised Multitask Learners”中,OpenAI的研究人員介紹了模型構建的思路和方法。

至於具體的計算力,論文中沒有提及,根據上文Twitter上的資料,他們的模型使用了256個谷歌雲TPU v3,儘管沒有公佈訓練時間。TPU v3在Google之外只提供單獨使用版本(儘管OpenAI可能得到了特別的許可),這意味著他們要支付8 * 256 = 2048美元/小時。

下面,就是OpenAI展示其成果的時間——你也可以直接拉到文末,點選“閱讀原文”檢視論文。


無需預訓練,8個資料集7個重新整理當前最佳紀錄

我們對四個語言模型進行了訓練和基準測試,它們的大小如下表所示:

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

4個模型大小的架構和超引數

其中,最小的模型等價於原始的GPT,次小的等價於最大的BERT模型。我們的最大模型是GPT-2,它的引數比GPT多一個數量級。

GPT-2在各種領域特定的語言建模任務上取得了state-of-the-art 的成績。我們的模型沒有針對任何特定於這些任務的資料進行訓練,只是作為最終測試對它們進行了評估;這就是被稱為“zero-shot”的設定。

當在相同的資料集上進行評估時,GPT-2比在特定領域資料集(如Wikipedia、新聞、書籍)上訓練的模型表現更好。

下表顯示了我們所有最先進的zero-shot結果。

(+)表示該項分數越高越好。(-)表示分數越低越好。

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

GPT-2在這些資料集中均獲得SOTA結果

GPT-2在Winograd Schema、LAMBADA以及其他語言建模任務上實現了state-of-the-art 的結果。

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在各資料集上,四種不同引數大小模型的Zero-shot結果。

可以看到,WebText LMs可以很好地跨域和資料集傳輸在zero-shot設定下將8個資料集中的7個的state of the art結果進一步提升了

在Penn Treebank和WikiText-2等只有100萬到200萬個訓練token的小型資料集上,可以看到改進很大。在用於測量長期依賴關係的資料集上,如LAMBADA和the Children’s Book Test,也有很大的改進。

我們的模型在One Billion Word Benchmark上仍然明顯比之前的工作要差。這可能是由於它既是最大的資料集,又有一些最具破壞性的預處理——1BW的句子級變換消除了所有的遠端結構。


其他任務:問答、閱讀理解、摘要總結和翻譯

在其他語言任務,如問題回答、閱讀理解、摘要總結和翻譯,我們在沒有對模型進行任何微調的情況下獲得了極好的結果,只需要以正確的方式提示訓練模型(下面的例子展示了具體做法和結果),但在這些任務還達不到專業系統的SOTA水平。

1、閱讀理解:回答關於給定段落的問題

資料集:CoQA

示例

The 2008 Summer Olympics torch relay was run from March 24 until August 8, 2008, prior to the 2008 Summer Olympics, with the theme of “one world, one dream”. Plans for the relay were announced on April 26, 2007, in Beijing, China. The relay, also called by the organizers as the “Journey of Harmony”, lasted 129 days and carried the torch 137,000 km (85,000 mi) – the longest distance of any Olympic torch relay since the tradition was started ahead of the 1936 Summer Olympics.

After being lit at the birthplace of the Olympic Games in Olympia, Greece on March 24, the torch traveled to the Panathinaiko Stadium in Athens, and then to Beijing, arriving on March 31. From Beijing, the torch was following a route passing through six continents. The torch has visited cities along the Silk Road, symbolizing ancient links between China and the rest of the world. The relay also included an ascent with the flame to the top of Mount Everest on the border of Nepal and Tibet, China from the Chinese side, which was closed specially for the event.

Q: What was the theme?
A: “one world, one dream”.

Q: What was the length of the race?
A: 137,000 km

Q: Was it larger than previous ones?
A: No

Q: Where did the race begin?
A: Olympia, Greece

Q: Is there anything notable about that place?
A: birthplace of Olympic Games

Q: Where did they go after?
A: Athens

Q: How many days was the race?
A: seven

Q: Did they visit any notable landmarks?
A: Panathinaiko Stadium

Q: And did they climb any mountains?

A:

Target answers: unknown or yes
Model answer: Everest

效能表現:

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在閱讀理解任務中,GPT-2比DrQA+PGNet要差,也遠低於人類水平

2、常識推理:解決含義模糊的代詞

資料集:Winograd Schema Challenge

示例

The trophy doesn’t fit into the brown suitcase because it is too large.

Correct answer: it = trophy
Model answer: it = trophy

The trophy doesn’t fit into the brown suitcase because it is too small.

Correct answer: it = suitcase
Model answer: it = suitcase

效能表現

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在常識推理任務中,GPT-2優於SOTA

3、問題回答

資料集:Natural Questions

示例

Who wrote the book the origin of species?

Correct answer: Charles Darwin
Model answer: Charles Darwin

What is the largest state in the U.S. by land mass?

Correct answer: Alaska
Model answer: California

效能表現:

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在問答任務中,GPT-2的表現遠低於BERT

4、廣義語境的語言建模:預測一段文字的最後一個詞

資料集:LAMBADA

示例

Both its sun-speckled shade and the cool grass beneath were a welcome respite after the stifling kitchen, and I was glad to relax against the tree’s rough, brittle bark and begin my breakfast of buttery, toasted bread and fresh fruit. Even the water was tasty, it was so clean and cold. It almost made up for the lack of…

Correct answer: coffee
Model answer: food

效能表現

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在廣義語境的語言建模任務中,GPT-2比SO他的模型表現更好

5、寫摘要:對新聞文章進行總結

資料集:CNN和每日郵報資料集

示例文字:

Prehistoric man sketched an incredible array of prehistoric beasts on the rough limestone walls of a cave in modern day France 36,000 years ago.

Now, with the help of cutting-edge technology, those works of art in the Chauvet-Pont-d’Arc Cave have been reproduced to create the biggest replica cave in the world.

參考摘要:

Cave mimics famous Caverne du Pont-d’Arc in France, the oldest cave decorated by man and the best preserved. The replica contains all 1,000 paintings which include 425 such as a woolly rhinoceros and mammoths. Minute details were copied using 3D modelling and anamorphic techniques, often used to shoot widescreen images. The modern cave also includes replica paw prints of bears, bones and details preserved in the original cave.

機器編寫的摘要:

The original site in Vallon-Pont-D’arc in Southern France is a Unesco World Heritage site and is the oldest known and the best preserved cave decorated by man. The replica cave was built a few miles from the original site in Vallon-Pont-D’Arc in Southern France. The cave contains images of 14 different species of animals including woolly rhinoceros, mammoths, and big cats.

效能表現

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在摘要任務中,GPT-2的表現不如專門的系統

6、機器翻譯:把法語句子翻譯成英語

資料集:WMT-14 Fr-En

示例

法語句子:

Un homme a expliqué que l’opération gratuite qu’il avait subie pour soigner une hernie lui permettrait de travailler à nouveau.

參考翻譯:

One man explained that the free hernia surgery he’d received will allow him to work again.

模型的翻譯

A man told me that the operation gratuity he had been promised would not allow him to travel.

效能表現

15億引數!史上最強通用NLP模型誕生:狂攬7大資料集最佳紀錄

在法語-英語機器翻譯任務中,GPT-2的表現不如專門的系統

我們認為,由於這些任務是通用語言建模的子集,我們可以預期隨著計算力和資料量的增加,效能會進一步提高。其他研究人員也發表了類似的假設。我們還期望通過微調來提高下游任務的效能,儘管這需要進行徹底的實驗。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31555081/viewspace-2636356/,如需轉載,請註明出處,否則將追究法律責任。

相關文章