Part 2 of 3 · Previous: Sleep as a window into brain health · Next: The future of brain medicine
In part 1 we looked at how sleep can be used as a window into brain health, across 26 brain, mental and body conditions. Nearly all of them touch the same core of poor sleep, and each leaves its own mark in the finer rhythms. That is what excites me about sleep. I don't know of any other measure that gives such a comprehensive physiological readout. Yet it is still uncommon in healthcare. Your GP rarely if ever orders a sleep study, unless someone already suspects a sleep disorder1.
I started studying neuroscience to learn what the brain could teach us about building AI systems. This part turns that around, and asks what AI can teach us about the brain. New instruments in science tend to go through two phases. First they do what a trained eye already does, only faster or more accurately. And then later, they might show us what we couldn’t see with the naked eye. The microscope did exactly this. At first it magnified what naturalists already studied, and then Leeuwenhoek pointed it at a drop of water and saw bacteria2. I believe AI is going through the same phases, and in sleep science, we are in the middle of this transition. In phase 1, we get a faster and more accurate version of the sleep technologist’s eye. In phase 2, the AI model itself becomes the lens, and we look through it to better understand the brain.
I. Can a model read a night like an expert?
A sleep technologist scores the night by eye, calling each 30-second epoch awake, light sleep (N1, N2), deep sleep (N3) or REM. The 30-second epoch is a leftover from paper. Back in the 1930s, Alfred Loomis’s recorder had a knife that cut its paper roll every 30 seconds3. When one group rescored 100 recordings in 5-second epochs, the stage changed about eight times as often, and deep sleep fell from 25% to 15% of the scored time4. I've been surprised by how many standards in medicine exist for convenience, and not necessarily for biology.
Phase 1 is mostly solved. Models trained on scored recordings, such as U-Sleep, now stage sleep as accurately as human experts5 (Figure 1). But a model graded against experts can at best match them, and it learns their convention along with their skill, 30-second epochs included.
An expert and a model score the same night · agree on 86% of epochs
ExpertModel
The same model, before it has to pick one stage · each column adds up to 100%
WakeREMN1N2N3
Narcolepsy is where I first saw phase 2. A team trained a network on about 3,000 scored recordings, then asked it for something different. Instead of one stage per 30 seconds, it gave the probability of each stage every 5 seconds8. People with type 1 narcolepsy spent more of the night in mixtures of wake, REM and light sleep, a blur that one label per epoch hides. That blur alone caught 91% of patients in recordings the model had not seen, and wrongly flagged 4% of people without the disease. That is about as good as the standard diagnosis, a night in the lab followed by a day of nap tests8. The network had learned more than the human scorers told it. No clinic uses it yet, because scoring still follows the 30-second rules.
II. What happens if we drop the labels?
Most sleep AI so far is supervised. A model learns one job, such as staging, from recordings that experts have labelled. A foundation model is first pretrained on large amounts of unlabelled recordings, with a task it sets itself from the data, and only later fine-tuned for each job. The hope is that solving that task forces it to learn the dynamics underneath the signal.
If brain foundation models that matter for medicine get built, I think they will be built on sleep data. Sleep is linked to most of the conditions we care about (part 1), and there is a lot of it. Sleep models already pretrain on hundreds of thousands to more than two million hours of recordings9,10, against tens of thousands of hours for most EEG models11. And each night sits in a hospital record that can be linked to what happened to the patient later.
SleepFM is the clearest example so far9. A sleep study records brain waves, eye movements, muscle tone, heart rhythm and breathing at the same time. SleepFM was pretrained on 585,000 hours of these recordings from about 65,000 people, mostly sleep clinic patients. Its task was to take five minutes of one signal, say the heart, and pick out the matching five minutes of the other signals from a batch of other moments. To get it right, it has to learn how brain, heart and breathing move together through the night. It never saw a sleep stage or a diagnosis.
To test what it had learned, each sleep study was linked to the patient's hospital record, and the model was asked who would later be diagnosed with what. Take any two patients. A coin flip picks the one who gets sick first half the time. For death from any cause, the pretrained model picked right 84 times in 100. The same network trained from scratch on the diagnoses managed 79, no better than age, sex, BMI and ethnicity alone9. Across 939 conditions the gain over age, sex and BMI is smaller, 71 against 6810. The signal is real, but it is modest.
III. Do bigger brain models get better?
In language, scale worked almost by law. A model's size is counted in parameters, the numbers it tunes as it learns. As parameters and training text grew, the loss, how surprised the model is by the word that actually comes next, fell along a smooth curve called a scaling law12, and the downstream tasks people cared about improved with it13.
The closer analogy for brain models is protein language models. A protein is a chain of amino acids, and the order of the chain decides the shape it folds into. A protein language model learns from sequences alone, by hiding some amino acids and guessing them back. It never sees a structure. Yet in one such model the folded shape could be read straight out of its internal representation, and the bigger the model, the more accurate the predicted structure14. Evolution had written structure into sequence, and the model learned to read it. That is the bet behind brain foundation models too. Pretrain on the signal, and hope the biology underneath comes along.
I wanted to know whether brain models follow the same law. So I collected every study I could find that trained the same brain or body-signal model at several sizes and tested each size on the same task. That gave 26 size sweeps from about 17 papers, many of them preprints. On a scale where 0 is chance and 1 is perfect, the median gain per tenfold increase in size was about 0.02. A model ten times bigger moved two hundredths of the way. Sleep models did best, at about 0.05. Language and protein models gain about 0.1 or more (Figure 2).
Loss pretraining loss, relative to the smallest model. Lower is better.Task downstream task score, 0 = chance, 1 = perfect. Higher is better.Same scale in every panel.
Language
44M to 280B parameters
Loss predict the next word
Task finish a passage
Protein
8M to 15B parameters
Loss predict a hidden amino acid
Task read structure and fitness
Brain and body signals
0.4M to 1.7B parameters
Loss fill in hidden signal
Task published size sweeps
Size does help with the pretraining task. Bigger brain models usually reach a lower loss. What stays flat is the downstream task. In one sweep of ten EEG models, up to two billion parameters, accuracy on real tasks could fall while the training loss kept improving17. The bigger models got better at their pretraining task without learning more about the brain. A model learns exactly what its training setup rewards, so the question is what the setup rewards.
IV. What would break the barrier?
So I went looking for what would break that pattern. Across the papers I see four things the training has to get right, and each already has early evidence behind it (Figure 3).
A · data per parameter
Data buys more than size
median task gain, chance (0) to perfect (1)
B · the training task
The task decides what gets learned
same model and data, mean accuracy on 14 EEG tasks
C · the labels
The scorer is the ceiling
dashed line: where scorers agree with each other
D · the test
Most of the score was the person
dashed line: chance, 50%
The data-to-parameter ratio. Language models are trained on about 20 tokens of fresh text per parameter21. One of the larger EEG models had less than one second of signal per parameter22. That is far more capacity than data, and it shows in my tally of the sweeps, where ten times more data bought about three times as much as ten times more parameters. For sleep, more data means more people and more nights from each of them.
A training task that rewards physiology. Most EEG models learn by hiding a stretch of signal and filling it back in. Much of a scalp recording is muscle, eye movement, electrode noise and a background that shifts with age, so a model that fills the gap well has learned to predict all of that too23,24. The tasks that do better make the noise useless. One predicts a summary of the gap instead of every sample18. Another, the one SleepFM uses, matches the brain against the heart and breathing, which share the body's state and none of the electrode noise25.
Labels nobody has to judge. Train a staging model on scorers' labels and it stops improving at about 87%, roughly where scorers agree with each other19. The labels were the ceiling. Lab values and diagnoses made years later have no such ceiling, and the label decides what the model learns. In 639 people followed for 14 years, a sleep EEG score trained on cognition and disease tracked their memory decline. One trained to predict age did not26.
A test without shortcuts. An Alzheimer's EEG classifier scored 99.8% when the same people appeared in training and test, and 53% on people it had never seen20. A person's EEG is about as individual as their voice. Put the same voice on both sides of the test, and the model learns to recognise the speaker. A fair test uses new people and new sites, and someone else holds the answers.
If a model gets all four right, I'd expect it to predict well. That is still phase 1, a better version of the scorer's eye.
V. Can a model show us something new about the brain?
Phase 2 starts when we look inside the model and its learned representations show us things our eyes cannot see. The AI labs are already doing this, with their own language models. Their models work, but nobody can say exactly how, so they borrow tools from neuroscience to look inside. The field is called mechanistic interpretability. Point the same tools at a model trained on brain recordings, and what they find could teach us something new about the brain.
Different tools can be used to look inside the model. A probe checks whether the model already knows something we know. SleepFM-2 was never shown a sleep stage, yet a simple readout of its internal activity separates the five stages almost perfectly10. A sparse autoencoder shows what the model knows that we never asked about. It splits the model’s activity into features, and we look at what each one responds to. In SleepFM-2, a few features line up with spindles or slow waves, and most line up with nothing we have a name for10. Some of these unnamed features may reveal new insights about the brain.
The team behind SleepFM-2 found that the model lays the night out “along a continuous Wake to N3 depth axis, with REM offset as a separate mode”10. The five stages are cuts through a continuum, the same blur the narcolepsy network found inside the 30-second epoch. The disease predictions are simpler than they look too. Once age, sex and BMI are removed, a single direction explains 56% of what the model says about 939 conditions, and it shows up again in a health system the model never trained on. Higher risk on that axis goes with more ambiguous sleep and weaker spindle coupling across the scalp, which the authors read, carefully, as possible ageing or frailty.
A pattern like that is still only a hypothesis. In his 1974 commencement address at Caltech, Richard Feynman said, “The first principle is that you must not fool yourself, and you are the easiest person to fool”27. Looking inside a model makes it easy to fool yourself. A feature can vanish when the model is retrained28, or turn out to be reading age off the EEG background24.
A pattern becomes a finding in two steps. It has to hold up in people the model never saw, which the risk direction in SleepFM-2 already does. And changing the brain has to move it the way the model predicted. As with many neuroscience experiments, the clearest case so far is in mice.
Researchers recorded neurons in the hypothalamus during fights and fitted a model to the activity without telling it anything about behaviour. The researchers expected cells that fire for attack. Inside the fitted model they found something else, one slow direction in its learned representation that builds up and holds for over a minute, like a dial for how aggressive the animal is29. They then used the model as a map. Switching those neurons on with light turned the dial up, and it stayed up. Switching on other neurons had an effect that faded straight away30. Removing two hormone receptors from those neurons erased the dial, and the mice attacked less31. A variable first seen inside a model turned out to be a state the brain really holds.
In people, the closest case I know of comes from narcolepsy. In a small placebo-controlled drug trial, researchers ran the published network from that narcolepsy study on EEG recorded while patients tried to stay awake during the day. Adding up its sleep probabilities gave a sleepiness score every 15 seconds, and the drug slowed how fast that score climbed32. There are a handful of similar cases across neuroscience, and more are on the way.
One thing I’m experimenting with is using sound stimulation to modulate my sleep. Sounds timed to the peaks of slow waves make them larger33. Could sounds like these move a feature found inside a sleep model? I don’t know of any study that has tested that yet. One trial now running comes close. Older adults with memory complaints get four weeks of these sounds at home, and one of its measures is a sleep-based brain age, with results expected in 202834.
This is still early days for AI-enabled neuroscience, and this part only scratched the surface of it. When Leeuwenhoek reported his little animals, the Royal Society asked others to see them too. Its own botanist failed, and Robert Hooke only managed on his third attempt2. Models trained on the brain are at that stage now. Some of what they show us will turn out to be real, and some will turn out to be the lens.