Why Can AI Fail When It Faces Something New or Different?

AI can test well and still fail in a new hospital, place, population or year. Learn how generalization, distribution shift, shortcuts and edge cases cause it.

An AI system can pass its tests with impressive numbers and then stumble the first week it is used somewhere else: a different hospital, a new camera, a new group of customers, or simply a year later. That pattern surprises people because the system did not change. The world around it did.

Here is the core reason. An AI system learns from a collection of examples and is usually checked on more examples drawn from the same collection. When the inputs or conditions it meets in real use differ from those examples, performance can drop sharply, and researchers have documented such drops across hospitals, camera sites, regions and time periods [1]. The system has often learned whatever cues worked in its training data, including cues that only held there, so it can fail when those cues change [2]. And it rarely signals that anything is wrong, which is why a strong past score is not proof that it will work in your setting.

The previous guide, on why AI struggles to understand cause and effect, showed that learning patterns is not the same as learning causes. This guide follows that thread into what happens when the patterns themselves move.

TL;DR

  • Tests usually assume tomorrow looks like yesterday. Distribution shift, a difference between training data and the data met later, can substantially lower accuracy [1].
  • New settings can cost a lot. In one 2021 benchmark, a tissue-slide model averaged 93.2% accuracy on familiar hospitals and 70.3% on a hospital it had not seen [1].
  • Systems can learn the wrong lesson. An image model can rely on grass to spot cows, then fail on a cow standing on a beach [2].
  • Real deployments show it too. An independent 2021 check of a widely used sepsis alert found it performed substantially worse than its developer had reported [3].
  • Bigger models help but haven’t closed the gap. Larger, more diverse training data has improved robustness in some studies without eliminating drops [4, 5].

Generalization: Doing Well Beyond the Examples

Most of today’s AI systems are built by showing a model many examples, the training data, until it picks up patterns that link inputs to outputs; the How AI Works chapter covers the details. Builders then check the model on a test set: examples it has not seen, usually set aside from the same collection.

Generalization is how well a system performs on inputs it was not trained on. The catch is in the word “same.” A test set drawn from the same source as the training data measures performance under familiar conditions. Researchers call those inputs in-distribution. Inputs that differ in some systematic way are out-of-distribution, and that is where the trouble tends to start [1, 2].

Even a small difference can matter. When researchers rebuilt a famous image-recognition test, ImageNet, by closely following its original collection process, image classifiers lost 11 to 14 points of accuracy [6]. The authors concluded that this was not because the old test had been overused, but because the models struggled with images only slightly harder than the originals [6]. Other reasons test results can flatter a system are covered in why demos and benchmark scores don't always match real-world performance.

NIST, the US federal standards agency, uses the word robustness for the quality at stake: a system’s ability to maintain its level of performance under a variety of circumstances [7].

Distribution Shift: When the World Doesn’t Match the Data

Distribution shift means the data a system meets in use differ from the data it was built and tested on [1]. WILDS, a research benchmark published in 2021, gathered 10 real-world examples of it, from tumor detection across hospitals to wildlife cameras in new locations and satellite images from different times and places [1]. On every one of the 10, standard models did substantially worse on the new settings, and methods designed to cope with shift did not close the gap [1].

Shifts come in a few recognizable kinds.

Kind of changePlain exampleWhat differs
Place or institutionA model built at some hospitals used at anotherPatients, practices, record-keeping
Equipment or processNew scanner, camera or lab procedureHow the input itself looks
PopulationCustomers or patients unlike those in the training dataWho the system is used on
TimeA system used years after its data was collectedFacts, language, behavior

Place and process. In the WILDS tissue-slide task, a model spotting tumor tissue averaged 93.2% accuracy on slides from hospitals in its training data and 70.3% on slides from a hospital it had not seen [1]. The authors note that such differences can come from the patient population or from how slides are stained and scanned [1].

Population. A study published in February 2026 tested publicly available language models, fine-tuned on public clinical datasets, on hospital records from Pakistan [8]. Without further training on local records, the models did markedly worse, with scores at least 15% lower for pulling medical terms out of notes [8]. The authors concluded that the models they tested, trained mostly on data from high-income regions, were unreliable in that clinical setting without local adaptation [8]. Shifts like this can fall harder on some groups than others, which is the starting point for the next guide, on why AI can be biased even when no one intended it.

Time. The world keeps moving after training ends. Researchers at DeepMind found in 2021 that language models did up to 16% worse at predicting news and scientific articles published up to two years after their training data ended, with performance worsening the further ahead they went [9]. Those were much smaller models than today’s chatbots, but NIST names the general risk: training data can go stale or become detached from the setting where a system is deployed [7].

Shortcuts: Learning the Wrong Lesson

A system trained to get answers right will use whatever cues work in its training data. Some of those cues are the intended ones. Others are shortcuts: decision rules that perform well on standard tests but fail to carry over to harder conditions such as real-world use [2].

The classic illustration is a model that appears to recognize cows but fails on a cow standing on a beach, because most cows in its training photos stood on grass and it had learned to rely on the grass [2]. Inside the training data, “grass means cow” worked; outside it, the cue was worthless.

A medical study shows the same problem with higher stakes. In a 2018 study, Zech and colleagues trained pneumonia-detecting models on 158,323 chest X-rays from three US institutions [10]. Models trained at one hospital system did significantly worse on another system’s X-rays than on new X-rays from their own [10]. The networks could also tell which hospital system an X-ray came from almost perfectly, for 99.95% and 99.98% of images from two of the systems [10]. Because pneumonia was far more common at one hospital than the others, knowing the hospital was itself a strong clue [10]. Reviewing the case, Geirhos and colleagues describe the model as having learned to identify hospitals, for example from a hospital-specific metal marker on the scan [2].

This is where the previous guide’s lesson returns. A shortcut is a correlation that held in the training data but is not part of what actually produces the outcome. When the setting changes, the correlation breaks and the system’s performance breaks with it.

Edge Cases and Brittleness

An edge case is an input at the margins of what a system was built for: rare, unusual or extreme. They are hard partly because they are scarce in training data, so a system that handles common inputs well can still fail on the rare ones that matter most.

Brittleness describes something related: a large failure caused by a small or ordinary change. To measure it, Hendrycks and Dietterich built ImageNet-C in 2019, testing image classifiers on 15 kinds of everyday corruption, including noise, blur and weather effects such as snow, each at five levels of severity [11]. They noted that people are not confused by snow, blur or pixelation in the way the image classifiers of the time were [11]. The slightly harder images in the rebuilt ImageNet test point the same way: small departures from familiar inputs can produce outsized drops [6].

Language models show their own version of brittleness, where rewording a request or changing a familiar problem slightly changes the answer. That is covered in why AI can solve a hard problem and still fail an easy one.

A Deployment Case: One Sepsis Alert, Many Hospitals

The Epic Sepsis Model is a commercial risk score, implemented at hundreds of US hospitals according to the Michigan researchers, that estimates a patient’s risk of sepsis, a life-threatening reaction to infection, so clinicians can be warned early [3]. Researchers at Michigan Medicine independently tested it on 27,697 adult patients with 38,455 hospital stays between December 2018 and October 2019 [3].

Their main measure was the AUC, a score of how well a tool separates patients who will develop a condition from those who won’t, where 0.5 is no better than a coin flip and 1.0 is perfect. The model scored 0.63, substantially worse than the 0.76 to 0.83 that Epic Systems had reported in its internal documentation [3]. Used with an alert threshold within Epic’s recommended range, it missed 67% of patients who developed sepsis, even as it flagged 18% of everyone admitted [3].

A 2023 study of the same model across nine hospitals in one US network found its performance varied by hospital, and was worse where sepsis was more common and patients had more other illnesses and cancer [12]. Its authors noted that an earlier study at a community hospital had found the model helped speed antibiotic treatment, even as the academic-center study found poor performance [12]. They also reported that a forthcoming update to the model recommended that hospitals train it on their own data before clinical use [12]. No independent evaluation of that update was reviewed for this guide.

A tool’s performance belongs to the setting where it was measured, so a developer’s figures and a hospital’s experience can both be accurate and still differ. And an alert like this assists clinicians; it does not replace their judgment or their responsibility for the patient.

What We Know, What We Don’t, and Where Experts Disagree

Confidence: Research Finding

What We Know

  • When real inputs differ from training and test data, performance usually drops, often substantially, across images, medical records, text and other data [1, 10, 9, 8].
  • Systems can rely on cues that only held in their training data and fail when those cues disappear [2, 10].
  • A deployed tool’s performance can differ from its developer’s figures and from one site to the next [3, 12].

What We Don’t Know

  • How much today’s largest general-purpose models, including current chatbots, lose under real deployment shifts; the peer-reviewed language-model evidence reviewed here covers older or smaller models.

What Experts Disagree About

The main debate is whether scale fixes the problem. OpenAI researchers reported in 2021 that CLIP, an image model trained on 400 million image–text pairs from the internet, shrank the gap between standard-test and shifted-test accuracy by up to 75% when used without task-specific training [5]. The same paper reported that tuning CLIP on standard ImageNet data raised its ImageNet accuracy by 9.2% but slightly reduced its average robustness, so specializing for one setting can cost performance in others [5].

Others are more cautious. Testing 204 image models under 213 conditions in 2020, Taori and colleagues found that most techniques for improving robustness did not help on naturally occurring shifts; training on larger, more diverse data helped in several cases but was far from closing the gap [4]. For change over time, the DeepMind team found that making models bigger did not fix the decline, while continually updating them with new information reduced it [9].

The 2026 clinical-notes study adds a nuance: ChatGPT, based on OpenAI’s GPT-3.5, scored better on the local Pakistani records than on the public data even without local fine-tuning, while the smaller medical models fell [8]. Broad training can help. Whether it helps enough for a particular high-stakes setting still has to be checked there.

Why Failures Under Shift Are Easy to Miss

Shift is dangerous partly because it is quiet. A system working outside its familiar conditions usually produces answers in the same confident form as before, and whether systems can tell when they are likely to be wrong is the subject of does AI know when it is wrong. Busy output can also mask the problem: the sepsis alert flagged many patients yet missed most of those who went on to develop sepsis [3].

Standards bodies treat this as a testing and monitoring problem. NIST’s AI Risk Management Framework, published in January 2023, says accuracy should be measured on realistic test sets that represent the conditions of expected use, and that results should hold beyond the training conditions [7]. It also calls for monitoring a system’s behavior once it is in production and documenting the limits of its generalizability [7]. The framework is voluntary guidance, but it reflects a simple principle: performance has to be shown in the place a system will actually run, and checked again as conditions change.

Practical Takeaways

  • Ask what the system was trained and tested on. Which places, people, equipment and dates? The more your situation differs, the less a past score tells you [7].
  • Look for local evidence. Results from a setting like yours count for more than a headline figure from somewhere else [3, 12].
  • Test with your own messy cases, including unusual and borderline ones, before relying on a system; how to test AI before depending on it sets out a method.
  • Watch for change after launch. New equipment, new customers, new rules or the simple passage of time can all shift performance, so keep checking results [7].
  • Keep a person responsible where stakes are high. In medicine, hiring, lending and similar areas, treat an AI output as one input to a human decision, not the decision itself.

For how training data shapes what a model picks up, see the How AI Works chapter.

Sources

  1. WILDS: A Benchmark of in-the-Wild Distribution Shifts. ICML 2021 (arXiv version), 2020-12-14, accessed 2026-11-11.
  2. Shortcut Learning in Deep Neural Networks. Nature Machine Intelligence (arXiv version), 2020-04-16, accessed 2026-11-11.
  3. External Validation of a Widely Implemented Proprietary Sepsis Prediction Model in Hospitalized Patients. JAMA Internal Medicine (PubMed Central full text), 2021-08-01, accessed 2026-11-11.
  4. Measuring Robustness to Natural Distribution Shifts in Image Classification. NeurIPS 2020 (arXiv version), 2020-07-01, accessed 2026-11-11.
  5. Learning Transferable Visual Models From Natural Language Supervision. OpenAI (ICML 2021; arXiv version), 2021-02-26, accessed 2026-11-11.
  6. Do ImageNet Classifiers Generalize to ImageNet?. ICML 2019 (arXiv version), 2019-02-13, accessed 2026-11-11.
  7. Artificial Intelligence Risk Management Framework (AI RMF 1.0) (NIST AI 100-1). National Institute of Standards and Technology (NIST), U.S. Department of Commerce, 2023-01, accessed 2026-11-11.
  8. Evaluating large language models for clinical note processing: local fine-tuning and internal-external validation using electronic health records from South Asia. BMC Medical Informatics and Decision Making, 2026-02-25, accessed 2026-11-11.
  9. Mind the Gap: Assessing Temporal Generalization in Neural Language Models. NeurIPS 2021 (arXiv version), 2021-02-03, accessed 2026-11-11.
  10. Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: A cross-sectional study. PLOS Medicine, 2018-11-06, accessed 2026-11-11.
  11. Benchmarking Neural Network Robustness to Common Corruptions and Perturbations. ICLR 2019 (arXiv version), 2019-03-28, accessed 2026-11-11.
  12. Factors Associated With Variability in the Performance of a Proprietary Sepsis Prediction Model Across 9 Networked Hospitals in the US. JAMA Internal Medicine (PubMed Central full text), 2023-04-03, accessed 2026-11-11.