
For decades, sleep research has been held hostage by a single stubborn bottleneck: the sleep scorer. Whether studying mice, zebrafish, or humans, every hour of electrophysiological data must be manually staged into wake, NREM, and REM by a trained human technician staring at squiggly lines of EEG and EMG traces. Two experts scoring the same recording will disagree on 15 to 20 percent of epochs. Reproduce a published result in a different lab using a different species or a different recording setup, and the scoring pipeline typically has to be rebuilt from scratch. The result is a field where data accumulates faster than it can be annotated, where cross-study comparisons are plagued by methodological drift, and where the richness of sleep biology is routinely flattened into just three coarse categories because finer distinctions are too expensive to label.
A preprint posted to bioRxiv on July 28, 2026, proposes a clean break from this pattern. Called Nyx, after the Greek primordial goddess of night, the framework is an unsupervised, explainable sleep scoring system built on principal component analysis. The team behind it, led by Letizia Signorelli and Charlotte Boccara at the University of Oslo, did not set out to build a better classifier on top of the usual manual labels. Instead, they borrowed a strategy from a completely different corner of neuroscience: spike sorting.
In electrophysiology, spike sorting algorithms automatically cluster raw neural waveforms into putative single units without anyone telling the algorithm what a neuron looks like first. Nyx applies the same unsupervised logic to sleep staging. It takes the raw spectral features of a recording, reduces them to their principal components, and lets natural clusters emerge from the data itself. The result is a set of sleep states that are defined by the signal, not by a human pre-assigning epochs to arbitrary categories. This avoids the circularity problem inherent in supervised approaches: if you train a model on human scores, the best you can ever do is replicate human scoring, including its biases and blind spots. Nyx can, in principle, find structure that human scorers have been trained to miss.
The validation behind the claim is unusually broad. The team tested Nyx on roughly 8,000 hours of data drawn from 19 independent datasets spanning multiple laboratories, multiple species, multiple ages, and multiple recording modalities. Across this diverse corpus, the algorithm matched human inter-scorer agreement, the de facto gold standard in the field. That is a serious benchmark: human experts do not perfectly agree with one another, so demanding that an algorithm exceed human-human agreement is asking it to be better than the measurement itself. Nyx lands right in the same range, meaning it scores as reliably as a competent human technician, but in minutes rather than weeks, and with perfect reproducibility.
Where Nyx begins to distinguish itself from existing tools is in what it can see that humans and supervised classifiers cannot. In rodents, the algorithm can resolve substages of NREM sleep that correspond to what human sleep medicine calls N2 and N3. These stages are well established in human polysomnography but have been notoriously difficult to define automatically in mice and rats, where the electrophysiological signatures are less stereotyped. Nyx finds them without being told to look. This matters for basic research because N2 and N3 are thought to serve different physiological functions. N2 is associated with sleep spindles and memory consolidation, N3 with slow wave activity and metabolic clearance. If rodent models cannot distinguish them, the translational bridge between bench and bedside has a missing link.
The framework also reveals sleep states that cut across the standard wake-NREM-REM trichotomy, particularly in non-mammalian species. Birds, reptiles, and fish display sleep architectures that do not map neatly onto mammalian staging conventions. By letting the data drive the clustering, Nyx can identify cross-canonical states, patterns of neural activity that share features with multiple traditional stages or that do not fit into any existing box. This opens the door to comparative sleep research that is not forced to impose mammalian categories on non-mammalian brains.
A more immediately practical feature is that Nyx supports real-time, closed-loop manipulation. Because the algorithm does not require human annotation or model retraining for each new recording, it can classify epochs on the fly. Researchers can trigger optogenetic stimulation, pharmacological delivery, or sensory stimuli the instant the animal enters a specific sleep state. This capability used to require dedicated hardware systems or hand-crafted decision rules. Nyx makes it a built-in feature of the scoring pipeline.
The framework is released as an open-source Python package with a graphical user interface, which lowers the technical barrier for adoption. A lab that has never written a line of code can load an EEG file, click a button, and get back staged sleep data. But the deeper design philosophy, the authors said, was that Nyx was built to scale with the pace of innovation itself. Because it does not depend on a fixed training dataset, it can adapt to new recording configurations, new species, new ages, and even pathological sleep architectures such as those seen after sleep deprivation or in neurological disease, without being retrained from scratch each time.
The bottom line is this: sleep scoring has been the silent rate-limiter on a huge swath of neuroscience. Every study that depends on staging hundreds of hours of recordings, every cross-species comparison, every longitudinal developmental experiment, and every closed-loop sleep intervention has to negotiate the same bottleneck. Nyx does not eliminate the need for human expertise in experimental design or interpretation, but it does eliminate the need for humans to spend thousands of hours drawing lines on EEG traces. By making unsupervised sleep staging that works across species, ages, and recording modalities, and by giving it away as an open-source tool, the Oslo team has handed the field a piece of infrastructure that the field has needed for a long time.
Source: Signorelli, L., Korchynska, S., Ortiz, C., Arena, A., Wilhelm, S., & Boccara, C. (2026). Nyx: An unsupervised framework for sleep scoring across species, ages, and recording modalities. bioRxiv. DOI: 10.64898/2026.07.24.740558. Funded by European Research Council (ERC) grant 101117770 and Research Council of Norway grants 288478, 105428102, 332004, 187615/V40. No competing interests declared.

