Stochastic Discrete Descent
Stochastic optimization encompasses a class of mathematical optimization problems in which the objective function varies due to uncertainty. Given the irreducible uncertainty of the future, nearly all supply chain decision-making problems qualify as stochastic optimization problems. A stochastic optimizer is a core component of supply chain optimization: it uses probabilistic forecasts as inputs and returns risk-adjusted, optimized decisions.
Lokad has pioneered a specific approach to such optimization, known as the stochastic discrete descent. This programming paradigm specifically addresses the complexity of supply chain problems that involve uncertainty, building on the broader concept of stochastic optimization to deliver robust decisions at scale.

Technology overview
Since 2016, Lokad has predominantly optimized supply chains through probabilistic forecasts. Without probabilistic forecasts, optimized decisions inevitably become fragile, susceptible to even slight variations in demand or lead time. In contrast, decisions optimized against probabilistic forecasts are robust. Although robust decisions can be computed using relatively simple “greedy” heuristics, those heuristics often fail to handle more complex constraints.
In 2021, Lokad introduced its first general-purpose stochastic optimization technology, which we call stochastic discrete descent. This innovation tackles the shortcomings of greedy heuristics when confronted with non-linear supply chain situations. Conceptually, the Supply Chain Scientists at Lokad design a data processing pipeline with the following steps:
- Prepare the historical data.
- Generate probabilistic forecasts.
- Produce robust decisions.
Historical data is prepared using Envision’s general data engineering capabilities, Envision being Lokad’s domain-specific language. Probabilistic forecasts are then produced through differentiable programming, a paradigm ideally suited for probabilistic modeling—recognized as a first-class citizen in Envision. Lastly, robust decisions are derived using stochastic discrete descent, delivered as a programming paradigm within Envision.
Ultimately, steps (1), (2), and (3) are all executed within Envision.
Traditional solvers and their limits
Mathematical optimization is a well-established area within computer science. Most software products dedicated to mathematical optimization are packaged as solvers. Each solver typically offers its own domain-specific language (DSL), enabling users to mathematically optimize a specific class of problems. While many solvers exist on the market, including several open-source options, none adequately address the realities of supply chain problems.
-
Very few solvers handle the stochastic case. Almost all existing solutions focus on the deterministic scenario, where uncertainty is absent. Unfortunately, one cannot simply “repurpose” a deterministic solver for stochastic cases without introducing an unacceptable level of approximation.
-
Most solvers are not sufficiently scalable. Supply chain problems can grow extremely large: one million SKUs can translate into tens of millions of variables once modeled for optimization. Partitioning the supply chain just to accommodate the solver is not viable. The solver must natively handle tens of millions of variables.
-
Many solvers lack adequate expressiveness. The objective function often cannot be assumed to be linear, quadratic, or even convex. It is unacceptable to distort the problem under simplistic mathematical assumptions merely to fit solver constraints. Consequently, solvers must offer highly expressive programming paradigms.
After reviewing the existing landscape of mathematical optimization tools, we concluded that developing our own technology was the only viable solution.
Under the hood
Lokad takes a somewhat unorthodox approach to stochastic optimization. Rather than packaging the technology as a conventional solver, we tackle the problem through a dedicated programming paradigm known as stochastic discrete descent. This approach is crucial for leveraging the insights and expertise of our Supply Chain Scientists.
This programming paradigm leverages stochastic gradient descent (SGD) because it scales extremely well—by orders of magnitude beyond traditional non-convex optimization methods. However, SGD is not naturally suited to discrete problems (and virtually all supply chain problems are discrete). Since replenishment, production, or transfer quantities are integers, fractional outcomes are not meaningful.
To overcome this limitation, the stochastic discrete descent introduces an alternative differentiable representation of the original problem. This representation features a larger set of continuous, real-valued dimensions and effectively serves as a parameterization of the discrete solution. Unlike the original discrete model—where gradients degenerate to zero due to integer effects—this alternative yields non-degenerate gradients suitable for SGD.
The main limitation of stochastic discrete descent is its inability to address truly hard combinatorial problems, where solutions are so heavily constrained that they can’t be iterated upon through any kind of direct descent. Such problems require latent optimization, a later optimization technique also developed by Lokad.
Examples
Optimizing decisions in the face of an uncertain future is challenging. Many supply chain scenarios demand stochastic optimization for a proper resolution.
Fashion store replenisments
Consider a retail network replenishing stores with specific assortment objectives. For instance, ensuring all sizes are available for a garment is often more critical than offering every color—especially if some colors are very similar. If a customer cannot find the right size, they leave. Conversely, stocking only “popular” or neutral colors makes the store less visually appealing, reducing its overall attractiveness. Hence, “brightly colored” items must be included, even though their sales volume may be lower, and their total store presence must remain carefully balanced.
Without the assortment perspective, store dispatching can be handled with a simple greedy optimization, selecting each additional unit based on diminishing economic returns. This greedy approach works when items are treated as independent. However, once assortment goals are introduced, interdependencies arise, and adding one extra unit affects the desirability of other products—due to size and color relationships as described above.
Through stochastic discrete descent, Lokad delivers robust dispatch plans that optimize the classic trade-off between overstock and stockout costs while simultaneously addressing additional economic factors—such as ensuring the presence (or absence) of specific colors or sizes—to enhance the overall store appeal. Furthermore, because this optimization is performed at the network level, each unit allocated to a particular store is evaluated against the needs of all other stores.
Repairs of aircraft engines
Now consider the challenge of repairing aircraft engines. When an engine arrives, it is unclear which parts will be required because its bill of materials varies based on its specific condition—a genuinely stochastic bill of materials. Moreover, due to the engine’s layout (essentially a series of concentric layers), the earliest parts identified as needed during disassembly end up being required last during reassembly. As the entire repair cycle can exceed two months, maintaining those early parts in stock might not be immediately critical; they only become essential at the end of the process. Conversely, parts located in the engine’s innermost layers are needed right away, as the reassembly cannot continue without them.
A stochastic optimization—specifically, stochastic discrete descent—enables robust prioritization of part investments, helping the MRO (Maintenance, Repair, and Overhaul) provider minimize aircraft engine repair times. For each item to be purchased, the core question becomes: “Given this budget, how many days of repair delay can I avoid?” In this way, part purchases are strategically prioritized to reduce downtime—crucial since the MRO is paid to deliver serviceable engines, and any delay is a direct loss for both the MRO and the airline. A simple greedy approach fails here because dependencies between parts can trigger cascading delays. Conversely, if the MRO decides not to stock certain parts, it might not affect the overall timeline if those parts can be sourced in parallel while waiting for longer-lead-time components. The stochastic discrete descent do consider these interdependencies and parallel sourcing opportunities.
Constrained multi-sourcing
Now consider replenishment with multiple constraints and several sourcing options. Suppliers impose MOQs (minimum order quantities), which may be stated in units (for the entire order) or in monetary terms (for the total order). Additionally, full containers should be targeted to reduce transportation costs. Products can be sourced locally—leading to shorter lead times and lower MOQs but higher unit costs—or from distant suppliers, which offer lower unit costs but involve longer lead times and higher MOQs. Although the company may order multiple containers weekly, any specific product typically appears in no more than one container per month.
Stochastic optimization—with stochastic discrete descent as the enabling technique—addresses the fact that placing a purchase order today may prevent placing another order for the same product tomorrow. No single product typically justifies a full container on its own, so even top-selling items must be bundled with others. Consequently, if an item unexpectedly runs out of stock while significant inventory remains for most other bundle-eligible products, there is no cost-effective option to reorder that specific item earlier. The optimization process evaluates the long-term ramifications of each order—such as scheduling a full container—and accounts for how long it will be until all involved products can feasibly be replenished again under the same constraints.