SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.12024 · 2021

Q-Learning Lagrange Policies for Multi-Action Restless Bandits

arXiv · PDF · Open in the Atlas

Code that ran

14 of 17 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 14 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2106.12024.json · badge: /api/ran/2106.12024.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
killian-34/MAIQL_and_LPQL canonical (classifier label)
classifier basis: census
14 ran · 3 no recorded run
FunctionStatusWhere it lives
check_T_puterman Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/simulation_environments.py
code served (permissive licence) · get_code("2e580d57d36a5a1b")
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 bool, 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

# The function check_T_puterman expects T to be a 3D numpy array
# with shape (S, A, S) where:
# - S is the number of states
# - A is the number of actions
# - T[s, a, :] represents transition probabilities

# Create a small valid transition matrix
# Let's use S=3 states and A=2 actions
S = 3
A = 2

# T[s, a, k] represents the probability of transitioning from state s 
# to state k when taking action a
# We need to construct T such that the cumulative sum Q[s, a, k] = sum(T[s, a, k:])
# is non-decreasing in s for each (a, k) pair

# Start with a simple valid case: uniform transitions
T = np.zeros((S, A, S))

# Fill with valid probabilities that satisfy the Puterman condition
# For action 0:
T[0, 0, :] = [0.2, 0.3, 0.5]  # state 0
T[1, 0, :] = [0.1, 0.4, 0.5]  # state 1
T[2, 0, :] = [0.0, 0.5, 0.5]  # state 2

# For action 1:
T[0, 1, :] = [0.3, 0.3, 0.4]  # state 0
T[1, 1, :] = [0.2, 0.4, 0.4]  # state 1
T[2, 1, :] = [0.1, 0.5, 0.4]  # state 2

ARGS = {
    'T': T
}
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 bool, 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
check_T_strict Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/simulation_environments.py
code served (permissive licence) · get_code("5bdb56b0c0ffba79")
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 bool, 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 a valid transition tensor T
# T has shape (S, A, S) where S is number of states, A is number of actions
# Each T[s, a, :] should represent transition probabilities from state s via action a

S = 3  # number of states
A = 2  # number of actions

# Create a valid transition tensor that satisfies the strict conditions
# We need to construct T such that the cumulative sums are non-decreasing
T = np.array([
    # State 0
    [
        [0.5, 0.3, 0.2],  # action 0
        [0.4, 0.4, 0.2],  # action 1
    ],
    # State 1
    [
        [0.2, 0.5, 0.3],  # action 0
        [0.1, 0.6, 0.3],  # action 1
    ],
    # State 2
    [
        [0.1, 0.3, 0.6],  # action 0
        [0.0, 0.4, 0.6],  # action 1
    ],
], dtype=np.float32)

ARGS = {
    "T": T
}
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 bool, 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
epsilon_clip Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/utils.py
code served (permissive licence) · get_code("6110573fea8288bc")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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

# Create a simple numpy array to use as input
# Using a small array with values between 0 and 1 (typical for probabilities/clipping)
T = np.array([[0.1, 0.5, 0.9, 0.95],
              [0.05, 0.2, 0.8, 0.99]])

# Define epsilon - a small value used to clip the boundaries
epsilon = 0.1

ARGS = {
    "T": T,
    "epsilon": epsilon
}
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 ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
forest Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/mdptoolbox/example.py
code served (permissive licence) · get_code("6efeea9e9dc596fb")
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. 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 scipy.sparse as sp

# Test all parameter combinations
ARGS = {
    'S': 5,
    'r1': 4.0,
    'r2': 2.0,
    'p': 0.1,
    'is_sparse': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
isNonNegative Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/mdptoolbox/util.py
code served (permissive licence) · get_code("209b91f6c2571956")
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 bool, 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
import torch

torch.manual_seed(0)

# Test with a numpy array that is non-negative
matrix_nonnegative = np.array([[1.0, 2.0, 3.0],
                                [4.0, 5.0, 6.0]])

ARGS = {
    "matrix": matrix_nonnegative
}
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 bool, 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
isSquare Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/mdptoolbox/util.py
code served (permissive licence) · get_code("9a2544be4b3e7c40")
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 bool, 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
import torch

# Test case 1: square numpy array
square_matrix = np.array([[1, 2], [3, 4]])

# Test case 2: non-square numpy array
non_square_matrix = np.array([[1, 2, 3], [4, 5, 6]])

# Test case 3: square torch tensor
torch.manual_seed(0)
square_tensor = torch.tensor([[1.0, 2.0], [3.0, 4.0]])

# Test case 4: non-square torch tensor
non_square_tensor = torch.tensor([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])

# Test case 5: list representation of square matrix
square_list = [[1, 2], [3, 4]]

# Test case 6: list representation of non-square matrix
non_square_list = [[1, 2, 3], [4, 5, 6]]

# Using square matrix for the main test
ARGS = {
    "matrix": square_matrix
}
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 bool, 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
isStochastic Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/mdptoolbox/util.py
code served (permissive licence) · get_code("95dc2c7c2fc2b033")
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 bool, 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

# Create a valid row stochastic matrix
# A row stochastic matrix has rows that sum to 1
matrix = np.array([
    [0.2, 0.3, 0.5],
    [0.1, 0.4, 0.5],
    [0.6, 0.2, 0.2],
    [0.33, 0.33, 0.34]
], dtype=np.float64)

ARGS = {
    "matrix": matrix
}
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 bool, 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
list_valid_action_combinations Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/utils.py
code served (permissive licence) · get_code("91dda6827bb1bee5")
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 ndarray, ndim 2, dtype family int, shape (2, 2) 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

# N is used as a parameter but not directly referenced in the function body
N = 5

# C is indexed by options[i], so it needs to be indexable with integer indices
# Let's make it a 2D array where each row has a sum that we can control
C = np.array([
    [1.0, 2.0],      # index 0
    [0.5, 0.5],      # index 1
    [2.0, 3.0],      # index 2
    [1.0, 1.0],      # index 3
    [0.2, 0.3],      # index 4
])

# B is the budget threshold
B = 3.5

# options is a 2D array where each row contains indices into C
# Shape should be (num_options, some_dimension)
options = np.array([
    [0, 1],
    [1, 2],
    [3, 4],
    [0, 4],
], dtype=np.int64)

ARGS = {
    "N": N,
    "C": C,
    "B": B,
    "options": options,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (2, 2) — shape (2, 2) 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
maiql_approx_tabular_get_indexes Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/rmab_ql.py
code served (permissive licence) · get_code("be48aeb30a5ab4be")
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 ndarray, ndim 2, dtype family float, shape (3, 5) 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
import torch

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

# Analyze the function:
# - Q: indexed as Q[arm, :, current_state[arm], a]
#   So Q needs shape (n_arms, something, max_state, num_a)
# - current_state: indexed as current_state[arm], should be array of length n_arms
# - n_arms: scalar, loop range
# - num_a: scalar, loop range
# - lams: indexed as lams[np.argmin(Qdiff)], should be 1D array

n_arms = 3
num_a = 5
max_state = 4
q_middle_dim = 7

# Q shape: (n_arms, q_middle_dim, max_state, num_a)
Q = np.random.randn(n_arms, q_middle_dim, max_state, num_a).astype(np.float64)

# current_state: array of shape (n_arms,) with values in range [0, max_state)
current_state = np.array([0, 2, 1], dtype=np.int64)

# lams: array with at least q_middle_dim elements
lams = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7], dtype=np.float64)

ARGS = {
    "Q": Q,
    "current_state": current_state,
    "n_arms": n_arms,
    "num_a": num_a,
    "lams": lams,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 5) — shape (3, 5) 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
make_T_from_q Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/simulation_environments.py
code served (permissive licence) · get_code("2a26f1b7b035fb3d")
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 ndarray, ndim 3, dtype family float, shape (2, 3, 4) 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

# The function takes Q as input
# Q is used with: Q.shape[2], Q[:, :, -1], Q[:, :, i], Q[:, :, i+1]
# So Q must be a 3D numpy array

# Create a small 3D array with distinct dimensions
# Shape: (batch=2, height=3, depth=4)
Q = np.random.randn(2, 3, 4)

ARGS = {
    "Q": Q
}
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 ndarray, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
rand Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/mdptoolbox/example.py
code served (permissive licence) · get_code("5449e35824bf424f")
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 4, 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 numpy as np
import scipy.sparse as sp

np.random.seed(0)

ARGS = {
    "S": 4,
    "A": 3,
    "is_sparse": False,
    "mask": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
swap_axes Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/utils.py
code served (permissive licence) · get_code("26539f00ec8155f3")
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 4, 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 numpy as np
from numba import jit

@jit(nopython=True)
def swap_axes(T, R):
    T_i = np.transpose(T, (1, 0, 2))
    R_i = np.zeros(T_i.shape)
    for x in range(R_i.shape[0]):
        for y in range(R_i.shape[1]):
            R_i[x, :, y] = R
    return (T_i, R_i)

# Construct valid arguments
# T: 3D numpy array that will be transposed to (1, 0, 2)
# Shape (2, 3, 4) will become (3, 2, 4) after transpose
T = np.random.randn(2, 3, 4).astype(np.float64)

# R: 1D numpy array that will be assigned to R_i[x, :, y]
# Must match the middle dimension of T_i which is 2
R = np.random.randn(2).astype(np.float64)

ARGS = {
    "T": T,
    "R": R
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
takeAction Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/ma_rmab_online_simulation.py
code served (permissive licence) · get_code("6d79262cd8076e56")
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 ndarray, ndim 1, dtype family float, shape (2,) 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

# Set up random stream (numpy RandomState)
random_stream = np.random.RandomState(seed=42)

# Number of states in the batch
N = 2

# current_states: array of shape (N,) with state indices
current_states = np.array([0, 1], dtype=np.int64)

# T: transition matrix of shape (N, num_states, num_actions, num_states)
# Dimensions: (batch_size=2, current_states=3, actions=4, next_states=3)
num_states = 3
num_actions = 4
T = np.random.dirichlet([1.0] * num_states, size=(N, num_states, num_actions))

# actions: array of shape (N,) with action indices
actions = np.array([0, 2], dtype=np.int64)

ARGS = {
    "current_states": current_states,
    "T": T,
    "actions": actions,
    "random_stream": random_stream
}
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 ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
update_counts Ran
ran on a synthesized input
killian-34/MAIQL_and_LPQL/code/ma_rmab_online_simulation.py
code served (permissive licence) · get_code("91b695fbcce50fb9")
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 4, dtype family int, shape (2, 4, 3, 4) 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
import numpy as np

torch.manual_seed(0)

# Construct arguments for update_counts function
# The function iterates over actions, indexes into state_log and counts

# actions: iterable of action indices (one per arm)
actions = torch.tensor([0, 1], dtype=torch.long)

# state_log: tensor of shape [num_arms, 2] containing [state, state_prime] for each arm
state_log = torch.tensor([[0, 1], [2, 3]], dtype=torch.long)

# counts: tensor to accumulate counts, indexed as [arm, state, action, state_prime]
# Need dimensions large enough for all indices used:
# - arm: 2 (from actions length)
# - state: 4 (max state index is 3 from state_log)
# - action: 3 (max action index is 1 from actions, but use 3 for distinctness)
# - state_prime: 4 (max state_prime is 3 from state_log)
counts = torch.zeros((2, 4, 3, 4), dtype=torch.long)

ARGS = {
    "actions": actions,
    "state_log": state_log,
    "counts": counts
}
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 Tensor, ndim 4, dtype family int, shape (2, 4, 3, 4) — shape (2, 4, 3, 4) 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
action_knapsack Not yet run
unverified (harvested, no recorded run)
killian-34/MAIQL_and_LPQL/code/lp_methods.py
code served (permissive licence) · get_code("a827da5895627b3f")
How it ran

no invocation recorded.

hawkins Not yet run
unverified (harvested, no recorded run)
killian-34/MAIQL_and_LPQL/code/lp_methods.py
code served (permissive licence) · get_code("68d9010ee427aee8")
How it ran

no invocation recorded.

lp_to_compute_index Not yet run
unverified (harvested, no recorded run)
killian-34/MAIQL_and_LPQL/code/lp_methods.py
code served (permissive licence) · get_code("b2cf6ebf6a2df4f3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 10 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
forest 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
isNonNegative 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
isSquare 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
isStochastic 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
lp_to_compute_index 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
rand 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization
takeAction 1 other paper
1 later
ijcai2024_0036 (2024 (year only))
Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization

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

Multi-action restless multi-armed bandits (RMABs) are a powerful framework for constrained resource allocation in which $N$ independent processes are managed. However, previous work only study the offline setting where problem dynamics are known. We address this restrictive assumption, designing the first algorithms for learning good policies for Multi-action RMABs online using combinations of Lagrangian relaxation and Q-learning. Our first approach, MAIQL, extends a method for Q-learning the Whittle index in binary-action RMABs to the multi-action setting. We derive a generalized update rule and convergence proof and establish that, under standard assumptions, MAIQL converges to the asymptotically optimal multi-action RMAB policy as $t\rightarrow{}\infty$. However, MAIQL relies on learning Q-functions and indexes on two timescales which leads to slow convergence and requires problem structure to perform well. Thus, we design a second algorithm, LPQL, which learns the well-performing and more general Lagrange policy for multi-action RMABs by learning to minimize the Lagrange bound through a variant of Q-learning. To ensure fast convergence, we take an approximation strategy that enables learning on a single timescale, then give a guarantee relating the approximation's precision to an upper bound of LPQL's return as $t\rightarrow{}\infty$. Finally, we show that our approaches always outperform baselines across multiple settings, including one derived from real-world medication adherence data.

For agents

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

get_harvested_code_for_paper("2106.12024")
get_code_for_paper("2106.12024")
have("2106.12024")

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

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

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

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

Connect an agent — have() is free.