NEW
Also known as: Autodiff
A technique to compute exact derivatives of programs efficiently by applying the chain rule during execution.
DESCRIPTION
Automatic differentiation (AD) evaluates derivatives of functions expressed as programs by systematically applying the chain rule. Reverse-mode AD (backpropagation) is efficient for scalar losses and many parameters, while forward-mode suits few-input problems. AD underlies gradient-based optimization in machine learning, scientific computing, and control. Modern frameworks expose AD via transformations or computational graphs, enabling flexible model definitions and efficient training.
ALTERNATIVE DEFINITIONS
Wikipedia
In mathematics and computer algebra, automatic differentiation (AD), also called algorithmic differentiation or computational differentiation, is a set of techniques to numerically evaluate the derivative of a function specified by a computer program.
Presents AD as techniques to evaluate derivatives of programs.
arXiv
Automatic differentiation (AD) is a family of techniques to efficiently and accurately evaluate derivatives of numeric functions expressed as computer programs.
Emphasizes both efficiency and accuracy of AD.
JAX
Automatic differentiation (autodiff) is a set of techniques to evaluate derivatives programmatically.
Highlights programmatic evaluation through transformations.
RELATED TERMS
Backpropagation Reverse-Mode Differentiation Forward-Mode Differentiation Computational Graph Gradient Descent Chain Rule Autograd
COMPETING TERMS
Symbolic Differentiation Numerical Differentiation
RELATIONS
- Narrower: Autograd Backpropagation
KNOWLEDGE AREAS
Mathematics AI Data Science MLOps
TARGET AUDIENCE
AI Engineer Data Scientist MLOps Engineer Software Developer
EXTERNAL SOURCES
- Wikipedia - Automatic differentiation
- PyTorch - Autograd AD in PyTorch
- TensorFlow - Autodiff guide with GradientTape
- arXiv - Survey of AD in machine learning
TOP QUESTIONS
What is the main advantage of Automatic Differentiation over numerical methods?
AD provides exact (up to floating-point) derivatives efficiently, avoiding truncation and cancellation errors inherent in finite differences.
Category: Comparison
When should I use reverse-mode vs forward-mode Automatic Differentiation?
Use reverse-mode for many-parameter scalar losses; forward-mode for few-input, many-output functions.
Category: HowTo
How does Automatic Differentiation enable deep learning?
It computes gradients for backpropagation, powering optimization algorithms that train neural networks.
Category: Relevancy
Can Automatic Differentiation handle control flow?
Yes, modern frameworks trace or transform programs to differentiate through dynamic control flow.
Category: Capabilities
What are common AD pitfalls?
Non-differentiable operations, in-place mutations breaking graphs, and numerical instability in gradients.
Category: Mistakes
How do frameworks implement Automatic Differentiation?
Via operator overloading, source transformation, or graph tracing to apply the chain rule.
Category: Overview
Does Automatic Differentiation increase memory usage?
Reverse-mode stores intermediate activations for backprop; checkpointing trades compute for memory.
Category: Performance
Can Automatic Differentiation be used outside ML?
Yes, for scientific computing, optimization, and sensitivity analysis in many domains.
Category: Application
How to verify gradients produced by Automatic Differentiation?
Use finite-difference checks on small inputs and compare to analytical results when available.
Category: Testing