It's the time of year when seemingly innocent jingles tunnel into my brain. Right now I'm haunted by Ariana Grande's "Santa Tell Me," which I heard for the first time while researching this article. Help me.There may be good reasons why a song like that becomes an earworm, according to Elizabeth Margulis, director of the music cognition lab at the University of Arkansas. Like déjà vu, you might feel like you know the tune, but something throws you off. "[There's] this idea that songs that tend to get stuck are conventional in some ways but also have some little surprising twist," she says.The latest evidence comes from a study published last month in the journal Psychology of Aesthetics, Creativity, and the Arts. The researchers broke down the anatomy of an earworm tune and started looking for melodic features that may lead to compulsive looping. "This was really the first study into this area of melodic features of earworms," says lead author Kelly Jakubowski, a music psychologist at Durham University. "We focused on the pitch and rhythmic elements of a melody."The researchers didn't find earworms marked with anything as specific as a notable chord, note or musical interval. Instead, Jakubowski says, patterns came to light. When the researchers compared songs that 3,000 people deemed either earworms or not-so-catchy, they noticed the earworms were suspiciously lacking in uncommon musical patterns, such as where the melody only rises in pitch without sliding back down, like in the chorus of "Rock'n Me" by the Steve Miller Band.Instead, earworms often had a very common melodic pattern. "They tended to have this general melodic shape, a pattern of ups and downs in terms of pitch," Jakubowski says. And then they surprise us.Something happens in our brains when we hear the same sorts of patterns over and over, says Margulis, who wasn't involved with this study. When we hear a familiar pattern start, our brains start expecting the rest of it. "We're predicting what's about to come next," she says.Jakubowski says songs that obey simple conventions are nice. "The brain is pretty happy to predict what is happening in our [musical] environment," she says. But in her study, earworms usually had a surprising detail. For example, the hit big band song "In the Mood" by Glenn Miller has a familiar up-and-down movement but a lot of uncommonly large shifts in pitch. "It might be some large leap in pitch that's unexpected or more leaps than are expected in your average pop song," she says. "Something unique to add interest to make the brain want to recall or ponder over this melody."Some of the top earworms identified by study participants include Lady Gaga's "Bad Romance;" "Don't Stop Believing," by Journey; and "Moves Like Jagger," by Maroon 5.Those earworms set you up just to pull the rug out from under you. "Once [your brain starts predicting], you can really start to mess with them and do something new and surprising," Margulis says. "Your expectations are violated. There's a norm that is being crossed."Beautiful music tends to do this, too, Margulis says. "People also link those surprising moments to what gives rise to emotion in music or what passages seem expressive," she says. But earworms aren't always beautiful. And great music doesn't always get caught in an uncontrollable loop.Earworms tend to be simple tunes with just enough variation to distinguish them. "Familiar but a little unfamiliar, not too much," says Lassi Liikkanen, a cognitive scientist at the Helsinki Institute for Information Technology. Maybe, Liikkannen hedges, it's our brains way of integrating new, strange variations with the old ones. "Maybe in order for us to pick up more challenging patterns," he says.Holiday songs do have a characteristic, familiar feel. When a songwriter throws a melodic insurrection into the jingle, it may only be a matter of time before the tune spirals maddeningly in a chorus only I can hear (unless I decide to drag everyone my voice can reach into my purgatory with me.) It doesn't help, of course, that every business on the block finds it necessary to drone the same songs all day.The repetition may contribute to triggering earworms, too, Margulis thinks. "You often get this feeling when you listen to music you've heard before that's different than when you listen to music that's new," she says. "There's a link between that feeling of getting swept along and having something get stuck in your head. This is the case where you really are getting swept along. You're doing it in your head and can't stop."According to work from Liikkannen, over 90 percent of people experience earworms weekly. They are often associated with specific times of day or situations, like a song first heard in a morning, or during relaxation.Luckily, there are ways to break the cycle. Jakubowski suggests "engaging with the earworm." Play or sing the song until you feel like it's gone. Or you can distract yourself with another more tolerable earworm, she says."You can try chewing gum," Margulis suggests. Studies have found this interferes with certain thought processes like memory recall and scanning melodies. And there's always good old-fashioned passive resistance. If you wait long enough, the earworm will subside on its own.It's almost January, after all.Freelance science writer Angus Chen is on Twitter @angrchen. Copyright 2016 NPR. To see more, visit http://www.npr.org/.