SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.00121 · 2022

Near-Optimal Collaborative Learning in Bandits

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 6 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/2206.00121.json · badge: /api/ran/2206.00121.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
clreda/near-optimal-federated canonical (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
FunctionStatusWhere it lives
argmax_m_ls Ran
ran on a synthesized input
clreda/near-optimal-federated/utils.py
code served (permissive licence) · get_code("1d3ac5e0714e6843")
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 int; 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 random import sample

def randf(arr, n, f):
    return sample(np.array(np.argwhere(arr == f(arr))).flatten().tolist(), n)

def argmax_m_ls(ls, N):
    assert N <= len(ls)
    allowed = list(range(len(ls)))
    inds = [None] * N
    for i in range(N):
        idx = randf(np.array([ls[i] for i in allowed]), 1, np.max)[0]
        inds[i] = allowed[idx]
        del allowed[idx]
    return inds

# Setup for argmax_m_ls function
# The function takes:
# - ls: a list of numeric values that can be indexed and compared
# - N: an integer representing how many elements to select

# Create a simple list of numeric values
ls = [5, 2, 8, 3, 9, 1, 7, 4]

# N should be <= len(ls)
N = 3

ARGS = {
    "ls": ls,
    "N": N
}
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 list, ndim 1, dtype family int — 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
expExploration Ran
ran on a synthesized input
clreda/near-optimal-federated/betas.py
code served (permissive licence) · get_code("bb43ed36296f2fb1")
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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# def expExploration(T, A, W=None, verbose=False):
#     return lambda p: 2 ** p
#
# The function takes parameters T, A, W, and verbose
# but only returns a lambda that uses p (not any of the input parameters)
# So we just need to provide valid arguments for T, A, W, and verbose

T = torch.randn(2, 4)
A = torch.randn(2, 3)
W = torch.randn(4, 3)
verbose = False

ARGS = {
    "T": T,
    "A": A,
    "W": W,
    "verbose": verbose
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
explogExploration Ran
ran on a synthesized input
clreda/near-optimal-federated/betas.py
code served (permissive licence) · get_code("a94455fe719472c7")
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 function. 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

T = 100
A = np.array([[1, 2], [3, 4]])
W = None
verbose = False

ARGS = {
    'T': T,
    'A': A,
    'W': W,
    'verbose': verbose
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
logExploration Ran
ran on a synthesized input
clreda/near-optimal-federated/betas.py
code served (permissive licence) · get_code("a43a3db7a9995fd7")
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 function. 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 torch

torch.manual_seed(0)

# Analyze the function:
# - T: used in np.log(T), so needs to be a numeric value
# - A: defined as parameter but not used in the function body
# - W: optional parameter, not used in the function body
# - verbose: optional boolean parameter, not used in the function body

# The function returns a lambda that takes parameter p and returns 10 * np.log(T)
# So T should be a positive number for the log to work

T = 2.5  # positive number for np.log
A = np.array([[1, 2, 3], [4, 5, 6]])  # arbitrary array for unused parameter
W = np.array([[7, 8], [9, 10], [11, 12]])  # arbitrary array for optional parameter
verbose = False  # boolean for optional parameter

ARGS = {
    "T": T,
    "A": A,
    "W": W,
    "verbose": verbose
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
problem_solution_util Ran
ran on a synthesized input
clreda/near-optimal-federated/solving.py
code served (permissive licence) · get_code("2def288ba76c63b9")
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 cvxpy as cp

# Create a simple optimization problem for testing
# We'll create a basic linear program: minimize c^T x subject to Ax <= b

x = cp.Variable(3)
c = np.array([1.0, 2.0, 3.0])
A = np.array([[1.0, 1.0, 1.0],
              [2.0, 1.0, 0.0]])
b = np.array([5.0, 4.0])

objective = cp.Minimize(c @ x)
constraints = [A @ x <= b, x >= 0]
pb = cp.Problem(objective, constraints)

ARGS = {
    'pb': pb,
    'verbose': False,
    'solver': cp.MOSEK,
    'alt_solver': cp.ECOS,
    'qcq': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — 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
randf Ran
ran on a synthesized input
clreda/near-optimal-federated/utils.py
code served (permissive licence) · get_code("8429496c71df1f6e")
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 int; 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 random import sample

# Analyze the function:
# - arr: must be a numpy array that supports == comparison and argwhere
# - n: number of samples to return
# - f: a callable that takes arr and returns a scalar value to search for

# Create a simple numpy array with some repeated values
arr = np.array([1, 2, 3, 2, 4, 2, 5])

# Create a function that returns a value present in the array
def f(arr):
    return 2  # This value appears multiple times in arr

# n should be less than or equal to the number of occurrences of f(arr)
n = 2

ARGS = {
    "arr": arr,
    "n": n,
    "f": f
}
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 list, ndim 1, dtype family int — 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
argmax_m Not yet run
unverified (harvested, no recorded run)
clreda/near-optimal-federated/utils.py
code served (permissive licence) · get_code("5fffb0e7d511975c")
How it ran

no invocation recorded.

solve_decoupled Not yet run
unverified (harvested, no recorded run)
clreda/near-optimal-federated/solving.py
code served (permissive licence) · get_code("9b7071ed1d4b052c")
How it ran

no invocation recorded.

solve_oracle Not yet run
unverified (harvested, no recorded run)
clreda/near-optimal-federated/solving.py
code served (permissive licence) · get_code("7cd860031cd67cf2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

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

This paper introduces a general multi-agent bandit model in which each agent is facing a finite set of arms and may communicate with other agents through a central controller in order to identify, in pure exploration, or play, in regret minimization, its optimal arm. The twist is that the optimal arm for each agent is the arm with largest expected mixed reward, where the mixed reward of an arm is a weighted sum of the rewards of this arm for all agents. This makes communication between agents often necessary. This general setting allows to recover and extend several recent models for collaborative bandit learning, including the recently proposed federated learning with personalization (Shi et al., 2021). In this paper, we provide new lower bounds on the sample complexity of pure exploration and on the regret. We then propose a near-optimal algorithm for pure exploration. This algorithm is based on phased elimination with two novel ingredients: a data-dependent sampling scheme within each phase, aimed at matching a relaxation of the lower bound.

For agents

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

get_harvested_code_for_paper("2206.00121")
get_code_for_paper("2206.00121")
have("2206.00121")

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

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

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

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

Connect an agent — have() is free.