On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective

Jindong Wang, Xixu Hu, Wenxin Hou, Hao Chen, Runkai Zheng, Yidong Wang, Linyi Yang, Haojun Huang, Wei Ye, Xiubo Geng, Binxin Jiao, Yue Zhang, Xing Xie

As Large Language Models (LLMs) like ChatGPT become integrated into everything from search engines to medical assistants, a critical question arises: how easily do they break? While ChatGPT’s conversational prowess is well-documented, its robustness—the ability to maintain performance when faced with unexpected, noisy, or malicious inputs—has remained a bit of a black box.

In their paper, "On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective," researchers from Microsoft and several universities put ChatGPT through a rigorous "stress test" to see how it holds up against adversarial attacks and data it wasn't specifically trained on.

TL;DR

ChatGPT is significantly more robust than previous foundation models, particularly in handling out-of-distribution (OOD) data and conversational contexts. However, it is far from invincible; simple adversarial perturbations like typos or distracting sentences can still easily mislead it, posing a lingering threat for safety-critical applications.

What Problem Does This Paper Address?

The authors tackle the "robustness gap" in LLMs. Most models are evaluated on "clean" datasets, but the real world is messy. Users make typos, and malicious actors might intentionally craft "adversarial" inputs to bypass safety filters or trigger incorrect outputs. Furthermore, models often struggle with Out-of-Distribution (OOD) scenarios—tasks or data domains that differ from their training data.

If we want to use LLMs in fields like medicine or law, we need to know if they are "brittle." This paper provides the first comprehensive, zero-shot evaluation of ChatGPT’s robustness compared to other popular foundation models.

Methods

The researchers conducted a zero-shot evaluation, meaning they prompted the models directly without any task-specific fine-tuning. This approach mimics how most people actually use ChatGPT.

They compared ChatGPT (based on the GPT-3.5 series) against a wide array of baselines, including:

  • Discriminative models: DeBERTa-L, BART-L.
  • Generative models: GPT-J, Flan-T5, OPT, BLOOM, and the "davinci" series (text-davinci-002/003).

The evaluation focused on two pillars:

  1. Adversarial Robustness: Stability against imperceptible perturbations (e.g., typos, word swaps).
  2. OOD Robustness: Performance on unseen data distributions (e.g., medical diagnosis or product reviews).

Datasets

The study utilized several challenging benchmarks:

  • Adversarial: AdvGLUE (adversarial versions of standard NLP tasks) and ANLI (adversarial Natural Language Inference).
  • OOD: Flipkart (product reviews) and DDXPlus (a complex medical diagnosis dataset released in 2022).
  • Translation: AdvGLUE-T, a subset of AdvGLUE manually translated into Chinese to test adversarial machine translation.
Table 1: Statistics of the test sets used in the study.

Key Insights and Ideas

  • The "Dialogue Advantage": ChatGPT excels at understanding conversational context. This was most evident in the DDXPlus medical dataset, where it outperformed models that weren't optimized for dialogue.
  • Instruction Tuning is a Robustness Multiplier: Models like Flan-T5 and ChatGPT, which undergo instruction tuning, showed a clear edge over "raw" pre-trained models. This suggests that learning to follow human instructions helps models ignore irrelevant noise.
  • Size Isn't Everything: While larger models generally performed better, the relationship isn't linear. As seen in Figure 1, ChatGPT (175B parameters) shows a significant jump in robustness compared to other large models, likely due to its Reinforcement Learning from Human Feedback (RLHF) training.
  • Responsible Medical Analysis: Interestingly, ChatGPT rarely gave "definitive" medical answers. Instead, it provided informed suggestions and suggested further testing—a behavior the authors highlight as a "responsible AI" trait.
Figure 1: Robustness evaluation of different foundation models: performance vs. parameter size. Results show that ChatGPT shows consistent advantage on adversarial and OOD classification tasks. However, its absolute performance is far from perfection, indicating much room for improvement.

Key Results

  • Adversarial Performance: ChatGPT achieved the lowest Attack Success Rate (ASR) across almost all tasks. For example, on the QQP (Quora Question Pairs) task, its ASR was only 18.0%, compared to 28.2% for the next best model (text-davinci-002) and over 50% for many others.
  • OOD Performance: On the medical DDXPlus dataset, ChatGPT achieved an F1-score of 20.2. While this sounds low, most other models (like OPT or BLOOM) hovered near zero or random chance (4.0).
  • Translation: In adversarial translation, ChatGPT was highly readable but slightly less accurate than its sibling, text-davinci-003.
Table 2: Zero-shot classification results on adversarial (ASR↓) and OOD (F1↑) datasets. The best and second-best results are highlighted in bold and underline.

Despite these wins, the authors emphasize that an ASR of 40% on tasks like SST-2 means the model is still successfully "attacked" nearly half the time. As shown in the case studies (Figure 5), simple typos can still flip a "Positive" sentiment to "Negative."

Table 4: Case study on adversarial examples. Adversarial manipulations are marked red.

Limitations and Future Work

The authors acknowledge several hurdles:

  1. Data Contamination: Because ChatGPT's training data is private, it's hard to be 100% sure that the "OOD" datasets weren't actually seen during training.
  2. Zero-shot Constraints: The study didn't explore if fine-tuning could bridge the robustness gap for smaller models.
  3. Prompt Sensitivity: LLM performance is highly dependent on how a question is phrased; different prompts might yield different robustness profiles.

Future Directions: The researchers suggest that model owners should inject adversarial examples directly into the training pipeline and that the community needs better metrics to evaluate the "goodness" of generated text beyond simple classification accuracy.

Summary updated

BibTeX
@inproceedings{wang2024robustness,
  author = {Jindong Wang and Xixu Hu and Wenxin Hou and Hao Chen and Runkai Zheng and Yidong Wang and Linyi Yang and Haojun Huang and Wei Ye and Xiubo Geng and Binxin Jiao and Yue Zhang and Xing Xie},
  title = {{On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective}},
  booktitle = {IEEE Data Eng. Bull},
  year = {2024},
  url = {https://openreview.net/forum?id=mPFilM5Gac},
}
Figure