0x00 Preface
This article analyzes mini-batch SGD, following the Euclidean norm and stochastic gradient definitions from Part 11, and comparing them with the deterministic gradient descent from Part 22.
Let $\mathcal F_t$ denote the history before the $t$-th sampling round, using a fixed step size to update $w_{t+1}=w_t-\eta g_t$. $g_t$ is the average of $b$ new sample gradients, assuming
Here $\sigma^2$ is the upper bound on the variance of single-sample noise; the reduction by a factor of $1/b$ relies on conditionally independent noise within the batch or zero cross-covariance.
One-step Descent
$L$-smoothness yields
First, take the expectation conditioned on $\mathcal F_t$, where $w_t$ is fixed:
Next, take the expectation over the history. If $0<\eta\le1/L$, we obtain the subsequent recursive relation shared by all:
One cannot treat the random $f(w_t)$ or gradient as deterministic quantities in formulas involving unconditional expectations.
0x01 Smooth and Strongly Convex with Mini-batch SGD
defination
If $f$ is $L$-smooth, $\mu$-strongly convex, and an optimal solution exists, define$$ \mathcal E_t=\mathbb E[f(w_t)]-f^*,\quad q=1-\eta\mu,\quad C_b=\frac{\eta L\sigma^2}{2\mu b}. $$For $0<\eta\le1/L$, we have$$ \mathcal E_T\le q^T\mathcal E_0+C_b(1-q^T) =C_b+q^T(\mathcal E_0-C_b). $$
Proof: By the PL condition $\Vert\nabla f(w_t)\Vert^2\ge2\mu(f(w_t)-f^{\ast})$, a single step of descent becomes
Since $0\le q<1$, expanding the recursion and summing the geometric series yields
What Does the Bound Guarantee?
Under a fixed step size, the transient term in the bound decreases at a geometric rate, but typically only guarantees $\limsup_T\mathcal E_T\le C_b$. This is an upper bound on the error, not the actual error the algorithm necessarily achieves, nor a guarantee of linear convergence to the exact optimal solution.
If $0<q<1$ and $\mathcal E_0>\epsilon>C_b$, the required number of iterations is
If $\epsilon\le C_b$, this upper bound cannot guarantee reaching the target. One can reduce the step size, increase the batch size, or use a decaying step size scheme with applicable conditions. When $\sigma^2=0$, the results of deterministic GD are recovered; when $q=0$, directly use the recursion without calculating $\log0$.
0x02 Smooth Non-convex with Mini-batch SGD
defination
Assume $f$ is $L$-smooth and has a finite lower bound $f_{\inf}$, and the stochastic gradients satisfy the above conditions. For $0<\eta\le1/L$ and $T\ge1$,$$ \frac1T\sum_{t=0}^{T-1}\mathbb E\|\nabla f(w_t)\|^2 \le\frac{2(f(w_0)-f_{\inf})}{\eta T}+\frac{L\eta\sigma^2}{b}, $$Here we assume the starting point $w_0$ is deterministic; for a random starting point, replace $f(w_0)$ with its expectation.
Proof: Summing the one-step descent from $t=0$ to $T-1$ yields
Using $f(w_T)\ge f_{\inf}$, then dividing by $\eta T/2$ gives the conclusion. This summation starts from $w_0$, so the telescoping endpoints are $f(w_0)$ and $f(w_T)$.
Step Size and Output
If $R$ are independent and uniformly distributed over $\lbrace 0,\ldots,T-1\rbrace$, the expected squared gradient of the random output $w_R$ equals the above average. This conclusion cannot be directly converted into a guarantee for the final point $w_T$, nor does it guarantee reaching the global optimum.
Denote $A=f(w_0)-f_{\inf}>0$. When $\sigma^2>0$, choose for a given run length $T$
When the second term does not exceed $1/L$, the bound on the average squared gradient is
This is a fixed step size chosen based on a predetermined run length, not replacing the current index with $T$ at every step. It demonstrates the $O(1/\sqrt{bT})$ behavior within the corresponding range; the step size upper limit constrains this scaling. Without noise, taking $\eta=1/L$ yields $2LA/T$.

