cs.LGApr 13, 2026

Inter-Layer Hessian Analysis of Neural Networks with DAG Architectures

Authors: Maxim Bolshim, Alexander Kugaevskikh

Organizations: ITMO University, Saint Petersburg, Russia

Abstract

Modern automatic differentiation frameworks (JAX, PyTorch) return the Hessian of the loss function as a monolithic tensor, without exposing the internal structure of inter-layer interactions. This paper presents an analytical formalism that explicitly decomposes the full Hessian into blocks indexed by the DAG of an arbitrary architecture. The canonical decomposition H=HGN+HTH = H^{GN} + H^T separates the Gauss--Newton component (convex part) from the tensor component (residual curvature responsible for saddle points). For piecewise-linear activations (ReLU), the tensor component of the input Hessian vanishes (Hv,wT ⁣≡ ⁣0H^{T}_{v,w}\!\equiv\!0 a.e., Hv,wf ⁣= ⁣Hv,wGN ⁣⪰ ⁣0H^f_{v,w}\!=\!H^{GN}_{v,w}\!\succeq\!0); the full parametric Hessian contains residual terms that do not reduce to the GGN. Building on this decomposition, we introduce diagnostic metrics (inter-layer resonance~R\mathcal{R}, geometric coupling~C\mathcal{C}, stable rank~D\mathcal{D}, GN-Gap) that are estimated stochastically in O(P)O(P) time and reveal structural curvature interactions between layers. The theoretical analysis explains exponential decay of resonance in vanilla networks and its preservation under skip connections; empirical validation spans fully connected MLPs (Exp.,1--5) and convolutional architectures (ResNet-18, ∼11{\sim}11M~parameters, Exp.,6). When the architecture reduces to a single node, all definitions collapse to the standard Hessian ∇θ2L(θ)∈Rp×p\nabla^2_θ\mathcal{L}(θ)\in\mathbb{R}^{p\times p}.

Figures & tables

Appendix figures & tables10 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

May 4, 2026

Communication Dynamics Neural Networks: FFT-Diagonalized Layers for Improved Hessian Conditioning at Reduced Parameter Count

Communication Dynamics Neural Networks (CDNNs) apply the circulant-spectral machinery of the Communication Dynamics framework to neural-network layer design. We introduce CDLinear, a block-circulant linear layer with block size B = 2l + 1 that uses 1/B the parameters of a dense layer with the same input and output dimensions. The construction gives an explicit Fourier-domain diagnostic for optimization: for mean-squared loss, the weight Hessian is diagonalized by the discrete Fourier transform, with eigenvalues determined directly by the Fourier spectrum of the input blocks. Under input pre-whitening, the population Hessian condition number is exactly 1, and the empirical condition number is bounded by 1 + O(sqrt(B/N)) for N samples. We implement CDLinear in pure NumPy with hand-derived backward passes and verify gradients by finite differences. On the 8x8 MNIST digits benchmark, across three random seeds, a CDLinear MLP with B = 4 reaches 97.50% +/- 0.23% test accuracy using 2,380 parameters, compared with 98.15% +/- 0.47% for a dense baseline using 8,970 parameters. This gives a 3.8x parameter reduction at a 0.65% accuracy cost. The CD-MLP's mean Hessian condition number is 1.9e4, about 310x smaller than the dense baseline's 5.9e6. We position CDLinear as a special case of structured matrix neural-network layers, with the main contributions being a closed-form Hessian-spectrum diagnostic, a principled discrete sequence of block multiplicities, and an explicit conditioning analysis. We also release a reference PyTorch implementation integrating CDLinear into a DeepSeek-V3-style mixture-of-experts transformer for future large-scale benchmarks.
May 22, 2026

Spectral Asymptotics of Neural Network Loss Landscapes: An Exact Decomposition of the Curvature Exponent

The curvature exponent αα in hk∝σkαh_k \propto σ_k^α -- governing how Hessian eigenvalues scale with gradient singular values -- varies systematically across layer types (α≈2α\approx 2 for convolutions, ≈1\approx 1 for transformer attention, <1< 1 for MLP up-projections). Why? We prove the Spectral Alignment Decomposition: α=2+dlog⁡Φk/dlog⁡σkα= 2 + d\logΦ_k / d\logσ_k, where ΦkΦ_k measures alignment between Kronecker factor eigenbases and gradient singular directions. This reduces "why does αα vary?" to a geometric question we answer for LayerNorm, residual connections, and softmax heads. The decomposition implies a spectral transfer identity s=αγs = αγ linking curvature exponent, effective gradient rank-decay γγ, and Hessian decay exponent ss. The identity is algebraic; its empirical content is that αα and γγ, fit on independent data (HVPs vs. SVD), recover ss to ~2% median error across 93 layers, five architectures, and three datasets -- with no free parameters. A zeta-function bound on participation ratio shows curvature concentrates onto effectively one direction per layer. As a proof of concept, we derive the architecture-adaptive preconditioner T(σ;α)T(σ;α) and show that Spectral Newton -- implementing TT in the gradient singular basis -- outperforms AdamW on vision benchmarks where α≈2α\approx 2.
May 25, 2026

Stochastic Estimation of the Layer-wise Hessian Trace for Monitoring Neural-network Training

The loss and the norm of its gradient separate the healthy and the pathological regimes of neural-network training only weakly, whilst the curvature of the empirical risk differs qualitatively between them but is inaccessible explicitly at parameter counts P∼106−108P\sim 10^{6}-10^{8}. We present a stochastic estimator of the trace of the diagonal blocks of the Hessian matrix of the empirical risk of a neural network. The procedure combines the Hutchinson stochastic trace estimator with a single Hessian-vector product over the whole parameter vector and recovers unbiased estimates of every per-layer trace in one backward pass through the computational graph. We show that correctness under weight sharing requires the layer-wise Hessian to be assembled before the second differentiation: unrolling shared weights into independent coordinates introduces a systematic bias whose sign and magnitude are governed by the cross-instance blocks of the unrolled Hessian. A closed-form expression for the variance of the estimator at a fixed Hessian is derived, together with a decomposition of the total variance under the mini-batch sampling distribution. This decomposition yields a critical probe count K⋆K^{\star} that balances the two sources of randomness and supports the practical recommendation K∈[5,10]K\in[5,10] in the on-line monitoring regime. The estimator is applied to the detection of the label-memorisation regime of ResNet-18, ResNet-34, and VGG-11 on CIFAR-10 and CIFAR-100, where a calibrated cumulative-sum decision rule attains an empirical detection power of 179/180179/180 at a false-alarm rate of 16/12016/120.