GLUE
A collection of nine sentence-understanding tests (grammar, sentiment, paraphrase, similarity and inference) combined into one overall score.
At a glance
What it tests
GLUE bundled nine existing datasets into one number so that a single model could be compared across tasks. All of them are sentence or sentence-pair classification, which is why the GPT-1 recipe — one transformer, a tiny task-specific head, inputs concatenated with delimiters — fit so well.
GPT-1 scored 72.8 on the leaderboard in June 2018, the previous best being 68.9. BERT reached 80.5 four months later, and by 2019 models passed the 87.1 human baseline; SuperGLUE was created because GLUE had stopped discriminating between models.
WNLI (a Winograd-derived task with a broken train/dev split) is usually predicted as majority class; most papers footnote this.
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 per task, single model | 72.8 overall | Prior best 68.9; wins on 8 of 9 tasks (not RTE/SST-2 vs ensembles) |
State of the art
Leaderboard has not moved since 2022. Source: gluebenchmark.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
One config per task: cola, sst2, mrpc, qqp, stsb, mnli, qnli, rte, wnli, ax. `evaluate.load('glue', '<task>')` gives the matching metric.
from datasets import load_dataset ds = load_dataset("nyu-mll/glue", "<task>", split="validation") print(ds) # columns: One config per task: cola, sst2, mrpc, qqp, stsb, mnli, qnli, rte, wnli, ax 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
DATASET = "nyu-mll/glue" # Loop every task of the suite and compute the official metric with `evaluate` import evaluate TASKS = ["cola", "sst2", "mrpc", "qqp", "mnli", "qnli", "rte"] # GLUE; for SuperGLUE use boolq, cb, copa, multirc, record, rte, wic, wsc.fixed for t in TASKS: d = load_dataset(DATASET, t, split="validation" if t != "mnli" else "validation_matched") metric = evaluate.load(DATASET.split("/")[-1], t) preds = [predict(t, ex) for ex in d] # your per-task prompting / scoring goes here print(t, metric.compute(predictions=preds, references=d["label"]))
Task name(s): glue (group: cola, sst2, mrpc, qqp, mnli, qnli, rte, wnli). The harness reproduces the GPT-3 prompt formats and reports the standard metric.
lm_eval --model hf --model_args pretrained=gpt2,dtype=bfloat16 \
--tasks glue --num_fewshot 0 --batch_size auto --output_path results/Pitfalls
- Test labels are hidden; dev-set 'GLUE scores' are common in papers but not comparable to leaderboard numbers.
- Averaging requires the exact per-task metric mix; use `evaluate`'s glue metric per task.
- WNLI is adversarial by accident — majority-class (65.1) beats most models.
References
- Paper (arXiv 1804.07461)https://arxiv.org/abs/1804.07461
- Leaderboardhttps://gluebenchmark.com/leaderboard
- Hugging Facehttps://huggingface.co/datasets/nyu-mll/glue