SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.06831 · NeurIPS · 2024

Generalized Linear Bandits with Limited Adaptivity

Ayush Sawarni, Nirjhar Das, Siddharth Barman, Gaurav Sinha

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 6 violated it and 2 have no contract verdict; 2 failures of our instrument; 1 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/2404.06831.json · badge: /api/ran/2404.06831.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
nirjhar-das/glbandit_limited_adaptivity canonical (classifier label)
classifier basis: classifier_2025
6 ran · 1 no recorded run
nick-jhlee/logistic_bandit community
Papers with Code archive
3 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
LogisticBandit Ran
ran on a synthesized input · constructed an object; no result was computed
nick-jhlee/logistic_bandit/logbexp/algorithms/rs_glincb.py
pointer only (licence: NONE) · get_code("f2eececafa8fb5ca")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nick-jhlee/logistic_bandit 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.

RS_GLinCB Ran
ran on a synthesized input · constructed an object; no result was computed
nick-jhlee/logistic_bandit/logbexp/algorithms/rs_glincb.py
pointer only (licence: NONE) · get_code("613eeab5b98f9c9c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nick-jhlee/logistic_bandit 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.

dmu Ran
ran, violated the contract we drafted
nick-jhlee/logistic_bandit/logbexp/algorithms/rs_glincb.py
pointer only (licence: NONE) · get_code("4f7387d1937f4ded")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nick-jhlee/logistic_bandit 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.

dprobit Ran
ran, violated the contract we drafted
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("807e58bdf5b6c6fd")
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 ndarray, ndim 1, dtype family float, shape (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

def dprobit(x):
    return 1.0 / np.sqrt(2 * np.pi) * np.exp(-x * x / 2.0)

# The function dprobit takes a single parameter x
# It performs element-wise operations on x (multiplication, exponentiation)
# So x should be a numpy array or scalar

# Create a small numpy array as input
x_value = np.array([0.0, 0.5, 1.0, -0.5])

ARGS = {
    "x": x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (4,) — shape (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
dsigmoid Ran
ran, violated the contract we drafted
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("bb151ed835df82f7")
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 ndarray, ndim 1, dtype family float, shape (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

def sigmoid(x):
    return 1.0 / (1.0 + np.exp(-x))

def dsigmoid(x):
    return sigmoid(x) * (1.0 - sigmoid(x))

# The function dsigmoid takes a single parameter x
# It computes the derivative of sigmoid by:
# 1. Calling sigmoid(x)
# 2. Computing (1.0 - sigmoid(x))
# 3. Multiplying the two results
# x should be a numpy array or scalar that can be used with np.exp

# Create a small numpy array as input
x_input = np.array([0.0, 1.0, -1.0, 0.5])

ARGS = {
    "x": x_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (4,) — shape (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
log_loss_glm Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("f1d61d294fc5020c")
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 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
from scipy.stats import norm

np.random.seed(0)

# Create small sample data
n_samples = 2
n_features = 4

# theta: coefficient vector
theta = np.random.randn(n_features)

# X: feature matrix (n_samples x n_features)
X = np.random.randn(n_samples, n_features)

# Y: binary labels (0 or 1)
Y = np.random.randint(0, 2, n_samples).astype(float)

# lmbda: regularization parameter
lmbda = 0.01

# model: string specifying the model type
model = 'Logistic'

ARGS = {
    'theta': theta,
    'X': X,
    'Y': Y,
    'lmbda': lmbda,
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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
mat_norm Ran
ran, violated the contract we drafted
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("ac663e325a60b21b")
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

# Construct arguments for mat_norm(vec, matrix)
# The function computes: sqrt(vec^T @ matrix @ vec)
# So vec should be 1D and matrix should be 2D square

vec = np.array([1.0, 2.0, 3.0, 4.0])  # 1D vector of shape (4,)
matrix = np.array([
    [2.0, 0.5, 0.1, 0.2],
    [0.5, 3.0, 0.3, 0.1],
    [0.1, 0.3, 1.5, 0.4],
    [0.2, 0.1, 0.4, 2.5]
])  # 4x4 symmetric positive definite matrix

ARGS = {
    "vec": vec,
    "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 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
mu Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from nick-jhlee/logistic_bandit
pointer only; the stored copy get_code serves, from nick-jhlee/logistic_bandit, is pointer only (licence: NONE) · get_code("c3f0f3af4e86bef6")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

probit Ran
ran, violated the contract we drafted
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("594cafa89df7fdd5")
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 ndarray, ndim 1, dtype family float, shape (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
from scipy.stats import norm

torch.manual_seed(0)

# The probit function takes a single parameter 'x' and applies norm.cdf to it
# x can be a scalar, array, or array-like object
# We'll create a small numpy array as input

x = np.array([0.0, 0.5, -0.5, 1.0])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — 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 (4,) — shape (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
solve_glm_mle Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("ee8a2eb72b1fdb7c")
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
from scipy.stats import norm
from scipy.optimize import minimize

def sigmoid(x):
    return 1.0 / (1.0 + np.exp(-x))

def probit(x):
    return norm.cdf(x)

def log_loss_glm(theta, X, Y, lmbda, model):
    if model == 'Logistic':
        return -np.sum(Y * np.log(sigmoid(np.dot(X, theta))) + (1 - Y) * np.log(1 - sigmoid(np.dot(X, theta)))) + lmbda * np.sum(np.square(theta))
    elif model == 'Probit':
        return -np.sum(Y * np.log(probit(np.dot(X, theta))) + (1 - Y) * np.log(1 - probit(np.dot(X, theta)))) + lmbda * np.sum(np.square(theta))

def solve_glm_mle(theta_prev, X, Y, lmbda, model):
    res = minimize(log_loss_glm, theta_prev, args=(X, Y, lmbda, model))
    theta_hat, succ_flag = (res.x, res.success)
    return (theta_hat, succ_flag)

# Setup code
np.random.seed(0)

# Create small sample data
n_samples = 2
n_features = 4

X = np.random.randn(n_samples, n_features)
Y = np.random.randint(0, 2, size=n_samples)
theta_prev = np.random.randn(n_features)
lmbda = 0.01
model = 'Logistic'

ARGS = {
    'theta_prev': theta_prev,
    'X': X,
    'Y': Y,
    'lmbda': lmbda,
    'model': model
}
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
RS_GLinUCB Not yet run
unverified (harvested, no recorded run)
nirjhar-das/glbandit_limited_adaptivity/glmbanditexp/algorithms/rs_glinucb.py
code served (permissive licence) · get_code("9eb504e5cf46db03")
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, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
LogisticBandit
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.13977 (2024-07)
A Unified Confidence Sequence for Generalized Linear Models, with Applications to Bandits
mu
brick of this paper's assembly: helper
1 other paper
1 later
2407.13977 (2024-07)
A Unified Confidence Sequence for Generalized Linear Models, with Applications to 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-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

We study the generalized linear contextual bandit problem within the constraints of limited adaptivity. In this paper, we present two algorithms, B-GLinCB and RS-GLinCB, that address, respectively, two prevalent limited adaptivity settings. Given a budget M on the number of policy updates, in the first setting, the algorithm needs to decide upfront M rounds at which it will update its policy, while in the second setting it can adaptively perform M policy updates during its course. For the first setting, we design an algorithm B-GLinCB, that incurs Õ( √ T ) regret when M = Ω (log log T ) and the arm feature vectors are generated stochastically. For the second setting, we design an algorithm RS-GLinCB that updates its policy Õ(log 2 T ) times and achieves a regret of Õ( √ T ) even when the arm feature vectors are adversarially generated. Notably, in these bounds, we manage to eliminate the dependence on a key instance dependent parameter κ, that captures non-linearity of the underlying reward model. Our novel approach for removing this dependence for generalized linear contextual bandits might be of independent interest.

For agents

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

get_harvested_code_for_paper("2404.06831")
get_code_for_paper("2404.06831")
have("2404.06831")

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

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

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

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

Connect an agent — have() is free.