Generative pre-training: What the G in GPT describes
Generative pre-training gave the first GPT model both a name and a training strategy. The G stands for generative, identifying a model's capacity to produce content. The full expression, generative pre-trained transformer, also names a training stage and a neural-network architecture. The transformer supplied a way to process relationships within sequences; pre-training learned patterns from text before adaptation to particular tasks; generation used those learned patterns to continue a sequence. The term became attached to OpenAI's first GPT model in 2018, years before conversational software made the initials familiar to a much larger public.
The architectural starting point is Attention Is All You Need, published by Ashish Vaswani and colleagues in 2017. Their transformer replaced recurrent processing with attention mechanisms. Self-attention relates positions within a sequence, allowing the model to construct representations using information from other positions. The original design contained an encoder and a decoder. During output generation, the decoder consumed previously generated symbols as additional input. Its attention was masked so that predictions could depend on earlier output positions without looking ahead at subsequent ones.
That restriction connects the architecture with generation. During training, the expected output is available, but the model must not obtain a shortcut by looking at material it is supposed to predict. The original transformer also included positional information because its architecture did not otherwise encode sequence order through recurrence or convolution. Its authors tested English-to-German and English-to-French translation, reporting translation quality and training costs. The T in GPT therefore refers to a specified arrangement of attention and other network operations, with published experiments behind it.
OpenAI's June 11, 2018 work, Improving Language Understanding by Generative Pre-Training, combined a transformer language model with a two-stage training procedure. It first learned from unlabeled text in BookCorpus, then received task-specific fine-tuning. GPT models used the transformer's decoder component and learned to predict the next token. The initial training material did not need every passage manually labeled for a downstream task. Fine-tuning supplied a later, more directed stage. The P describes that preparation before adaptation; it does not mean that the model begins learning language from scratch during each conversation.
The accompanying software release preserved an unusually useful qualification about results. OpenAI's finetune-transformer-lm repository identifies itself as the code and model for the 2018 generative pre-training study. Its README says the implementation reproduces the ROCStories Cloze Test experiment. It also reports a median accuracy of 85.8% across ten runs with default settings, compared with the 86.5% single run reported in the research. The developers attribute nondeterminism to GPU operations. This is a concrete difference between a published experimental result and repeated runs of released software. The repository states the discrepancy directly, alongside the command used to run the experiment, rather than presenting one number as an inevitable outcome.
The G becomes especially tangible in OpenAI's GPT-2 sampling code. Its sample_sequence function accepts either a starting token or an existing context. The routine obtains model scores for possible next tokens, adjusts those scores using a temperature setting, and applies sampling filters. It then draws a token and appends it to the output. The next iteration uses the growing sequence and stored model state. Generation, at this operational level, involves an output assembled step by step from model predictions.
The same file contains both top-k and nucleus sampling routines. The first can restrict sampling to highly ranked candidates; the second filters candidates using cumulative probabilities. These operations affect how the model's scores become a selected token. The implementation does not simply demand the highest-scoring candidate on every step. Its loop continues until the requested generation length is reached. These are observations about the released GPT-2 routine, rather than specifications for every later model. The file documents the act of generating a sequence separately from the training process that produced the model's scores.
Tom Brown and colleagues explored a further distinction in the 2020 GPT-3 study, Language Models Are Few-Shot Learners. They trained an autoregressive model with 175 billion parameters, then supplied task descriptions and demonstrations through text. During those evaluations, the model received no gradient updates or task-specific fine-tuning. The researchers compared settings with no demonstrations, one demonstration, or several demonstrations. A prompt could change the task being performed without changing the stored model parameters. That is a different operation from the fine-tuning stage used in the earlier two-stage procedure.
The GPT-3 experiments included translation, word manipulation, arithmetic, and using a newly defined word in a sentence. Performance varied: some comparison and comprehension tasks remained difficult. The researchers also identified limits in a prediction objective that treated every token equally and lacked a separate notion of which predictions mattered most. Generative capacity therefore described a mechanism with measured strengths and weaknesses. In generative pre-training, the initial word identifies production through a learned model; neither the acronym nor fluent output certifies that every continuation is accurate, useful, or appropriate for the task.
- OpenAI — finetune-transformer-lm, original code and model release for Improving Language Understanding by Generative Pre-Training (2018) — github.com
- Ashish Vaswani and colleagues — Attention Is All You Need (2017) — arxiv.org
- OpenAI — GPT-2 sample.py, released sequence-generation routine — raw.githubusercontent.com
- Tom B. Brown and colleagues — Language Models Are Few-Shot Learners (2020) — arxiv.org
- Wikipedia — Generative pre-trained transformer, acronym and 2018 model chronology — en.wikipedia.org
- Wikipedia — General-purpose technology — en.wikipedia.org