Evaluates the robustness of finetuned transformer models (BERT, GPT-2, T5) to various text perturbations (e.g., dropping nouns/verbs, character changes, adding text) across classification and generation tasks. It measures how much model performance degrades when inputs are syntactically or semantically altered. Use when the user wants to benchmark on GLUE, XSum, CommonGen, SQuAD, or asks about evaluating this task. Reports Accuracy, Robustness Score.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill text-perturbation-robustness-eval --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Text Perturbation Robustness Eval?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-text-perturbation-robustness-eval)More formats (shields.io, HTML) on the badges page.
---
name: text-perturbation-robustness-eval
description: Evaluates the robustness of finetuned transformer models (BERT, GPT-2, T5) to various text perturbations (e.g., dropping nouns/verbs, character changes, adding text) across classification and generation tasks. It measures how much model performance degrades when inputs are syntactically or semantically altered. Use when the user wants to benchmark on GLUE, XSum, CommonGen, SQuAD, or asks about evaluating this task. Reports Accuracy, Robustness Score.
metadata:
skill_kind: dataset_eval
source_arxiv: 2305.14453
bibtex_key: neerudu2023robustness
confidence: high
---
# text-perturbation-robustness-eval
> On Robustness of Finetuned Transformer-based NLP Models — Neerudu et al. (2023) (arXiv:2305.14453, 2023)
## What this evaluates
Evaluates the robustness of finetuned transformer models (BERT, GPT-2, T5) to various text perturbations (e.g., dropping nouns/verbs, character changes, adding text) across classification and generation tasks. It measures how much model performance degrades when inputs are syntactically or semantically altered.
## Datasets
- **GLUE** — total ?; splits: test (-1); HF `glue`
- **XSum** — total ?; splits: test (-1); HF `xsum`
- **CommonGen** — total ?; splits: val (-1); HF `allenai/common_gen`
- **SQuAD** — total ?; splits: test (-1); HF `squad`
## Metrics
- `Accuracy` **(primary)** — range: [0, 1]
- Fraction of correctly predicted labels out of total instances.
- `Matthews CC` — range: [-1, 1]
- Matthews Correlation Coefficient for binary classification tasks (e.g., CoLA).
- `Pearson CC` — range: [-1, 1]
- Pearson Correlation Coefficient for regression/similarity tasks (e.g., STS-B).
- `ROUGE-1` — range: [0, 1]
- Unigram overlap F1 score between generated and reference text.
- `ROUGE-2` — range: [0, 1]
- Bigram overlap F1 score between generated and reference text.
- `ROUGE-L` — range: [0, 1]
- Longest common subsequence F1 score between generated and reference text.
- `Robustness Score` **(primary)** — range: [0, 1]
- Ratio of the perturbed task metric to the clean (unperturbed) task metric: metric_perturbed / metric_clean.
## Input / output format
**Input**: Single sentences or sentence pairs for classification tasks; source documents for generation tasks.
**Output**: Predicted class labels or similarity scores for classification; generated text sequences for generation.
## Scoring recipe
```python
def compute_robustness(clean_metric, perturbed_metric):
return perturbed_metric / clean_metric
def compute_task_metric(predictions, gold, metric_name):
if metric_name == 'Accuracy':
return sum(p == g for p, g in zip(predictions, gold)) / len(gold)
elif metric_name == 'Matthews CC':
return matthews_corrcoef(gold, predictions)
elif metric_name == 'Pearson CC':
return pearsonr(gold, predictions)[0]
elif metric_name.startswith('ROUGE'):
return rouge_score(gold, predictions, rouge_types=[metric_name])
```
## Common pitfalls
- Robustness scores are reported as ratios (perturbed/clean), not absolute differences or percentages.
- GLUE sub-tasks use different primary metrics (Accuracy, Matthews CC, Pearson CC) that must be applied correctly per dataset.
- CKA and STIR measure representation similarity, not task performance robustness, and should not be confused with the evaluation metrics.
## Evidence (verbatim from paper)
> Table 1: Accuracy comparison on various GLUE datasets for BERT, GPT-2 and T5 on the test dataset. Table 3: Comparison of robustness scores on various GLUE tasks for finetuned Transformer models under different types of perturbations.
## Citation
```bibtex
@misc{neerudu2023robustness,
title={On Robustness of Finetuned Transformer-based NLP Models},
author={Neerudu et al. (2023)},
year={2023},
note={arXiv:2305.14453}
}
```
- arXiv: 2305.14453
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!