當前位置:
首頁 > 新聞 > 一個續寫故事達到人類水平的AI,OpenAI大規模無監督語言模型GPT-2

一個續寫故事達到人類水平的AI,OpenAI大規模無監督語言模型GPT-2

雷鋒網 AI 科技評論按:模型大小的比拼還在繼續!自谷歌大腦的 2.77 億參數的語言模型 Transformer-XL之後,OpenAI 也完成了自己具有 15 億個參數的語言模型 GPT-2,而且這個模型還有一項驚人的能力,就是從短句續寫成篇的文章。雷鋒網 AI 科技評論簡單介紹如下。

一個續寫故事達到人類水平的AI,OpenAI大規模無監督語言模型GPT-2

打開今日頭條,查看更多圖片GPT-2 介紹

2018 年 6 月,OpenAI 發表論文介紹了自己的語言模型 GPT,它基於 Transformer 架構,用先在大規模語料上進行無監督預訓練、再在小得多的有監督數據集上為具體任務進行精細調節(fine-tune)的方式,不依賴針對單獨任務的模型設計技巧就一次性在多個任務中取得了很好的表現。這也是 2018 年中自然語言處理領域的研究趨勢,就像計算機視覺領域流行 ImageNet 預訓練模型一樣。

這次的 GPT-2 是 GPT 的直接技術升級版本,有多 10 倍的模型參數,多達 15 億個,並在多 10 倍的數據上進行訓練。訓練數據是來自互聯網的 40GB 高質量語料,具體來說這些語料來自 Reddit 論壇中出現的高評分外鏈頁面;高評分表示這些頁面中的內容有較高的質量。這樣篩選出的語料內容多達 800 萬個頁面。

模型在無監督訓練階段的目標是,給定一組單片語成的句子之後預測下文的下一個詞。由於資料庫有足夠高的文本質量和足夠高的多樣性,模型也有很高的容量,即便這樣簡單的訓練目標也得出了驚人的結果:模型不僅可以根據給定的文本流暢地續寫句子,甚至可以形成成篇的文章,就像人類的續寫文章一樣。

模型生成文本有時會出現失敗的現象,比如文字重複、錯誤的世界常識(比如有時候模型會寫到在水下燃燒的火)、不自然地切換話題,但在成功的例子中,模型生成的文本有多樣、全面的敘述,對事件的介紹煞有介事,接近人類的表達質量,而且在段落之間甚至全篇文章之中保持連續一致。這可以說非常驚人(可以看下文的樣例)

OpenAI 的研究人員們發現,根據模型對內容的熟悉程度不同,進行數次嘗試之後一般都可以得到較好的生成結果。比如對於訓練文本中常出現的(也就是互聯網上出現較多的)英國脫歐、指環王、歌手 Miley Cyrus 等話題,模型在大約一半的嘗試中都可以生成有理有據的文本;反過來,對於訓練文本中較少出現的技術性討論以及哲學內容,模型生成的效果就要差很多。

和之前的 GPT 一樣,預訓練結束後的模型可以在領域數據集上做進一步精細調節,對文本的風格得到更好的控制,比如在亞馬遜評價數據上精細調節後,模型生成的文本更關注評分、商品類別之類的東西。

除此之外,GPT-2 也可以在各種任務中做「無樣本學習」,即不經過任何任務專用數據集訓練就進行測試,也取得了優秀的結果。OpenAI 的研究人員們猜想這些任務都只是通用語言建模的子集,所以自然會有良好表現。

文本生成欣賞

GPT-2 的表現中最引人關注的當然還是文本生成水平,我們來看幾個 OpenAI 也給出的文本生成樣例。為了方便閱讀,我們簡單翻譯了其中三組。在翻譯過程中我們感覺到,模型的描寫和敘事邏輯雖然還是有一些混亂,但模型不僅可以找到適合的文字風格,自己補充了許多細節,文本中也有一些上下文聯繫、有層層遞進,語法還幾乎沒有錯誤,可以說是非常以假亂真了。

我們一起感受下那煞有介事的文風。

例一

人類給定文本


In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.

(在一項令人震驚的發現中,科學家們在安第斯山脈中偏遠的、從未曾探索過的山谷中發現了一群獨角獸。更令研究人員們驚訝的是,這群獨角獸能說一口流利的英語。)

模型續寫(第 10 次嘗試的結果)


The scientist named the population, after their distinctive horn, Ovid』s Unicorn. These four-horned, silver-white unicorns were previously unknown to science. (科學家們以它們的角的名字把它們命名為 Ovid 獨角獸,科學界從未知道過這些四隻角的、銀白色的獨角獸的存在。)

Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.(如今,經過大概兩個世紀之後,這種古老的現象是如何發現的終於找到了答案。)

Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.(La Paz 大學的進化生物學家 Jorge Pérez 博士和他的同行們在探索安第斯山脈的時候發現了一個很小的山谷,這裡沒有其他的動物或者人類。Pérez 注意到在這個山谷里的似乎是一個自然噴泉,周圍還有兩座岩石山和銀色的雪。)

Pérez and the others then ventured further into the valley. 「By the time we reached the top of one peak, the water looked blue, with some crystals on top,」 said Pérez.(Pérez 和其它人更走到了山谷的更深入。「等到我們走到了其中一座山的山頂的時候,水看起來是藍色的,上面還有一些晶體狀的東西」,Pérez 說。)

Pérez and his friends were astonished to see the unicorn herd. These creatures could be seen from the air without having to move too much to see them – they were so close they could touch their horns.(Pérez 和他的朋友們看到獨角獸群的時候驚呆了。透過空氣,不需要有多少動作就可以看到它們 —— 他們走得好近,甚至都可以摸到它們的角。)

While examining these bizarre creatures the scientists discovered that the creatures also spoke some fairly regular English. Pérez stated, 「We can see, for example, that they have a common 『language,』 something like a dialect or dialectic.」(當這些科學家們檢查這些奇怪的生物的時候,他們發現這些生物的英文說得還挺規範的。Pérez 指出「我們可以看到,比如,它們有共通的『語言』,像是一種口音或者方言」。)

Dr. Pérez believes that the unicorns may have originated in Argentina, where the animals were believed to be descendants of a lost race of people who lived there before the arrival of humans in those parts of South America.(Pérez 博士相信這些獨角獸最初是來自阿根廷的,這些動物很有可能是人類遷移到南美洲之前的一支消失了的人種的後裔。)

While their origins are still unclear, some believe that perhaps the creatures were created when a human and a unicorn met each other in a time before human civilization. According to Pérez, 「In South America, such incidents seem to be quite common.」(雖然它們的來源還不確定,有人認為這些動物可能是在人類文明出現之前,有人和獨角獸相遇而產生的。Pérez 說:「在南美洲,這種事情一點也不罕見。」)

However, Pérez also pointed out that it is likely that the only way of knowing for sure if unicorns are indeed the descendants of a lost alien race is through DNA. 「But they seem to be able to communicate in English quite well, which I believe is a sign of evolution, or at least a change in social organization,」 said the scientist.(然而,Pérez 也指出,也許只有一種辦法能確定這些獨角獸是不是某一支已經消失了的外星人種族的後裔,那就是通過 DNA。「但是它們用英文溝通的能力不怎麼好,在我看來這是一種進化的信號,或者起碼是社交組織的一種變化」,這位科學家說。)

例二

人類給定文本


A train carriage containing controlled nuclear materials was stolen in Cincinnati today. Its whereabouts are unknown.

(今天,一輛載有受控核原料的貨運火車在辛辛那提被偷走了。我們不知道它在哪裡。)

模型續寫(第 1 次嘗試的結果)


The incident occurred on the downtown train line, which runs from Covington and Ashland stations.(事件發生在鬧市區的火車線路上,這條線連通考文垂和阿什蘭。)

In an email to Ohio news outlets, the U.S. Department of Energy said it is working with the Federal Railroad Administration to find the thief.(在一封致俄亥俄州新聞發布窗口的郵件中,美國能源部表示它正在和聯邦鐵路管理局共同協作找到盜賊。)

「The theft of this nuclear material will have significant negative consequences on public and environmental health, our workforce and the economy of our nation,」 said Tom Hicks, the U.S. Energy Secretary, in a statement. 「Our top priority is to secure the theft and ensure it doesn』t happen again.」(「這起核原料失竊事件對於公眾、環境健康、我們的勞動力和國家的經濟有很糟糕的負面後果」,美國能源秘書長 Tom Hicks 在一則聲明中表示,「我們的首要任務是確保失竊事件的安全,並確保它不會再次發生。」 )

The stolen material was taken from the University of Cincinnati』s Research Triangle Park nuclear research site, according to a news release from Department officials.(按照部門官員發布的新聞表示,失竊的材料是從辛辛那提研究院三角公園核能研究院被偷走的)

The Nuclear Regulatory Commission did not immediately release any information.(核管制委員會沒有立即發表任何信息。)

According to the release, the U.S. Department of Energy』s Office of Nuclear Material Safety and Security is leading that team』s investigation.(根據發表的信息,美國能源部核能材料安全與保衛辦公室正在帶領團隊進行調查。)

「The safety of people, the environment and the nation』s nuclear stockpile is our highest priority,」 Hicks said. 「We will get to the bottom of this and make no excuses.(「人民的安全、環境、以及核能儲備是我們最重要的目標,」Hicks 說,「我們會追查到底,不找任何借口。」)

例三

人類給定文本(這是 OpenAI 對 GPT-2 模型的簡介)


We』ve trained a large language model called GPT-2 that generates realistic paragraphs of text, while also exhibiting zero shot generalization on tasks like machine translation, question answering, reading comprehension, and summarization - problems usually approached by using training datasets and models designed explicitly for these tasks.

A typical approach to language modeling is to learn the following task: predict the next word, given all of the previous words within some text. Last year, OpenAI』s Generative Pre-trained Transformer (GPT) showed that language models trained on large amounts of data can be fine-tuned to specific tasks to achieve high performance. GPT-2 shows that much larger language models trained on a more diverse dataset derived from the internet begin to learn these NLP tasks without needing task-specific training data, instead learning from examples the system derives from the raw text. These systems also display a substantial qualitative jump in the realism and coherence of generated text.

模型續寫(第 1 次嘗試的結果)


Here you can see the most recent progress with Generative Pre-trained Transformer:(來和我們一起看看生成式預訓練 Transformer 模型的最新進展)

Figure 1: Generative Pre-trained Transformer training on several texts.(圖 1 :生成式預訓練 Transformer 在多種任務中的表現)

We are now preparing a collection of datasets for translation and machine translation in our language model. We will be using one of the large number of text samples provided by The New York Times.(我們正在準備在語言模型中收集一些數據集用於翻譯和機器翻譯。我們會使用紐約時報提供的大規模文本樣本之一。)

We believe this project is the first step in the direction of developing large NLP systems without task-specific training data. That is, we are developing a machine language system in the generative style with no explicit rules for producing text.(我們相信這個項目是向著開發不需要任務專用數據的大規模 NLP 系統的第一步。也就是說,我們正在開發一個生成式的機器語言系統,它生成文本不需要任何明確的規則。)

We hope for future collaborations between computer scientists, linguists, and machine learning researchers.(我們希望未來可以在計算機科學家、語言學家、機器學習研究人員們之間有更多合作。)

OpenAI 的擔憂

我們看到了,模型確實可以根據任意給定的句子續寫生成近似人類水準的整篇文字,OpenAI 表示具有這樣能力的模型可以有寫作助手、對話智能體、無監督翻譯等多種用途,但他們同時也擔憂具有這樣能力的模型可能會遭到濫用,比如被用來惡意地創作傳播虛假信息的文章,就像之前曾經同樣受到熱烈討論的人臉替換模型 DeepFake,網友已經用它把明星臉替換到色情視頻里;也可以模仿他人寫作、大批量製作釣魚文章等等。

由於 GPT-2 這樣能力的模型可以用來生成欺騙性的、有偏見的以及暴力語言,而 OpenAI 非常看重研究內容的安全、合作、有益,他們更希望以合作的方式向其他研究人員共享他們的經驗,更好地幫助整個領域的進步,而不是直接面向公眾呈上所有成果,所以 OpenAI 並不打算一併發布完整的經過預訓練的模型,只發布一個小得多的模型便於研究人員們用於實驗。

論文地址 https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf

介紹博客 https://blog.openai.com/better-language-models/

開源地址 https://github.com/openai/gpt-2

從技術角度來講 GPT-2 的突破並不大,它只是再一次證明了足夠大的網路配合足夠多的數據訓練就可以有良好的記憶能力,而邏輯和推理能力仍然是無法從記憶能力中自然自然地出現的。另一方面,這也再一次說明了只要肯投入足夠多的計算力和數據,刷刷榜永遠都不難。攤手。

雷鋒網 AI 科技評論報道

喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 雷鋒網 的精彩文章:

庫克承諾調查「沙特用App監控女性出境」事件;蘋果高管涉內幕交易遭起訴 | 雷鋒早報
IBM認為模擬晶元可為機器學習加速1000倍

TAG:雷鋒網 |