adversarial-rc-eval
Beat the AI: Investigating Adversarial Human Annotation for Reading Comprehension — Bartolo et al. (2020) (arXiv:2002.00293, 2020)
What this evaluates
This evaluation probes a model's ability to answer reading comprehension questions under adversarial conditions, specifically testing generalization across datasets constructed by progressively stronger language models. It measures how well models trained on challenging, model-in-the-loop generated questions can handle both adversarial and standard benchmarks.
Datasets
- SQuAD — total ?; splits: train (-1), test (-1)
- BiDAF-adversarial — total ?; splits: train (-1), test (-1)
- BERT-adversarial — total ?; splits: train (-1), test (-1)
- RoBERTa-adversarial — total ?; splits: train (-1), test (-1)
- DROP — total ?; splits: test (-1)
- Natural Questions — total ?; splits: test (-1)
Metrics
F1 (primary) — range: [0, 100] (percent)
- Token-level F1 score between the predicted answer string and the gold answer string, calculated as the harmonic mean of precision and recall over word tokens.
EM — range: [0, 100] (percent)
- Exact match accuracy; returns 1 if the predicted answer string exactly matches the gold answer string, else 0.
Input / output format
Input: A context passage (paragraph) and a natural language question requiring an answer extracted from or inferred from the passage.
Output: A text span or string representing the predicted answer.
Scoring recipe
def score(predictions, golds):
em = sum(1 for p, g in zip(predictions, golds) if p == g) / len(predictions)
f1s = []
for p, g in zip(predictions, golds):
p_tok, g_tok = set(p.lower().split()), set(g.lower().split())
if not p_tok or not g_tok: f1s.append(0.0)
else:
common = p_tok & g_tok
prec, rec = len(common)/len(p_tok), len(common)/len(g_tok)
f1s.append(2*prec*rec/(prec+rec))
return sum(f1s)/len(f1s), em
Common pitfalls
- Random initialization and mini-batch ordering during training significantly impact adversarial annotation consistency; retrained models often achieve non-zero EM on their own adversarial datasets (Table 5).
- Evaluations are averaged over 10 runs with different random seeds, and results report mean ± standard deviation, not single-run scores.
- Adversarial datasets are model-specific; training on data generated by a weaker model does not guarantee performance on datasets generated by stronger models.
Evidence (verbatim from paper)
First, we observe – as expected given our annotation constraints – that model performance is 0.0EM on datasets created with the same respective model in the annotation loop. We observe however that retrained models do not reliably perform as poorly on those samples. For example, BERT reaches 19.7EM, whereas the original model used during annotation provides no correct answer with 0.0EM.
Citation
@misc{bartolo2020beattheai,
title={Beat the AI: Investigating Adversarial Human Annotation for Reading Comprehension},
author={Bartolo et al. (2020)},
year={2020},
note={arXiv:2002.00293}
}
1---2name: adversarial-rc-eval3description: This evaluation probes a model's ability to answer reading comprehension questions under adversarial conditions, specifically testing generalization across datasets constructed by progressively stronger language models. It measures how well models trained on challenging, model-in-the-loop generated questions can handle both adversarial and standard benchmarks. Use when the user wants to benchmark on SQuAD, BiDAF-adversarial, BERT-adversarial, RoBERTa-adversarial, DROP, Natural Questions, or asks about evaluating this task. Reports F1.4---56# adversarial-rc-eval78> Beat the AI: Investigating Adversarial Human Annotation for Reading Comprehension — Bartolo et al. (2020) (arXiv:2002.00293, 2020)910## What this evaluates1112This evaluation probes a model's ability to answer reading comprehension questions under adversarial conditions, specifically testing generalization across datasets constructed by progressively stronger language models. It measures how well models trained on challenging, model-in-the-loop generated questions can handle both adversarial and standard benchmarks.1314## Datasets1516- **SQuAD** — total ?; splits: train (-1), test (-1)17- **BiDAF-adversarial** — total ?; splits: train (-1), test (-1)18- **BERT-adversarial** — total ?; splits: train (-1), test (-1)19- **RoBERTa-adversarial** — total ?; splits: train (-1), test (-1)20- **DROP** — total ?; splits: test (-1)21- **Natural Questions** — total ?; splits: test (-1)2223## Metrics2425- `F1` **(primary)** — range: [0, 100] (percent)26 - Token-level F1 score between the predicted answer string and the gold answer string, calculated as the harmonic mean of precision and recall over word tokens.27- `EM` — range: [0, 100] (percent)28 - Exact match accuracy; returns 1 if the predicted answer string exactly matches the gold answer string, else 0.2930## Input / output format3132**Input**: A context passage (paragraph) and a natural language question requiring an answer extracted from or inferred from the passage.3334**Output**: A text span or string representing the predicted answer.3536## Scoring recipe3738```python39def score(predictions, golds):40 em = sum(1 for p, g in zip(predictions, golds) if p == g) / len(predictions)41 f1s = []42 for p, g in zip(predictions, golds):43 p_tok, g_tok = set(p.lower().split()), set(g.lower().split())44 if not p_tok or not g_tok: f1s.append(0.0)45 else:46 common = p_tok & g_tok47 prec, rec = len(common)/len(p_tok), len(common)/len(g_tok)48 f1s.append(2*prec*rec/(prec+rec))49 return sum(f1s)/len(f1s), em50```5152## Common pitfalls5354- Random initialization and mini-batch ordering during training significantly impact adversarial annotation consistency; retrained models often achieve non-zero EM on their own adversarial datasets (Table 5).55- Evaluations are averaged over 10 runs with different random seeds, and results report mean ± standard deviation, not single-run scores.56- Adversarial datasets are model-specific; training on data generated by a weaker model does not guarantee performance on datasets generated by stronger models.5758## Evidence (verbatim from paper)5960> First, we observe – as expected given our annotation constraints – that model performance is 0.0EM on datasets created with the same respective model in the annotation loop. We observe however that retrained models do not reliably perform as poorly on those samples. For example, BERT reaches 19.7EM, whereas the original model used during annotation provides no correct answer with 0.0EM.6162## Citation6364```bibtex65@misc{bartolo2020beattheai,66 title={Beat the AI: Investigating Adversarial Human Annotation for Reading Comprehension},67 author={Bartolo et al. (2020)},68 year={2020},69 note={arXiv:2002.00293}70}71```7273- arXiv: 2002.00293