The participants then took a test called the Raven’s Advanced Progressive Matrices, a pattern-based exam that’s a common measure of human intelligence.

The participants who were better pattern detectors were more likely to make stereotypical errors: They tended to ascribe the friendly behaviors to the wrong yellow alien, and the unfriendly behaviors to the wrong blue alien. Meanwhile, they were less likely to ascribe the behavior to a different-colored alien.

A second study showed similar results, but for measures of implicit bias. That is, smarter participants were quicker to stereotype the aliens in the course of a word-sorting task, even if they didn’t realize they were doing it.