Search

Search papers and lessons

Measuring Massive Multitask Language Understanding

Dan Hendrycks, Collin Burns, Steven Basart et al. · 2020

A 57-subject, multiple-choice test of language models' knowledge, scored with zero-shot and few-shot prompts; the largest GPT-3 scored 43.9% against 25% for guessing, far below experts.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Neural network basics
  • Linear algebra
  • Probability
  • Architectures
  • ReadReady to readNot yet

TL;DR

The paper builds a test of 57 subjects, from elementary mathematics and US history to law, medicine and computer science, made of about 16,000 four-option multiple-choice questions. Models are scored with zero-shot or few-shot prompts and no training on the test subjects. The main finding is that the largest GPT-3 model, with 175 billion parameters, scored 43.9% when given five examples, against 25% for random guessing, and no model came close to expert accuracy on any subject.

Builds on: Language Models are Few-Shot Learners (GPT-3), In-Context Learning · Leads to: later multiple-choice knowledge benchmarks, which report accuracy per subject in the same way

Why it mattered

The test gave the field a single, broad measure of how much general knowledge a language model holds, across subjects that range from school level to professional exams. Because it reports accuracy per subject, it also shows where a model is strong and where it is weak, which a single average hides.

The paper also changed what counts as a useful benchmark. By 2020, models were already near or above human level on several widely used tests such as GLUE and SuperGLUE, so those tests could no longer separate models well. By covering subjects that people study for years, the new test gave researchers a target that was far from solved when it appeared.

The problem

By 2020, language models were pretrained on very large amounts of web text, books and reference material. They saw a lot of specialized knowledge during that pretraining. But the benchmarks used to judge them were narrow. Commonsense tests such as HellaSwag asked questions that almost any child can answer, and reading-comprehension tests measured linguistic skill more than knowledge. Scores on these tests were approaching human level, so they said little about where models still failed.

There was also a mismatch in how models were tested. Previous benchmarks gave a model a large labelled training set for the task, which measured what the model could learn from that set. The paper asks a different question: how much knowledge did the model pick up during pretraining, when it is given no training on the test task? That means evaluating models in the zero-shot and few-shot settings described in Zero-Shot Learning and In-Context Learning.

How it works

The benchmark is a pipeline with a fixed set of steps. Trace one invented question through it. The question is illustrative, not from the paper's data.

  1. Collect a question from a source. The authors gathered questions by hand from freely available sources, such as practice exams and course materials, and labelled each with its subject. Suppose the question is "Which gas makes up most of Earth's atmosphere?" with four options and subject "high school chemistry". Check: each question belongs to exactly one of the 57 subjects.
  2. Split the questions. Each subject has a few examples with answers for the development set, which are used as the few-shot demonstrations, plus validation and test questions. Every subject has at least 100 test questions. Check: the test set is the only one used to report the final score.
  3. Build the prompt. The prompt starts with a header naming the subject, for example "The following are multiple choice questions (with answers) about high school chemistry." It then adds the chosen number of solved examples, which is zero in the zero-shot setting and up to five in the few-shot setting. It ends with the question, the four options labelled A to D, and the text "Answer:". Check: the prompt ends where the model must choose a letter.
  4. Read the model's choice. The model gives a probability to each of the tokens "A", "B", "C" and "D". The option with the highest probability is the prediction. The model does not write free text. Suppose the probabilities are A 0.10, B 0.55, C 0.20, D 0.15. The prediction is B. Check: the four probabilities sum to 1.
  5. Score it. If the prediction matches the answer key, count one correct answer. Suppose the answer key says B. The question is correct.
  6. Aggregate. Compute accuracy for each subject, then average over subjects to get the overall score. If the subject has four questions and three are correct, its accuracy is 75%. Check: with random guessing among four options, the expected accuracy is 25%.
flowchart LR
  A[Question with subject] --> B[Build prompt with header and k examples]
  B --> C[Model scores tokens A, B, C, D]
  C --> D[Pick highest-scoring letter]
  D --> E[Compare with answer key]
  E --> F[Accuracy per subject, then average]

The math

Accuracy and chance

For a set of NN questions with predicted letters y^i\hat{y}_i and answer key yiy_i, accuracy is the share of correct answers:

Acc=1N∑i=1N1[y^i=yi].\mathrm{Acc} = \frac{1}{N} \sum_{i=1}^{N} \mathbf{1}\big[\hat{y}_i = y_i\big].

Here 1[⋅]\mathbf{1}[\cdot] is 1 when the condition holds and 0 otherwise. With four options, a model that picks letters at random gets each question right with probability 1/41/4, so its expected accuracy is 0.250.25, or 25%. That is the "random chance" line used to judge the results.

Step 3 in symbols: the prediction

For a question with options AA to DD, the model produces a score svs_v for each letter vv, and the prediction is the letter with the largest probability after normalising over the four letters:

p(v)=exp⁡(sv)∑u∈{A,B,C,D}exp⁡(su),y^=arg⁡max⁡vp(v).p(v) = \frac{\exp(s_v)}{\sum_{u \in \{A,B,C,D\}} \exp(s_u)}, \qquad \hat{y} = \arg\max_{v} p(v).

This uses the same Softmax normalisation as the language model itself, restricted to the four letters. Taking the highest value is the decision rule.

Step 6 in symbols: the average over subjects

Let S\mathcal{S} be the set of 57 subjects and Accs\mathrm{Acc}_s the accuracy on subject ss. The overall score averages the subject accuracies, giving every subject the same weight regardless of how many questions it has:

Accmacro=1∣S∣∑s∈SAccs.\mathrm{Acc}_{\text{macro}} = \frac{1}{|\mathcal{S}|} \sum_{s \in \mathcal{S}} \mathrm{Acc}_s.

Averaging over all questions instead would give large subjects more weight. In the example above there is only one subject, so both give 75%.

Results

The main results use few-shot prompts for GPT-3 and a transfer setting for UnifiedQA, a text-to-text model fine-tuned on other question-answering datasets.

ModelAverage accuracy
Random baseline25.0%
UnifiedQA, 11 billion parameters, transfer setting48.9%
GPT-3, 175 billion parameters, few-shot43.9%
Estimated expert accuracyabout 89.8%
Amazon Mechanical Turk crowd workers34.5%

Three points stand out. First, the smaller GPT-3 models stayed close to chance, and the score rose sharply only at the largest size. Second, UnifiedQA scored higher than the few-shot 175-billion-parameter GPT-3 while having far fewer parameters, which suggests that its training on related question-answering data helped. Third, the best and worst subjects differ widely for the same model, which is why the per-subject breakdown matters.

The paper also reports limits. Models scored lowest on calculation-heavy STEM subjects and on subjects such as moral scenarios and professional law. GPT-3 was also poorly calibrated, meaning its stated confidence did not match how often it was right. Even so, every model was far below the estimated expert level on every subject.

Reading guide

The paper is short enough to read in one sitting. Its parts map to the prerequisites as follows.

  • The introduction: the motivation and the headline numbers. Needs Language Models are Few-Shot Learners (GPT-3) for the 175-billion-parameter model and In-Context Learning for the few-shot setting.
  • The related work: the difference between pretraining and fine-tuning, and why commonsense benchmarks saturated. Needs Transfer Learning and Fine-Tuning.
  • The description of the test: how the questions were collected and split, the 57 subjects and the four groups. Needs no new prerequisite beyond the idea of a multiple-choice test.
  • The experiments: the prompt format, the scoring rule and the results table. Needs Language Model and Softmax for how the letter probabilities are produced.
  • The discussion: why the test is built on pretraining rather than training data, and its limits. Needs Neural Scaling Laws for the argument that scale alone may not be enough.
  • The appendices: the models compared and the error analysis. Needs Transformer for the architecture of the models compared.

Check yourself

QuestionThe test has 57 subjects and four answer options per question. What accuracy would a model that guesses at random reach in expectation, and why?Show answer

With four options, each guess is correct with probability 1/4, so the expected accuracy is 0.25, or 25%. This is the random-chance line that the paper uses to judge whether a model has learned anything on the test.

QuestionA model gives letter probabilities A 0.20, B 0.05, C 0.60 and D 0.15 for a question whose answer key is A. Is the prediction correct, and what is the model's predicted letter?Show answer

The predicted letter is C, because it has the highest probability. The answer key is A, so the prediction is wrong. The four probabilities sum to 1, as they must after normalising over the four letters.

QuestionCompute accuracy. A model answers 3 of 4 questions correctly in subject X and 9 of 10 questions correctly in subject Y. What is its accuracy on the combined 14 questions, and what is the unweighted average of the two subject accuracies?Show answer

Combined accuracy is (3+9)/14=12/14≈0.857(3 + 9)/14 = 12/14 \approx 0.857, or about 85.7%. The unweighted average of the two subject accuracies is (0.75+0.90)/2=0.825(0.75 + 0.90)/2 = 0.825, or 82.5%. The two summaries differ because subject Y has more questions, which is the case where the choice of summary matters.

QuestionWhy does the paper measure models in the zero-shot and few-shot settings instead of fine-tuning them on the questions? Give one reason from the paper's argument and say what the score would miss if it had fine-tuned.Show answer

The paper wants to measure the knowledge a model picked up during pretraining. Fine-tuning on questions like the test would measure what the model can learn from a labelled set instead. A fine-tuned score would therefore mix knowledge with the skill of fitting that particular dataset, and it would miss how much the model already knew.

Sources

Read the full paper

Dan Hendrycks, Collin Burns, Steven Basart et al., 2020. arXiv:2009.03300