SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.07309 · 2024

Reinforced Sequential Decision-Making for Sepsis Treatment: The POSNEGDM Framework with Mortality Classifier and Transformer

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2403.07309.json · badge: /api/ran/2403.07309.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
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
discount_cumsum Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from bkkgbkjb/oppo, is pointer only (licence: NONE) · get_code("0161b27cbe3cc58d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from bkkgbkjb/oppo, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

evaluate_episode Ran
ran; our contract draft was wrong, not the code
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/dualsight/evaluation/evaluate_episodes.py
code served (permissive licence) · get_code("1ed718456cb9f7a0")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a mock environment
class MockEnv:
    def __init__(self, state_dim):
        self.state_dim = state_dim
        self.step_count = 0
    
    def reset(self):
        self.step_count = 0
        return np.random.randn(self.state_dim).astype(np.float32)
    
    def step(self, action):
        self.step_count += 1
        state = np.random.randn(self.state_dim).astype(np.float32)
        reward = float(np.random.randn())
        done = self.step_count >= 5
        info = {}
        return state, reward, done, info

# Create a minimal model that implements get_action method
class MockModel(nn.Module):
    def __init__(self, state_dim, act_dim):
        super().__init__()
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.linear = nn.Linear(state_dim, act_dim)
    
    def get_action(self, states, actions, rewards, target_return=None):
        # states shape: (seq_len, state_dim)
        # actions shape: (seq_len, act_dim)
        # rewards shape: (seq_len,)
        # Returns action of shape (act_dim,)
        output = self.linear(states[-1:])  # Use last state
        return output.squeeze(0)

state_dim = 4
act_dim = 3
env = MockEnv(state_dim)
model = MockModel(state_dim, act_dim)
state_mean = np.zeros(state_dim, dtype=np.float32)
state_std = np.ones(state_dim, dtype=np.float32)

ARGS = {
    'env': env,
    'state_dim': state_dim,
    'act_dim': act_dim,
    'model': model,
    'max_ep_len': 1000,
    'device': 'cpu',
    'target_return': 0.0,
    'mode': 'normal',
    'state_mean': state_mean,
    'state_std': state_std,
}
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 tuple, ndim 1, dtype family float — a tuple 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
evaluate_episode_rtg Ran
ran; our contract draft was wrong, not the code
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/dualsight/evaluation/evaluate_episodes.py
code served (permissive licence) · get_code("9c904f0602da78d7")
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) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a minimal environment mock
class MockEnv:
    def __init__(self, state_dim, act_dim):
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.step_count = 0
    
    def reset(self):
        self.step_count = 0
        return np.random.randn(self.state_dim).astype(np.float32)
    
    def step(self, action):
        self.step_count += 1
        state = np.random.randn(self.state_dim).astype(np.float32)
        reward = np.random.randn()
        done = self.step_count >= 5
        info = {}
        return state, reward, done, info

# Create a minimal model that has get_action method
class MockDecisionTransformer(nn.Module):
    def __init__(self, state_dim, act_dim):
        super().__init__()
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.linear = nn.Linear(state_dim, act_dim)
    
    def get_action(self, states, actions, rewards, returns_to_go, timesteps):
        # states: (seq_len, state_dim)
        # returns_to_go: (1, seq_len)
        # timesteps: (1, seq_len)
        # Output: (act_dim,)
        batch_size = states.shape[0]
        action = self.linear(states[-1:])  # Take last state
        return action.squeeze(0)

state_dim = 4
act_dim = 3
device = 'cpu'

env = MockEnv(state_dim, act_dim)
model = MockDecisionTransformer(state_dim, act_dim)

state_mean = np.zeros(state_dim, dtype=np.float32)
state_std = np.ones(state_dim, dtype=np.float32)

ARGS = {
    'env': env,
    'state_dim': state_dim,
    'act_dim': act_dim,
    'model': model,
    'max_ep_len': 10,
    'scale': 1000.0,
    'state_mean': state_mean,
    'state_std': state_std,
    'device': device,
    'target_return': 100.0,
    'mode': 'normal'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
get_accuracy Ran
ran, honoured the contract we drafted
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/utils.py
code served (permissive licence) · get_code("ffe73c36fbe2646f")
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 float, 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 numpy as np

# Construct valid arguments for get_accuracy
# The function expects:
# - predicts: array-like with shape (batch_size, num_classes), will be argmaxed along axis=1
# - targets: array-like with shape (batch_size,), containing true class indices

# Create sample predictions (batch_size=2, num_classes=4)
predicts = np.array([
    [0.1, 0.9, 0.05, 0.05],  # batch 0: argmax -> 1
    [0.2, 0.3, 0.4, 0.1]      # batch 1: argmax -> 2
])

# Create sample targets (batch_size=2)
targets = np.array([1, 2])

ARGS = {
    "predicts": predicts,
    "targets": targets
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
read_dst Ran
ran; our contract draft was wrong, not the code
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/utils.py
code served (permissive licence) · get_code("b05dfefff93286a7")
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.

import pandas
import numpy as np
import tempfile
import os

# Create a temporary CSV file with the required columns
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, 'test_data.csv')

# Create sample data matching the function's requirements
observation_item = ['gender', 'mechvent', 'max_dose_vaso', 're_admission', 'age', 'Weight_kg', 'GCS', 'HR', 'SysBP', 'MeanBP', 'DiaBP', 'Temp_C', 'RR', 'FiO2_1', 'Potassium', 'Sodium', 'Chloride', 'Glucose', 'Magnesium', 'Calcium', 'Hb', 'WBC_count', 'Platelets_count', 'PTT', 'PT', 'Arterial_pH', 'paO2', 'paCO2', 'Arterial_BE', 'HCO3', 'Arterial_lactate', 'SOFA', 'SIRS', 'Shock_Index', 'PaO2_FiO2', 'cumulated_balance', 'SpO2', 'BUN', 'Creatinine', 'SGOT', 'SGPT', 'Total_bili', 'INR', 'input_total', 'input_4hourly', 'output_total', 'output_4hourly']

# Create sample data with 8 rows
data = {col: np.random.randn(8).tolist() for col in observation_item}
data['traj'] = [0, 0, 0, 1, 1, 1, 2, 2]
data['r'] = [0.1, 0.2, 0.5, -0.1, 0.3, 0.6, 0.2, 0.4]
data['a'] = [0, 1, 0, 1, 0, 1, 0, 1]

df = pandas.DataFrame(data)
df.to_csv(csv_path, index=False)

ARGS = {
    'csv_path': csv_path
}
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 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_tf_weights_in_gpt2 Not yet run
unverified (harvested, no recorded run)
dipeshtamboli/posnegdm-reinforced-sequential-decision-making-for-sepsis-treatment/dualsight/models/trajectory_gpt2.py
pointer only (licence: MIT); the stored copy get_code serves, from tencentarc/moto, is pointer only (licence: NOASSERTION) · get_code("00a33466c69c5705")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from tencentarc/moto, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. 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 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 2 later) and 2 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_tf_weights_in_gpt2 22 other papers
11 dated earlier, 1 the same month, 10 later
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2110.06206 (2021-10)
StARformer: Transformer with State-Action-Reward Representations for Visual Reinforcement Learning
2202.11705 (2022-02)
COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
and 19 more not named here
discount_cumsum 17 other papers
12 dated earlier, 5 later
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2110.06206 (2021-10)
StARformer: Transformer with State-Action-Reward Representations for Visual Reinforcement Learning
2111.10364 (2021-11)
Generalized Decision Transformer for Offline Hindsight Information Matching
and 14 more not named here
evaluate_episode 3 other papers
3 dated earlier
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2202.05607 (2022-02)
Online Decision Transformer
2206.08353 (2022-06)
Towards Understanding How Machines Can Learn Causal Overhypotheses
evaluate_episode_rtg 3 other papers
3 dated earlier
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2202.05607 (2022-02)
Online Decision Transformer
2206.08353 (2022-06)
Towards Understanding How Machines Can Learn Causal Overhypotheses

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-22.

Repositories linked to this paper

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

Abstract

Sepsis, a life-threatening condition triggered by the body's exaggerated response to infection, demands urgent intervention to prevent severe complications. Existing machine learning methods for managing sepsis struggle in offline scenarios, exhibiting suboptimal performance with survival rates below 50%. This paper introduces the POSNEGDM -- ``Reinforcement Learning with Positive and Negative Demonstrations for Sequential Decision-Making" framework utilizing an innovative transformer-based model and a feedback reinforcer to replicate expert actions while considering individual patient characteristics. A mortality classifier with 96.7\% accuracy guides treatment decisions towards positive outcomes. The POSNEGDM framework significantly improves patient survival, saving 97.39% of patients, outperforming established machine learning algorithms (Decision Transformer and Behavioral Cloning) with survival rates of 33.4% and 43.5%, respectively. Additionally, ablation studies underscore the critical role of the transformer-based decision maker and the integration of a mortality classifier in enhancing overall survival rates. In summary, our proposed approach presents a promising avenue for enhancing sepsis treatment outcomes, contributing to improved patient care and reduced healthcare costs.

For agents

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

get_harvested_code_for_paper("2403.07309")
get_code_for_paper("2403.07309")
have("2403.07309")

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

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

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

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

Connect an agent — have() is free.