People getting treated for depression often have to suffer through months of trial-and-error testing of different drugs to see which of them—if any—will help. For a long time, scientists and clinicians have hoped for a biological means of diagnosing depression or predicting which patients will do better on a given treatment. A new study takes a step toward the latter kind of prediction by finding a distinctive signature with the noninvasive technique of electroencephalography (EEG) to test who will benefit from one common antidepressant.

The study, published Monday in Nature Biotechnology, followed more than 300 people with depression as they began taking the drug sertraline (Zoloft) or a placebo. A computer algorithm could discern the EEGs of those who fared well on the drug from those who did not. Trained on one group, the algorithm also effectively predicted results in several others.

The work is preliminary and needs to be confirmed with further studies and expanded to include other treatments, such as different antidepressants, transcranial magnetic stimulation and psychotherapy. But “in my field, this, itself, is a huge step. We have not had the kind of predictors that are specific for a drug,” says Madhukar Trivedi, a psychiatrist at the University of Texas Southwestern Medical Center’s Peter O’Donnell Jr. Brain Institute, who oversaw the multisite trial.

Right now doctors give patients whichever antidepressant they like best, and then—for all choices in this class of drugs—they have to wait six to eight weeks to know whether it is working or not, says Amit Etkin, who also oversaw the research. If the drug does not work well, it might be another six weeks before they know whether a different dose or a new drug is more effective. Meanwhile many of the people who seek medication are at risk for suicide or too depressed to function normally.

“This very idea that we’ve accepted, as a field, as a world, that it takes eight weeks or more to see an antidepressant response, and that that’s okay—that should never be okay,” says Etkin, who is currently on leave from Stanford University to pursue commercialization of an EEG-based diagnostic. “We should be apologizing all the time about that, not accepting it.” One in eight Americans currently takes an antidepressant, so improving the process of matching a patient to a medication could benefit a huge number of people, he says.

Tom Insel, former head of the National Institute of Mental Health and now an entrepreneur, thinks this approach—if proved through more research—could be extremely helpful for patients and doctors. “This is a real step forward. It’s an important moment to say, ‘Yes, we can indeed do better,’” says Insel, who was not involved in the new paper but was head of NIMH when it decided to fund the research. “If we could save these people a six-week trial on sertraline, that would save time and money and get better outcomes.”

Today about 40 percent of patients will respond to the first drug they are given, Etkin says. In his study, about 65 percent of patients’ whose EEG signature suggested they would respond well to sertraline did so. Even if the approach does not improve, as Etkin hopes it will, it is still substantially superior to the current method, he says.

Today’s psychiatric drugs do not work better than a placebo for many people, which has given them the reputation of being ineffective. But the problem may be the diagnosis, not the drug, Etkin says. Maybe the current way we diagnose is imprecise, because it is not tied to the biology of the condition. “It’s all subjective report,” he says. If scientists could diagnose based on a biological marker, diagnoses would become more objective, and the same therapies would seem more effective because they would be better matched to patients who would benefit from them. An EEG has a lot of advantages as a diagnostic, Etkin says: it is relatively cheap, readily available and easy to administer.

The use of artificial intelligence is limited in a field such as mental health, where it is very challenging to get large data sets, he says. The researchers could not rely on the increasingly popular artificial intelligence technique known as deep learning, because it would require data from 100,000 patients or so to make predictions, which isn’t feasible in psychiatry, he says. Instead Etkin and his colleagues created a simpler algorithm to mine the richness of EEG data and take advantage of the relatively large pool of patients they did have. Earlier efforts to find a signature without using AI failed, the paper shows, and patients’ symptoms did not help to stratify them.

EEG measures electrical activity of the brain via electrodes placed on the skull. Some patterns of activity on the left side of the organ suggested that a patient would fare better on sertraline, Trivedi says. In the study, researchers used the same algorithm to try to find a signature—the absence of the same marker—that predicts which patients will respond well to transcranial magnetic stimulation (TMS), which delivers repeated magnetic pulses to areas of the brain thought to be involved in depression.

“From a patient perspective, that is a very valuable step,” says Martijn Arns, another author of the paper and research director of the Brainclinics Foundation in the Netherlands. “Rather than using ’stepped care,’ where a patient is started on the ’simplest’ treatment and escalated every time [that person] does not respond, we can now guide someone more quickly to the right treatment that will work for [him or her] using a biomarker.”

Sebastian Olbrich, an EEG researcher who was not involved in the new study, says that although he considers the paper a “great piece of work,” he is concerned that the researchers team did not train their algorithm on TMS before drawing their conclusions. “They only trained it on one treatment option and then applied it to another,” which isn’t appropriate, he says.

Still, Olbrich, a psychiatrist and president of the International Pharmaco EEG Society, says he is eager to see the study expanded to other depression treatments. “If you have this for several treatment options, this is a really great step for psychiatry,” he says.

Trivedi says he would ultimately like to develop an EEG test that could identify the signature of depression before a person suffered its symptoms. He adds that he has begun a study with about 1,200 volunteers whom he plans to follow over time. He will check in with them a few times a year to begin to develop predictive models about who will experience depression and who will recover from it.