Every night that a patient spends hooked up to sensors in a sleep lab, their body broadcasts an extraordinary amount of information — brain waves, heartbeat, breathing patterns, muscle twitches, eye movements. For decades, most of that data has been used for one narrow purpose: diagnosing sleep disorders. A new artificial intelligence model built by researchers at Stanford Medicine suggests it’s capable of much more.
The model, called SleepFM, was trained on nearly 600,000 hours of polysomnography recordings — the gold-standard overnight sleep study — collected from 65,000 patients. Rather than just scoring sleep stages or flagging apnea events, SleepFM learned to treat the data the way a large language model treats text: it broke the overnight recordings into five-second increments, akin to words, and taught itself the underlying patterns connecting them.
“We record an amazing number of signals when we study sleep,” said Dr. Emmanuel Mignot, the Craig Reynolds Professor in Sleep Medicine at Stanford and co-senior author of the study, published in Nature Medicine. “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.”
To test whether that data could forecast future illness, the researchers turned to an unusual resource: more than 50 years of patient records from the Stanford Sleep Medicine Center, founded in 1970 by the late William Dement, widely regarded as the father of sleep medicine. A cohort of 35,000 patients, whose sleep studies dated back to 1999, had electronic health records tracking up to 25 years of follow-up.
Cross-referencing the two datasets, SleepFM was able to forecast 130 distinct health conditions with reasonable accuracy out of more than 1,000 examined. Its strongest predictions — measured using a statistic called the C-index, where a score above 0.8 indicates strong accuracy — included Parkinson’s disease (0.89), prostate cancer (0.89), breast cancer (0.87), dementia (0.85), and overall mortality (0.84).
Notably, the model’s best predictions didn’t come from any single data stream. “The most information we got for predicting disease was by contrasting the different channels,” Mignot said. A brain that appears to be asleep while the heart behaves as though it’s awake, for instance, seemed to be a red flag the model picked up on — a form of physiological discord invisible to standard sleep scoring.
James Zou, an associate professor of biomedical data science at Stanford and the study’s other co-senior author, said the field has largely overlooked sleep as a target for AI analysis. “From an AI perspective, sleep is relatively understudied,” he said. “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.”
The model isn’t without limits. Researchers are still working to understand exactly what it “sees” when it makes a prediction — its outputs come as risk scores, not explanations. “It doesn’t explain that to us in English,” Zou said, though the team has developed interpretation techniques to probe which signals are driving specific predictions. The researchers are also exploring whether incorporating wearable-device data could sharpen SleepFM’s forecasts further, potentially extending its reach beyond the sleep lab and into everyday life.


