At first glance, diabetes and Alzheimer’s disease may not seem to have much in common. But the latest research suggests that the same drug — insulin — that treats diabetes may also help stave off the symptoms of cognitive decline in Alzheimer’s.

Led by Suzanne Craft, a psychiatrist at the University of Washington in Seattle and head of the memory disorders clinic at the Veterans Affairs Puget Sound Health Care System, researchers conducted a small pilot study involving 104 men and women with mild cognitive impairment — a common precursor to more advanced dementia — as well as the early stages of Alzheimer’s itself.

The researchers gave each participant two daily doses of a nasal spray, randomly containing either insulin or placebo. The intranasal delivery — similar to the way nasal flu shots work — makes more sense in the context of Alzheimer’s disease because it sends the drug to the brain and central nervous system faster.

Over four months, the researchers found that those who took insulin improved or at least maintained their scores on tests of memory and general cognitive abilities; people who got a placebo did worse over time.

The participants who received insulin actually got one of two doses: a lower dose of 20 international units (I.U.) or a higher dose of 40 I.U. At the end of four months, nearly 80% of those in the low-dose group showed improvements in a memory test, which asked people to remember 44 elements of a story that was read to them. The placebo group showed worse performance on the task. People getting the higher dose of insulin also did not show enhancement in memory, but they did improve in overall cognitive functions.

In addition to the memory tests, scientists also compared patients’ levels of proteins and other substances in the body, which are known to be markers of Alzheimer’s. Although there was no change in the average levels of these markers, participants who showed improvements in memory also showed slight declines in levels of disease-related plaques and tangles in the brain.

Brain scans further showed that people in the insulin-treated group were able to preserve their ability to process glucose properly in the brain. Glucose helps brain cells work normally and perform functions related to memory and other cognitive abilities. Alzheimer’s brains show less metabolism of glucose, and in the study’s placebo group, scans showed gradual declines in the brain’s ability to break it down.

So where does insulin come into play? Brain cells also need insulin, and conditions like diabetes or prediabetes that interfere with its proper activity in body are known to be linked to an increased risk of Alzheimer’s. As the new findings suggest, delivering more insulin to the brain could improve its function in people with dementia.

“For the past 10 years, we have understood a lot more about the role of insulin in the brain,” says Craft. “It’s well known that insulin plays an important role in blood-sugar regulation in the body, but work from our lab and others suggests that it has a number of different and important roles in the brain as well. Those include mediating glucose or energy metabolism in the parts of the brain important for memory and other cognitive functions. When there is a problem with insulin’s ability to carry out these functions, we believe that the stage is set for development of age-related conditions such as Alzheimer’s disease.”

By looking at a variety of measures and markers of Alzheimer’s, the current research is among the most complete studies of how insulin may affect the nerve networks that are damaged by the disease. But it is a small study and very preliminary — only the first of many steps toward figuring out whether insulin could become a weapon against dementia.

It’s still unclear, for example, why the lower dose of insulin appeared to improve people’s memory, while the higher dose did not; and yet the higher dose enhanced other cognitive functions. The finding suggests there’s a fine line between too little insulin and too much. “We can’t know for sure what mechanism is underlying this pattern, but, potentially, the dose that is optimal for memory may be different from the dose that is optimal for other types of cognitive abilities,” says Craft. “With insulin, it’s like a Goldilocks story. Too little is bad, and too much is bad.”

It is far too soon to suggest that Alzheimer’s patients try using insulin. Further studies will need to be done to understand exactly how the drug may interfere with the course of the memory-robbing disease. “We have come so far, that I see [researchers] making even greater progress in terms of tailoring the type of insulin, the way it is administered and its timing to really have an impact on this disease,” says Craft.

Alice Park is a writer at TIME. Find her on Twitter at @aliceparkny. You can also continue the discussion on TIME’s Facebook page and on Twitter at @TIME.