Not all meditation is created equal, according to a new study. And if you’re looking to meditate to improve something specific, you should pick a practice that focuses on the thing you’d like to improve.

Many studies have been done to show the benefits of meditation: it can make you calmer and happier and a better person. But “meditation” is actually a group of different techniques — different methods produce different results. And a lot of the studies are somewhat subpar, lumping together different skills and using relatively few participants, says Sofie Valk, a cognitive scientist at the Max Planck Institute for Human Cognitive and Brain Studies in Germany.

That’s why Valk and her colleagues recruited over 300 people to spend nine months practicing three specific types of meditation techniques, and recorded their results in a study published today in Science Advances. They found that all three techniques — which focused on attention, empathy, and perspective-taking — caused changes in both brain structure and actual behavior. But practicing one skill doesn’t make you better at something else, so focusing on your breath probably won’t make you more compassionate.

All the participants went to a lab once a week to get training and do exercises, and also practiced at home. The first three-month module, called “presence,” focused on attention. It taught participants skills from traditional mindfulness meditation, like focusing on how different parts of your body feel and paying attention to your breath.

The second and third modules focused more on social dynamics. In the “affect” module, participants tried to develop compassion and deal with difficult emotions. They worked in pairs. One told a personal story about a positive or negative experience, while the other one listened carefully and tried to really feel the emotions of the other. After five minutes, they switched roles. They also tried loving-kindness meditation, in which people try forgiving those close to them, then strangers and, inevitably, their enemies.

In the “perspective,” people practiced putting themselves in other people’s shoes, and worked on observing their thoughts.

The scientists used a test that measures brain structure to track changes before and after the meditation modules. In each case, there was growth in the area of the brain that is usually linked to controlling the ability participants had focused on acquiring. For example, the “presence” module caused growth in the brain area associated with attention, while the “affect” module made the brain area linked to emotion regulation thicker.

Crucially, though, the skills didn’t generalize. People who did the “presence” module did better at computer-based attention tests. But they didn’t do any better in measures of compassion or perspective until they took the other two modules.

In a second part of the research, scientists tested whether actual behavior changed by putting participants in stressful situations. They had to sit for “job interviews” and count backwards by 17 with a jury saying “mistake!” every time they flubbed. Participants reported feeling less stressed in these situations after each module. That’s significant, of course — since the idea behind a lot of meditation is to feel less stressed. But when researchers tested stress physiologically by measuring the hormone cortisol, the people who improved were those who had taken the social meditation modules.

The paper “touches a lot of the social aspects that have not been previously addressed” and goes further by showing that actual physiological changes happen, says Adam Gazzaley, a neuroscientist at the University of California, San Francisco. “It’s an interesting, well-conducted study that’s also very timely in terms of the goal of increasing understanding of empathy and compassion in a world that seems very lacking it.”

Valk says that the results are promising for people interested in improving their social skills, though further research needs to be done to establish how long the effects can last. “I think it gives hope to people who are socially awkward,” she jokes. “But the main thing is that it matters what you train. Doing a basic body scan isn’t going to help you become more compassionate. You have to really train the domain you want to train.”

Correction: A previous version of the article incorrectly stated that the team measured blood flow using brain scans.