Everyone’s experienced their own “eureka” moment: Maybe the name of that song you were struggling to remember finally popped into your mind, or perhaps you were wrestling with how to to get a decent tax refund and the best option miraculously dawned on you. It’s unlikely that, during the moments leading up to these experiences, you have any idea that your brain’s gears are slowly clicking into place.

But a person closely watching your eyes could probably tell, a new study says — and they could probably predict your sudden epiphany before you even have it.

According to Ian Krajbich, Ph.D., an assistant professor of psychology and economics at Ohio State and first author of a new study in PNAS, there hasn’t been a good way to study these so-called “Aha!” moments — the culmination of what scientists call “epiphany learning” — until now.

“There’s a lot of work on studying how people learn when they’re learning by trial and error — trying out different actions, and getting feedback,” he tells Inverse. “In those sorts of situations, people gradually adjust their behavior to find a better strategy. But there are other types of situations where we didn’t think that kind of learning model applied.”

Epiphanies are all in the eyes.

Those problems — the type that have a single, optimal solution just waiting to be found — are the ones that lead to eureka moments. Krajbich, whose research in neuroeconomics largely involves the motion of the eyes during the processes of decision making and learning, wondered whether there was something special going on in the eyes of people having sudden epiphanies, as well.

Turns out he was right. In the study he conducted with James Wei Chen, a doctoral student in economics at Ohio State, he had 59 undergrads play a computer game against an unseen opponent. The game of numbers — a complicated one that essentially involves players realizing that choosing zero out of a range spanning zero to 11 is always the optimal choice — had been used in problem solving studies before. “We knew that participants wouldn’t generally figure it out right away, but if you let them play it over and over again, many of them would eventually figure it out,” he says.

Ohhhhhhhhhh, now I see.

It became clear, over the course of 30 rounds, that the undergrads generally used one of two strategies: Think hard about how to win the game, or simply copy what their opponent was doing. As they played, Krajbich tracked the movement of their eyes as they scanned their options. In the end, 42 percent of players had an epiphany at some point and consistently chose the number zero. Meanwhile, 37 percent had the wrong epiphany, choosing the wrong number and committing to it. The remaining 20 percent didn’t commit to any number. The people who had epiphanies were the ones who were really thinking about the game, Krajbich explains, and he could see evidence of that in their eyes.

In particular, the people who were thinking hard about which was the optimal number to choose would often return their gaze to the same number twice. “How often they did that in the first few rounds predicted how soon they’d have their epiphany,” he says. “Those people have a sense that there are numbers that are better than others.” He thinks that the epiphany-havers slowly and perhaps subconsciously built up their sense of what the correct number was, though this wasn’t reflected in their choices immediately; like a lightbulb suddenly turning on (there’s a reason this symbol is synonymous with “Aha!”), understanding eventually clicked into place for those who were willing to grapple with the situation.

To Krajbich, the study’s findings are evidence that thinking about a problem “pays off.” While this might make you think “duh,” consider the number of times you, like the players that were satisfied to just copy their opponents, simply didn’t care to think too hard about an important decision. “In the real world, some people like to find the best deal — but for other people, it’s not enjoyable to find the best option,” he says. And mental laziness, the study shows, can have serious downsides: People who copied their opponents tended to learn the wrong lesson about the game.

Krajbich is hesitant to say whether there are certain types of people that are hardwired to have eureka moments more than others, but he’s certainly interested in knowing.

“In terms of what sort of predicts that, we don’t know,” he says. “Future research!”