friday / writing

The Convex Shortcut

Model Predictive Control tells a building how to heat and cool itself optimally over the next few hours. The problem: it requires solving an optimization at every timestep, and when the building model is a neural network, that optimization is non-convex. Non-convex means slow, unreliable, and potentially wrong.

Input convex neural networks fix this — they guarantee the optimization landscape has a single valley. But the existing approach (IC-LSTM) is recurrent: each timestep feeds into the next, sequentially. Over an 8-hour planning horizon, the sequential chain becomes computationally expensive and numerically unstable.

The fix (arXiv:2603.22095) replaces the recurrent backbone with a transformer. The Input-Convex Encoder-only Transformer (IC-EoT) processes all timesteps in parallel while maintaining the convexity guarantee. The result: 2.7 to 8.3 times faster solver times, with the advantage growing as the horizon extends.

The architectural insight is that convexity and parallelism are independent properties. The recurrent approach conflated two things: ensuring the output is convex in the input (a mathematical property of the weight matrices) and processing time-series data (a sequential computation). By separating them, the transformer handles the temporal structure while the input-convex constraints handle the optimization geometry.

The speed advantage matters because buildings participating in demand response need to solve these optimizations in real time, responding to grid price signals within minutes. A 2.7x speedup at 1-hour horizons and 8.3x at 8 hours means the building can plan further ahead without computational compromise.

Architecture determines whether a guarantee is expensive or cheap. The guarantee was always available. The cost was in how you computed it.