SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.12438 · NeurIPS · 2022

Algorithms with Prediction Portfolios

Sergei Vassilvitskii, Michael Dinitz, Sungjin Im, Thomas Lavastida, Benjamin Moseley

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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 10 have no contract verdict; 0 failures of our instrument; 2 no recorded run), 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/2210.12438.json · badge: /api/ran/2210.12438.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
tlavastida/PredictionPortfolios canonical (classifier label)
classifier basis not recorded on the link
10 ran · 2 no recorded run
FunctionStatusWhere it lives
GreedyMatching Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/MaxBipartiteMatching.py
code served (permissive licence) · get_code("2eb766e101b0537c")
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. 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 numpy as np

# Create a simple graph-like object that has U, V, and Adj attributes
class SimpleGraph:
    def __init__(self, U, V, Adj):
        self.U = U
        self.V = V
        self.Adj = Adj

# Define vertices
U_vertices = ['u0', 'u1', 'u2']
V_vertices = ['v0', 'v1', 'v2']

# Define adjacency list (mapping from U vertices to lists of V vertices)
Adj = {
    'u0': ['v0', 'v1'],
    'u1': ['v1', 'v2'],
    'u2': ['v0']
}

# Create the graph object
G = SimpleGraph(U=U_vertices, V=V_vertices, Adj=Adj)

# Define ARGS dictionary with all parameters
ARGS = {
    'G': G,
    'U_matches': None,
    'V_matches': None
}
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
JaccardMatching Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/UtilityFunctions.py
code served (permissive licence) · get_code("c11682b9f49c1403")
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 torch

torch.manual_seed(0)

# JaccardMatching takes two collections (M1 and M2) and computes Jaccard similarity
# It checks if elements of M1 are in M2, so both should be iterable collections
# The function works with any hashable elements

M1 = [1, 2, 3, 4]
M2 = [3, 4, 5, 6]

ARGS = {
    "M1": M1,
    "M2": M2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
assign_to_clusters Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/KMedian.py
code served (permissive licence) · get_code("7913b86f64143493")
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. 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

torch.manual_seed(0)

# Create sample points as dictionaries with numeric keys and numeric values
points = [
    {'a': 1.0, 'b': 2.0, 'c': 3.0},
    {'a': 1.5, 'b': 2.5, 'c': 3.5},
    {'a': 5.0, 'b': 6.0, 'c': 7.0},
    {'a': 5.5, 'b': 6.5, 'c': 7.5},
]

# Create cluster centers as dictionaries with the same keys
centers = [
    {'a': 1.0, 'b': 2.0, 'c': 3.0},
    {'a': 5.0, 'b': 6.0, 'c': 7.0},
]

k = 2

ARGS = {
    'points': points,
    'centers': centers,
    'k': k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
check_certificates Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/MinWeightPerfectMatching.py
code served (permissive licence) · get_code("d526e886996d86ad")
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.

class Graph:
    def __init__(self):
        self.U = [0, 1, 2, 3]  # vertices
        self.E = [(0, 1), (1, 2), (2, 3), (0, 3)]  # edges
        self.Adj = {
            0: {1, 3},
            1: {0, 2},
            2: {1, 3},
            3: {2, 0}
        }
        self.W = {
            (0, 1): 5.0,
            (1, 2): 3.0,
            (2, 3): 4.0,
            (0, 3): 2.0
        }
    
    def matching_weight(self, M):
        total = 0.0
        for u, v in M:
            total += self.W[(u, v)]
        return total


G = Graph()

M = [(0, 1), (2, 3)]

d = {
    0: 2.5,
    1: 2.5,
    2: 2.0,
    3: 2.0
}

ARGS = {
    'G': G,
    'M': M,
    'd': d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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_duals Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/MinWeightPerfectMatching.py
code served (permissive licence) · get_code("527efe97e46903d1")
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.

class Graph:
    def __init__(self):
        self.E = []
        self.W = {}

# Create a simple graph with 3 nodes
G = Graph()
G.E = [(0, 1), (1, 2), (0, 2)]
G.W = {
    (0, 1): 5.0,
    (1, 2): 3.0,
    (0, 2): 6.0
}

# Create dual values for each node
# Using values that satisfy the dual feasibility condition
duals = {
    0: 2.0,
    1: 1.5,
    2: 1.0
}

ARGS = {
    'G': G,
    'duals': duals
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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_matching Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/MinWeightPerfectMatching.py
code served (permissive licence) · get_code("e530beae4bbad15a")
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.

class Graph:
    def __init__(self, num_vertices, edges):
        self.U = list(range(num_vertices))
        self.Adj = {i: set() for i in range(num_vertices)}
        for u, v in edges:
            self.Adj[u].add(v)
            self.Adj[v].add(u)

G = Graph(
    num_vertices=4,
    edges=[(0, 1), (1, 2), (2, 3), (0, 3)]
)

M = [(0, 1), (2, 3)]

ARGS = {
    "G": G,
    "M": M
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
l1_distance Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/KMedian.py
code served (permissive licence) · get_code("8689b1b268903675")
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 torch

torch.manual_seed(0)

# p and q are dicts with keys mapping to numeric values
# The function iterates over p.keys() and computes abs(p[v] - q[v]) for each key
# So we need two dicts with the same keys and numeric values

p = {
    'a': 1.5,
    'b': 2.3,
    'c': 0.7,
    'd': 3.2
}

q = {
    'a': 1.2,
    'b': 2.8,
    'c': 0.5,
    'd': 2.9
}

ARGS = {
    'p': p,
    'q': q
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
median Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/UtilityFunctions.py
code served (permissive licence) · get_code("44abf67f662415da")
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 int, ndim 0, dtype family int, 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 torch
import numpy as np

def median(L):
    n = len(L)
    if n % 2 == 0:
        idx = n // 2 - 1
    else:
        idx = n // 2
    return sorted(L)[idx]

# The function takes a list L and finds the median
# It uses len(L), modulo operator, integer division, sorted(), and indexing
# L should be a list of comparable elements (numbers)

torch.manual_seed(0)

# Create a simple list of numbers for testing
L = [5, 2, 8, 1, 9, 3, 7]

ARGS = {
    "L": L
}
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 int, ndim 0, dtype family int, 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
median_duals Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/UtilityFunctions.py
code served (permissive licence) · get_code("089f383224153f3d")
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 dict. 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)

# Analyze the function:
# median_duals takes dual_list parameter
# It accesses dual_list[0].keys() - so first element must be dict-like
# It iterates over keys V and accesses d[v] for each d in dual_list
# So dual_list is a list of dicts with the same keys
# The values d[v] are passed to median() which calls sorted() on them
# So values should be numeric (int or float)

# Create a simple list of dicts with numeric values
dual_list = [
    {'a': 5, 'b': 2, 'c': 8, 'd': 1},
    {'a': 3, 'b': 7, 'c': 4, 'd': 6},
    {'a': 9, 'b': 1, 'c': 2, 'd': 5},
]

ARGS = {
    'dual_list': dual_list
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
taxicab_dist Ran
ran on a synthesized input
tlavastida/PredictionPortfolios/geometric_type_model_exp.py
code served (permissive licence) · get_code("acc65c6cfa2dfaa4")
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

# Create small distinct numpy arrays for x and y
x = np.array([1.0, 2.0, 3.0, 4.0])
y = np.array([5.0, 6.0, 7.0, 8.0])

ARGS = {
    "x": x,
    "y": y
}
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
check_matches Not yet run
unverified (harvested, no recorded run)
tlavastida/PredictionPortfolios/MaxBipartiteMatching.py
code served (permissive licence) · get_code("611928045ad80095")
How it ran

no invocation recorded.

euclid_dist Not yet run
unverified (harvested, no recorded run)
tlavastida/PredictionPortfolios/geometric_type_model_exp.py
code served (permissive licence) · get_code("46253cb3bea7318d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 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 12 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-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

The research area of algorithms with predictions has seen recent success showing how to incorporate machine learning into algorithm design to improve performance when the predictions are correct, while retaining worst-case guarantees when they are not. Most previous work has assumed that the algorithm has access to a single predictor. However, in practice, there are many machine learning methods available, often with incomparable generalization guarantees, making it hard to pick a best method a priori. In this work we consider scenarios where multiple predictors are available to the algorithm and the question is how to best utilize them. Ideally, we would like the algorithm's performance to depend on the quality of the best predictor. However, utilizing more predictions comes with a cost, since we now have to identify which prediction is the best. We study the use of multiple predictors for a number of fundamental problems, including matching, load balancing, and non-clairvoyant scheduling, which have been well-studied in the single predictor setting. For each of these problems we introduce new algorithms that take advantage of multiple predictors, and prove bounds on the resulting performance.

For agents

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

get_harvested_code_for_paper("2210.12438")
get_code_for_paper("2210.12438")
have("2210.12438")

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

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

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

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

Connect an agent — have() is free.