SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.00933 · 2026

CGM-JEPA: Learning Consistent Continuous Glucose Monitor Representations via Predictive Self-Supervised Pretraining

Flora Salim, Zechen Li, Ahmed Metwally, Hada Melino Muhammad

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2605.00933.json · badge: /api/ran/2605.00933.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
cruiseresearchgroup/CGM-JEPA canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
FunctionStatusWhere it lives
get_eval_loaders Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cruiseresearchgroup/CGM-JEPA/data_loaders/data_loader.py
code served (permissive licence) · get_code("f10f9bba015b7dca")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataLoader. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset

torch.manual_seed(0)

class MockClassificationDataLoader(Dataset):
    """Stand-in for ClassificationDataLoader that the function instantiates"""
    def __init__(self, path_data, patch_size, metabolic, extract_method, 
                 global_mean=None, global_std=None, output_type='patch'):
        self.path_data = path_data
        self.patch_size = patch_size
        self.metabolic = metabolic
        self.extract_method = extract_method
        self.global_mean = global_mean
        self.global_std = global_std
        self.output_type = output_type
        # Create minimal dataset with 4 samples
        self.data = [(torch.randn(3, 4), torch.randint(0, 2, (1,))) for _ in range(4)]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

# Monkey-patch the import so the function uses our mock
import sys
from unittest.mock import MagicMock
mock_module = MagicMock()
mock_module.ClassificationDataLoader = MockClassificationDataLoader
sys.modules['data_loader_module'] = mock_module

# Inject into builtins so the function can find ClassificationDataLoader
import builtins
builtins.ClassificationDataLoader = MockClassificationDataLoader

ARGS = {
    'path': '/tmp/mock_data',
    'patch_size': 16,
    'task': 'classification',
    'extract_method': 'random',
    'metabolic': False,
    'seed': 42,
    'batch_size': 2,
    'global_mean': torch.tensor([0.5, 0.5, 0.5]),
    'global_std': torch.tensor([0.2, 0.2, 0.2]),
    'y_global_mean': torch.tensor([0.1]),
    'y_global_std': torch.tensor([0.05]),
    'portion': 0.8,
    'output_type': 'patch',
    'context_size': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_gluformer_dataloader Ran
ran; our contract draft was wrong, not the code
cruiseresearchgroup/CGM-JEPA/data_loaders/data_loader.py
code served (permissive licence) · get_code("c7f4ca3b643dff1c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataLoader. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from torch.utils.data import DataLoader, Dataset
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal stand-in for GluFormerDataLoader
class GluFormerDataLoader(Dataset):
    def __init__(self, path_data, series_split_size=288, stride=None):
        self.path_data = path_data
        self.series_split_size = series_split_size
        self.stride = stride
        # Create some dummy data
        self.data = [
            (torch.randn(4), torch.randn(1)),
            (torch.randn(4), torch.randn(1)),
            (torch.randn(4), torch.randn(1)),
            (torch.randn(4), torch.randn(1)),
        ]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

# Inject the stand-in class into the module scope so get_gluformer_dataloader can use it
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'GluFormerDataLoader', GluFormerDataLoader)

ARGS = {
    "path": "/tmp/dummy_path",
    "batch_size": 2,
    "stride": 12,
    "series_split_size": 288,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
loss_pred Ran
ran; our contract draft was wrong, not the code
cruiseresearchgroup/CGM-JEPA/pretrain/pretrain_cgm_jepa.py
code served (permissive licence) · get_code("fe65142dc4a832b7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function iterates over pred and target_ema with zip,
# and computes torch.mean(torch.abs(pred_i - target_ema_i)) for each pair.
# So pred and target_ema should be iterables of tensors with compatible shapes.

# Create two lists of small tensors
pred = [
    torch.randn(2, 4),
    torch.randn(2, 4)
]

target_ema = [
    torch.randn(2, 4),
    torch.randn(2, 4)
]

ARGS = {
    "pred": pred,
    "target_ema": target_ema
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_jepa_loaders Not yet run
unverified (harvested, no recorded run)
cruiseresearchgroup/CGM-JEPA/data_loaders/data_loader.py
code served (permissive licence) · get_code("6889f19f6dd59f49")
How it ran

no invocation recorded.

lr_lambda Not yet run
unverified (harvested, no recorded run)
cruiseresearchgroup/CGM-JEPA/pretrain/pretrain_cgm_jepa.py
code served (permissive licence) · get_code("08534d4fba9d55a6")
How it ran

no invocation recorded.

lr_lambda Not yet run
unverified (harvested, no recorded run)
cruiseresearchgroup/CGM-JEPA/pretrain/pretrain_x_cgm_jepa.py
code served (permissive licence) · get_code("fb54d1048c4d4685")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Continuous Glucose Monitoring (CGM) shows promise for detecting early metabolic subphenotypes such as insulin resistance (IR) and 𝛽-cell dysfunction, but its deployment for population-scale metabolic stratification faces two coupled problems. First, the same physiological state appears through multiple representational forms (raw CGM time series, sparse venous OGTT, distributional summaries such as Glucodensity), so a representation tied to a single view fails to transfer when deployment shifts the modality or setting. Second, baselines evaluated under such shifts perform inconsistently: each ranks well in some regimes and poorly in others. Both problems point to one remedy: representations that abstract away from any single view to capture higher-level temporal and distributional structure. We propose CGM-JEPA, a self-supervised predictive pretraining framework which predicts masked latent representations rather than reconstructing raw values, yielding abstraction that transfers across modalities. X-CGM-JEPA adds a masked Glucodensity cross-view objective that contributes complementary information from a distributional view. We pretrain on ∼389k unlabeled CGM readings from 228 subjects and evaluate on two clinical cohorts (Initial: 𝑁 = 27; Validation: 𝑁 = 17 in the public-release subset) across cohort generalization, venous-to-CGM transfer, and home CGM regimes, under a 20-iteration × 2-fold cross-validation protocol. X-CGM-JEPA ranks first or second on AUROC for both endpoints across all three evaluation regimes while no baseline stays in the top three, exceeding the strongest baseline by up to +6.5 AUROC points in cohort generalization and +3.6 points in venous-to-CGM transfer (paired Wilcoxon, 𝑝 < 0.001). The cross-view design pays off where it should: in deployment settings under modality shift, X-CGM-JEPA matches mean AUROC while redistributing performance toward weaker subgroups (ethnicity AUROC gap shrinks 25-54% under transfer); in the in-domain venous setting, where temporal context is sparse, the Glucodensity view lifts label-aware clustering (ARI +39%, NMI +40% on the Initial cohort). Code, de-identified consented data, and pretrained weights are available at https://github.com/cruiseresearchgroup/CGM-JEPA. Continuous glucose monitoring (CGM) enables dense, continuous measurements of glucose dynamics and is increasingly adopted in normoglycemic and prediabetic populations [11,25,26]. Beyond tracking average glucose levels, a central clinical goal is to uncover latent metabolic dysfunctions that may underlie superficially similar glucose trajectories. In particular, insulin resistance and 𝛽-cell dysfunction represent two distinct physiological mechanisms on the path toward Type 2 Diabetes, yet they can produce overlapping CGM patterns depending on diet, activity, and daily routines. Accurately distinguishing these dysfunctions from CGM would enable earlier risk stratification and personalized intervention. Despite this promise, deploying CGM-based subphenotype prediction at population scale faces two coupled problems. The first is a multi-view representation problem: the same physiological state

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2605.00933")
get_code_for_paper("2605.00933")
have("2605.00933")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2605.00933.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2605.00933.svg)](https://syntology.ai/paper/2605.00933)

Connect an agent — have() is free.