RTE

Recognizing Textual Entailment

Tests whether a model can decide if a short news passage implies a hand-written statement; a small, old and surprisingly hard set.

Released 2005–2018 Metric test accuracy (SuperGLUE) SOTA 96.0 · Vega v2 (2022)
01

At a glance

Task
Binary (entailment / not entailment)
Size
2.5k train / 277 dev / 3k test
Metric
Accuracy
Source
News and Wikipedia text from RTE1, RTE2, RTE3 and RTE5
Part of
GLUE and SuperGLUE
The PASCAL Recognising Textual Entailment Challenge
Dagan, Glickman, Magnini (RTE1); later RTE2/3/5 overviews · PASCAL 2005 / TAC
Read the paper ↗ Hugging Face ↗
02

What it tests

RTE predates deep learning. The premise is a sentence or short passage from a news article; the hypothesis is a sentence written by a human; the question is whether a typical reader would infer the hypothesis from the premise.

Two things make it hard despite its age: the training set is tiny (about 2,500 pairs), and the hypotheses were written by experts rather than crowd-workers, so there are fewer cheap lexical cues. GPT-1 only reached 56% on it, barely above the 50% majority baseline.

With large pre-trained models the picture flipped — RTE became one of the tasks where scale helps most, which is why GPT-3 reported it as part of SuperGLUE.

03

Examples

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

Premise
Dana Reeve, the widow of the actor Christopher Reeve, has died of lung cancer at age 44, according to the Christopher Reeve Foundation.
Hypothesis
Christopher Reeve had an accident.
Answernot entailment
Premise
Yet, we now are discovering that antibiotics are losing their effectiveness against illness. Disease-causing bacteria are mutating faster than we can come up with new antibiotics to fight the new variations.
Hypothesis
Bacteria is winning the war against antibiotics.
Answerentailment
04

Reported results

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

SettingReportedContext
Fine-tuned56.0 accBelow prior best 61.7; the only GLUE task GPT-1 lost
Few-shot (32 examples in context), SuperGLUE version69.0 accZero-shot 63.5, one-shot 70.4; fine-tuned SOTA at the time 92.5
05

State of the art

Best known · test accuracy (SuperGLUE)
96.0
✓ saturated · at or above human level
Model
Vega v2 (JD Explore Academy)
2022
Human baseline
93.6

GLUE-leaderboard RTE best is 94.1 (Turing NLR v5). Source: arxiv.org ↗ · 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

premise, hypothesis, label (0 entailment · 1 not_entailment). The GLUE copy is `nyu-mll/glue`, config `rte`.

python · load
from datasets import load_dataset

ds = load_dataset("aps/super_glue", "rte", split="validation")
print(ds)            # columns: premise, hypothesis, label (0 entailment · 1 not_entailment)
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
LABELS = ["True", "False"]              # entailment / not_entailment
def prompt(ex):
    a = ex.get("premise") or ex.get("question"); b = ex.get("hypothesis") or ex.get("sentence")
    return f"{a}\nQuestion: {b} True or False?\nAnswer:"
acc = sum(int(max(range(2), key=lambda i: loglik(prompt(ex), " " + LABELS[i])) == ex["label"]) for ex in ds) / len(ds)
print("accuracy", acc)
4Or use lm-evaluation-harness

Task name(s): rte. 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 rte --num_fewshot 0 --batch_size auto --output_path results/
07

Pitfalls

  • 277 dev examples means ±3 points of noise between runs; average several seeds.
  • GLUE and SuperGLUE ship the same data with different split sizes; cite which one.
08

References