Improving Black-box Robustness with In-Context Rewriting
Not on the map. Why?
Abstract (arXiv)
Machine learning models for text classification often excel on in-distribution (ID) data but struggle with unseen out-of-distribution (OOD) inputs. Most techniques for improving OOD robustness are not applicable to settings where the model is effectively a black box, such as when the weights are frozen, retraining is costly, or the model is leveraged via an API. Test-time augmentation (TTA) is a simple post-hoc technique for improving robustness that sidesteps black-box constraints by aggregating predictions across multiple augmentations of the test input. TTA has seen limited use in NLP due to the challenge of generating effective natural language augmentations. In this work, we propose LLM-TTA, which uses LLM-generated augmentations as TTA's augmentation function. LLM-TTA outperforms conventional augmentation functions across sentiment, toxicity, and news classification tasks for BERT and T5 models, with BERT's OOD robustness improving by an average of 4.48 percentage points without regressing average ID performance. We explore selectively augmenting inputs based on prediction entropy to reduce the rate of expensive LLM augmentations, allowing us to maintain performance gains while reducing the average number of generated augmentations by 57.74%. LLM-TTA is agnostic to the task model architecture, does not require OOD labels, and is effective across low and high-resource settings. We share our data, models, and code for reproducibility.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 73 of its 96 references that are in the map. First posted on arXiv 13 Feb 2024.
Builds on
73 of 96 references.
References · 73
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2019Benchmarking Neural Network Robustness to Common Corruptions and Perturbationscited by 2,857
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
- 2020The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalizationcited by 1,842
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
38 more
- 2020WILDS: A Benchmark of in-the-Wild Distribution Shiftscited by 1,366
- 2019Certified Adversarial Robustness via Randomized Smoothingcited by 1,324
- 2019Unsupervised Data Augmentation for Consistency Trainingcited by 1,057
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
- 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 800
- 2015Improving Neural Machine Translation Models with Monolingual Datacited by 784
- 2021A Survey of Uncertainty in Deep Neural Networkscited by 675
- 2020Measuring Robustness to Natural Distribution Shifts in Image Classificationcited by 452
- 2022Memory-Based Model Editing at Scalecited by 443
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 419
- 2023Large Language Models Are State-of-the-Art Evaluators of Translation Qualitycited by 416
- 2021A Survey of Data Augmentation Approaches for NLPcited by 408
- 2019Nuanced Metrics for Measuring Unintended Bias with Real Data for Text Classificationcited by 396
- 2021MEMO: Test Time Robustness via Adaptation and Augmentationcited by 376
- 2020Med-BERT: pre-trained contextualized embeddings on large-scale structured electronic health records for disease predictioncited by 368
- 2023A Comprehensive Survey on Test-Time Adaptation under Distribution Shiftscited by 353
- 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
- 2021Unsolved Problems in ML Safetycited by 291
- 2020On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselinescited by 254
- 2017PixelDefend: Leveraging Generative Models to Understand and Defend against Adversarial Examplescited by 243
- 2021Latent Hatred: A Benchmark for Understanding Implicit Hate Speechcited by 216
- 2018Contextual Augmentation: Data Augmentation by Words with Paradigmatic Relationscited by 201
- 2019Counterfactual Data Augmentation for Mitigating Gender Stereotypes in Languages with Rich Morphologycited by 200
- 2019Facebook FAIR's WMT19 News Translation Task Submissioncited by 179
- 2019Not Enough Data? Deep Learning to the Rescue!cited by 174
- 2020Data Augmentation using Pre-trained Transformer Modelscited by 168
- 2018QANet: Combining Local Convolution with Global Self-Attention for Reading Comprehensioncited by 164
- 2023Multilingual Machine Translation with Large Language Models: Empirical Results and Analysiscited by 156
- 2020An Empirical Study on Robustness to Spurious Correlations using Pre-trained Language Modelscited by 133
- 2020Better Aggregation in Test-Time Augmentationcited by 121
- 2023Change is Hard: A Closer Look at Subpopulation Shiftcited by 119
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2021A Survey on Data Augmentation for Text Classificationcited by 111
- 2021An Empirical Survey of Data Augmentation for Limited Data Learning in NLPcited by 101
- 2023Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalizationcited by 100
- 2023Revisiting Out-of-distribution Robustness in NLP: Benchmark, Analysis, and LLMs Evaluationscited by 96
- 2021Challenges in Automated Debiasing for Toxic Language Detectioncited by 95
- 2020SSMBA: Self-Supervised Manifold Based Data Augmentation for Improving Out-of-Domain Robustnesscited by 94
50 most cited of 73 All 73 (JSON)
Built on by
Citing papers per year: 2024: 4; 2025: 2; 2026: 2.
8 papers.
- 2024A Survey on Medical Large Language Models: Technology, Application, Trustworthiness, and Future Directionscited by 34
- 2025A Comprehensive Survey on the Trustworthiness of Large Language Models in Healthcarecited by 27
- 2025SLOT: Sample-specific Language Model Optimization at Test-timecited by 17
- 2024Rephrasing natural text data with different languages and quality levels for Large Language Model pre-trainingcited by 8
- 2024Global Contrastive Training for Multimodal Electronic Health Records with Language Supervisioncited by 4
- 2024On Adversarial Robustness and Out-of-Distribution Robustness of Large Language Modelscited by 1
- 2026What are the Right Symmetries for Formal Theorem Proving?cited by 0
- 2026Toward Robust In-Context Learning: Leveraging Out-of-distribution Proxies for Target Inaccessible Demonstration Retrievalcited by 0
- 2026What are the Right Symmetries for Formal Theorem Proving?21 May 2026
- 2026Toward Robust In-Context Learning: Leveraging Out-of-distribution Proxies for Target Inaccessible Demonstration Retrieval13 Apr 2026
- 2025SLOT: Sample-specific Language Model Optimization at Test-time18 May 2025
- 2025A Comprehensive Survey on the Trustworthiness of Large Language Models in Healthcare21 Feb 2025
- 2024On Adversarial Robustness and Out-of-Distribution Robustness of Large Language Models13 Dec 2024
- 2024Rephrasing natural text data with different languages and quality levels for Large Language Model pre-training28 Oct 2024
- 2024A Survey on Medical Large Language Models: Technology, Application, Trustworthiness, and Future Directions6 Jun 2024
- 2024Global Contrastive Training for Multimodal Electronic Health Records with Language Supervision10 Apr 2024