backdoor-detection-purification-eval
DUP: Detection-guided Unlearning for Backdoor Purification in Language Models — Hu et al. (2025) (arXiv:2508.01647, 2025)
What this evaluates
Evaluates language models' vulnerability to backdoor attacks and the effectiveness of detection and purification defenses. It probes whether a model can correctly classify clean text while resisting trigger-induced misclassifications, and whether a defense can identify poisoned samples without degrading benign task performance.
Datasets
- SST-2 — total ?; splits: train (-1), val (-1), test (-1)
- YELP — total ?; splits: train (-1), val (-1), test (-1)
- AG’s News — total ?; splits: train (-1), val (-1), test (-1)
Metrics
AUC (primary) — range: [0, 1]
- Area Under the Receiver Operating Characteristic curve. It measures the detector's ability to distinguish between clean and poisoned samples across all classification thresholds, independent of a fixed cutoff.
FAR — range: percent
- False Acceptance Rate. The percentage of poisoned samples that are incorrectly classified as clean by the detector.
FRR — range: percent
- False Rejection Rate. The percentage of clean samples that are incorrectly classified as poisoned by the detector.
CACC — range: percent
- Clean Accuracy. The classification accuracy of the purified model on benign (unpoisoned) test samples, measuring utility preservation.
ASR — range: percent
- Attack Success Rate. The percentage of poisoned test samples that successfully trigger the backdoor behavior (i.e., are misclassified to the attacker's target label) after purification.
Input / output format
Input: Text sequences (sentences) from SST-2, YELP, or AG's News. For detection evaluation, inputs are split into clean samples and poisoned samples (poisoned at a 0.2 rate using explicit or implicit triggers). For purification evaluation, inputs are clean samples (to compute CACC) and poisoned samples (to compute ASR).
Output: Classification logits or probabilities for the target task. Detection metrics use anomaly scores or binary labels; purification metrics use predicted class labels.
Scoring recipe
def compute_metrics(y_true_clean, y_true_poisoned, y_pred_clean, y_pred_poisoned, anomaly_scores):
# Detection
auc = roc_auc_score(y_true_clean_poisoned, anomaly_scores)
far = sum(1 for p in y_pred_poisoned if p == 'clean') / len(y_pred_poisoned)
frr = sum(1 for p in y_pred_clean if p == 'poisoned') / len(y_pred_clean)
# Purification
cacc = sum(1 for p, g in zip(y_pred_clean, y_true_clean) if p == g) / len(y_true_clean)
asr = sum(1 for p in y_pred_poisoned if p == target_label) / len(y_pred_poisoned)
return {'AUC': auc, 'FAR': far, 'FRR': frr, 'CACC': cacc, 'ASR': asr}
Common pitfalls
- Confusing detection metrics (AUC/FAR/FRR) with purification metrics (CACC/ASR), as they evaluate different defense stages and use different input subsets.
- Failing to report results separately for explicit vs. implicit triggers, since implicit attacks (e.g., Stylebkd, Synbkd) cause significant performance drops in baselines but are handled well by detection-guided methods.
- Assuming defense generalizes uniformly across architectures; e.g., DAN works well on BERT but degrades significantly on LLaMA, so architecture-specific reporting is necessary.
Evidence (verbatim from paper)
We evaluate detection performance using the Area Under the Receiver Operating Characteristic (AUC) as a threshold-independent metric, alongside the False Acceptance Rate (FAR) and the False Rejection Rate (FRR) for a more detailed analysis. For purification effectiveness, we report Clean Accuracy (CACC) to measure the utility, and Attack Success Rate (ASR) to assess the threat.
Citation
@misc{hu2025dup,
title={DUP: Detection-guided Unlearning for Backdoor Purification in Language Models},
author={Hu et al. (2025)},
year={2025},
note={arXiv:2508.01647}
}
1---2name: backdoor-detection-purification-eval3description: Evaluates language models' vulnerability to backdoor attacks and the effectiveness of detection and purification defenses. It probes whether a model can correctly classify clean text while resisting trigger-induced misclassifications, and whether a defense can identify poisoned samples without degrading benign task performance. Use when the user wants to benchmark on SST-2, YELP, AG’s News, or asks about evaluating this task. Reports AUC.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/backdoor-detection-purification-eval6 skill_kind: dataset_eval7 source_arxiv: 2508.016478 bibtex_key: hu2025dup9 confidence: high10---1112# backdoor-detection-purification-eval1314> DUP: Detection-guided Unlearning for Backdoor Purification in Language Models — Hu et al. (2025) (arXiv:2508.01647, 2025)1516## What this evaluates1718Evaluates language models' vulnerability to backdoor attacks and the effectiveness of detection and purification defenses. It probes whether a model can correctly classify clean text while resisting trigger-induced misclassifications, and whether a defense can identify poisoned samples without degrading benign task performance.1920## Datasets2122- **SST-2** — total ?; splits: train (-1), val (-1), test (-1)23- **YELP** — total ?; splits: train (-1), val (-1), test (-1)24- **AG’s News** — total ?; splits: train (-1), val (-1), test (-1)2526## Metrics2728- `AUC` **(primary)** — range: [0, 1]29 - Area Under the Receiver Operating Characteristic curve. It measures the detector's ability to distinguish between clean and poisoned samples across all classification thresholds, independent of a fixed cutoff.30- `FAR` — range: percent31 - False Acceptance Rate. The percentage of poisoned samples that are incorrectly classified as clean by the detector.32- `FRR` — range: percent33 - False Rejection Rate. The percentage of clean samples that are incorrectly classified as poisoned by the detector.34- `CACC` — range: percent35 - Clean Accuracy. The classification accuracy of the purified model on benign (unpoisoned) test samples, measuring utility preservation.36- `ASR` — range: percent37 - Attack Success Rate. The percentage of poisoned test samples that successfully trigger the backdoor behavior (i.e., are misclassified to the attacker's target label) after purification.3839## Input / output format4041**Input**: Text sequences (sentences) from SST-2, YELP, or AG's News. For detection evaluation, inputs are split into clean samples and poisoned samples (poisoned at a 0.2 rate using explicit or implicit triggers). For purification evaluation, inputs are clean samples (to compute CACC) and poisoned samples (to compute ASR).4243**Output**: Classification logits or probabilities for the target task. Detection metrics use anomaly scores or binary labels; purification metrics use predicted class labels.4445## Scoring recipe4647```python48def compute_metrics(y_true_clean, y_true_poisoned, y_pred_clean, y_pred_poisoned, anomaly_scores):49 # Detection50 auc = roc_auc_score(y_true_clean_poisoned, anomaly_scores)51 far = sum(1 for p in y_pred_poisoned if p == 'clean') / len(y_pred_poisoned)52 frr = sum(1 for p in y_pred_clean if p == 'poisoned') / len(y_pred_clean)53 # Purification54 cacc = sum(1 for p, g in zip(y_pred_clean, y_true_clean) if p == g) / len(y_true_clean)55 asr = sum(1 for p in y_pred_poisoned if p == target_label) / len(y_pred_poisoned)56 return {'AUC': auc, 'FAR': far, 'FRR': frr, 'CACC': cacc, 'ASR': asr}57```5859## Common pitfalls6061- Confusing detection metrics (AUC/FAR/FRR) with purification metrics (CACC/ASR), as they evaluate different defense stages and use different input subsets.62- Failing to report results separately for explicit vs. implicit triggers, since implicit attacks (e.g., Stylebkd, Synbkd) cause significant performance drops in baselines but are handled well by detection-guided methods.63- Assuming defense generalizes uniformly across architectures; e.g., DAN works well on BERT but degrades significantly on LLaMA, so architecture-specific reporting is necessary.6465## Evidence (verbatim from paper)6667> We evaluate detection performance using the Area Under the Receiver Operating Characteristic (AUC) as a threshold-independent metric, alongside the False Acceptance Rate (FAR) and the False Rejection Rate (FRR) for a more detailed analysis. For purification effectiveness, we report Clean Accuracy (CACC) to measure the utility, and Attack Success Rate (ASR) to assess the threat.6869## Citation7071```bibtex72@misc{hu2025dup,73 title={DUP: Detection-guided Unlearning for Backdoor Purification in Language Models},74 author={Hu et al. (2025)},75 year={2025},76 note={arXiv:2508.01647}77}78```7980- arXiv: 2508.01647