One bad night’s sleep can result in a foggy brain for the entire day. But new research suggests a single night’s sleep may also carry clues and predictions about illnesses and diseases that won’t appear as overt symptoms for years. 

In one test, an AI system used overnight physiological signals to estimate a person’s risk for more than 100 future health conditions.


EarthSnap

The model, called SleepFM, was developed by Stanford Medicine researchers and collaborators.

It was trained on nearly 600,000 hours of polysomnography data from about 65,000 people, using the kind of overnight sleep study that tracks the brain, heart, breathing, movement, and more.

Mining data with SleepFM

Polysomnography is often treated as a clinical tool: you do the study, score sleep stages, look for sleep apnea, and move on. The team argues that’s only a small slice of what these recordings contain.

“We record an amazing number of signals when we study sleep,” said co-senior author Emmanuel Mignot, a professor of sleep medicine at Stanford. 

“It’s a kind of general physiology that we study for eight hours in a subject who’s completely captive. It’s very data rich.”

The problem, until recently, was that humans and standard software could only digest so much of that complexity.

AI changes that equation, at least in principle, by learning patterns across thousands of nights and multiple body systems at once.

Sleep studies with AI

Medical AI has been booming in fields like radiology and cardiology. Sleep has lagged behind, even though it sits at the intersection of brain function, metabolism, breathing, and cardiovascular health.

Study co-senior author James Zou is an associate professor of biomedical data science.

“From an AI perspective, sleep is relatively understudied. There’s a lot of other AI work that’s looking at pathology or cardiology, but relatively little looking at sleep, despite sleep being such an important part of life,” said Zou.

That gap shaped the team’s approach. Instead of building a model for a single task, they developed a foundation model designed to learn broad patterns first and adapt to specific predictions later.

SleepFM and the language of sleep

SleepFM was trained like a large language model, but instead of words, it learned from tiny slices of physiology.

The polysomnography recordings were chopped into five second segments, so the model could process long nights as sequences and learn what normally follows what. “SleepFM is essentially learning the language of sleep,” Zou said.

The model pulled in multiple channels at once, including signals such as electroencephalography for brain activity, electrocardiography for heart rhythms, electromyography for muscle activity, plus pulse and airflow data. 

Training a model for reliability

The goal wasn’t just to read each channel. It was to understand how the channels relate to one another.

To do that, the researchers created a training method designed to make the model fill in blanks. One stream of data would be hidden, and the model would have to reconstruct it from the others.

“One of the technical advances that we made in this work is to figure out how to harmonize all these different data modalities so they can come together to learn the same language,” Zou said.

After training, the team fine-tuned SleepFM for familiar sleep medicine tasks. They tested whether it could classify sleep stages and assess sleep apnea severity, among other standard measures.

On those benchmarks, the system performed as well as or better than leading models already used in the field.

That step mattered because it suggested the model wasn’t just learning noise. It could do the basics reliably before being asked to do something more ambitious.

Sleep data and disease risk

Then came the real swing: forecasting future disease from one night’s sleep. To do this, the researchers paired sleep data with long-term medical outcomes, using decades of patient records from a major sleep clinic.

The Stanford Sleep Medicine Center was founded in 1970 by the late William Dement. For this project, the largest dataset came from about 35,000 patients aged 2 to 96 whose polysomnography tests were recorded between 1999 and 2024. 

The team matched those sleep studies to electronic health records, giving up to 25 years of follow-up data for some individuals.

SleepFM scanned more than 1,000 disease categories and identified 130 that it could predict with reasonable accuracy using sleep data alone. 

Predicting diseases years ahead

The strongest results were reported for cancers, pregnancy complications, circulatory conditions, and mental disorders, with a C-index above 0.8 in those groups.

The C-index is a way to score how well a model ranks risk across people. It’s not about certainty for one person. It’s about whether the model tends to place higher-risk individuals above lower-risk ones.

“For all possible pairs of individuals, the model gives a ranking of who’s more likely to experience an event – a heart attack, for instance – earlier. A C-index of 0.8 means that 80% of the time, the model’s prediction is concordant with what actually happened,” Zou said.

The model performed especially well for several specific outcomes, including Parkinson’s disease, dementia, hypertensive heart disease, heart attack, prostate cancer, breast cancer, and death.

“We were pleasantly surprised that for a pretty diverse set of conditions, the model is able to make informative predictions,” Zou said.

What the SleepFM model “sees”

Even with strong performance numbers, the obvious question remains: what exactly is SleepFM picking up? The team says they’re working on interpretation tools and may also try improving predictions by adding data from wearables.

“It doesn’t explain that to us in English,” Zou said. “But we have developed different interpretation techniques to figure out what the model is looking at when it’s making a specific disease prediction.”

One pattern already stands out. The most accurate predictions didn’t come from a single channel. They came from comparing channels and spotting mismatches.

“The most information we got for predicting disease was by contrasting the different channels,” Mignot said.

In other words, it may be the body being out of sync that signals trouble. A brain that looks asleep while the heart looks “awake,” for example, could hint that something deeper is off.

The study is published in the journal Nature Medicine.

—–

Like what you read? Subscribe to our newsletter for engaging articles, exclusive content, and the latest updates.

Check us out on EarthSnap, a free app brought to you by Eric Ralls and Earth.com.

—–