TL;DR
When making decisions under uncertainty—like deciding how much power a grid should generate tomorrow based on weather forecasts—a classic trick is to weigh past historical scenarios by how similar they are to today. This paper breaks open that black box, showing that how you represent and compare "today" to the past is an explicit design choice. By plugging hidden-layer embeddings from neural networks, learned distance metrics, or even the internal routing paths of decision trees into optimization models, you can dramatically improve real-world decisions without ever changing how your predictive models are trained.
What Problem Does This Paper Address?
Imagine you’re managing inventory or scheduling power plants. You don't know tomorrow's exact demand, so you minimize expected costs by averaging over historical scenarios—a workhorse technique called Sample Average Approximation (SAA).
Because you have context (like weather forecasts or recent sales), contextual stochastic optimization upgrades this by giving higher weights to historical days that look like today. Traditionally, algorithms like $k$-nearest neighbors or random forests are used to spit out these scenario weights directly, or we measure Euclidean distance in the raw feature space.
The catch? Raw feature distances fall apart when relationships are nonlinear or buried in noise, and many powerful modern architectures (like deep neural networks) don't naturally output scenario weights. The authors ask: what happens if we decouple learning a representation of the context from calculating scenario weights?
Methods
The authors introduce representation-weighted contextual SAA, a modular "estimate-then-optimize" framework that splits weight generation into three distinct choices:
- Feature Representation ($\phi$): Mapping raw context vectors into a new space or structure—using PCA, supervised kernel PCA (KSPCA), neural network hidden layers, or time-series architectures like TSMixer.
- Dissimilarity ($d$): Choosing how to measure distance in that space. Instead of standard Euclidean distance, you can use metric learning (like MLKR) or count the number of edges separating leaves along a decision tree's routing path.
- Weight Construction: Translating those dissimilarities into probabilities via a kernel function (like a Gaussian kernel) or nearest neighbors.
Crucially, this setup seamlessly pairs with residual-based SAA—a technique where historical scenarios are first shifted ("recentered") using a point prediction of tomorrow's mean outcome, and representation weights then handle any remaining differences in variance, skewness, or tails. The authors also back this up mathematically, proving finite-sample error bounds and conditions for statistical consistency.
Datasets
- Synthetic Benchmarks: Simulated data for a two-stage manufacturing capacity-expansion problem (4 machines, 4 products). The authors test linear and nonlinear data-generating processes where 4 true demand factors are mixed with up to 1,020 noise variables, including setups with context-dependent variance, positive shocks, and bimodal distributions.
- Real-World Electricity Dispatch: Hourly load and temperature data from GEFCom2012 paired with grid network and quadratic cost parameters from MATPOWER (
case30), evaluated on day-ahead generation scheduling over 181 days in 2008.
Key Insights and Ideas
- One fitted model, multiple uses: You don't need end-to-end "decision-focused" retraining to get great prescriptions. A single trained forecasting network (like TSMixer) can simultaneously supply point predictions to recenter scenarios and hidden-layer embeddings to weight them.
- Rethinking decision trees: Standard tree prescriptions only assign weights to historical data landing in the exact same terminal leaf. By instead measuring distance along the tree's routing path, nearby leaves can share statistical strength—consistently improving single-tree decisions while keeping the tree's interpretable structure intact.
- Geometry beats dimensionality reduction: Even when the representation dimension equals the raw feature dimension (no compression at all), reshaping how contexts are compared via neural embeddings or metric learning massively outperforms raw feature distances.
- Weights catch what point predictions miss: Adjusting scenarios by subtracting predicted means works wonders when noise is uniform. When uncertainty changes shape or variance across contexts, representation-based weights clean up the distributional differences left behind.
Key Results
Performance is measured via the normalized optimality gap, where $100\%$ equals naive unweighted SAA and $0\%$ equals an impossible-to-beat oracle (or perfect foresight in the grid task).
- Synthetic Nonlinear Tasks: Standard PCA and single decision trees hover near $100\%$ (no better than ignoring context), and raw feature weighting sits above $80\%$. In contrast, metric learning (MLKR) and Neural representations slash the gap to roughly $25\%\text{--}38\%$.
- High-Dimensional Resilience: Even without dimensionality reduction ($16$ representation dimensions for $16$ raw features), MLKR and Neural hold gaps near $11\%$, compared to $46\%$ for raw Euclidean weighting.
- Real-World Power Grid Dispatch: Using unadjusted historical scenarios, domain-specific representations from TSMixer drop the optimality gap from $100\%$ down to $21.55\%$ (beating raw features at $54.37\%$ and Random Forests at $30.95\%$). When combined with TSMixer residual recentering, Neural representation weights push the gap down further to $13.12\%$, outperforming equal-weighted residual SAA ($15.28\%$).
Limitations and Future Work
- Curse of extreme noise: In nonlinear synthetic tests, when pure noise variables scaled up to $\sim 1,000$ dimensions while keeping training data fixed at $1,000$ samples, all learned representation methods eventually degraded back to naive SAA levels.
- Theoretical vs. practical assumptions: The statistical consistency proofs assume independent and identically distributed (i.i.d.) data with separate fitting and SAA splits, whereas real-world applications like electricity dispatch involve temporal dependence and overlapping rolling windows (though empirical performance remained strong). Also, neural representations were only evaluated empirically rather than theoretically bounded.
- Future directions: The authors suggest exploring lightweight fine-tuning of pretrained representations, designing unsupervised/statistical objectives tailored to capture optimization-relevant tail behaviors, and bridging this representation lens with decision-focused (end-to-end) learning.
Summary updated