RACE

ReAding Comprehension from Examinations

Tests reading comprehension using multiple-choice questions from English exams given to Chinese school students.

Released Apr 2017 Metric accuracy SOTA 92.9 (RACE-H) · Claude 3 Opus (2024)
01

At a glance

Task
4-way multiple choice over a passage
Size
28k passages, 98k questions; RACE-M (middle school) 25k Q, RACE-H (high school) 70k Q
Metric
Accuracy (RACE-M, RACE-H, overall)
Source
English exams for Chinese students aged 12–18, written by teachers
Licence
Research use only
RACE: Large-scale ReAding Comprehension Dataset From Examinations
Lai, Xie, Liu, Yang, Hovy · EMNLP 2017
Read the paper ↗ Hugging Face ↗
02

What it tests

RACE is reading comprehension the way a school exam does it: a passage of a few hundred words, a question, and four options written by a teacher who wanted to test understanding rather than word-matching.

Because exam writers deliberately include distractors that reuse words from the passage, and because many questions ask about the main idea, the author's attitude or what a pronoun refers to, a model has to combine information across sentences. The original paper estimated that only about a quarter of questions can be answered by matching a single sentence.

RACE-H (high school) is noticeably harder than RACE-M (middle school); papers report both. GPT-1 fine-tuned on it, and GPT-3 evaluated it few-shot and found it one of the weaker in-context learning results.

03

Examples

Items from the dataset (or representative items where the originals are not freely redistributable).

RACE-M style
Passage (excerpt)
Runners in a relay race pass a stick in one direction. However, merchants passed silk, gold, fruit, and glass along the Silk Road in more than one direction. They earned their living by traveling the famous Silk Road. The Silk Road was not a simple trading network. It passed through thousands of cities and towns…
Question
The Silk Road was named after the silk because ______.
Options
A. silk was the most important product traded · B. silk was the most expensive goods · C. silk was transported in the greatest quantity · D. silk was brought by the Chinese first
AnswerA (representative item, paraphrased)
RACE-H style question types
Typical stems
'What is the best title for the passage?' · 'The underlined word "it" in paragraph 2 refers to…' · 'We can infer from the passage that…' · 'What is the author's attitude towards…'
04

Reported results

Scores reported on this benchmark, with the evaluation setting each one used.

SettingReportedContext
Fine-tuned; passage+question+each option scored, softmax over options59.0 overall (62.9 RACE-M / 57.4 RACE-H)Prior best 53.3 (Bi-attention MRU ensemble)
Few-shot (10 examples)RACE-h 46.8RACE-m 58.1Fine-tuned SOTA then 90.0 / 93.1 (Megatron-BERT); one of GPT-3's weakest results
05

State of the art

Best known · accuracy
92.9 (RACE-H)
✓ saturated · at or above human level
Model
Claude 3 Opus (5-shot)
2024
Human baseline
Turker ~69 (H) / ~85 (M); ceiling 94.2 / 95.4

Best fine-tuned encoder: Megatron-BERT 3.9B ensemble, 90.0 RACE-H / 93.1 RACE-M (2019). Frontier models rarely report RACE any more. Source: www-cdn.anthropic.com ↗ · checked October 2026.

06

Quickstart

Load the benchmark and score a Hugging Face causal LM on it in a few lines.

1Install
shell
pip install -U datasets transformers evaluate lm-eval sacrebleu rouge-score scikit-learn
2Load the data

article, question, options (list of 4), answer ('A'–'D'). Configs: 'high', 'middle', 'all'.

python · load
from datasets import load_dataset

ds = load_dataset("ehovy/race", "all", split="test")
print(ds)            # columns: article, question, options (list of 4), answer ('A'–'D')
print(ds[0])
3Score a model

Two helpers cover every benchmark in this collection: loglik for anything multiple-choice (score each option, pick the highest) and generate for anything free-form. Swap MODEL for whatever you are evaluating.

python · helpers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

MODEL = "gpt2"                                   # or "Qwen/Qwen2.5-1.5B", "meta-llama/Llama-3.2-1B", …
tok = AutoTokenizer.from_pretrained(MODEL); model = AutoModelForCausalLM.from_pretrained(MODEL, torch_dtype=torch.bfloat16).eval().to("cuda")

@torch.no_grad()
def loglik(context, continuation):
    """Sum of log-probs of `continuation` tokens given `context` — the standard multiple-choice scorer."""
    ids = tok(context + continuation, return_tensors="pt").input_ids.to(model.device)
    n_ctx = len(tok(context).input_ids)
    logp = model(ids).logits.log_softmax(-1)[0, :-1]
    return logp.gather(1, ids[0, 1:, None])[n_ctx - 1:].sum().item()

@torch.no_grad()
def generate(prompt, max_new_tokens=32, stop=None):
    ids = tok(prompt, return_tensors="pt").input_ids.to(model.device)
    out = model.generate(ids, max_new_tokens=max_new_tokens, do_sample=False, pad_token_id=tok.eos_token_id)
    text = tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True)
    return text.split(stop)[0] if stop else text
python · evaluate
acc = 0
for ex in ds:
    ctx = f"Article: {ex['article']}\n\nQuestion: {ex['question']}\nAnswer:"
    s = [loglik(ctx, " " + o) / max(1, len(o)) for o in ex["options"]]
    acc += int("ABCD"[s.index(max(s))] == ex["answer"])
print("accuracy", acc / len(ds))
4Or use lm-evaluation-harness

Task name(s): race. The harness reproduces the GPT-3 prompt formats and reports the standard metric.

shell
lm_eval --model hf --model_args pretrained=gpt2,dtype=bfloat16 \
        --tasks race --num_fewshot 0 --batch_size auto --output_path results/
07

Pitfalls

  • Report RACE-M and RACE-H separately — 'overall' hides a 10-point gap.
  • lm-eval's `race` task uses RACE-H only and scores by log-likelihood of the option text; exam-style prompting with letters can give different numbers.
  • Passages were written for language learners; vocabulary is simple but reasoning is not.
08

References