Stress test
A stress test evaluates an AI model on deliberately difficult, unusual or shifted inputs to find where it fails, rather than on data that looks like its training set.
Standard evaluation scores a model on test data drawn from the same source as its training data. That shows how it performs on familiar cases. A stress test asks a different question: what happens on the cases that are rare, awkward or different from anything in training? A 2020 study of underspecification by Alexander D'Amour and 39 co-authors describes stress tests as evaluations that probe a model by observing its outputs on specifically designed inputs.
That study grouped stress tests into three kinds. Stratified tests split the test data into groups, such as different patient subpopulations or images of people with different skin types, and compare performance across them. Shifted tests change the data in a controlled way, for example by adding noise to images or collecting test data by a different method. Contrastive tests apply specific changes to individual inputs and check whether the output shifts in unexpected ways, for example when a change should not affect the answer.
Stress tests often reveal what ordinary tests hide. D'Amour's team found, across computer vision, medical imaging, language processing and health record prediction, that models with near-identical scores on standard test data behaved quite differently on stress tests, depending on arbitrary choices such as the random seed used in training. Earlier, in 2018, Aakanksha Naik and colleagues built automatically generated stress tests for natural language inference to check whether six models were genuinely reasoning about sentences or exploiting surface patterns.
The paper notes that stress tests were becoming part of the standards of evidence in fields such as medicine, economics, public policy and epidemiology, and that where they have been proposed in machine learning they have often uncovered models that fail to generalise as real use requires.
For anyone deploying AI, the practical lesson is that a high average score is not enough. Testing the model on the groups, edge cases and changed conditions it will actually meet is the only way to know where it will break.
It is evaluating a model on inputs designed to be harder or different from its training data, such as specific subgroups, noisy or shifted data, or carefully altered examples. The aim is to expose failures that an ordinary test set drawn from the same source as the training data would miss. Red teaming uses people or tools acting as adversaries, trying to make a system misbehave, usually around safety and security. Stress testing is broader: it checks performance under difficult or shifted conditions, which may be accidental rather than hostile. The two overlap when adversarial inputs are part of the stress test. A test set drawn from the same data as training mostly contains familiar cases. Research on underspecification found that many different models can score equally well on such data while relying on different patterns, which only shows up when inputs change.Common questions
What is stress testing in machine learning?
How is a stress test different from red teaming?
Why do models that score well on test sets fail stress tests?
Search for "stress test machine learning", "distribution shift evaluation" or "subgroup analysis model performance". Peer-reviewed papers on arXiv and in conference proceedings, reporting standards for AI in medicine and evaluation guidance from standards bodies are the most dependable. Be sceptical of claims that a model is reliable when only an average test score is given.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.