GPT-1
{{Short description|2018 text-generating language model}}
{{Third-party|date=August 2023}}
{{Infobox software
| name = Generative Pre-trained Transformer 1 (GPT-1)
| logo =
| screenshot =
| screenshot size =
| caption =
| author = OpenAI
| developer =
| released = {{Start date and age|June 2018}}
| latest release version =
| latest release date =
| repo =
| programming language =
| operating system =
| replaces =
| replaced_by = GPT-2
| genre = {{ indented plainlist |
}}
| license = MIT{{cite web|work=GitHub|title=gpt-2|url=https://github.com/openai/gpt-2|access-date=13 March 2023|archive-date=11 March 2023|archive-url=https://web.archive.org/web/20230311154936/https://github.com/openai/gpt-2|url-status=live}}
| website =
}}
{{see also|Generative pre-trained transformer#History}}
{{Machine learning|Artificial neural network}}
File:Full GPT architecture.svg
Generative Pre-trained Transformer 1 (GPT-1) was the first of OpenAI's large language models following Google's invention of the transformer architecture in 2017.{{cite journal |last1=Vaswani |first1=Ashish |author1-link= Ashish Vaswani |last2=Shazeer |first2=Noam |last3=Parmar |first3=Niki |last4=Uszkoreit |first4=Jakob |last5=Jones |first5=Llion |last6=Gomez |first6=Aidan N |author6-link= Aidan Gomez |last7=Kaiser |first7=Łukasz |last8=Polosukhin |first8=Illia |title=Attention is All you Need |journal=Advances in Neural Information Processing Systems |date=2017 |volume=30 |url=https://proceedings.neurips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf |publisher=Curran Associates, Inc.}} In June 2018, OpenAI released a paper entitled "Improving Language Understanding by Generative Pre-Training", in which they introduced that initial model along with the general concept of a generative pre-trained transformer.{{Cite web |url=https://www.makeuseof.com/gpt-models-explained-and-compared/ |title=GPT-1 to GPT-4: Each of OpenAI's GPT Models Explained and Compared |date=11 April 2023 |access-date=2023-04-29 |archive-date=2023-04-15 |archive-url=https://web.archive.org/web/20230415175013/https://www.makeuseof.com/gpt-models-explained-and-compared/ |url-status=live }}
Up to that point, the best-performing neural NLP models primarily employed supervised learning from large amounts of manually labeled data. This reliance on supervised learning limited their use of datasets that were not well-annotated, in addition to making it prohibitively expensive and time-consuming to train extremely large models; many languages (such as Swahili or Haitian Creole) are difficult to translate and interpret using such models due to a lack of available text for corpus-building. In contrast, a GPT's "semi-supervised" approach involved two stages: an unsupervised generative "pre-training" stage in which a language modeling objective was used to set initial parameters, and a supervised discriminative "fine-tuning" stage in which these parameters were adapted to a target task.
The use of a transformer architecture, as opposed to previous techniques involving attention-augmented RNNs, provided GPT models with a more structured memory than could be achieved through recurrent mechanisms; this resulted in "robust transfer performance across diverse tasks".
Reason for choosing BookCorpus
BookCorpus was chosen as a training dataset partly because the long passages of continuous text helped the model learn to handle long-range information. It contained over 7,000 unpublished fiction books from various genres. The rest of the datasets available at the time, while being larger, lacked this long-range structure (being "shuffled" at a sentence level).
The BookCorpus text was cleaned by the ftfy library to standardized punctuation and whitespace and then tokenized by spaCy.
Architecture
The GPT-1 architecture was a twelve-layer decoder-only transformer, using twelve masked self-attention heads, with 64-dimensional states each (for a total of 768). Rather than simple stochastic gradient descent, the Adam optimization algorithm was used; the learning rate was increased linearly from zero over the first 2,000 updates to a maximum of 2.5×10−4, and annealed to 0 using a cosine schedule. GPT-1 has 117 million parameters.
While the fine-tuning was adapted to specific tasks, its pre-training was not; to perform the various tasks, minimal changes were performed to its underlying task-agnostic model architecture. Despite this, GPT-1 still improved on previous benchmarks in several language processing tasks, outperforming discriminatively-trained models with task-oriented architectures on several diverse tasks.
Performance and evaluation
GPT-1 achieved a 5.8% and 1.5% improvement over previous best results on natural language inference (also known as textual entailment) tasks, evaluating the ability to interpret pairs of sentences from various datasets and classify the relationship between them as "entailment", "contradiction" or "neutral". Examples of such datasets include QNLI (Wikipedia articles) and MultiNLI (transcribed speech, popular fiction, and government reports, among other sources); It similarly outperformed previous models on two tasks related to question answering and commonsense reasoning—by 5.7% on RACE, a dataset of written question-answer pairs from middle and high school exams, and by 8.9% on the Story Cloze Test.
GPT-1 improved on previous best-performing models by 4.2% on semantic similarity (or paraphrase detection), evaluating the ability to predict whether two sentences are paraphrases of one another, using the Quora Question Pairs (QQP) dataset.
GPT-1 achieved a score of 45.4, versus a previous best of 35.0 in a text classification task using the Corpus of Linguistic Acceptability (CoLA). Finally, GPT-1 achieved an overall score of 72.8 (compared to a previous record of 68.9) on GLUE, a multi-task test.
References
{{reflist|refs=
|url = https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf
|title = Improving Language Understanding by Generative Pre-Training
|last1 = Radford
|first1 = Alec
|last2 = Narasimhan
|first2 = Karthik
|last3 = Salimans
|first3 = Tim
|last4 = Sutskever
|first4 = Ilya
|pages = 12
|publisher = OpenAI
|date = 11 June 2018
|access-date = 23 January 2021
|archive-date = 26 January 2021
|archive-url = https://web.archive.org/web/20210126024542/https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf
|url-status = live
}}
|url = http://www.cs.cmu.edu/~ytsvetko/jsalt-part1.pdf
|title = Opportunities and Challenges in Working with Low-Resource Languages
|last = Tsvetkov
|first = Yulia
|website =
|publisher = Carnegie Mellon University
|date = 22 June 2017
|access-date = 23 January 2021
|quote =
|archive-date = 31 March 2020
|archive-url = https://web.archive.org/web/20200331150440/http://www.cs.cmu.edu/~ytsvetko/jsalt-part1.pdf
|url-status = live
}}
|url = https://www.aclweb.org/anthology/W17-0906.pdf
|title = LSDSem 2017 Shared Task: The Story Cloze Test
|last1 = Mostafazadeh
|first1 = Nasrin
|last2 = Roth
|first2 = Michael
|last3 = Louis
|first3 = Annie
|last4 = Chambers
|first4 = Nathanael
|last5 = Allen
|first5 = James F.
|website =
|publisher = Association for Computational Linguistics
|date = 3 April 2017
|access-date = 23 January 2021
|quote = The LSDSem’17 shared task is the Story Cloze Test, a new evaluation for story understanding and script learning. This test provides a system with a four-sentence story and two possible endings, and the system must choose the correct ending. Successful narrative understanding (getting closer to human performance of 100%) requires systems to link various levels of semantics to commonsense knowledge.
|archive-date = 22 November 2020
|archive-url = https://web.archive.org/web/20201122092238/https://www.aclweb.org/anthology/W17-0906.pdf
|url-status = live
}}
| last1 = Lai
| first1 = Guokun
| last2 = Xie
| first2 = Qizhe
| last3 = Hanxiao
| first3 = Liu
| last4 = Yang
| first4 = Yiming
| last5 = Hovy
| first5 = Eduard
| eprint = 1704.04683
| title = RACE: Large-scale ReAding Comprehension Dataset From Examinations
| class = cs.CL
| date = 15 April 2017
}}
|url = https://www.aclweb.org/anthology/N18-1101.pdf
|title = A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference
|last1 = Williams
|first1 = Adina
|last2 = Nangia
|first2 = Nikita
|last3 = Bowman
|first3 = Samuel
|website =
|publisher = Association for Computational Linguistics
|date = 1 June 2018
|access-date = 23 January 2021
|quote = At 433k examples, this resource is one of the largest corpora available for natural language inference (a.k.a. recognizing textual entailment), [...] offering data from ten distinct genres of written and spoken English [...] while supplying an explicit setting for evaluating cross-genre domain adaptation.
|archive-date = 11 February 2020
|archive-url = https://web.archive.org/web/20200211002817/https://www.aclweb.org/anthology/N18-1101.pdf
|url-status = live
}}
|last1 = Wang
|first1 = Alex
|last2 = Singh
|first2 = Amanpreet
|last3 = Michael
|first3 = Julian
|last4 = Hill
|first4 = Felix
|last5 = Levy
|first5 = Omar
|last6 = Bowman
|first6 = Samuel R.
|author-link =
|eprint = 1804.07461
|title = GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
|class = cs.CL
|date = 20 April 2018
}}
|last1 = Zhu
|first1 = Yukun
|last2 = Kiros
|first2 = Ryan
|last3 = Zemel
|first3 = Richard
|last4 = Salakhutdinov
|first4 = Ruslan
|last5 = Urtasun
|first5 = Raquel
|last6 = Torralba
|first6 = Antonio
|last7 = Fidler
|first7 = Sanja
|eprint = 1506.06724
|title = Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Books
|class = cs.CV
|date = 22 June 2015
|quote = # of books: 11,038 / # of sentences: 74,004,228 / # of words: 984,846,357 / mean # of words per sentence: 13 / median # of words per sentence: 11
}}
}}
{{OpenAI navbox}}
{{Artificial intelligence navbox}}
{{Generative AI}}
Category:Large language models
Category:Generative pre-trained transformers