SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · ijcai2024_0036 · IJCAI · 2024

Towards a Pretrained Model for Restless Bandits via Multi-arm Generalization

Edward Hughes, Milind Tambe, Karl Tuyls, Dheeraj Nagaraj, Edwin Zhang, Yunfan Zhao, Aparna Taneja, Nikhil Behari

Open in the Atlas

Code that ran

8 of 11 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 8 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/ijcai2024_0036.json · badge: /api/ran/ijcai2024_0036.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
yzhao3685/PreFeRMAB canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_mean_l2_diff Ran
ran on a synthesized input
yzhao3685/PreFeRMAB/double_oracle.py
code served (permissive licence) · get_code("1b09078a9e185f00")
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 float64, ndim 0, 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

# The function expects two collections of arrays/vectors (nsp1 and nsp2)
# It iterates through them, computes L2 norm of differences, and returns mean

# Create two lists of numpy arrays with distinct shapes for clarity
nsp1 = [
    np.array([1.0, 2.0, 3.0, 4.0]),
    np.array([5.0, 6.0, 7.0, 8.0])
]

nsp2 = [
    np.array([1.5, 2.5, 3.5, 4.5]),
    np.array([5.5, 6.5, 7.5, 8.5])
]

ARGS = {
    'nsp1': nsp1,
    'nsp2': nsp2
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
yzhao3685/PreFeRMAB/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
yzhao3685/PreFeRMAB/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
yzhao3685/PreFeRMAB/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
yzhao3685/PreFeRMAB/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
yzhao3685/PreFeRMAB/robust_rmab/simulator.py
code served (permissive licence) · get_code("4f37b2467585dc82")
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 (0, 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: appears to be unused in the function body
N = 5

# C: indexed by options[i], needs to be array-like with .sum() method
# Shape should be (num_actions, cost_dims) where each action has associated costs
C = np.array([
    [1.0, 2.0],
    [0.5, 1.5],
    [2.0, 3.0],
    [0.3, 0.7],
    [1.5, 1.5]
])

# B: budget threshold for comparison with costs
B = 3.0

# options: 2D array where each row is an option (indices into C)
# Shape (num_options, num_choices_per_option)
options = np.array([
    [0, 1],
    [2, 3],
    [1, 4],
    [0, 2]
])

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
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 (0, 2) — shape (0, 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
rand Ran
ran on a synthesized input
yzhao3685/PreFeRMAB/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
takeAction Ran
ran on a synthesized input
yzhao3685/PreFeRMAB/robust_rmab/simulator.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
action_knapsack Not yet run
unverified (harvested, no recorded run)
yzhao3685/PreFeRMAB/robust_rmab/lp_methods.py
code served (permissive licence) · get_code("2199c1d1fd473729")
How it ran

no invocation recorded.

hawkins Not yet run
unverified (harvested, no recorded run)
yzhao3685/PreFeRMAB/robust_rmab/lp_methods.py
code served (permissive licence) · get_code("f27feefeea04ce73")
How it ran

no invocation recorded.

lp_to_compute_index Not yet run
unverified (harvested, no recorded run)
yzhao3685/PreFeRMAB/robust_rmab/lp_methods.py
code served (permissive licence) · get_code("b2cf6ebf6a2df4f3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
isNonNegative 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
isSquare 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
isStochastic 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
lp_to_compute_index 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
rand 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits
takeAction 1 other paper
1 dated earlier
2106.12024 (2021-06)
Q-Learning Lagrange Policies for Multi-Action Restless Bandits

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

Repositories linked to this paper

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

Abstract

Restless multi-arm bandits (RMABs) is a class of resource allocation problems with broad application in areas such as healthcare, online advertising, and anti-poaching. We explore several important question such as how to handle arms opting-in and opting-out over time without frequent retraining from scratch, how to deal with continuous state settings with nonlinear reward functions, which appear naturally in practical contexts. We address these questions by developing a pre-trained model (PreFeRMAB) based on a novel combination of three key ideas: (i) to enable fast generalization, we use train agents to learn from each other's experience; (ii) to accommodate streaming RMABs, we derive a new update rule for a crucial λ-network; (iii) to handle more complex continuous state settings, we design the algorithm to automatically define an abstract state based on raw observation and reward data. PreFeRMAB allows general zero-shot ability on previously unseen RMABs, and can be fine-tuned on specific instances in a more sampleefficient way than retraining from scratch. We theoretically prove the benefits of multi-arm generalization and empirically demonstrate the advantages of our approach on several challenging, real-world inspired problems.

For agents

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

get_harvested_code_for_paper("ijcai2024_0036")
get_code_for_paper("ijcai2024_0036")
have("ijcai2024_0036")

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

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

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

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

Connect an agent — have() is free.