Longer Records, Broader Invariance: The Hidden Scaling Problem in Longitudinal Contrastive Learning
Organizations: New York University · Columbia University · Oregon Health & Science University
Abstract
Longitudinal data are valuable because people change. Yet the objectives used to learn from these data can inadvertently erase that change. In person-level contrastive learning, observations from the same person are treated as positives; as records grow, those positives can span increasingly distant---and increasingly different---behavioral states. More history can therefore produce not only more data, but broader invariance. We show that this distinction is fundamental. We separate \emph{record span}, how much history the learner sees, from \emph{supervision span}, how far across that history positive-pair supervision reaches. Across in-home sensing records spanning up to 2.7 years, broader supervision systematically suppresses recoverable changing-state information, even when the available history is held fixed. At the broadest span, less than 10% of the information recoverable from an untrained encoder remains. Yet keeping positives local is not sufficient: as records grow, even distant states that are never paired become increasingly similar. Explicitly contrasting other observations from the same person reverses this loss without shortening the record, revealing a second route by which longitudinal scale can broaden invariance. Finally, we prospectively reproduce the supervision-span effect in 199 GLOBEM participants. Longitudinal scale therefore presents a choice: more history need not mean more invariance. By controlling what is held invariant as records grow, we can preserve the change that made the longitudinal data valuable in the first place.
Figures & tables
| History source | Single-resident | Households |
|---|---|---|
| Recent ( ) | ||
| Shifted (disjoint block) | ||
| Random (four past windows) | ||
| Distant (earliest four windows) |
| Cohort | History | Ordered | Shuffled | Set | Ordered Shuffled |
|---|---|---|---|---|---|
| Single-resident | 20d ( ) | 0.2877 | 0.2469 | 0.2454 | +0.0408 [0.0252, 0.0576] |
| Single-resident | 40d ( ) | 0.2773 | 0.2312 | 0.2098 | +0.0461 [0.0285, 0.0649] |
| Multi-resident | 20d ( ) | 0.2480 | 0.2252 | 0.2253 | +0.0228 [0.0142, 0.0313] |
| Multi-resident | 40d ( ) | 0.2421 | 0.2055 | 0.2064 | +0.0365 [0.0249, 0.0485] |
Appendix figures & tables52 assets
Supplementary material from the paper’s appendix.
Appendix
| Channel | Median correlation | Pairs with variance in both |
|---|---|---|
| Motion events | 1.000 | 43/43 |
| Motion areas | 1.000 | 43/43 |
| Steps | 0.206 | 14/43 |
| Bed activity | 0.382 | 8/43 |
| Respiratory rate | 0.850 | 8/43 |
| Medication events | 0.011 | 8/43 |
| Analysis | 87 records | 44 households |
|---|---|---|
| Recent | 0.2746 | 0.2325 |
| Shifted | 0.0306 | 0.0158 |
| Random | 0.0235 | 0.0261 |
| Distant | 0.0324 | 0.0051 |
| Recent shifted | 0.2441 | 0.2167 |
| Recent random | 0.2511 | 0.2064 |
| Channel | Statistic | Mean | SD | Zero rate |
|---|---|---|---|---|
| Motion events | 7.818 | 0.787 | 0.00 | |
| Motion areas | 4.964 | 0.430 | 0.00 | |
| Steps | 6.323 | 2.949 | 0.14 | |
| Bed activity | 3.673 | 3.048 | 0.32 | |
| Respiratory rate | 2.657 | 2.222 | 0.33 | |
| Medication events | 1.077 | 0.568 | 0.11 |
| History arm | Single-resident | Households |
|---|---|---|
| Recent | 0.1335 | 0.1171 |
| Shifted | 0.0241 | 0.0425 |
| Random | 0.0409 | 0.0499 |
| Distant | 0.0553 | 0.0559 |
| Check | Violations |
| Training chronology violations | 0 |
| Test chronology violations | 0 |
| Target contained in prediction input | 0 |
| Target contained in an SSL positive block | audited separately † |
| Mismatched anchor eligibility across arms | 0 |
| uses post-training data | 0 |
| History arm | Single-resident | Households |
|---|---|---|
| Recent | ||
| Shifted | ||
| Random | ||
| Distant |
| Temporal distance | 24-window buffer | 8-window buffer |
|---|---|---|
| 5 days | ||
| 10 days | ||
| 15 days | ||
| 20 days | ||
| 25 days | ||
| 30 days |
| Experiment | Cohort | Condition | Mean SD | Seeds |
|---|---|---|---|---|
| History source | Single-resident | Recent | 5/5 | |
| History source | Single-resident | Shifted | — | |
| History source | Single-resident | Random | — | |
| History source | Single-resident | Distant | — | |
| History source | Households | Recent | 5/5 | |
| History source | Households | Shifted | — |
| Single-resident (chance ) | Households (chance ) | |||
| Residualized | Logistic | MLP | Logistic | MLP |
| Recent | 0.019 | 0.183 | 0.022 | 0.157 |
| Shifted | 0.036 | 0.510 | 0.022 | 0.541 |
| Distant | 0.895 | 0.895 | 0.888 | 0.888 |
| History arm | Single-resident | Households |
|---|---|---|
| Recent | ||
| Shifted | ||
| Random | ||
| Distant |
| Penalty | Design cond. | Test MSE | Test MSE, LOO HO | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Cohort | Arm | LOO | HO | LOO | HO | LOO | HO | CI | |
| Single-resident | Uniform, 30 d | ||||||||
| Uniform, full | |||||||||
| Matched, 30 d | |||||||||
| Matched, full | |||||||||
| Households | Uniform, 30 d | ||||||||
| Single-resident | Households | |||||
| Arm | Learned | Untrained | Raw block | Learned | Untrained | Raw block |
| Recent | ||||||
| Shifted | ||||||
| Random | ||||||
| Distant | ||||||
| Recent shifted | ||||||
| Cohort | Drift definition | Stratification | Low | Middle | High | Low/high disjoint |
|---|---|---|---|---|---|---|
| Single-resident | Local | Pooled | +0.1817 [.131,.234] | +0.2305 | +0.3215 [.262,.369] | yes |
| Single-resident | Local | Within | +0.2367 [.185,.281] | +0.2246 | +0.2723 [.227,.316] | no |
| Single-resident | Baseline | Pooled | +0.1793 [.128,.235] | +0.2390 | +0.3151 [.256,.363] | yes |
| Single-resident | Baseline | Within | +0.2422 [.189,.285] | +0.2253 | +0.2661 [.223,.307] | no |
| Single-resident | Person | Pooled | +0.1739 [.138,.210] | +0.2182 | +0.3412 [.288,.405] | yes |
| Households | Local | Pooled | +0.1164 [.094,.138] | +0.1870 | +0.3163 [.259,.361] | yes |
| Within-unit measure | Single-resident ( ) | Households ( ) |
|---|---|---|
| Displacement from own past | ||
| Displacement, lagged one block | ||
| Rate of change |
| Single-resident | Households | |||
|---|---|---|---|---|
| Gap | Canonical | Residualized | Canonical | Residualized |
| 0 days | ||||
| 5 days | ||||
| 10 days | ||||
| 15 days | ||||
| 20 days | ||||
| Single-resident | Households | |||||
|---|---|---|---|---|---|---|
| Gap | ||||||
| 0 days | ( ) | ( ) | ( ) | ( ) | ||
| 5 days | ( ) | ( ) | ( ) | ( ) | ||
| 10 days | ( ) | ( ) | ( ) | ( ) | ||
| 20 days | ( ) | ( ) | ( ) | ( ) | ||
| 30 days | ( ) | ( ) | ( ) | ( ) | ||
| at record span (days) | |||||||
|---|---|---|---|---|---|---|---|
| Cohort | 30 | 120 | full | Change | 95% CI | Seeds | Identity |
| Single-resident | 5/5 | ||||||
| Households | 5/5 | ||||||
| Record span (days) | 30 | 60 | 120 | 240 | full |
|---|---|---|---|---|---|
| Single-resident | |||||
| identity | |||||
| between-person | |||||
| within-person | |||||
| between/within | |||||
| at record span (days) | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Cohort | Encoder | Supervision | 30 | 60 | 120 | 240 | full | Change | 95% CI | Seeds | Identity |
| Single-resident | k | local | 5/5 | ||||||||
| Single-resident | k | unrestricted | 5/5 | ||||||||
| Single-resident | k | local | 4/5 | ||||||||
| Single-resident | k | unrestricted | 5/5 | ||||||||
| Households | k | local | 5/5 | ||||||||
| Construction | Prediction population | Encoder | Cohort | 30 days | Full | Change |
|---|---|---|---|---|---|---|
| Expanding | varies with | k | Single-resident | |||
| Expanding | varies with | k | Households | |||
| Fixed-anchor | held fixed | k | Single-resident | |||
| Fixed-anchor | held fixed | k | Households | |||
| Fixed-anchor | held fixed | k | Single-resident | |||
| Fixed-anchor | held fixed | k | Households |
| Cohort | Objective | 30d | 60d | 120d | 240d | Full | Canon. | Resid. |
|---|---|---|---|---|---|---|---|---|
| Single | Person-contrastive | |||||||
| sep.-matched | ||||||||
| Predictive | ||||||||
| Masked | ||||||||
| Households | Person-contrastive | |||||||
| sep.-matched |
| Cohort | Representation | History | Canonical | Residualized |
|---|---|---|---|---|
| Single-resident | Learned | Recent | ||
| Single-resident | Mean | Recent | ||
| Single-resident | Learned | Shifted | ||
| Single-resident | Mean | Shifted | ||
| Single-resident | Learned | Random | ||
| Single-resident | Mean | Random |
| Cohort | Baseline | Decoder | 30d | 60d | 120d | 240d | Full | 30d full |
|---|---|---|---|---|---|---|---|---|
| Single | Fixed | Ridge | .0940 | .0689 | .0525 | .0384 | .0151 | |
| MLP | .1687 | .1317 | .0995 | .0872 | .0563 | |||
| Trailing 30d | Ridge | .0366 | .0278 | .0234 | .0104 | .0143 | ||
| MLP | .0362 | .0244 | .0241 | .0181 | .0112 | |||
| Trailing 60d | Ridge | .0430 | .0292 | .0220 | .0062 | .0074 | ||
| MLP | .0504 | .0316 | .0313 | .0261 | .0152 |
| Cohort | Baseline | Decoder | 30d | 60d | 120d | 240d | Full | 30d full |
|---|---|---|---|---|---|---|---|---|
| Single | Fixed | Ridge | 0.0950 | 0.0893 | 0.0818 | 0.1016 | 0.0982 | |
| MLP | 0.1629 | 0.1488 | 0.1426 | 0.1587 | 0.1437 | |||
| Trailing 30d | Ridge | 0.0392 | 0.0351 | 0.0314 | 0.0385 | 0.0367 | ||
| MLP | 0.0360 | 0.0234 | 0.0343 | 0.0370 | 0.0330 | |||
| Trailing 60d | Ridge | 0.0433 | 0.0393 | 0.0307 | 0.0405 | 0.0406 | ||
| MLP | 0.0536 | 0.0303 | 0.0480 | 0.0508 | 0.0416 |
| Single-resident | Households | |||||
|---|---|---|---|---|---|---|
| Cap | Realized | Identity | Realized | Identity | ||
| 10 days | ||||||
| 20 days | ||||||
| 30 days | ||||||
| 60 days | ||||||
| 90 days | ||||||
| Single-resident | Households | |||||
|---|---|---|---|---|---|---|
| Cap | Realized | Identity | Realized | Identity | ||
| 2 days | ||||||
| 4 days | ||||||
| 7 days | ||||||
| 10 days | ||||||
| 20 days | ||||||
| Single-resident | Households | |||||
|---|---|---|---|---|---|---|
| Realized | ( ) | floor | Realized | ( ) | floor | |
| 2 days | ||||||
| 4 days | ||||||
| 8 days | ||||||
| 16 days | ||||||
| 32 days | ||||||
| Single-resident | Households | |||||
|---|---|---|---|---|---|---|
| Fixed-card. ( / raw) | Cap-sampled ( ) | Gap | Fixed-card. ( / raw) | Cap-sampled ( ) | Gap | |
| 2 days | / | (2.0) | / | (2.0) | ||
| 4 days | / | (3.2) | / | (3.2) | ||
| 8 days | / | (9.2) | / | (9.2) | ||
| 16 days | / | (17.2) | / | (17.2) | ||
| 32 days | / | (32.9) | / | (32.9) | ||
| Sampling rule | Realized sep. (d) | (raw) | ( ) | floor |
|---|---|---|---|---|
| Single-resident , untrained floor | ||||
| hard cap = 2 d | ||||
| hard cap = 8 d | ||||
| hard cap = 32 d | ||||
| hard cap = unrestricted | ||||
| exponential decay = 2 d | ||||
| Single-resident | Households | |||
|---|---|---|---|---|
| Cap | Original | Overlap-free | Original | Overlap-free |
| 30 days | ||||
| 60 days | ||||
| 120 days | ||||
| 240 days | ||||
| Unrestricted | ||||
| 4 days | 10 days | 30 days | 60 days | 120 days | |
| Single-resident | |||||
| ( ) | ( ) | ( ) | ( ) | ( ) | |
| ( ) | ( ) | ( ) | ( ) | ( ) | |
| ( ) | ( ) | ( ) | ( ) | ( ) | |
| ( ) | ( ) | ( ) | ( ) | ( ) | |
| Households | |||||
| Cohort | Series | normalized value at realized separation (days) | ||||
|---|---|---|---|---|---|---|
| Single-resident | Availability | ( ) | ( ) | ( ) | ( ) | — |
| ( ) | ( ) | ( ) | ( ) | ( ) | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Households | Availability | ( ) | ( ) | ( ) | ( ) | — |
| Contrastive label | Identities | Identity | vs. unsegmented | vs. | |
|---|---|---|---|---|---|
| Single-resident | |||||
| person identity (unsegmented) | |||||
| cross-segment pairs masked | |||||
| segments, 30 d | |||||
| segments, 60 d | |||||
| segments, 120 d | |||||
| Arm | Identity | Between/within | Own windows d | |
|---|---|---|---|---|
| Single-resident | ||||
| reference | ||||
| full record, unsegmented | ||||
| full record, segments 30 d | ||||
| full record, segments 60 d | ||||
| full record, segments 120 d | ||||
| Representation | (%) | Identity | |
|---|---|---|---|
| Raw block ( -d) | — | ||
| PCA- | — | ||
| Masked reconstruction | |||
| Random projection- | — | ||
| Predictive | — | ||
| Untrained encoder- |
| Cap (realized sep., d) | (%) | Identity | |
|---|---|---|---|
| — | |||
| — | |||
| Cohort | Objective | Decoder | 30d | 60d | 120d | 240d | Full | 30d full |
|---|---|---|---|---|---|---|---|---|
| Single | Person-contrastive | Ridge | .0971 | .0697 | .0565 | .0460 | .0198 | |
| MLP | .1433 | .1352 | .0809 | .0619 | .0398 | |||
| sep.-matched | Ridge | .0896 | .1014 | .0827 | .1129 | .1004 | ||
| MLP | .1390 | .1408 | .1181 | .1308 | .1271 | |||
| Predictive | Ridge | .1983 | .2129 | .2136 | .2237 | .2299 | ||
| MLP | .1752 | .1747 | .1821 | .1984 | .2094 |
| Single-resident (52 units) | Households (42 units) | |
| Recent | ||
| Shifted | ||
| Random | ||
| Distant | ||
| Recent shifted | , 5/5 | , 5/5 |
| Recent random | , 5/5 | , 5/5 |
| Gap from present | Single-resident | Households |
|---|---|---|
| 0 days | ||
| 5 days | ||
| 10 days | ||
| 15 days | ||
| 20 days | ||
| 30 days |
| Cohort | Context | Ordered | Shuffled | Set | Ordered Shuffled | Main-text 5d |
|---|---|---|---|---|---|---|
| Single-resident | (4d) | 0.3016 | 0.2381 | 0.2439 | +0.0635 [0.0545, 0.0721] | +0.0408 |
| Single-resident | (20d) | 0.2602 | 0.1605 | 0.1569 | +0.0997 [0.0824, 0.1183] | +0.0408 |
| Households | (4d) | 0.3167 | 0.2481 | 0.2539 | +0.0686 [0.0486, 0.0882] | +0.0228 |
| Households | (20d) | 0.2598 | 0.1364 | 0.1423 | +0.1234 [0.0975, 0.1519] | +0.0228 |
| Experiment | Arm | Representation dim. | Encoder width | Parameters |
|---|---|---|---|---|
| History source | All four arms | 32 | 95 | 33,791 |
| Temporal order | Ordered / shuffled | 32 | 95 | 33,791 |
| Temporal order | Set (deep sets) | 32 | 88 | 33,908 |
| Temporal order, | Ordered / shuffled | 32 | 71 | 34,111 |
| Sequence encoders, | MLP | 48 | 151 / 134 / 108 / 74 | 39,999 / 39,920 / 40,200 / 39,992 |
| Sequence encoders, | GRU (1 layer) | 48 | 84 | 40,200 |
| 30-day record | Full record | ||||
|---|---|---|---|---|---|
| Cohort | Dim. | Identity | Identity | ||
| Single | |||||
| Households | |||||
| Single-resident | Households | ||||
| Arm | identity | identity | vs. unrestricted | ||
| 1 Unrestricted person-contrastive | — | ||||
| 2 Hand-matched 30-day cap | / | ||||
| 3 TNC | / | ||||
| 4 InfoNCE ADF neighborhood | / | ||||
| PCA, 32-d (reference) | |||||
| Arm | Single-resident | Households |
|---|---|---|
| Unrestricted person-contrastive | ||
| TNC | ||
| InfoNCE ADF neighborhood | ||
| Raw block, 96-d (reference) | ||
| PCA, 32-d (reference) | ||
| Random projection, 32-d |
| Single-resident | Households | |||
|---|---|---|---|---|
| Representation | identity | identity | ||
| Raw block, 96-d | ||||
| PCA, 32-d (training-only) | ||||
| Random projection, 32-d | ||||
| Untrained encoder, 32-d | ||||
| Learned, short span | ||||
| Cohort | Negatives | Span | InfoNCE loss | Top-1 | Change | |
|---|---|---|---|---|---|---|
| Single-resident | Easy (uniform) | 30d | ||||
| Single-resident | Easy (uniform) | Full | , 5/5 | |||
| Single-resident | Hard (mined) | 30d | ||||
| Single-resident | Hard (mined) | Full | , 5/5 | |||
| Households | Easy (uniform) | 30d | ||||
| Households | Easy (uniform) | Full | , 5/5 |
| Cohort | Negatives | Span | Pool size | InfoNCE loss | Top-1 | [95% CI] |
|---|---|---|---|---|---|---|
| Single-resident | Fixed-8 | 30d | ||||
| Single-resident | Fixed-8 | Full | ||||
| Single-resident | In-batch | 30d | ||||
| Single-resident | In-batch | Full | ||||
| Households | Fixed-8 | 30d | ||||
| Households | Fixed-8 | Full |
| Single-resident | Households | |||
|---|---|---|---|---|
| History | CKA / ceiling | Information | CKA / ceiling | Information |
| Recent | 1.000 | 100% | 1.000 | 100% |
| Shifted | 0.536 | 9% | 0.592 | 7% |
| Random | 0.571 | 9% | 0.610 | 10% |
| Distant | 0.571 | 5% | 0.597 | 2% |
| Cohort | Objective | 30-day | Full-record | Change | Identity (30d full) |
|---|---|---|---|---|---|
| Single-resident | Person-contrastive | ||||
| Single-resident | separation-matched | ||||
| Single-resident | Predictive | ||||
| Single-resident | Masked reconstruction | ||||
| Households | Person-contrastive | ||||
| Households | separation-matched |
| Uniform positives | Separation-matched | ||||
|---|---|---|---|---|---|
| Cohort | identity | identity | |||
| Single-resident | 15 | ||||
| Single-resident | 30 | ||||
| Single-resident | 54 (full) | ||||
| Households | 15 | ||||
| Households | 30 | ||||
| bin | Initial loss | Final loss | Learned weight |
|---|---|---|---|
| 2 | 6.0422 | 0.0703 | 0.884 |
| 3 | 6.1339 | 0.0704 | 0.732 |
| 4–5 | 6.2152 | 0.0711 | 0.578 |
| 6–8 | 6.2789 | 0.0712 | 0.424 |
| 9–13 | 6.3430 | 0.0708 | 0.272 |
| 14–20 | 6.3631 | 0.0704 | 0.169 |
| Single-resident | Households | |||||||
| Arm | identity | InfoNCE | top-1 | identity | InfoNCE | top-1 | ||
| Untrained (strong architecture) | — | — | — | — | ||||
| Strong, short span (30 d) | ||||||||
| Strong, unrestricted | ||||||||
| Weak ( k), short span | — | — | — | — | ||||
| Weak ( k), unrestricted | — | — | — | — | ||||