This article moves beyond the introductory surface of Machine Learning to examine the rigorous mathematical foundations of optimization and the emergent laws governing large-scale model training.
The generalization error of any machine learning model can be decomposed into three components: Bias, Variance, and Irreducible Error.
For a true function f(x) and an estimate \hat{f}(x), the expected Mean Squared Error (MSE) at a point x is:
Modern deep learning has challenged the classical view that increasing model complexity always increases variance. In the Interpolation Regime, where models are large enough to perfectly fit the training data, the test error often enters a second "descent" phase, achieving lower error than smaller models.
Backpropagation is the application of the Chain Rule to compute the gradient of the loss function \mathcal{L} with respect to the weights W in a computational graph.
For a layer l:
We define the "error" \delta^{(l)} for layer l as the derivative of the loss with respect to the pre-activation input z^{(l)}:
Output Layer Error:
Hidden Layer Error (Recursive):
Weight Gradients:
The multiplicative nature of the chain rule in deep networks leads to the Vanishing Gradient problem, where \delta^{(l)} approaches zero as it propagates backward. Solutions include Residual Connections and Batch Normalization, which maintain the magnitude of the gradient signal.
The transition from small models to Large Language Models (LLMs) is governed by "Scaling Laws"—empirical power laws relating loss to compute (C), parameters (N), and data (D).
Kaplan et al. (2020) observed that cross-entropy loss L follows:
This suggests that as long as you scale N and D in tandem, the loss continues to decrease predictably.
The "Chinchilla" research corrected the Kaplan laws, identifying that previous models (like GPT-3) were significantly undertrained.
The success of modern architectures rests on two key mechanisms:
Machine learning is moving from "Training" to "Inference-time Compute" (e.g., OpenAI o1). The next scaling frontier is not just more data or parameters, but Test-Time Search—allowing models to "think" longer by exploring the reasoning manifold before outputting a token.
The practitioner's task is to balance the rigorous calculus of the backward pass with the empirical physics of the scaling laws to build systems that are both mathematically sound and compute-efficient.