Inferensys

Glossary

DeepAR

An autoregressive recurrent neural network model developed by Amazon that produces probabilistic forecasts by learning a parametric distribution from multiple related time series.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
PROBABILISTIC FORECASTING

What is DeepAR?

DeepAR is an autoregressive recurrent neural network architecture developed by Amazon for producing calibrated probabilistic forecasts from multiple related time series.

DeepAR is a supervised learning algorithm based on an autoregressive recurrent neural network (RNN) that learns a global model from a set of related time series. Unlike single-series methods, it trains on hundreds or thousands of related histories simultaneously, using Long Short-Term Memory (LSTM) cells to capture complex seasonal patterns and long-range dependencies. The model outputs the parameters of a user-specified parametric distribution—typically Gaussian or negative binomial—at each time step, generating a full probability distribution rather than a single point estimate.

The architecture's key innovation is its ability to handle cold-start scenarios by incorporating static categorical and real-valued covariates, such as product category or location, directly into the network. During training, DeepAR uses teacher forcing with observed lagged values; at inference, it samples from its own predicted distribution to generate multi-step-ahead Monte Carlo forecast paths. This enables the direct calculation of quantile forecasts for any service level, making it particularly effective for intermittent demand patterns and inventory optimization where quantifying aleatoric uncertainty is critical.

Probabilistic Forecasting Architecture

Key Features of DeepAR

DeepAR is an autoregressive recurrent neural network model developed by Amazon that produces probabilistic forecasts by learning a parametric distribution from multiple related time series. Unlike point-forecast models, it outputs full prediction intervals that quantify uncertainty for risk-aware supply chain decisions.

01

Global Model Training Across Multiple Time Series

DeepAR trains a single global model on hundreds or thousands of related time series simultaneously, rather than fitting separate models per SKU or location. This approach enables the model to learn shared seasonal patterns, trend behaviors, and demand correlations across the entire product hierarchy. By pooling information from high-volume items, the model improves forecast accuracy for low-volume or intermittent-demand products that lack sufficient individual history. The architecture uses an encoder-decoder LSTM that conditions predictions on both historical values and known future covariates such as planned promotions, pricing changes, or calendar events.

Thousands
Time Series Trained Simultaneously
Single Model
Architecture Type
02

Probabilistic Output with Parametric Distributions

Instead of predicting a single demand number, DeepAR outputs the parameters of a chosen probability distribution at each forecast time step. Common distributions include:

  • Gaussian for real-valued data with symmetric uncertainty
  • Negative Binomial for overdispersed count data common in retail demand
  • Beta for constrained values like fill rates or service levels
  • Student's t for heavy-tailed distributions with outlier demand spikes

The model learns to predict distribution parameters directly, enabling the generation of quantile forecasts at any service level—such as the 10th, 50th, and 90th percentiles—without retraining. This allows inventory planners to set safety stock based on explicit prediction intervals rather than heuristic buffers.

Any Quantile
Forecast Granularity
Multiple
Supported Distributions
03

Cold-Start Forecasting for New Products

DeepAR addresses the cold-start problem by leveraging embeddings learned from similar items during global training. When a new SKU enters the catalog with zero or minimal sales history, the model uses item-level categorical features—such as product category, brand, price tier, or warehouse location—to generate an initial forecast based on the behavior of comparable products. As the first sales observations arrive, the model dynamically updates its predictions through the autoregressive LSTM structure. This capability is critical for fashion retail, electronics launches, and pharmaceutical rollouts where new product introductions are frequent and historical data is absent.

Zero History
Minimum Data Required
Categorical
Feature Type for Similarity
04

Covariate Integration for Context-Aware Forecasts

DeepAR natively ingests two categories of external features that shape demand predictions:

  • Static covariates: Time-invariant attributes like product category, store size, or geographic region that define the identity of each time series
  • Dynamic covariates: Time-varying inputs known in advance across the forecast horizon, such as planned promotions, holiday calendars, price changes, or marketing spend

The model learns complex interactions between these covariates and historical demand patterns. For example, it can capture how a 20% price discount during a holiday weekend affects demand differently for premium versus budget product categories. This context-aware conditioning makes DeepAR particularly effective for promotional demand sensing and scenario planning.

Static + Dynamic
Covariate Types Supported
Known Future
Dynamic Covariate Horizon
05

Autoregressive Sampling for Multi-Step Uncertainty

DeepAR generates probabilistic forecasts through ancestral sampling: at each time step, the model draws a value from the predicted distribution and feeds it back as input for the next step. This autoregressive process is repeated hundreds or thousands of times to build an empirical distribution of possible future trajectories. The resulting sample paths capture the compounding uncertainty that grows with the forecast horizon—a phenomenon that point-forecast models ignore. Supply chain planners can use these trajectories to run Monte Carlo simulations for inventory optimization, calculating metrics like expected stockout probability or fill rate under different reorder policies.

Hundreds
Sample Paths Generated
Compounding
Uncertainty Behavior
06

Likelihood-Based Training with Pinball Loss Alternative

DeepAR is trained by maximizing the log-likelihood of observed values under the predicted distribution, which is a strictly proper scoring rule that encourages well-calibrated probabilistic outputs. This contrasts with models trained on point-error metrics like MAE or RMSE, which ignore uncertainty quantification. For practitioners who prefer direct quantile estimation, the architecture can alternatively be trained using pinball loss, an asymmetric loss function that penalizes over-prediction and under-prediction differently depending on the target quantile. The choice between likelihood and pinball loss depends on whether the downstream application requires full distributional information or specific quantile thresholds for safety stock calculation.

Log-Likelihood
Default Training Objective
Pinball Loss
Alternative Objective
DEEPAR EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about Amazon's DeepAR probabilistic forecasting algorithm, designed for engineers and supply chain data scientists.

DeepAR is an autoregressive recurrent neural network (RNN) model developed by Amazon for probabilistic forecasting. Unlike models that output a single point estimate, DeepAR learns the parameters of a user-specified parametric distribution (e.g., Gaussian, negative binomial) at each time step. It works by training a single global model across hundreds or thousands of related time series, using an encoder-decoder architecture built on Long Short-Term Memory (LSTM) cells. The encoder processes the historical context, while the decoder generates multi-step-ahead predictions by sampling from the predicted distribution. This allows DeepAR to produce full prediction intervals and quantile forecasts, quantifying both aleatoric uncertainty (inherent noise) and epistemic uncertainty (model uncertainty) for each forecast horizon.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.