SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.07633 · NeurIPS · 2024

Benchmarking PtO and PnO Methods in the Predictive Combinatorial Optimization Regime

Junchi Yan, Runzhong Wang, Yang Li, Lei Chen, Haoyu Geng, Yang Wang, Hang Ruan

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure 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/2311.07633.json · badge: /api/ran/2311.07633.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
Thinklab-SJTU/PredictiveCO-Benchmark canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
collect_results Ran
ran, honoured the contract we drafted
Thinklab-SJTU/PredictiveCO-Benchmark/rethink_exp/collect_results.py
code served (permissive licence) · get_code("dde3bb6970d2d582")
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 DataFrame. 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 os
import numpy as np
import pandas as pd
import tempfile
import shutil

# Create a temporary directory structure with mock log files
temp_dir = tempfile.mkdtemp()
saved_records_dir = os.path.join(temp_dir, 'saved_records')

# Create directory structure and log files
data_name = 'test_data'
prefix_name = 'test_prefix'
model_names = ['model_a', 'model_b', 'model_c']

for model_name in model_names:
    model_dir = os.path.join(saved_records_dir, data_name, model_name, prefix_name)
    os.makedirs(model_dir, exist_ok=True)
    
    # Create a mock log file with results
    log_path = os.path.join(model_dir, 'log.txt')
    with open(log_path, 'w') as f:
        f.write('some log content here\n')
        f.write('epoch 10  metric1 0.85  metric2 0.90  metric3 0.88  metric4 0.92\n')

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

# Define arguments for collect_results function
ARGS = {
    'data_name': 'test_data',
    'prefix_name': 'test_prefix',
    'model_names': ['model_a', 'model_b', 'model_c']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
compare_result Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Thinklab-SJTU/PredictiveCO-Benchmark/openpto/expmanager/utils_manager.py
code served (permissive licence) · get_code("770d9d944eb0dd6d")
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 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - metrics_idx is a dict with nested 'eval' key
# - metrics_idx['eval']['sense'] is a scalar (used in multiplication)
# - metrics_idx['eval']['value'] is a tensor with .mean() method
# - best is indexable (best[0]) and best[0] has .mean() method
# - best[0] should be a tensor

metrics_idx = {
    'eval': {
        'sense': 1,  # scalar sense value
        'value': torch.tensor([0.5, 0.7, 0.6, 0.8])  # tensor with mean() method
    }
}

best = [torch.tensor([0.4, 0.6, 0.5, 0.7])]  # list containing a tensor

ARGS = {
    'metrics_idx': metrics_idx,
    'best': best
}
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 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
get_results Ran
ran, honoured the contract we drafted
Thinklab-SJTU/PredictiveCO-Benchmark/rethink_exp/collect_results.py
code served (permissive licence) · get_code("411c0a5ba07cc36a")
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 (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 os
import numpy as np
import tempfile
import shutil

# Create a temporary directory structure to simulate the saved_records
temp_dir = tempfile.mkdtemp()
records_dir = os.path.join(temp_dir, 'saved_records')
os.makedirs(records_dir, exist_ok=True)

# Create the nested directory structure: saved_records/data_name/model_name/prefix_name/
data_name = 'test_data'
model_name = 'test_model'
prefix_name = 'test_prefix'

nested_path = os.path.join(records_dir, data_name, model_name, prefix_name)
os.makedirs(nested_path, exist_ok=True)

# Create a log.txt file with valid content
log_file_path = os.path.join(nested_path, 'log.txt')
with open(log_file_path, 'w') as f:
    f.write("some earlier log lines\n")
    f.write("epoch 1  loss 0.5  acc 0.7  prec 0.8  rec 0.9\n")

# Change to the temp directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'data_name': data_name,
    'model_name': model_name,
    'prefix_name': prefix_name,
}
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 (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
to_array Ran
ran, honoured the contract we drafted
Thinklab-SJTU/PredictiveCO-Benchmark/openpto/method/utils_method.py
code served (permissive licence) · get_code("6e441f6e9d40e483")
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
import torch

torch.manual_seed(0)

# Test case 1: torch tensor
tensor_input = torch.randn(2, 4)

# Test case 2: list of torch tensors
list_of_tensors = [torch.randn(2, 4), torch.randn(3, 5)]

# Test case 3: list of numpy arrays
list_of_arrays = [np.random.randn(2, 4), np.random.randn(3, 5)]

# Test case 4: plain numpy array or other type
numpy_array = np.random.randn(2, 4)

# The function takes a single parameter Y
# We'll test with a torch tensor as the primary case
ARGS = {
    "Y": tensor_input
}
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 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
to_device Ran
ran, honoured the contract we drafted
Thinklab-SJTU/PredictiveCO-Benchmark/openpto/method/utils_method.py
code served (permissive licence) · get_code("b83b4415735acacd")
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 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 torch

torch.manual_seed(0)

# Test case 1: Single tensor
tensor_obj = torch.randn(2, 4)

# Test case 2: List of tensors
list_obj = [torch.randn(2, 4), torch.randn(3, 5)]

# Test case 3: Non-tensor object (should pass through unchanged)
other_obj = {"key": "value"}

# Device to move to
device = "cpu"

ARGS = {
    "obj": tensor_obj,
    "device": device,
}
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 Tensor, 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
to_tensor Ran
ran, honoured the contract we drafted
Thinklab-SJTU/PredictiveCO-Benchmark/openpto/method/utils_method.py
code served (permissive licence) · get_code("9af2e76f0f0b4f60")
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 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 torch
import numpy as np

torch.manual_seed(0)

# Test case 1: torch tensor input
tensor_input = torch.randn(2, 4)

# Test case 2: list of torch tensors
list_of_tensors = [torch.randn(2, 4), torch.randn(3, 4)]

# Test case 3: list of numpy arrays
list_of_arrays = [np.random.randn(2, 4).astype(np.float32), np.random.randn(3, 4).astype(np.float32)]

# Test case 4: numpy array
numpy_input = np.random.randn(2, 4).astype(np.float32)

# We'll use the numpy array case as the primary test
ARGS = {
    "Y": numpy_input
}
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 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
get_logger Not yet run
unverified (harvested, no recorded run)
Thinklab-SJTU/PredictiveCO-Benchmark/openpto/config/utils_conf.py
code served (permissive licence) · get_code("5d306d2258b565c1")
How it ran

no invocation recorded.

Also present in other papers' code

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

Predictive combinatorial optimization, where the parameters of combinatorial optimization (CO) are unknown at the decision-making time, is the precise modeling of many real-world applications, including energy cost-aware scheduling and budget allocation on advertising. Tackling such a problem usually involves a prediction model and a CO solver. These two modules are integrated into the predictive CO pipeline following two design principles: "Predict-then-Optimize (PtO)", which learns predictions by supervised training and subsequently solves CO using predicted coefficients, while the other, named "Predict-and-Optimize (PnO)", directly optimizes towards the ultimate decision quality and claims to yield better decisions than traditional PtO approaches. However, there lacks a systematic benchmark of both approaches, including the specific design choices at the module level, as well as an evaluation dataset that covers representative real-world scenarios. To this end, we develop a modular framework to benchmark 11 existing PtO/PnO methods on 8 problems, including a new industrial dataset for combinatorial advertising that will be released. Our study shows that PnO approaches are better than PtO on 7 out of 8 benchmarks, but there is no silver bullet found for the specific design choices of PnO. A comprehensive categorization of current approaches and integration of typical scenarios are provided under a unified benchmark. Therefore, this paper could serve as a comprehensive benchmark for future PnO approach development and also offer fast prototyping for application-focused development. The code is available at https://github.com/Thinklab-SJTU/PredictiveCO-Benchmark.

For agents

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

get_harvested_code_for_paper("2311.07633")
get_code_for_paper("2311.07633")
have("2311.07633")

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

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

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

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

Connect an agent — have() is free.