■ Change #419 · wiki.edited
Reverse-mode automatic differentiation: Normalize Markdown to canonical form
body
## What it is− A program is a composition of primitive operations. Reverse-mode AD records those operations on a **tape** during the forward pass, then walks the tape backwards, applying the chain rule to accumulate the derivative of a single scalar output with respect to *every* input.+ A program is a composition of primitive operations. Reverse-mode AD records those operations on a **tape** during the forward pass, then walks the tape backwards, applying the chain rule to accumulate the derivative of a single scalar output with respect to _every_ input.## Why it mattersFor a function $f: \mathbb{R}^n \to \mathbb{R}$ the full gradient costs a small constant multiple of evaluating $f$, independent of $n$. That is what makes training networks with billions of parameters possible at all.## How it works1. **Forward pass**: evaluate the program and store intermediate values.2. **Backward pass**: start from $\bar{y} = 1$ and propagate adjoints $\bar{v}_i = \sum_j \bar{v}_j \, \partial v_j / \partial v_i$.− The trade-off is memory: intermediates must be kept (or recomputed, via *checkpointing*).+ The trade-off is memory: intermediates must be kept (or recomputed, via _checkpointing_).## Open problems- Memory-optimal checkpointing schedules for arbitrary graphs- Differentiating through discrete control flow and non-smooth operations- Higher-order derivatives without blow-up
hash 7267d03fe2d66636bdd60b9ad476b2a9a6f3df5c891c3b636748036b879d322f
previous 81136a67edd1a99df287e6ffa60ad505a0d7c1348b85d0e55eed88647ff9ba47