Imagine playing a game where you’re seated in front of four decks of cards. On the back of two decks are pictures of puppies; on the other two are pictures of spiders. Each deck has some cards that win points and others that lose points. In general, the puppy decks are “good” in that they win you more points than they lose while the spider decks are “bad” in that they lose you more points they win. You repeatedly select cards in hopes of winning as many points as possible. This game seems pretty easy— and it is. Most players favor the puppy decks from the start and quickly learn to continue favoring them because they produce more points.

However, if the pictures on the decks are reversed, the game becomes a little harder. People may have a tougher time initially favoring spider decks because it’s difficult to learn that something people fear like spiders brings positive outcomes and something people enjoy like puppies brings negative outcomes.

Performance on this learning task is best when one’s attitudes and motivations are aligned. For instance, when puppies earn you more points than spiders, people’s preference for puppies can lead people to select more puppies initially, and a motivation to earn as many points as possible leads people to select more and more puppies over time. But when spiders earn you more points than spiders, people have to overcome their initial aversion to spiders in order to perform well.

This potential conflict between attitudes and motivations on behavior is not reserved for puppies and spiders. There are social domains where attitudes and motivations point in competing directions. Race is a clear example. On average, white people associate black people with negativity. These anti-black attitudes can exist in both consciously controlled explicit attitudes or in less consciously controlled implicit attitudes. At the same time, many white people also value appearing and being racially unprejudiced. For instance, data from a 2015 volunteer sample found that while 80 percent of white people had an easier time pairing black than white faces with negative words, 73 percent also agreed with statements such as “I am personally motivated by my beliefs to be non-prejudiced.”

What happens to race-related behavior when our attitudes and motivations conflict with one another? My co-author Sophie Trawalter and I examined this question in a series of studies recently published in the Journal of Experimental Social Psychology. We found that white participants strongly resisted displaying anti-black behavior, even if this meant sacrificing a chance for a financial reward.

Our studies adapted a tool called the Iowa Gambling Task, the learning measure described in the opening paragraph. Our version of the Iowa Gambling Task asked people to repeatedly select one face from an array of black or white faces. Participants were told that it was their job to win as many points as possible over 120 selections, and that people in the top 10 percent of points earned would win a gift card.

Across conditions, we manipulated whether black or white faces represented the good or bad decks. In one condition, selecting black faces generally led to gaining points and selecting white faces generally led to losing points. In the reverse condition, selecting black faces generally led to losing points and white faces generally led to gaining points.

Our results highlighted the impact of both attitudes and motivations on behavior. At the beginning of the task, we saw the influence of racial attitudes. Participants performed better in the condition that aligned with anti-black attitudes, earning more points when black faces were tied to losses. Participants had a much harder time initially earning points when black faces were tied to gains, and this was particularly true among those reporting higher levels of consciously preferring white to black people.

However, as the task progressed, we saw the influence of racial motivations. While people were initially better at earning points when black faces were tied to losses, performance in this condition did not improve over time. That is, participants appeared to avoid reinforcing that black faces were associated with negative outcomes like losing points. Conversely, while people had a harder time initially learning that black faces were associated with gains, they showed a great deal of improvement in this condition throughout the task.

In fact, by the end of the study, participants tasked with learning that black faces led to point gains were outperforming those tasked with learning that black faces led to point losses. Moreover, this ability to learn that black faces led to point gains was weakly but reliably related to a greater desire to avoid racial prejudice. In other words, participants highest in reporting a motivation to appear unprejudiced were best able to acquire the association between selecting black faces and positive outcomes.

One remaining issue is whether participants simply could not or chose not to reinforce anti-black associations. While our data cannot definitively answer that question, we have some reason to believe participants were “playing dumb,” and choosing to not perform well when the task paired black faces with losses. For instance, remember that when the task paired puppies with gains and spiders with losses, performance was good both initially and significantly improved over time. That is, performance suffered only when the task supported potentially unwanted racial associations.

Do these studies prove that people who are motivated to be unprejudiced need not worry about racial bias in their behavior? No. After all, even people motivated to appear unprejudiced still had a much easier time earning points initially when black faces were paired with losses. But, this work does highlight how people can work against undesired attitudes given the right motivation. Our white participants valued acting unprejudiced so much that they were willing to forego possible reward to avoid strengthening any anti-black associations. As we say in the paper, attitudes may have the first word but not the final say in behavior.