From the free course Backpropagation on Lykke
Historical Context and the Backwards Method
Key concepts: Interpretative Flexibility · Perceptron Controversy · Ordered Derivatives · Backwards Method · Computational Efficiency
Explores the sociological history of neural networks and the early mathematical foundations of the 'backwards method' for sensitivity analysis.
Historical Context and the Backwards Method
Overview
The development of backpropagation was not a linear path. While today it is the undisputed engine of the deep learning revolution, its history is a complex tapestry of independent discovery, academic suppression, and cross-disciplinary synthesis. This section examines the historical sociology of neural network research and the early mathematical breakthroughs—specifically the transition from forward sensitivity analysis to the "Backwards Method"—that preceded the modern era.
AI_SVGI_SVG## The Historical Sociology of Neural Networks To understand why the "Backwards Method" was revolutionary, one must first understand the intellectual climate of the 1960s and 70s. The field was dominated by Symbolic AI, which viewed intelligence as the manipulation of high-level symbols and logic.
The Perceptron Controversy
In 1958, Frank Rosenblatt introduced the Perceptron, a simple linear classifier. While initially met with fanfare, it was famously critiqued by Marvin Minsky and Seymour Papert in their 1969 book Perceptrons. They mathematically proved that a single-layer perceptron could not solve the XOR problem (non-linearly separable data).
The XOR Problem: A logical operation where the output is true only if the inputs are different. In a 2D plane, the points (0,0) and (1,1) belong to one class, while (0,1) and (1,0) belong to another. No single straight line can separate these two classes.
This critique led to the first "AI Winter," during which funding for connectionist research (neural networks) evaporated. The "Backwards Method" was the key to unlocking multi-layer networks, which could solve XOR, but the mathematical foundations were largely ignored for over a decade.
| Era | Dominant Paradigm | Key Limitation | Role of Backprop |
|---|---|---|---|
| 1950s-1960s | Perceptrons / Linear Models | Limited to linearly separable data | Non-existent / Early precursors |
| 1970s-1980s | Symbolic AI / Logic | Brittle, "Good Old Fashioned AI" (GOFAI) | Re-discovered (Werbos, Rumelhart) |
| 1990s-2000s | Statistical Learning / SVMs | Feature engineering required | Used in Niche (CNNs, RNNs) |
| 2010s-Present | Deep Learning | Computational cost / Data hungry | Standard optimization engine |
The Mathematical Foundation: Ordered Derivatives
The breakthrough that eventually became backpropagation was the concept of Ordered Derivatives, introduced by Paul Werbos in his 1974 Harvard Ph.D. thesis. Werbos was not looking for a "brain-like" algorithm; he was looking for a way to improve econometric forecasting and policy modeling.
Definition: Ordered Derivative
An ordered derivative, denoted as $\frac{\partial^+ L}{\partial z_i}$, represents the total change in a target variable $L$ with respect to a variable $z_i$, accounting for all paths through which $z_i$ influences $L$ in a directed acyclic graph (DAG).
Unlike a simple partial derivative $\frac{\partial L}{\partial z_i}$, which assumes all other variables are held constant, the ordered derivative acknowledges that $z_i$ is an input to subsequent variables $z_{i+1}, z_{i+2}, \dots, z_n$.
# Conceptualizing the difference between Partial and Ordered Derivatives
# Let L = f(y, z) where y = g(z)
def partial_derivative_L_wrt_z(z, y):
# Assumes y is constant
return d_f / d_z
def ordered_derivative_L_wrt_z(z):
# Accounts for the fact that changing z also changes y
return (d_f / d_z) + (d_f / d_y * d_g / d_z)
The Backwards Method (Reverse Mode Differentiation)
The "Backwards Method" is the algorithmic implementation of the chain rule applied in reverse order. In a complex system with $N$ parameters and a single scalar output (the Loss), calculating the gradient via the forward method (perturbing each weight one by one) requires $N$ forward passes. The Backwards Method requires only one forward pass and one backward pass, regardless of the number of parameters.
Why it Matters: Efficiency
The computational complexity of the gradient calculation is the primary bottleneck in training deep models.
| Method | Complexity (Time) | Complexity (Memory) | Best Use Case |
|---|---|---|---|
| Forward Perturbation | $O(N \cdot Cost(f))$ | $O(1)$ | Very few parameters |
| Symbolic Differentiation | $O(Exp(N))$ | $O(Exp(N))$ | Simple expressions |
| Reverse Mode AD (Backprop) | $O(Cost(f))$ | $O(N)$ | Many parameters, one output |
Mechanics of the Backwards Pass
The algorithm operates on a computational graph. For a node $i$ with output $z_i$, the "sensitivity" or "error signal" $\delta_i$ is defined as: $$\delta_i = \frac{\partial L}{\partial z_i}$$
The fundamental recurrence relation for the backwards method is: $$\frac{\partial L}{\partial z_i} = \sum_{j \in \text{Children}(i)} \frac{\partial L}{\partial z_j} \frac{\partial z_j}{\partial z_i}$$
Implementation Example: A Simple 2-Layer MLP
Consider a network where $z_1 = W_1 x$, $a_1 = \sigma(z_1)$, $z_2 = W_2 a_1$, and $L = \frac{1}{2}(y - z_2)^2$.
import numpy as np
def backward_pass(x, y, W1, W2, z1, a1, z2):
# 1. Compute output error (dL/dz2)
delta_2 = z2 - y
# 2. Gradient for W2 (dL/dW2 = dL/dz2 * dz2/dW2)
# Note: dz2/dW2 is just a1
grad_W2 = np.outer(delta_2, a1)
# 3. Backpropagate error to hidden layer (dL/da1 = dL/dz2 * dz2/da1)
# Note: dz2/da1 is W2
delta_a1 = np.dot(W2.T, delta_2)
# 4. Account for activation function (dL/dz1 = dL/da1 * da1/dz1)
# Assuming sigmoid: sigma'(z) = sigma(z) * (1 - sigma(z))
delta_1 = delta_a1 * (a1 * (1 - a1))
# 5. Gradient for W1 (dL/dW1 = dL/dz1 * dz1/dW1)
grad_W1 = np.outer(delta_1, x)
return grad_W1, grad_W2
Backpropagation Through Time (BPTT)
When the "Backwards Method" is applied to sequences, it is known as Backpropagation Through Time (BPTT). This is the standard method for training Recurrent Neural Networks (RNNs).
Network Unfolding
The core insight of BPTT is that a recurrent network (which contains loops) can be "unfolded" into a deep feedforward network where each layer represents a discrete time step. The weights $W$ are shared across all time steps.
Definition: BPTT is the application of the backwards method to a computational graph that has been unrolled over $T$ time steps.
The Gradient Accumulation Problem
Because the same weight matrix $W$ is used at every time step $t$, the total gradient for $W$ is the sum of the gradients calculated at each step: $$\frac{\partial L}{\partial W} = \sum_{t=1}^{T} \frac{\partial L_t}{\partial W}$$
Truncated BPTT
In practice, unfolding a network over thousands of time steps is computationally expensive and leads to the Vanishing Gradient Problem. Truncated BPTT limits the backward pass to a fixed number of steps $k$.
| Feature | Standard Backprop | BPTT | Truncated BPTT |
|---|---|---|---|
| Graph Structure | Static DAG | Unrolled Sequence | Fixed-length Window |
| Weight Sharing | No (usually) | Yes (across time) | Yes (across time) |
| Memory Usage | $O(\text{Layers})$ | $O(\text{Time Steps})$ | $O(k)$ |
| Long-term Dependencies | N/A | Theoretical | Limited to $k$ |
Backpropagation Through Structure (BPTS)
Introduced by Goller and Küchler in 1996, Backpropagation Through Structure (BPTS) generalizes BPTT to data that is structured as a tree or a graph rather than a linear sequence.
Recursive Neural Networks
BPTS is used to train Recursive Neural Networks (not to be confused with Recurrent). These are common in Natural Language Processing (NLP) for parsing tree structures or in chemistry for molecular graphs.
- Forward Pass: The network processes nodes from the leaves up to the root.
- Backward Pass: The error is propagated from the root down to the leaves.
Mathematical Formulation
For a node $p$ with children $c_1, c_2$: $$h_p = f(W [h_{c1}; h_{c2}] + b)$$ The gradient at node $p$ must be distributed to both $c_1$ and $c_2$ based on the weights $W$ used in the recursive step.
Common Pitfalls and Technical Challenges
1. The Vanishing and Exploding Gradient Problem
During the backwards pass, the gradient is multiplied by the weights and the derivative of the activation function at each layer.
- If the weights are small ($<1$) or the derivative is small (e.g., sigmoid saturation), the gradient shrinks exponentially (Vanishing).
- If the weights are large ($>1$), the gradient grows exponentially (Exploding).
2. The "Dead Neuron" Problem
In the backwards method, if an activation function like ReLU outputs 0 for a given input, its derivative is 0. This "kills" the gradient, and the weights for that neuron will never be updated again during that training session.
3. Confusion with Optimization
A common misconception is that backpropagation is the learning algorithm. It is not.
- Backpropagation is only the method for calculating gradients.
- Stochastic Gradient Descent (SGD), Adam, or RMSProp are the optimization algorithms that use those gradients to update the weights.
| Concept | Role |
|---|---|
| Loss Function | Defines the "error" surface. |
| Backpropagation | Finds the "direction" of steepest ascent/descent. |
| Optimizer | Decides "how far" to step in that direction. |
Summary of the "Backwards" Philosophy
The transition from forward-thinking to backward-thinking was a paradigm shift in computational science. By focusing on how the output depends on the internal state (sensitivity) rather than how the input propagates forward (perturbation), researchers unlocked the ability to optimize systems with millions, and now trillions, of parameters.
Whether it is the temporal unfolding of BPTT or the structural recursion of BPTS, the underlying principle remains the same: Dynamic Programming. We store intermediate results (partial derivatives) to avoid redundant calculations, turning an intractable problem into a linear-time operation.
AI_FLASHCARDSI_FLASHCARDS Ordered Derivative: A derivative that accounts for all paths of influence in a system, not just the direct path.
- Reverse Mode AD: The general mathematical name for the backwards method; efficient for functions with many inputs and one output.
- XOR Problem: The classic counter-example that proved single-layer networks were insufficient, necessitating deep networks and backprop.
- Unfolding: The process of transforming a recurrent network into a feedforward one by duplicating layers for each time step.
- Weight Sharing: The technique where the same parameters are used in different parts of the computational graph, requiring gradient summation.
- Sensitivity ($\delta$): The partial derivative of the loss with respect to a specific node's output.
AI_QUIZI_QUIZ. Why is the "Backwards Method" more efficient than the "Forward Method" for neural networks?
- Answer: Because neural networks typically have millions of input parameters (weights) but only one scalar output (Loss). Reverse mode calculates all gradients in one pass, whereas forward mode would require a pass for every single weight.
-
What was the primary contribution of Paul Werbos to this field?
- Answer: He formalized the concept of "Ordered Derivatives" and reverse-mode differentiation in his 1974 thesis, providing the mathematical framework that would later be called backpropagation.
-
In BPTT, if a sequence has 100 steps, how many times is the weight matrix $W$ updated per sequence?
- Answer: Once. Although gradients are calculated for each of the 100 steps, they are summed together to perform a single update to the shared weight matrix $W$.
-
What happens to the gradient in BPTS when a node has multiple parents?
- Answer: The gradients from all parents are summed at that node, following the multivariate chain rule.
-
How does Truncated BPTT mitigate the vanishing gradient problem?
- Answer: By limiting the number of steps the gradient can flow backward, it prevents the repeated multiplications that cause the gradient to shrink to zero, though at the cost of losing long-term dependency information.
AI_STUDY_GUIDEI_STUDY_GUIDE*Key Equations to Memorize:**
- The Chain Rule: $\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$
- Error Signal: $\delta_j = \frac{\partial L}{\partial z_j}$
- Weight Update: $w_{ij} \leftarrow w_{ij} - \eta \delta_j a_i$
Historical Timeline:
- 1958: Rosenblatt's Perceptron.
- 1969: Minsky & Papert's Perceptrons (The XOR critique).
- 1974: Werbos's Thesis (Ordered Derivatives).
- 1986: Rumelhart, Hinton, & Williams (Popularization of Backprop).
- 1996: Goller & Küchler (BPTS).
Comparison Checklist:
- Do I understand the difference between a partial derivative and an ordered derivative?
- Can I explain why BPTT requires "unfolding"?
- Do I know the difference between Backpropagation and SGD?
- Can I derive the gradient for a single neuron?
Source Materials
Study Backpropagation on Lykke
This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.
Add the free extensionSign in to open every section