Gemma 4 26B-A4B inference in ~2 GB of RAM on any M-series MacBook
The derivative of the loss with respect to the weights is
$$\frac{\partial L}{\partial w} = \sum_{i=1}^{n} (\hat{y}_i - y_i) x_i