AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Models

Hengrui Xing, Cong Tian, Liang Zhao, Zhi Ma, Wensheng Wang, Nan Zhang, Chao Huang, Zhenhua DuanarXiv 2025 · DOI

Introduction

Traditional evaluation of Natural Language Processing (NLP) models often relies on aggregate accuracy scores from standard benchmarks. However, high accuracy does not necessarily imply robustness or fairness. A model might perform well on average but fail catastrophically when faced with simple linguistic perturbations, such as a name change or a typo. This has led to the rise of behavioral testing, popularized by tools like CheckList, which evaluates models on specific linguistic capabilities.

Despite its benefits, behavioral testing faces a significant bottleneck: the intensive human labor required to design high-quality test templates. AutoTestForge addresses this challenge by introducing a fully automated framework that leverages Large Language Models (LLMs) to generate, verify, and expand multidimensional test suites, significantly increasing the efficiency and depth of model evaluation.

The AutoTestForge Framework

AutoTestForge operates through a structured four-stage pipeline designed to minimize human intervention while maximizing the diversity of test cases.

The four-stage pipeline of AutoTestForge, moving from initial template generation to the final test suite construction.

1. Automated Template Generation

Instead of relying on human linguists, AutoTestForge uses structured prompting to guide LLMs (such as GPT-4 or Claude-3) to act as test designers. The LLMs generate detailed descriptions and templates that target specific linguistic phenomena. For example, a template might be designed to test if a model correctly identifies sentiment in sentences containing negated positive words.

An example of an AI-generated test template for sentiment analysis, including the description, template structure, and a pool of word substitutions.

2. Differential Testing and Label Verification

To ensure the reliability of generated test cases without manual labeling, the framework employs Differential Testing. Test cases are processed by a panel of multiple existing NLP models. If these models reach a consensus, the label is considered verified. In instances of disagreement, a "referee" LLM (typically GPT-3.5-Turbo) is used to optimize the test case and resolve ambiguity.

3. Multi-Capability Expansion

Once a preliminary suite is established, AutoTestForge automatically expands it across three critical dimensions:

  • Taxonomy: Testing lexical depth by swapping words for synonyms or hyponyms.
  • Fairness: Inserting diverse demographic attributes (e.g., religion, sexual orientation) to detect underlying biases.
  • Robustness: Introducing spelling perturbations and adversarial attacks to evaluate model stability under noise.

4. Filtering and Merging

The final stage involves a consistency check to filter out low-quality or non-discriminative test cases, resulting in a high-quality, comprehensive final test suite.

Experimental Evaluation

The framework was evaluated on two primary NLP tasks: Sentiment Analysis (SA) and Semantic Textual Similarity (STS). Benchmarks included SST-2, Yelp Polarity, IMDB, QQP, and STS-B. The goal was to determine if AutoTestForge could identify errors that standard datasets and existing automated tools missed.

Key Results

  • Superior Error Detection: AutoTestForge achieved an average error detection rate of 30.89% for Sentiment Analysis and 34.58% for Semantic Similarity. This represents a significant improvement over previous state-of-the-art tools, outperforming CheckList by approximately 15-17%.
  • AI vs. Human Design: A striking finding was that templates generated entirely by AI often outperformed those designed by humans. LLMs can draw from a vast breadth of linguistic patterns that are often too tedious or complex for human experts to manually codify.
  • Model Stability: The framework demonstrated consistent performance across various architectures, including BERT, RoBERTa, and XLNet, proving its generalizability.

Insights and Discussion

The research highlights a critical trade-off between text quality and robustness. As test cases become more adversarial or "noisy" to challenge model robustness, their perceived linguistic quality (as measured by standard classifiers) naturally decreases. This suggests that the most effective "edge cases" for testing are often those that deviate furthest from clean training data.

Furthermore, GPT-4 emerged as the most effective "tester" among the LLMs evaluated, consistently producing higher-quality and more diverse templates than Llama-3 or Claude-3-Opus.

Conclusion and Future Work

AutoTestForge represents a major step toward fully automated, multidimensional NLP evaluation. By removing the human bottleneck, it allows for the rapid generation of complex test suites that uncover deep-seated model failures in fairness and robustness.

Future work will focus on expanding the framework to generative tasks like long-form dialogue and summarization. Additionally, the team plans to integrate Active Learning to allow the framework to dynamically adapt its testing strategy based on the specific vulnerabilities it discovers during the evaluation process.

Summary updated

BibTeX
@misc{xing2025autotestforge,
  author = {Hengrui Xing and Cong Tian and Liang Zhao and Zhi Ma and Wensheng Wang and Nan Zhang and Chao Huang and Zhenhua Duan},
  title = {{AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Models}},
  year = {2025},
  eprint = {2503.05102},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.05102},
}
Figure