A new study published in the Journal of Experimental Psychology: General finds that people who score higher on one type of intelligence test are more likely to buy into stereotypes. Fortunately, they’re also more likely to discard them.

There are many different kinds of intelligence, each reliant on its own set of skills and abilities. One such ability is pattern recognition, without which we’d have trouble recognizing faces, learning languages, or reading other people’s emotions. Because it’s so central to our cognitive and social functioning, pattern recognition is sometimes used by researchers as a shorthand for overall intelligence.

Researchers at New York University wondered if there was any downside to this kind of intelligence—if a person’s ability to make quick associations could make them more susceptible to harmful generalizations and stereotypes.

To find out, they designed a series of six online experiments to compare more than 1200 participants’ pattern recognition skills with how easily they bought into stereotypes.

In one experiment, the researchers showed participants a collection of men’s faces, along with a description of something each man had done in the past. Some of the men’s actions were good, like sending flowers to someone who was sick. Others were unpleasant.

What the participants didn’t realize was that the researchers had rigged the setup so that one facial feature, either a wide nose or a narrow one, was paired more frequently with bad behavior, essentially inventing a negative stereotype.

After this subconscious introduction, participants were invited to play a trust game with a virtual partner (actually a research bot). The “partner” avatars had subtle differences in the shape and size of their noses.

Sure enough, participants who aced the pattern recognition test were more distrustful of participants with the “bad” kind of nose, whichever type that happened to be. Their ability to jump quickly to conclusions seemed to lead them right into the stereotype trap.

“Superior cognitive abilities are often associated with positive outcomes, such as academic achievement and social mobility,” lead author David Lick said in a statement. “However, our work shows that some cognitive abilities can have negative consequences.”

The news wasn’t all bad. Another experiment tested people’s ability to let go of harmful existing stereotypes—in this case, relating to gender. The researchers subtly exposed participants to information that challenged their beliefs, showing women behaving assertively, for example, or men stepping aside to let others lead.

As it turned out, participants who scored higher on the pattern recognition test were also better at taking in this new information and letting it change their minds. After exposure, they were less likely to buy into harmful gender stereotypes.

“Finding that higher pattern detection ability puts people at greater risk to detect and apply stereotypes, but also to reverse them, implicates this ability as a cognitive mechanism underlying stereotyping,” co-author Jonathan Freeman said in the statement.

“Our findings may help pave the way for future research that leverages pattern detection or other cognitive abilities for reducing social biases.”