RACE
Tests reading comprehension using multiple-choice questions from English exams given to Chinese school students.
At a glance
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.
Examples
Items from the dataset (or representative items where the originals are not freely redistributable).
Reported results
Scores reported on this benchmark, with the evaluation setting each one used.
| Setting | Reported | Context |
|---|---|---|
| Fine-tuned; passage+question+each option scored, softmax over options | 59.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.1 | Fine-tuned SOTA then 90.0 / 93.1 (Megatron-BERT); one of GPT-3's weakest results |
State of the art
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.
Quickstart
Load the benchmark and score a Hugging Face causal LM on it in a few lines.
pip install -U datasets transformers evaluate lm-eval sacrebleu rouge-score scikit-learn
article, question, options (list of 4), answer ('A'–'D'). Configs: 'high', 'middle', 'all'.
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])
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.
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
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))
Task name(s): race. The harness reproduces the GPT-3 prompt formats and reports the standard metric.
lm_eval --model hf --model_args pretrained=gpt2,dtype=bfloat16 \
--tasks race --num_fewshot 0 --batch_size auto --output_path results/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.
References
- Paper (arXiv 1704.04683)https://arxiv.org/abs/1704.04683
- Dataset page (CMU)https://www.cs.cmu.edu/~glai1/data/race/
- Hugging Facehttps://huggingface.co/datasets/ehovy/race