Vibe Engines
YouTube
Paper Breakdowns  /  GPT-3
Paper 15~13 min readNeurIPS 2020worked math + runnable code
Paper Breakdown

GPT-3,
explained.

By 2020, the recipe for a new task was fixed: gather a labeled dataset, then fine-tune. GPT-3 asked a wilder question — what if you just made the model enormous, and then, instead of training it, simply showed it a few examples in the prompt? At 175 billion parameters, something new fell out: the model could learn a task from the words you handed it, with no fine-tuning at all.

The delta

What changes against T5: the fine-tune disappears

Rungs 1 and 2 both end with a gradient step on your task. BERT fine-tunes a head; T5 fine-tunes the whole model on a task expressed as text. GPT-3's claim is that at sufficient scale you can skip that entirely: put a few worked examples in the prompt, and the model performs the task without any weight update at all. No labelled training set, no optimiser, no checkpoint per task.

In the ladder's units: T5's largest was 11B parameters; GPT-3 is 175B, a ~16× jump, trained on roughly 300B tokens. Hold those two numbers together, because rungs 4 and 5 are an argument about precisely that ratio: 175B parameters against 300B tokens is about 1.7 training tokens per parameter. Nothing in this paper suggests that ratio is a choice at all — it reads as a consequence of using the compute available.

The interface change is the lasting one. Once the way to get behaviour out of a model is to write text at it, prompting becomes an engineering discipline, and everything on the reasoning ladder becomes possible.

01

The fine-tuning bottleneck

BERT had made a recipe famous: pre-train a big model once, then fine-tune it on each specific task with a labeled dataset. It worked brilliantly — but it had a cost that was easy to overlook. Every new task needed its own curated collection of thousands of labeled examples, and its own round of training that nudged the model's weights.

Humans don't work that way. You can be told "translate these to French" and shown one or two examples, and you're off — no dataset of ten thousand pairs, no retraining of your brain. The GPT-3 authors framed this squarely: the fine-tuning recipe was powerful but narrow, and it scaled poorly to the long tail of tasks nobody had built a dataset for. They wanted a model that could pick up a task the way a person does — from a short description and a handful of examples.

02

The bet: don't change the model — make it bigger

GPT-3's architecture is almost boringly familiar: it's the same autoregressive Transformer decoder as GPT-2, trained on the same humble objective — predict the next word, over and over, across a huge slice of the internet. The paper introduces essentially no new architecture. Its one radical move is scale.

GPT-2 had 1.5 billion parameters. GPT-3 has 175 billion — over a hundred times larger — trained on roughly 300 billion tokens of text. The hypothesis was that capability wasn't waiting on a cleverer design but on size, and that at some scale, new behaviors would simply emerge. The title says it all: Language Models are Few-Shot Learners. Scale was the whole idea.

The through-line

GPT-3 is the loudest evidence for the "scaling hypothesis" — that predictable gains come from making models, data, and compute bigger. It's the same bet the Scaling Laws and Chinchilla papers formalize; GPT-3 is where it stopped being a curve on a chart and started feeling like magic.

03

Zero-shot, one-shot, few-shot

The paper's central move is to stop fine-tuning entirely and instead put the "training" inside the prompt. It measures three settings, all with the model's weights frozen:

Zero-shot — you give only a task description. One-shot — you add a single worked example. Few-shot — you add several (often 10–100) examples before the real question. In every case the model just reads the prompt and continues it.

Few-shot prompt — teaching by example, in the text itself
sea otter  =>  loutre de mer
cheese  =>  fromage
plush giraffe  =>  girafe en peluche
otter  =>  ?
loutre  ·  model continues the pattern

Nothing here updates a single weight. The examples are just text the model reads on its way to generating the answer. And yet, at 175B, accuracy climbs steadily as you go from zero- to one- to few-shot — the extra examples genuinely help. Smaller models barely benefit; the effect grows with scale.

04

How it works under the hood

GPT-3 is a stack of 96 Transformer-decoder layers, 12,288-dimensional embeddings, 96 attention heads, and a context window of 2,048 tokens. Each layer is the standard decoder block: masked self-attention (each token attends only to tokens before it) followed by a feed-forward network. Trained on next-token prediction, it becomes a probability machine — given everything so far, what word comes next?

That single objective is deceptively powerful. To predict the next word well across the whole internet, the model has to implicitly pick up grammar, facts, translation, arithmetic, and reasoning patterns — because all of those show up in text. Few-shot prompting simply conditions that machine: the examples in the prompt shift the probabilities so the most likely continuation is the answer in the format you demonstrated.

05

The 175B, derived by hand

"175 billion parameters" sounds like a press-release number, but you can compute it from the architecture on a napkin. A Transformer layer's weights are dominated by four attention projections (each d×d) and two feed-forward matrices (d×4d and 4d×d), giving ≈ 12·d² parameters per layer:

The same formula reproduces the whole model family the paper trained (embedding matrix ≈ 50257·d added; it matters for the small ones, vanishes at scale):

ModelLayersdmodel12·L·d² + embeddingsPaper says
GPT-3 Small1276885M + 39M = 0.12B125M
GPT-3 XL2420481.21B + 0.10B = 1.31B1.3B
GPT-3 13B40514012.7B + 0.26B = 12.9B13B
GPT-3 175B9612288173.9B + 0.6B = 174.6B175B

Training cost falls out just as cleanly. Each token requires roughly 6 FLOPs per parameter (2 for the forward pass, 4 for backward), and GPT-3 saw 300B tokens:

That's several thousand petaflop/s-days. These two rules — 12·L·d² and 6·N·D — are the napkin math practitioners still use to size and price every model since.

06

In-context learning: the surprise

The headline phenomenon has a name: in-context learning. The model appears to "learn" the task from the examples in its context window, during a single forward pass, with no gradient descent and no weight change anywhere. Whatever adaptation is happening lives entirely in the activations as the model processes the prompt.

This was genuinely unexpected. Learning, in machine learning, had always meant updating weights. GPT-3 showed a second, temporary kind of learning that happens at inference time, purely from what's in front of the model. It reframed the interface to AI: you no longer train a model for a task, you describe the task and show examples. That's the birth of prompting as a discipline.

Worth knowing

In-context learning is why "prompt engineering" exists. Because the model adapts to whatever pattern you put in context, the wording, ordering, and choice of examples measurably change the answer — a lever you pull with text, not training runs.

Since then

What the authors admit, and what happened next

The paper's own limitations section is longer and franker than most: few-shot performance is still well short of fine-tuned state-of-the-art on many tasks; the model is weak on tasks requiring comparison of two sentences; it has no notion of which of its outputs are true; and the authors flag both the training-data contamination problem and the energy cost of the run. They also state plainly that the model reproduces the biases of its corpus.

The admission most relevant to this ladder is quieter: they note the model is trained once, and that they could not afford to retrain it to explore alternatives. A single un-repeatable run is not a measurement of how to spend compute — which is the gap rung 4 sets out to fill.

How it held up: in-context learning held up completely and is now the primary interface to every frontier model. The specific sizing did not. Within two years the same compute was understood to be badly allocated, and GPT-3's 1.7 tokens per parameter became the canonical example of an under-trained model — the comparison rung 5 uses to make its case.

SOLVE IT YOURSELF

Size and price any GPT on a napkin

The two estimation rules from the derivation, as runnable functions: rebuild the paper's model-family table from just layers and width, then price the training run with 6·N·D. Change the config to a modern model's shape and the same napkin math still lands within a few percent.

YOUR TASK

Write the body of train_flops. Everything else in the file is already written; this is the function the paper is about. Press ▶ Run to check it against the 5 assertions below — they start red.

WHAT IT HAS TO SATISFY — 5 ASSERTIONS
  1. Derives 175B within 1 percent
  2. Derives the small model near 125M
  3. 6ND reproduces the paper FLOPs
  4. The embedding matrix adds params on top of the core
  5. Training compute is linear in tokens (2x tokens = 2x FLOPs)
CPython · WebAssembly
07

The real results

Across dozens of benchmarks, few-shot GPT-3 was often competitive with — sometimes matching — fine-tuned models that had seen thousands of task-specific examples. It did strong translation with no parallel-text fine-tuning, answered trivia, unscrambled words, and even did multi-digit arithmetic it was never explicitly taught. The clearest pattern was that more examples and more parameters both helped.

SettingWhat the model seesTrend at 175B
Zero-shottask description onlysolid baseline
One-shot+ one exampleclear jump
Few-shot+ ~10–100 examplesbest; rivals fine-tuned models

The paper's own headline numbers, not paraphrases:

BenchmarkGPT-3 few-shotContext
LAMBADA (long-range completion)86.4% (76.2% zero-shot)zero-shot alone beat prior SOTA by 8 points
TriviaQA (closed-book)71.2%matched/beat fine-tuned open-domain systems
2-digit arithmetic~100%never explicitly taught; decays as digits grow
News-article generationhumans detect at ~52%chance is 50% — near-indistinguishable text

The scaling curves were the real message. Plot accuracy against model size and it keeps climbing — bigger models were not just a little better, they were qualitatively better at learning from context. The gap between few-shot and zero-shot also widened with scale, evidence that in-context learning is something large models grow into.

08

What it couldn't do

The paper is unusually candid about limits. GPT-3 makes things up — fluent, confident text that is simply wrong. It loses the thread over long passages, contradicting itself. It stumbles on tasks needing real multi-step reasoning, and its arithmetic falls apart past a few digits. Because it learned from the open internet, it also absorbed the web's biases around gender, race, and religion.

There's a deeper gap too: GPT-3 is trained only to continue text, not to follow instructions or be helpful. Ask it a question and it might answer — or it might continue with more questions, because that's a plausible continuation. Aligning that raw next-word engine to human intent was the unfinished business that InstructGPT and RLHF picked up next, and which ultimately produced ChatGPT.

09

Why it still matters

GPT-3 is the hinge between two eras. Before it, you adapted models by training them; after it, you adapted them by talking to them. In-context learning turned the prompt into the primary interface for AI, and made "few-shot" and "zero-shot" everyday vocabulary. Every prompt you write to a modern assistant is a descendant of this paper.

It also settled, loudly, that scale delivers — the conviction that drove the models that followed. GPT-3 wasn't aligned, wasn't a chatbot, and got plenty wrong. But it proved that a big enough next-word predictor is a general-purpose, promptable engine, and everything from InstructGPT to today's frontier models is a refinement of what GPT-3 first made undeniable.

The line to today

GPT-3 (capability) → InstructGPT (align it to follow instructions with RLHF) → ChatGPT (wrap it in a chat interface). If GPT-3 is the engine, the papers after it are the steering, the seatbelt, and the dashboard.

Check yourself

5 questions on this paper

Answer each one out loud before you open it. Recalling an answer is what makes it stick; recognising one you have just read is not. Your score is kept on this device.

What is GPT-3?

Show answer

GPT-3 is a 2020 language model from OpenAI with 175 billion parameters, described in the paper 'Language Models are Few-Shot Learners.' It is an autoregressive Transformer decoder trained to predict the next word on a huge corpus. Its landmark finding was that at this scale the model can perform new tasks from a few examples shown in the prompt — without any fine-tuning or weight updates.

What is in-context learning?

Show answer

In-context learning is GPT-3's ability to learn a task from the prompt itself. You show the model a few input-output examples in the text you send it, and it infers the pattern and continues it — all during a single forward pass, with no gradient updates and no change to its weights. This is what 'few-shot learning' means for GPT-3.

What is the difference between zero-shot, one-shot, and few-shot?

Show answer

Zero-shot gives the model only a task description and asks for the answer. One-shot adds a single worked example. Few-shot adds several (typically 10-100) examples in the prompt before the real question. GPT-3 showed that accuracy generally climbs from zero- to one- to few-shot, and that bigger models benefit more from the extra examples.

How is GPT-3 different from BERT?

Show answer

BERT is an encoder trained bidirectionally with masked language modeling, and it is fine-tuned per task. GPT-3 is a much larger left-to-right decoder trained only to predict the next token, and instead of fine-tuning it is prompted — you steer it with examples in context. GPT-3's scale and in-context learning are what set it apart.

What are GPT-3's limitations?

Show answer

GPT-3 can state falsehoods confidently, loses coherence over long passages, struggles with multi-step reasoning and arithmetic, and reflects biases in its training data. It is also expensive to run and, being trained only to predict text, is not aligned to follow instructions or human intent — the gap that InstructGPT and RLHF later addressed.

Where this sits

Pre-training, and the scaling laws

The ladder where rung 5 overturns rung 4. Read `scaling-laws` before `chinchilla` — the second measures the same axis in the same units and gets a different answer.

  1. 1BERT2019
  2. 2T52020
  3. 3GPT-32020
  4. 4Scaling Laws2020
  5. 5Chinchilla2022
  6. 6Textbooks Are All You Need2023
  7. 7Muon2024

All 110 papers, in 19 ladders →

Finished this one? 0 / 110 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns