Greeks via Automatic Differentiation
Automatic Differentiation for Greeks Computation · Also known as: AD Greeks, Algorithmic Differentiation, Autodiff
Automatic differentiation (AD) is a computational technique for computing derivatives (Greeks) by differentiating the computer code that computes the option price. AD avoids manual derivation of formulas and finite-difference approximations, yielding exact sensitivities with machine precision. It has become essential for real-time risk management in modern trading systems.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use AD for pricing exotic or complex derivatives where Greeks are hard to derive analytically. Essential for Monte Carlo pricing (finite-difference is slow and noisy). Use forward mode AD for few inputs (delta, vega); reverse mode for many inputs or when computing all Greeks simultaneously.
Strengths & limitations
- Exact computation: computes derivatives to machine precision, avoiding finite-difference rounding errors
- Speed: typically only 2-5x slower than computing the price alone; much faster than bump-and-reprice
- Generality: applies to any pricing algorithm (Monte Carlo, PDE, trees) without manual formula derivation
- Automation: once you have pricing code, Greeks are automatic; no analytical work needed
- Implementation overhead: requires AD-capable automatic differentiation tools (TensorFlow, JAX, specialized libraries)
- Code structure sensitivity: AD works best with clean, differentiable code; conditionals and loops require care
- Memory overhead (reverse mode): storing intermediate values for backpropagation can exceed memory for large computations
- Limited third derivatives: computing higher-order Greeks (speed, color) is more complex and slower
Frequently asked
What is the difference between forward and reverse mode AD?
Forward mode (direct) propagates derivatives forward through the computation graph. Reverse mode (adjoint) propagates backward. Forward mode is faster for few inputs; reverse mode is faster for many outputs. For Greeks, you typically compute many outputs (delta, vega, gamma) from few inputs (spot, vol, rate), so reverse mode is preferred.
How much slower is AD than the original pricing code?
Typically 2-5x slower for reverse-mode AD. You're computing derivatives alongside the price. Compare this to bump-and-reprice (finite difference), which is 100x-1000x slower because you must recompute the price for each input bump.
Can I use AD for Monte Carlo pricing?
Yes. AD differentiates each path's payoff, averaging the derivatives across paths to get the Greek. However, this is noisy (path-specific estimates have high variance). Combine AD with variance-reduction techniques (antithetic, control variates) to reduce variance.
What if my code has if-statements?
AD handles differentiable code best. For non-smooth branches (e.g., 'if spot > strike'), use smooth approximations (logistic function, softplus). Alternatively, separate the code into smooth regimes and differentiate each separately.
Sources
How to cite this page
ScholarGate. (2026, June 3). Automatic Differentiation for Greeks Computation. ScholarGate. https://scholargate.app/en/quantitative-finance/greeks-via-automatic-differentiation
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Bates ModelQuantitative Finance↔ compare
- Local Volatility (Dupire)Quantitative Finance↔ compare
- Risk-Neutral ValuationQuantitative Finance↔ compare