SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2508.17554 · NeurIPS · 2025

Bridging Graph and State-Space Modeling for Intensive Care Unit Length of Stay Prediction

Pietro Liò, Emma Rocheteau, Haitz Sáez De Ocáriz Borde, Shuqi Zi

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 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/2508.17554.json · badge: /api/ran/2508.17554.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
ShuqiZi1/S2G-Net canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
add_time_of_day Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/MIMIC_preprocessing/timeseries.py
code served (permissive licence) · get_code("5722574ef2b5a93c")
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 DataFrame. 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 numpy as np
import pandas as pd

# Create minimal processed_timeseries DataFrame
# The function expects a DataFrame with 'patient' and 'time' columns
# It performs a join on 'patient' and uses 'time' for arithmetic
processed_timeseries = pd.DataFrame({
    'patient': [1, 1, 2, 2],
    'time': [5, 10, 3, 8],
    'other_col': [0.1, 0.2, 0.3, 0.4]
})

# Create minimal flat_features DataFrame
# The function joins on 'patient' and expects an 'hour' column
flat_features = pd.DataFrame({
    'patient': [1, 2],
    'hour': [14, 18],
    'other_feat': [100, 200]
})

ARGS = {
    'processed_timeseries': processed_timeseries,
    'flat_features': flat_features
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
collate_graphgps Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/experiments/train_graphgps_only.py
code served (permissive licence) · get_code("845464946a768a4f")
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 dict. 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

torch.manual_seed(0)

# The function expects samples to be a list with exactly 1 element
# It returns samples[0], so samples[0] can be any object
# For GraphGPS, this is typically a batch dict or object containing graph data

# Create a minimal sample that could represent a graph batch
sample_batch = {
    'x': torch.randn(2, 4),  # node features: 2 nodes, 4 features
    'edge_index': torch.tensor([[0, 1], [1, 0]], dtype=torch.long),  # edges
    'batch': torch.tensor([0, 0], dtype=torch.long),  # batch assignments
    'y': torch.tensor([1], dtype=torch.long),  # target
}

# The samples parameter is a list containing exactly one element
samples = [sample_batch]

ARGS = {
    'samples': samples
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
determine_icd9_chapter Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/MIMIC_preprocessing/diagnoses.py
code served (permissive licence) · get_code("a0cb73380eaa3f59")
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 str. 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

# The function determine_icd9_chapter takes a single parameter: code_prefix
# It converts code_prefix to an integer and compares it against ranges
# to determine the ICD-9 chapter

# Valid test cases covering different chapters:
# - '001' to '139': Infectious
# - '140' to '239': Neoplasms
# - '780' to '799': Symptoms
# - '800' to '999': Injury
# - Outside ranges: Other

# Create a simple string that can be converted to int
code_prefix = "050"  # Falls in range 1-139 (Infectious)

ARGS = {
    "code_prefix": code_prefix
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
extract_icd_hierarchy Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/MIMIC_preprocessing/diagnoses.py
code served (permissive licence) · get_code("162629362c493d99")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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.

# PYTHON SETUP CODE

ARGS = {
    'icd_code': '00100',
    'icd_version': '9'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
load_json Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/src/utils.py
code served (permissive licence) · get_code("0ca0c1bca741caa0")
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 dict. 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 json
import tempfile
import os

# Create a temporary JSON file with valid test data
temp_dir = tempfile.mkdtemp()
json_path = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": 42,
    "key3": [1, 2, 3],
    "nested": {"inner_key": "inner_value"}
}

with open(json_path, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_pkl Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/src/utils.py
code served (permissive licence) · get_code("cec500afc9a210d2")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "test_data.pkl")

# Create some sample data and pickle it
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_path, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    "path": temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
preprocess_labels Ran
ran; our contract draft was wrong, not the code
ShuqiZi1/S2G-Net/MIMIC_preprocessing/flat_and_labels.py
code served (permissive licence) · get_code("b952bf57b9c0b7da")
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 DataFrame. 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 pandas as pd

# Create a small DataFrame with the required column
labels = pd.DataFrame({
    'patientunitstayid': [101, 102, 103],
    'value1': [1.0, 2.0, 3.0],
    'value2': [4.0, 5.0, 6.0]
})

ARGS = {
    'labels': labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
reconfigure_timeseries_chunked Ran
ran, honoured the contract we drafted
ShuqiZi1/S2G-Net/MIMIC_preprocessing/timeseries.py
code served (permissive licence) · get_code("f4f50b5eec628d32")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create a minimal valid timeseries DataFrame
np.random.seed(0)

# Generate sample data
n_rows = 150
patient_ids = np.repeat([1, 2, 3], 50)
offsets = np.tile(np.arange(0, 50), 3)
features = np.tile(['temp', 'hr', 'bp'], 50)
values = np.random.randn(n_rows)

timeseries = pd.DataFrame({
    'patientunitstayid': patient_ids,
    'offset': offsets,
    'feature': features,
    'value': values
})

offset_column = 'offset'
feature_column = 'feature'
test_flag = False

ARGS = {
    'timeseries': timeseries,
    'offset_column': offset_column,
    'feature_column': feature_column,
    'test': test_flag
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
add_icd_codes Not yet run
unverified (harvested, no recorded run)
ShuqiZi1/S2G-Net/MIMIC_preprocessing/diagnoses.py
code served (permissive licence) · get_code("ded9a5198b8be293")
How it ran

no invocation recorded.

preprocess_flat Not yet run
unverified (harvested, no recorded run)
ShuqiZi1/S2G-Net/MIMIC_preprocessing/flat_and_labels.py
code served (permissive licence) · get_code("839f737819652ebe")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

FunctionAlso present inEarliest-datedOthers named
load_pkl 2 other papers
2 dated earlier
2003.09572 (2020-03)
Monocular Real-time Hand Shape and Motion Capture using Multi-modal Data
2203.02167 (2022-03)
SimKGC: Simple Contrastive Knowledge Graph Completion with Pre-trained Language Models

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

Predicting a patient's length of stay (LOS) in the intensive care unit (ICU) is a critical task for hospital resource management, yet remains challenging due to the heterogeneous and irregularly sampled nature of electronic health records (EHRs). In this work, we propose S 2 G-Net, a novel neural architecture that unifies statespace sequence modeling with multi-view Graph Neural Networks (GNNs) for ICU LOS prediction. The temporal path employs Mamba state-space models (SSMs) to capture patient trajectories, while the graph path leverages an optimized GraphGPS backbone, designed to integrate heterogeneous patient similarity graphs derived from diagnostic, administrative, and semantic features. Experiments on the largescale MIMIC-IV cohort dataset show that S 2 G-Net consistently outperforms sequence models (BiLSTM, Mamba, Transformer), graph models (classic GNNs, GraphGPS), and hybrid approaches across all primary metrics. Extensive ablation studies and interpretability analyzes highlight the complementary contributions of each component of our architecture and underscore the importance of principled graph construction. These results demonstrate that S 2 G-Net provides an effective and scalable solution for ICU LOS prediction with multi-modal clinical data. The code can be found at https://github.com/ShuqiZi1/S2G-Net.

For agents

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

get_harvested_code_for_paper("2508.17554")
get_code_for_paper("2508.17554")
have("2508.17554")

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

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

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

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

Connect an agent — have() is free.