Understanding the Evolution of ChatGPT: Half 2 — GPT-2 and GPT-3 | by Shirley Li | Jan, 2025

The Paradigm Shift In direction of Bypassing Finetuning

In our earlier article, we revisited the core ideas in GPT-1 in addition to what had impressed it. By combining auto-regressive language modeling pre-training with the decoder-only Transformer, GPT-1 had revolutionized the sector of NLP and made pre-training plus finetuning a normal paradigm.

However OpenAI didn’t cease there.

Reasonably, whereas they tried to know why language mannequin pre-training of Transformers is efficient, they started to note the zero-shot behaviors of GPT-1, the place as pre-training proceeded, the mannequin was in a position to steadily enhance its efficiency on duties that it hadn’t been finetuned on, exhibiting that pre-training may certainly enhance its zero-shot functionality, as proven within the determine beneath:

Determine 1. Evolution of zero-shot efficiency on completely different duties as a operate of LM pre-training updates. (Picture from the GPT-1 paper.)

This motivated the paradigm shift from “pre-training plus finetuning” to “pre-training solely”, or in different phrases, a task-agnostic pre-trained mannequin that may deal with completely different duties with out finetuning.

Each GPT-2 and GPT-3 are designed following this philosophy.

However why, you may ask, isn’t the pre-training plus finetuning magic working simply high-quality? What are the extra advantages of bypassing the finetuning stage?

Limitations of Finetuning

Finetuning is working high-quality for some well-defined duties, however not for all of them, and the issue is that there are quite a few duties within the NLP area that now we have by no means acquired an opportunity to experiment on but.

For these duties, the requirement of a finetuning stage means we might want to acquire a finetuning dataset of significant dimension for every particular person new job, which is clearly not very best if we wish our fashions to be actually clever sometime.

In the meantime, in some works, researchers have noticed that there’s an rising threat of exploiting spurious correlations within the finetuning knowledge because the fashions we’re utilizing change into bigger and bigger. This creates a paradox: the mannequin must be giant sufficient in order that it may take in as a lot info as doable throughout coaching, however finetuning such a big mannequin on a small, narrowly distributed dataset will make it battle when generalize to out-of-distribution samples.

Another excuse is that, as people we don’t require giant supervised datasets to be taught most language duties, and if we wish our fashions to be helpful sometime, we want them to have such fluidity and generality as properly.

Now maybe the actual query is that, what can we do to attain that purpose and bypass finetuning?

Earlier than diving into the main points of GPT-2 and GPT-3, let’s first check out the three key components which have influenced their mannequin design: task-agnostic studying, the size speculation, and in-context studying.

Job-agnostic Studying

Job-agnostic studying, also referred to as Meta-Studying or Studying to Be taught, refers to a brand new paradigm in machine studying the place the mannequin develops a broad set of abilities at coaching time, after which makes use of these abilities at inference time to quickly adapt to a brand new job.

For instance, in MAML (Mannequin-Agnostic Meta-Studying), the authors confirmed that the fashions may adapt to new duties with only a few examples. Extra particularly, throughout every interior loop (highlighted in blue), the mannequin firstly samples a job from a bunch of duties and performs a couple of gradient descent steps, leading to an tailored mannequin. This tailored mannequin will probably be evaluated on the identical job within the outer loop (highlighted in orange), after which the loss will probably be used to replace the mannequin parameters.

Determine 2. Mannequin-Agnostic Meta-Studying. (Picture from the MAML paper)

MAML exhibits that studying could possibly be extra basic and extra versatile, which aligns with the course of bypassing finetuning on every particular person job. Within the comply with determine the authors of GPT-3 defined how this concept could be prolonged into studying language fashions when mixed with in-context studying, with the outer loop iterates by completely different duties, whereas the interior loop is described utilizing in-context studying, which will probably be defined in additional element in later sections.

Determine 3. Language mannequin meta-learning. (Picture from GPT-3 paper)

The Scale Speculation

As maybe probably the most influential concept behind the event of GPT-2 and GPT-3, the size speculation refers back to the observations that when coaching with bigger knowledge, giant fashions may someway develop new capabilities mechanically with out specific supervision, or in different phrases, emergent talents may happen when scaling up, simply as what we noticed within the zero-shot talents of the pre-trained GPT-1.

Each GPT-2 and GPT-3 could be thought of as experiments to check this speculation, with GPT-2 set to check whether or not a bigger mannequin pre-trained on a bigger dataset could possibly be straight used to unravel down-stream duties, and GPT-3 set to check whether or not in-context studying may deliver enhancements over GPT-2 when additional scaled up.

We’ll talk about extra particulars on how they applied this concept in later sections.

In-Context Studying

As we present in Determine 3, underneath the context of language fashions, in-context studying refers back to the interior loop of the meta-learning course of, the place the mannequin is given a pure language instruction and some demonstrations of the duty at inference time, and is then anticipated to finish that job by mechanically discovering the patterns within the given demonstrations.

Word that in-context studying occurs within the testing part with no gradient updates carried out, which is totally completely different from conventional finetuning and is extra just like how people carry out new duties.

In case you aren’t conversant in the terminology, demonstrations often means exemplary input-output pairs related to a specific job, as we present within the “examples” half within the determine beneath:

Determine 4. Instance of few-shot in-context studying. (Picture from GPT-3 paper)

The thought of in-context studying was explored implicitly in GPT-2 after which extra formally in GPT-3, the place the authors outlined three completely different settings: zero-shot, one-shot, and few-shot, relying on what number of demonstrations are given to the mannequin.

Determine 5. zero-shot, one-shot and few-shot in-context studying, contrasted with conventional finetuning. (Picture from GPT-3 paper)

Briefly, task-agnostic studying highlights the potential of bypassing finetuning, whereas the size speculation and in-context studying counsel a sensible path to attain that.

Within the following sections, we are going to stroll by extra particulars for GPT-2 and GPT-3, respectively.