Microsoft has developed an artificial intelligence based design pattern to protect against malware. The basic structure is a series of layers made up of machine learning models. The first layers are able to detect potential threats in milliseconds, while the later layers can take minutes, performing much more thorough analysis. The key is to have many diverse models, that all specialize on detect different kinds of threats. Each model can make its own predictions about the likelihood of an event being a threat, and the diverse models are more likely to collectively flag a suspicious event. Microsoft also trained a model to look at the output of all the specialized models to predict what outputs warrant a security threat. Tests of this architecture in Brazil have proven to be effective.