Papers › Neur2SP: Neural Two-Stage Stochastic Programming

Neur2SP: Neural Two-Stage Stochastic Programming

20 May 2022arXiv:2205.12006archive 2025-07-28

Justin Dumouchelle, Rahul Patel, Elias B. Khalil, Merve Bodur

Stochastic Programming is a powerful modeling framework for decision-making under uncertainty. In this work, we tackle two-stage stochastic programs (2SPs), the most widely used class of stochastic programming models. Solving 2SPs exactly requires optimizing over an expected value function that is computationally intractable. Having a mixed-integer linear program (MIP) or a nonlinear program (NLP) in the second stage further aggravates the intractability, even when specialized algorithms that exploit problem structure are employed. Finding high-quality (first-stage) solutions -- without leveraging problem structure -- can be crucial in such settings. We develop Neur2SP, a new method that approximates the expected value function via a neural network to obtain a surrogate model that can be solved more efficiently than the traditional extensive formulation approach. Neur2SP makes no assumptions about the problem structure, in particular about the second-stage problem, and can be implemented using an off-the-shelf MIP solver. Our extensive computational experiments on four benchmark 2SP problem classes with different structures (containing MIP and NLP second-stage problems) demonstrate the efficiency (time) and efficacy (solution quality) of Neur2SP. In under 1.66 seconds, Neur2SP finds high-quality solutions across all problems even as the number of scenarios increases, an ideal property that is difficult to have for traditional 2SP solution techniques. Namely, the most generic baseline method typically requires minutes to hours to find solutions of comparable quality.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2205.12006")

Code

Syntology Ran 5 of 10 code samples harvested from 3 repositories linked to this paper; 5 have no recorded run. Of those that ran: 2 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 2 ran; community (archive-listed): 5 samples from 2 repositories, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

khalil-research/neur2sp officialmentioned in papermentioned on GitHub report
Lycle/ICNN2SP mentioned on GitHub report
khalil-research/neur2bilo mentioned on GitHubpytorch report
khalil-research/neur2ro mentioned on GitHubpytorch report
lily-x/combinatorial-rmab mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 5 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · fixture could not drive it
3ran
5unverified

Licence: 10 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_nn_e_function_call khalil-research/Neur2SP/runner.py official repository ran · fixture could not drive it no licence file found · pointer only · fbd59d0d6ff55995 · report
get_nn_p_function_call khalil-research/Neur2SP/runner.py official repository ran · fixture could not drive it no licence file found · pointer only · 4434e1b767639860 · report
ReLUNetworkPerScenario khalil-research/neur2sp/nsp/models/pytorch_model.py official repository unverified no licence file found · pointer only · 7226b6dce8698f76 · report
ReLUNetworkPerScenarioModel khalil-research/neur2sp/nsp/models/pytorch_model.py official repository unverified no licence file found · pointer only · 0d2a0ec787332480 · report
get_scenario_and_test_sets khalil-research/Neur2SP/runner.py official repository unverified no licence file found · pointer only · 1b5536301d592aac · report
ICNNExpected Lycle/ICNN2SP/nsp/models/pytorch_model.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 8ad99dca43244bf8 · report
LossFunction Lycle/ICNN2SP/nsp/models/pytorch_model.py community (archive-listed) ran no licence file found · pointer only · cb36752969868b55 · report
SetInstanceEncodingNetwork khalil-research/neur2bilo/blo/models/models.py community (archive-listed) ran no licence file found · pointer only · 2ae6b6bd81f551f4 · report
ICNNExpectedModel Lycle/ICNN2SP/nsp/models/pytorch_model.py community (archive-listed) unverified no licence file found · pointer only · da274afd52fa3cc1 · report
Model Lycle/ICNN2SP/nsp/models/pytorch_model.py community (archive-listed) unverified no licence file found · pointer only · 57521b4f46b20b71 · report

Tasks

Decision MakingDecision Making Under UncertaintyVocal Bursts Valence Prediction

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections