Second-Order Complexity Theory for Neural Networks
Yoshihiro Maruyama
Abstract
Machine learning relies on gradient-based training procedures whose empirical efficiency is usually analyzed through finite-dimensional arithmetic counts rather than formal complexity over continuous real-valued data. This paper studies neural-network training primitives as represented-real operators in the second-order complexity framework of Kawamura and Cook. Here, second-order polynomial time ($\mathrm{FP}_2$) means computing a real-valued operator to accuracy $2^{-n}$ in time polynomial in the requested precision, architecture size, primitive evaluation costs, and analytic bounds encoded with the input. We prove that dense backpropagation, convolutional backpropagation, soft attention, a fixed number of SGD- or Adam-style updates, and related smooth local primitives are $\mathrm{FP}_2$-computable over the relevant represented real spaces. More precisely, dense one-sample backpropagation has tight arithmetic-and-output complexity $\Theta(s)$ for $s$ weights and polynomial bit complexity; convolutional backpropagation is polynomial in the number of active convolution incidences; dense soft-attention backpropagation for sequence length $\ell$ and model dimension $d$ has arithmetic cost $\Theta(\ell d^2+\ell^2d)$ using classical matrix multiplication; and fixed finite optimizer updates remain $\mathrm{FP}_2$-computable, with polynomial precision moduli and denominator bounds determining the required precision. Higher complexity enters through three distinct mechanisms: discontinuous selection, global optimization, and continuous-time flow solving. For example, hard routing, top-$k$ sparsification, argmax decisions, ReLU kink conventions, exact line search, and idealized gradient flow change the second-order complexity of the training operator. Overall, this work provides a rigorous mathematical language for establishing tractability guarantees and identifying computational barriers in neural-network training, thus enabling a unified account of computational complexity for dense networks, CNNs, attention, Transformers, and standard optimizers.
Successful Page Load