How Optimization and Forecasting Power Amazon Fulfillment

Peter Bubenik ยท Amazon Research Publication ยท ยท Source
Image for Beyond the harness: End-to-end optimization of context artifacts for enterprise Text-to-SQL

What the Student Should Know, Understand, or Be Able to Do

After studying this material, the student should be able to:

  1. Understand the core scientific domains required for large-scale fulfillment optimization
  2. Identify and differentiate key optimization and forecasting techniques used in real-world systems
  3. Apply conceptual knowledge to understand how these methods solve practical supply chain problems
  4. Evaluate tradeoffs between cost, speed, accuracy, and capacity in optimization contexts

Step-by-Step Study Material

๐Ÿงฑ STEP 1: The Big Picture โ€” What Problem Are We Solving?

The Core Challenge

Large-scale fulfillment networks (like Amazon's) must answer questions like:

  • Which warehouse ships your order?
  • Which truck carries it?
  • How many workers are needed tomorrow?
  • How do we keep delivery promises to hundreds of millions of customers?

Why This Is Hard

DimensionScale
Orders processedHundreds of millions daily
Decision speedMillions of shipments per hour
Financial impactBillions in operational spend
VariablesCost, speed, capacity, demand uncertainty

Key Insight: No human team can manually make these decisions. Mathematical models and machine learning must do it automatically, reliably, and optimally.


๐Ÿ”ฌ STEP 2: The Two Scientific Pillars

The field splits into two complementary disciplines. Think of them as:

PILLAR 1: Optimization          PILLAR 2: Forecasting
"What should we do NOW          "What will HAPPEN so we
given what we know?"            can plan ahead?"

Pillar 1 โ€” Large-Scale Optimization and Planning

Definition: Finding the best possible decision among millions of options, subject to constraints.

Real Example:

Assign 10 million orders to 200 warehouses, minimizing total shipping cost while ensuring no warehouse exceeds capacity and all delivery promises are kept.

Core Techniques:

๐Ÿ“ Linear Programming (LP)

  • Optimize a linear objective function subject to linear constraints
  • Example: Minimize cost = ฮฃ(cost_ij ร— x_ij) where x_ij = units shipped from warehouse i to customer j
  • Strength: Solvable efficiently even at large scale

๐Ÿ”ข Mixed Integer Programming (MIP)

  • Like LP, but some variables must be whole numbers (integers)
  • Example: "Do we open this warehouse? Yes or No" โ€” binary decision
  • Strength: Models real-world yes/no decisions
  • Challenge: Much harder to solve than LP

๐Ÿงฉ Decomposition Methods

  • Break one massive problem into smaller, manageable subproblems
  • Solve subproblems independently, then coordinate solutions
  • Why needed: A single MIP with millions of variables is computationally intractable
LARGE PROBLEM
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Master Problem (coordinates)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚
  โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
  โ–ผ         โ–ผ
Sub 1     Sub 2  ... Sub N
(region)  (region)   (region)

๐Ÿ”„ Combinatorial Optimization

Specific problem types that appear constantly in logistics:

Problem TypeFulfillment Example
AssignmentWhich warehouse handles which order?
SchedulingWhen does each truck depart?
Network FlowsHow do goods move through the distribution network?

โš–๏ธ Multi-Objective Optimization

  • Real problems have competing goals โ€” you cannot perfectly optimize all at once
  • Example: Faster delivery costs more money
  • Solution: Find the Pareto Frontier โ€” the set of solutions where you cannot improve one objective without worsening another
Cost
 โ–ฒ
 โ”‚  โ— (cheap but slow)
 โ”‚    โ—
 โ”‚      โ—
 โ”‚        โ— (fast but expensive)
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Speed
    Pareto Frontier

Practical Skill: Being able to explain a Pareto frontier to a non-technical operations leader is explicitly valued in this field.


Pillar 2 โ€” Demand Forecasting & Predictive ML

Definition: Using historical data and contextual signals to predict future demand so the network can prepare.

Real Example:

Predict how many orders will arrive at each warehouse next Tuesday, accounting for a weather event and an ongoing sale.

๐Ÿ“ˆ Time-Series Forecasting

  • Data ordered by time: sales yesterday, last week, last year
  • Goal: Predict future values
  • Key challenge: Demand is seasonal, noisy, and affected by external events

๐ŸŒ Contextual Information Integration

Forecasts improve when you incorporate external signals:

Signal TypeExample
WeatherStorm reduces deliveries in region X
Sales/PromotionsPrime Day spikes demand 3x
Order PropertiesLarge items need different routing

๐Ÿ“Š Probabilistic Forecasting & Uncertainty Quantification

  • Instead of predicting a single number, predict a distribution
  • Example: "Demand will be 50,000 units ยฑ 8,000 with 90% confidence"
  • Why critical: Planning systems need to know the risk, not just the average
Traditional:  Demand = 50,000  โ† single point, dangerous

Probabilistic:
     โ”‚    โ–ˆโ–ˆโ–ˆโ–ˆ
     โ”‚   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
     โ”‚  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
     โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Demand
        40k  50k  60k

๐Ÿค– Generative AI Models for Forecasting

  • Modern large-scale forecasting increasingly uses transformer-based architectures
  • These models learn patterns across thousands of time series simultaneously
  • Advantage: Transfer learning โ€” patterns learned in one region help forecast another

๐Ÿ” Causal Inference

  • Correlation โ‰  Causation โ€” critical distinction in operations
  • Example: Ice cream sales and drowning rates are correlated (both increase in summer) but one doesn't cause the other
  • Spatiotemporal Causal Modeling: Understanding cause-and-effect relationships across geography and time
  • Offline Policy Evaluation: Testing whether a new decision policy would have worked better, using historical data โ€” without running a live experiment

โš™๏ธ STEP 3: How Optimization and Forecasting Work Together

These two pillars are not independent โ€” they form a feedback loop:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                             โ”‚
โ”‚  FORECAST                                   โ”‚
โ”‚  "We expect 2M orders in region A           โ”‚
โ”‚   with high uncertainty"                    โ”‚
โ”‚           โ”‚                                 โ”‚
โ”‚           โ–ผ                                 โ”‚
โ”‚  OPTIMIZATION                               โ”‚
โ”‚  "Given that forecast + uncertainty,        โ”‚
โ”‚   assign capacity to minimize cost          โ”‚
โ”‚   while protecting delivery promises"       โ”‚
โ”‚           โ”‚                                 โ”‚
โ”‚           โ–ผ                                 โ”‚
โ”‚  EXECUTION                                  โ”‚
โ”‚  "Actual orders arrive"                     โ”‚
โ”‚           โ”‚                                 โ”‚
โ”‚           โ–ผ                                 โ”‚
โ”‚  FEEDBACK โ†’ Improve forecast model          โ”‚
โ”‚                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ STEP 4: The Applied Scientist Workflow

Understanding the day-to-day process is as important as the theory:

Phase 1: Problem Formulation

  • Translate a business question into a mathematical model
  • Define: objective function, decision variables, constraints
  • Example: "Minimize total shipping cost" โ†’ formal LP/MIP formulation

Phase 2: Prototyping

  • Implement in Python using real data
  • Use optimization solvers (e.g., Gurobi, CPLEX, OR-Tools)
  • Run on a subset of data first

Phase 3: Experimentation

  • Test against production-scale datasets
  • Measure performance: solution quality, computation time, cost savings
  • Iterate rapidly

Phase 4: Production Validation

  • Collaborate with engineers to integrate into live systems
  • Validate that the model behaves correctly at full scale
  • Monitor ongoing performance

Phase 5: Communication

  • Present results to non-technical stakeholders
  • Translate mathematical findings into business recommendations

๐Ÿ“š STEP 5: Key Concepts Summary Table

ConceptWhat It IsWhy It Matters
Linear Programming (LP)Optimize linear objective with linear constraintsFoundation of large-scale optimization
Mixed Integer Programming (MIP)LP with integer/binary variablesModels real yes/no decisions
Decomposition MethodsBreak large problems into subproblemsMakes intractable problems solvable
Network FlowsOptimize movement through a graphCore to logistics routing
Pareto FrontierSet of non-dominated tradeoff solutionsCommunicates cost-speed tradeoffs
Time-Series ForecastingPredict future from historical sequencesEnables proactive planning
Probabilistic ForecastingPredict distributions, not point estimatesQuantifies risk for planners
Causal InferenceIdentify true cause-effect relationshipsPrevents misleading correlations
Offline Policy EvaluationTest policies on historical dataSafe experimentation without live risk
Multi-Armed BanditsExplore/exploit tradeoff in sequential decisionsAdaptive decision-making under uncertainty

โœ… STEP 6: Self-Assessment Questions

Test your understanding:

  1. Why is MIP harder to solve than LP? (Answer: Integer constraints break the convexity that makes LP efficiently solvable)

  2. What is the difference between a point forecast and a probabilistic forecast, and why does it matter for planning? (Answer: Point forecasts give one number; probabilistic forecasts give a distribution, allowing planners to account for uncertainty and risk)

  3. Explain the Pareto frontier in plain language to a non-technical manager. (Answer: It's the set of best possible options โ€” you can't get faster delivery without paying more, and you can't cut costs without slowing delivery. The frontier shows all the best tradeoffs available)

  4. Why is causal inference important in demand forecasting? (Answer: Correlations can be misleading; understanding true causes prevents wrong decisions, e.g., attributing demand spikes to the wrong factor)

  5. How do decomposition methods help solve large-scale optimization problems? (Answer: They split one massive unsolvable problem into smaller coordinated subproblems that can each be solved efficiently)


๐ŸŽฏ Final Learning Outcome Achieved

You now understand:

  • โœ… The two scientific pillars: optimization and forecasting
  • โœ… Core techniques in each pillar and when to apply them
  • โœ… How these methods interact in a real fulfillment system
  • โœ… The end-to-end workflow from problem formulation to production
  • โœ… How to communicate mathematical tradeoffs to non-technical audiences

More to study