Most people think of sleep as a reset button. You wake up, you feel better or worse, and you move on. But Stanford Medicine researchers say one night of sleep may contain a hidden forecast of what is coming next, including serious diseases that might not show up for years.
In a study published Jan. 6 in Nature Medicine, Stanford Medicine scientists and their colleagues introduced SleepFM, an artificial intelligence model that can predict a person’s risk of developing more than 100 health conditions using physiological recordings from a single night of sleep. The team trained the model on nearly 600,000 hours of sleep data from about 65,000 participants, using polysomnography, the gold standard overnight sleep test that records brain activity, heart activity, breathing, muscle activity, eye movements, and more.
“We record an amazing number of signals when we study sleep,” said Emmanuel Mignot, MD, PhD, a Stanford Medicine sleep researcher and co-senior author. He called it “very data rich” because it captures general physiology for about eight hours while a person is still and continuously monitored.
The work was led by Stanford Medicine researchers working with a broader group of collaborators. Emmanuel Mignot and James Zou, PhD, were co-senior authors. Zou is an associate professor of biomedical data science. Two PhD students, Rahul Thapa (Stanford) and Magnus Ruud Kjaer (Technical University of Denmark), were co-lead authors. Researchers from the Technical University of Denmark, Copenhagen University Hospital – Rigshospitalet, BioSerenity, the University of Copenhagen, and Harvard Medical School contributed.
Their model, SleepFM, is described as a foundation model, meaning it is trained on massive amounts of data in a way that allows it to later be adapted to many tasks. The researchers compare this idea to large language models like ChatGPT, which learn patterns from huge text datasets. SleepFM does something similar, but with sleep signals.
“SleepFM is essentially learning the language of sleep,” Zou said.
How Can AI Predict Disease While You Sleep
Polysomnography records multiple streams of signals at once. The researchers treated the sleep recording like a long sequence broken into five-second chunks, similar to how language models break text into pieces. SleepFM then learns how the different signals relate to each other over time.
The team developed a training method called leave-one-out contrastive learning. The basic idea is that the model sometimes has one type of signal hidden from it, and it has to reconstruct what is missing using the other signals.
“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.
Instead of relying on just one clue, SleepFM learns patterns across brain signals, heart signals, breathing signals, and muscle signals, and it looks at how those systems stay in sync or drift out of sync during sleep.
“The most information we got for predicting disease was by contrasting the different channels,” Mignot said. He pointed to cases where the body seems misaligned, like “a brain that looks asleep but a heart that looks awake,” as a possible sign that something is wrong.
What They Found: One Night Can Predict Over 100 Conditions
After training, the researchers first tested SleepFM on classic sleep tasks such as identifying sleep stages and assessing sleep apnea severity. SleepFM performed as well as or better than leading models used today.
Then they aimed higher: predicting future disease onset.
To do that, they paired sleep recordings with long-term health outcomes. The Stanford Sleep Medicine Center, founded in 1970 by William Dement, had decades of patient data. The largest group used for this disease prediction work included about 35,000 patients, ages 2 to 96, whose sleep studies were recorded between 1999 and 2024. The researchers matched those recordings with electronic health records, with up to 25 years of follow-up for some patients.
SleepFM analyzed more than 1,000 disease categories and found 130 that could be predicted with reasonable accuracy from one night of sleep data.
The model’s predictions were especially strong for cancers, pregnancy complications, circulatory conditions, and mental disorders, with performance measured using the C-index. Zou explained the C-index using a simple idea: if you take any two people, the model ranks who is more likely to experience an event first. A C-index of 0.8 means the model’s ranking matches reality about 80% of the time.
Which Diseases Were Predicted Most Strongly
The researchers reported especially strong predictions for several major conditions, including:
- Parkinson’s disease (C-index 0.89)
- Dementia (0.85)
- Hypertensive heart disease (0.84)
- Heart attack (0.81)
- Prostate cancer (0.89)
- Breast cancer (0.87)
- Death (0.84)
Zou said the team did not expect the predictions to hold across such a wide range of conditions.
“We were pleasantly surprised that for a pretty diverse set of conditions, the model is able to make informative predictions,” he said.
He also pointed out that even models with lower performance, around a 0.7 C-index, can still be useful in real clinical settings, such as systems that predict how a patient might respond to cancer treatments.
The researchers frame this as a new way of thinking about sleep. Instead of treating polysomnography as a test mainly for sleep apnea or sleep staging, they argue it is a broad physiological dataset that has been underused.
“From an AI perspective, sleep is relatively understudied,” Zou said. He noted that many AI projects focus on pathology or cardiology, but much less attention has been given to sleep, even though it is “such an important part of life.”
At the same time, the team is clear about the challenge ahead. SleepFM can make predictions, but it does not automatically explain itself in plain language.
“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.”
They are also working on improving the system further, including the idea of adding wearable data in the future.
If these findings hold up as the work expands, one night of sleep testing could become more than a diagnostic snapshot. It could become a risk forecast, helping doctors identify who is trending toward neurological disease, heart disease, cancer risk, and more, long before symptoms force the issue.
The central message of SleepFM is blunt and a little unsettling: while you sleep, your body may already be signaling what is coming. Now, an AI may be able to hear it.








