and the mini-batch size $b$. Unlike the linear regression setting, the closed form expressions for the variance are unknown. However, Theorem \[thm:varianceRepresentation\] conquers this issue by iteratively deducing $t$ one by one and it provides a polynomial representation. We are also able to show the decreasing property of the variance of stochastic gradient estimators with respect to $b$, based on this polynomial representation.

  ---------------------------------------------------------- ------------------------------------------------------------ -- --
      ![image](figure/regression.png){width="50.00000%"}      ![image](figure/regression_fitpoly.png){width="50.00000%"}     
   \(a) Variance of stochastic gradients and full gradients        \(b) Fitting polynomials of mini-batch size $b$           
  ---------------------------------------------------------- ------------------------------------------------------------ -- --

  ----------------------------------------------------- ----------------------------------------------------- -- --
   ![image](figure/twolayer_W1.png){width="50.00000%"}   ![image](figure/twolayer_W2.png){width="50.00000%"}     
    \(a) Variance of gradients with respect to $W_1$      \(b) Variance of gradients with respect to $W_2$       
  ----------------------------------------------------- ----------------------------------------------------- -- --

  ------------------------------------------------------- ---------------------------------------------------------- -- -- -- --
   ![image](figure/MNIST_initial.png){width="50.00000%"}   ![image](figure/MNIST_gen_zoomed.png){width="50.00000%"}           
              \(a) Different initial weights                           \(b) Gap of accuracy (zoomed-in)                       
  ------------------------------------------------------- ---------------------------------------------------------- -- -- -- --

Experiments {#sec:4}
===========

In this section, we present numerical results to support the theorems in Section \[sec:3\] and provide further insights into the impact of the mini-batch size on the dynamics of SGD. The experiments are conducted on four datasets and models that are relatively small due to the computational cost of using large models and datasets. The goal of these experiments is 