Reliability Testing for Natural Language Processing Systems

Samson Tan, Shafiq R. Joty, Kathy Baxter, Araz Taeihagh, Gregory A. Bennett, Min-Yen Kan

Abstract

Standard accuracy metrics often fail to capture the real-world reliability of Natural Language Processing (NLP) systems. This paper introduces DOCTOR, a framework that reframes adversarial attacks as targeted reliability tests. By evaluating systems across specific dimensions such as dialect and demographics, DOCTOR enables a shift from average-case performance to rigorous worst-case analysis, ensuring AI robustness before deployment.

Introduction: Beyond the Accuracy Trap

In NLP development, a high score on a held-out test set is frequently mistaken for real-world readiness. However, high-profile failures—ranging from harmful chatbot suggestions to biased translation errors—demonstrate that standard accuracy is a poor proxy for reliability. Most models are evaluated on data that mirrors their training sets, failing to account for the "messy" reality of human language, including typos, code-switching, and diverse dialects.

The Reliability Gap

Current evaluation methods suffer from two primary flaws:

  1. Average-case bias: High overall accuracy can mask catastrophic failures for minority groups or specific linguistic variations.
  2. Fragility to Noise: Minor perturbations, such as a single synonym swap, can cause state-of-the-art models to fail.

While adversarial attacks are used to identify these flaws, they are often unconstrained, breaking models without providing actionable insights. There is a critical need for a structured approach that identifies why a system fails in relation to real-world harms.

The DOCTOR Framework

To address these gaps, we propose the DOCTOR framework, which establishes a rigorous lifecycle for reliability testing. This framework integrates test development directly into the system development process, ensuring that reliability requirements are defined and validated iteratively.

The DOCTOR framework lifecycle, illustrating the iterative process of test and system development.

The DOCTOR lifecycle consists of six key stages:

  1. Define reliability requirements based on the specific use case.
  2. Operationalize dimensions (e.g., Singaporean English, gender pronouns) as mathematical distributions.
  3. Construct targeted tests using these distributions.
  4. Test the system and report detailed results.
  5. Observe the behavior of the system once deployed.
  6. Refine requirements and tests based on observed real-world performance.

The technical core of this approach involves constraining adversarial perturbations to specific dimensions of interest. This allows practitioners to measure worst-case performance—for example, determining the model's lowest accuracy when encountering African American English (AAE) rather than just its average performance across all dialects.

Key Insights and Methodology

The framework emphasizes Reliability over the more vaguely defined "Robustness." Reliability, following IEEE standards, requires defining the specific conditions under which a system must function.

Furthermore, DOCTOR advocates for Interdisciplinary Red Teaming. Determining what constitutes "fairness" or "reliability" should not happen in a technical vacuum. The framework encourages collaboration with linguists, ethicists, and "community juries" to identify relevant testing dimensions. Because the framework is designed for black-box auditing, it is particularly suitable for independent regulatory oversight where internal model weights are inaccessible.

Case Studies and Results

The utility of DOCTOR is demonstrated through two primary case studies:

  • Automated Text Scoring (ATS): In multilingual environments like Singapore, standard models may penalize students for using local colloquialisms (Singlish). DOCTOR helps identify these biases, ensuring students are graded on knowledge rather than socioeconomic linguistic markers.
  • Violent Content Detection: Models often misidentify AAE as "toxic" due to training data biases. DOCTOR provides a quantitative metric ($\delta$) to measure the gap between average and worst-case performance, highlighting specific areas for model refinement.

Limitations and Future Directions

While DOCTOR provides a structured path forward, several challenges remain. Automatically generated (synthetic) test cases may lack the nuance of natural human language. Additionally, selecting which dimensions to test is inherently a question of values and power—deciding which groups are "protected" remains a complex societal issue. Future work will focus on "guaranteed" generation techniques to ensure test sets fully cover the intended linguistic distributions.

Conclusion

Reliability testing represents a necessary evolution in NLP evaluation. By moving from unconstrained adversarial attacks to targeted, dimension-specific tests, the DOCTOR framework provides the tools necessary to build AI systems that are not just accurate on paper, but robust and fair in the real world.

Summary updated

BibTeX
@inproceedings{tan2021reliability,
  author = {Samson Tan and Shafiq R. Joty and Kathy Baxter and Araz Taeihagh and Gregory A. Bennett and Min-Yen Kan},
  title = {{Reliability Testing for Natural Language Processing Systems}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.321},
}
Figure