Spava: Sleep Sensing & Video Inference
- Spava is a polysemous term that denotes both a privacy-preserving smartphone sleep monitoring pipeline employing a Heterogeneous Hidden Markov Model and an unrelated multi-GPU long-video inference framework.
- In its sleep analytics context, Spava collects passive smartphone signals to derive sleep metrics like circadian midpoint and social jetlag, validated against commercial wearables.
- The long-video framework accelerates inference by using sequence-parallel approximate attention, optimizing computational load in large multimodal models.
Spava is a polysemous term in recent arXiv literature. Its most specific and technically defined use denotes a privacy-preserving smartphone pipeline for sleep activity recognition and characterization from passively sensed signals, implemented with a Heterogeneous Hidden Markov Model (HHMM) that outputs 10-minute sleep–wake labels, detects the main sleep period, and derives weekly markers such as circadian midpoint and social jetlag (Martínez-García et al., 2023). In adjacent sleep-monitoring work, the term is also used more loosely as a label for sleep-focused sensing and modeling systems built from wearables, pressure mats, and cross-modal biosignal models (Zhang et al., 2024, Yuan et al., 14 Feb 2026). Separately, “Spava” is the exact name of an unrelated systems method for accelerating long-video inference in large multimodal models through sequence-parallel approximate attention across multiple GPUs (Huang et al., 29 Jan 2026).
1. Terminological scope and disambiguation
Current usage indicates that “Spava” has at least two distinct referents and one broader contextual use.
| Usage of “Spava” | Domain | Core idea |
|---|---|---|
| Smartphone sleep activity recognition | Mobile health | HHMM over passive smartphone signals (Martínez-García et al., 2023) |
| Broader sleep-monitoring label | Wearables and biosignals | Sleep staging, posture sensing, cross-modal modeling (Zhang et al., 2024, Yuan et al., 14 Feb 2026) |
| Long-video inference framework | Large multimodal models | Sequence-parallel approximate attention (Huang et al., 29 Jan 2026) |
The smartphone meaning is the most self-contained research object. It addresses sleep–wake cycle recognition from non-sensitive smartphone data only, explicitly excluding microphone, GPS, WiFi, and content, and validates derived sleep metrics against consumer wearables rather than using those wearables for training (Martínez-García et al., 2023). This gives the term a concrete place in digital phenotyping and passive mobile sensing.
A separate systems paper assigns the same name to a multi-GPU attention framework for long-video understanding. That work concerns the prefill bottleneck of long-sequence large multimodal models, not sleep analytics, and its mathematical apparatus is based on approximate attention, anchor blocks, passing blocks, and sequence parallelism (Huang et al., 29 Jan 2026). A recurrent misconception is therefore terminological rather than methodological: the two “Spava” works are unrelated.
A broader reading is suggested by later sleep papers that use “Spava” as a contextual label for sleep monitoring more generally. In that usage, the term encompasses smartphone sensing, EEG-less wearable staging, bed-based posture sensing, and unified nocturnal biosignal representation learning rather than a single standardized architecture (Zhang et al., 2024, Yuan et al., 14 Feb 2026).
2. Smartphone Spava: sensing regime, data representation, and privacy model
In its sleep-computing sense, Spava is a continuous, non-intrusive method for detecting sleep–wake cycles and characterizing significant sleep episodes from passively sensed smartphone data (Martínez-García et al., 2023). The stated motivation is that sleep is a sensitive biomarker of health, cognition, and psychiatric risk, whereas polysomnography is intrusive, expensive, and episodic, and validated wearables are not universally adopted. Smartphones are treated as ubiquitous behavioral sensors capable of profiling biorhythms continuously, objectively, and non-invasively.
The data were collected by the eB2 MindCare app, which passively acquired smartphone signals and linked them, for validation only, to commercial wearables such as Fitbit and Garmin. The cohort comprised 41 healthy students aged 22–30 at Universidad Carlos III de Madrid. The training set contained 24 users and 687 days; the validation set contained 17 users and 1523 days with wearable sleep data; and a filtered validation subset with complete streams contained 11 users and 546 days (Martínez-García et al., 2023).
Temporal organization is central to the method. Each day is defined from 14:00 to 14:00 the next day, a choice intended to capture nocturnal sleep and late sleepers. Signals are discretized into 10-minute slots, yielding slots per day, and per-user/day vectors are processed independently to reduce inter- and intra-user variability. The per-slot observation is heterogeneous: continuous modalities are actigraphy and ambient light, while discrete modalities are steps and a combined smartphone-usage indicator derived by OR-ing app usage and unlocks (Martínez-García et al., 2023).
Preprocessing is modality specific. Actigraphy outliers above are removed, a per-user/device bias is estimated as the mode and subtracted, negative samples are discarded, and values are min–max normalized to . Ambient light is similarly cleaned and normalized. Steps are binarized to presence or absence. App usage and unlocks are combined into a single binary smartphone indicator, with no app names or content recorded. The resulting feature factorization is
for continuous features and
for discrete features (Martínez-García et al., 2023).
A defining property of the pipeline is its treatment of missing data. Operating-system differences and permissions produce partially or fully missing streams. Rather than discarding such sequences, the modeling layer integrates missingness intrinsically: continuous features are inferred via conditional Gaussians, discrete features are imputed by the state-wise maximum-likelihood symbol, and fully missing slots use state-wise means (Martínez-García et al., 2023). This is a core reason the method can operate under realistic smartphone sensing heterogeneity.
3. HHMM formulation, semi-supervision, and inference
The latent process is a Hidden Markov Model with heterogeneous emissions. Let denote the latent state sequence with values in , and let denote the observations, factored as . The model uses an initial distribution and transition matrix 0, so that temporal continuity is encoded directly in the state dynamics (Martínez-García et al., 2023).
The emission model is modality-factorized. For each state 1, continuous observations follow a Gaussian,
2
while each binary modality follows a Bernoulli,
3
Under conditional independence across modalities given the state,
4
The full joint likelihood for one daily sequence is
5
With multiple daily sequences, the log-likelihood sums across sequences (Martínez-García et al., 2023).
Inference uses standard forward–backward recursions and Viterbi decoding. The forward variable is
6
with 7, and the backward variable is
8
with 9. Smoothed marginals satisfy 0, pairwise posteriors satisfy 1, and the most likely path is obtained via Viterbi using
2
with backpointers 3 (Martínez-García et al., 2023).
Parameter estimation follows EM/Baum–Welch. The updates are the standard state-posterior-weighted estimators: 4,
5
6
7
and
8
In the semi-supervised variant, selected discrete emission probabilities are fixed rather than updated (Martínez-García et al., 2023).
That semi-supervision is the principal inductive bias. For selected sleep states 9, the model fixes
0
The interpretation is explicit: steps or smartphone usage equal to 1 is incompatible with sleep. No wearable labels are used during training; wearables are reserved for post hoc validation. After Viterbi decoding, states with fixed discrete emissions are mapped to “asleep,” and all others to “awake” (Martínez-García et al., 2023).
Model selection compared 1 to 2 in unsupervised and semi-supervised modes. AIC and BIC favored a semi-supervised HHMM with 3 and two fixed sleep states, balancing interpretability and fit (Martínez-García et al., 2023).
4. Sleep episode characterization, validation, and limitations
Once the slot-level asleep/awake sequence is obtained, Spava identifies contiguous asleep runs within each 14:00–14:00 window and characterizes the principal nocturnal sleep episode. The method does not impose an additional minimum-duration threshold or an explicit circadian prior; smoothing arises from the HMM transition structure, while the 14:00 anchoring acts as a weak time-of-day prior by construction (Martínez-García et al., 2023).
The computed indicators are deliberately restricted to quantities that smartphone-only sensing can support. The paper computes start time and end time of the main sleep episode, Sleep Period Time (SPT), circadian midpoint (CM), weekly mean start/end, weekly mean SPT, weekly max/min SPT, weekly mean CM, and social jetlag (SJ), where
4
By contrast, Total Sleep Time, Sleep Efficiency, Wake After Sleep Onset, and Sleep Onset Latency are defined for completeness but explicitly not computed because phone interaction is insufficient to identify short awakenings and SOL reliably (Martínez-García et al., 2023).
At slot level, the reported performance is strong for a passive smartphone method. On the full validation set, the HHMM achieved accuracy 5, sensitivity 6, and specificity 7, outperforming all baselines; the closest baseline was a GMM with accuracy around 8. On the filtered validation subset with complete streams, the HHMM achieved accuracy 9, sensitivity 0, and specificity 1 (Martínez-García et al., 2023).
Daily and weekly characterization errors were also reported against wearable-derived indicators. On full daily validation (2), RMSE/MAE in minutes were 113.8/68.1 for start, 76.8/39.3 for end, 119.9/80.3 for SPT, and 76.4/42.5 for CM. On the filtered daily subset (3), these improved to 81.8/51.4 for start, 53.2/29.5 for end, 95.6/64.9 for SPT, and 49.8/29.5 for CM. For weekly indicators on filtered data (201 weeks, 11 users), RMSE/MAE were 47.1/35.9 for mean start, 31.7/18.5 for mean end, 61.6/45.7 for mean SPT, 75.7/47.3 for max SPT, 110.4/77.3 for min SPT, 25.7/16.9 for mean CM, and 33.6/22.8 for SJ (Martínez-García et al., 2023).
The observed error asymmetry is noteworthy. Start time is harder than end time. The stated explanation is behavioral: users often do not interact with phones immediately before falling asleep, inflating SOL uncertainty, whereas they frequently interact on awakening through alarms or notifications, improving rise-time detection. This asymmetry propagates into SPT, CM, and SJ estimates (Martínez-García et al., 2023).
The method’s limitations are explicit. It can confuse true sleep with simple phone inactivity, such as a device left on a table or charging, producing false sleep particularly near bedtime. It does not estimate SOL, WASO, or SE reliably without richer biosignals. Atypical schedules such as shift work are not explicitly modeled beyond the 14:00–14:00 anchoring. The cohort is young, healthy, and geographically homogeneous, so generalization to clinical or shift-working populations remains an open question (Martínez-García et al., 2023). A common misconception is therefore that smartphone Spava is a substitute for PSG; the paper instead presents it as a scalable, low-burden alternative for continuous assessment when more reliable sources are unavailable.
5. Broader sleep-monitoring interpretations of “Spava”
Later literature suggests a broader “Spava” interpretation in which sleep monitoring is treated as a multi-sensor, multi-task problem spanning behavioral proxies, wearable physiology, bed-based sensing, and multimodal representation learning. This broader usage is not a single formal framework, but it situates the smartphone HHMM within a wider technical landscape (Zhang et al., 2024, Yuan et al., 14 Feb 2026).
| System | Sensing regime | Representative reported result |
|---|---|---|
| S2MAML | PSG with EEG, EOG, EMG | Unseen-subject Avg 75.8 MF1 in All vs All (Lemkhenter et al., 2022) |
| Mamba wearable staging | ECG, PPG, accelerometry, temperature | 3-class BA 83.50%, 5-class BA 64.30% (Zhang et al., 2024) |
| SPeM | 27 × 27 pressure e-mat | Sleep-posture accuracy 0.993 with CDNN (Yuan et al., 2023) |
| sleep2vec | Nine nocturnal modalities | SHHS full-channel Acc 88.6%, 4 (Yuan et al., 14 Feb 2026) |
| NAP | Late fusion of frozen PSG predictors | Zero-shot MF1 0.796 on SEDF-ST (Rossi et al., 5 Nov 2025) |
Within PSG-based sleep staging, S2MAML introduces self-supervised meta-learning for zero-shot cross-subject and cross-dataset generalization. It extends MAML by placing a PhaseSwap self-supervised pseudo-task in the inner loop and supervised learning in the outer loop. In the All vs All setting, it reaches average MF1 of 86.5 on seen subjects and 75.8 on unseen subjects, exceeding both vanilla MAML and standard supervised learning (Lemkhenter et al., 2022). This line of work addresses five-stage AASM scoring rather than binary sleep–wake recognition.
EEG-less wearable staging pushes the “Spava” idea toward physiological sensing without full PSG. A Mamba-based study using the ANNE One wireless system combines ECG, PPG, accelerometry, and temperature and reports, for its best RNN ensemble, 3-class balanced accuracy 83.50%, 4-class balanced accuracy 74.64%, and 5-class balanced accuracy 64.30% on a tertiary-care sleep-lab cohort (Zhang et al., 2024). The paper explicitly frames sleep staging without EEG as feasible through multimodal wearable signals and long-context sequence modeling.
Bed-based posture monitoring constitutes another branch. The Smart Pressure e-Mat (SPeM) is a foldable 27 × 27 taxel pressure mat aligned to a Queen-size mattress and processed by ResNet-PI with temporal fusion. For four sleeping postures, it reports accuracy 0.988 with CRNN, 0.985 with 3D CNN, and 0.993 with CDNN (Yuan et al., 2023). This addresses body posture rather than sleep stage, but it fits a broader interpretation of sleep monitoring as unobtrusive, privacy-preserving ambient sensing.
Foundation-model approaches extend the scope further. sleep2vec pre-trains on 42,249 overnight recordings spanning nine modalities and uses metadata-aware DASH-InfoNCE for cross-modal alignment. For SHHS sleep staging, it reaches 88.6% accuracy and 5 with full channels, and for SHHS6APPLES cross-cohort transfer it reaches 78.4% accuracy and 7 with full channels (Yuan et al., 14 Feb 2026). NAP, by contrast, is an attention-based late-fusion meta-model over frozen single-channel PSG predictors and reports strong zero-shot gains, including MF1 0.815 on DCSM and 0.796 on SEDF-ST (Rossi et al., 5 Nov 2025). A plausible implication is that “Spava,” in the broad sleep sense, now spans both raw-signal modeling and meta-aggregation over heterogeneous expert streams.
6. The unrelated long-video framework named “Spava”
A distinct 2026 paper uses “Spava” as the name of a systems method for accelerating long-video understanding, with no relation to sleep research (Huang et al., 29 Jan 2026). The target problem is the prefill stage of large multimodal models, where dense scaled dot-product attention over long visual-token sequences incurs 8 time and 9 memory if attention weights are materialized. Even fused kernels such as FlashAttention retain quadratic arithmetic intensity in sequence length.
This Spava is a sequence-parallelism-aware approximate attention framework. It partitions non-query tokens into a global anchor block of length 0 and evenly split context blocks across 1 virtual hosts, pairs complementary virtual hosts onto 2 physical hosts for load balance, and constructs compressed passing blocks by selecting the top-3 query-relevant key/value pairs with 4. Local attention is then computed over the anchor, local context, and received passing blocks, while query attention is computed in parallel and merged through online softmax (Huang et al., 29 Jan 2026).
The per-host attention FLOPs for a single layer and single head are reported as
5
with communication handled through overlapped AllGather operations for compressed key/value subsets and partial query results. System-level optimizations include zigzag pairing for balanced workload, fused context-and-query forward passes, frame parallelism in the visual encoder, and immediate freeing of transient passing-block buffers (Huang et al., 29 Jan 2026).
Empirically, the reported acceleration is substantial. On Qwen2.5-VL-3B with 64 frames at 1440p, Spava is stated to be 12.72× faster than FlashAttn, 1.70× faster than ZigZagRing, and 1.18× faster than APB, without notable performance loss. On LongVideoBench, reported overall scores are comparable to or slightly better than FullAttn for several models, whereas on the harder VNBench there is some degradation but still better retention than other approximate-attention baselines (Huang et al., 29 Jan 2026). This unrelated use of the name is the strongest reason to disambiguate “Spava” by domain whenever the term appears in technical writing.