Inter-Layer Hessian Analysis of Neural Networks with DAG Architectures
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 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 ( a.e., ); 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~, geometric coupling~, stable rank~, GN-Gap) that are estimated stochastically in 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, M~parameters, Exp.,6). When the architecture reduces to a single node, all definitions collapse to the standard Hessian .
Figures & tables
| Symbol | Definition |
|---|---|
| Graph and derivatives | |
| DAG of the neural network | |
| , | Parents / children of node |
| Output of node | |
| Parameters of node | |
| Gradient | |
| Arch | Acc (%) | |||||||
|---|---|---|---|---|---|---|---|---|
| 8 | Plain | 2.59 | 2.50 | 2.78 | 0.02 | 0.05 | 0.08 | 49.8 |
| 8 | Res. | 1.25 | 1.31 | 1.33 | 0.02 | 0.04 | 0.04 | 51.3 |
| 10 | Plain | 2.69 | 2.47 | 2.59 | 0.03 | 0.03 | 0.04 | 49.7 |
| 10 | Res. | 1.22 | 1.27 | 1.29 | 0.02 | 0.03 | 0.04 | 51.3 |
| 12 | Plain | 2.69 | 2.48 | 2.55 | 0.03 | 0.03 | 0.04 | 49.7 |
| 12 | Res. | 1.20 | 1.23 | 1.25 | 0.01 | 0.03 | 0.03 | 51.3 |
| Acc (%) | |||||
|---|---|---|---|---|---|
| 4 | 8.9 ‡ | ||||
| 8 | 14.2 | ||||
| 16 | 17.8 | ||||
| 32 | 19.8 | ||||
| 64 | 21.1 | ||||
| 128 | 22.0 |
| Activation | (%) | Acc (%) | |||
|---|---|---|---|---|---|
| ReLU | 67.8 | 0 | |||
| LeakyReLU | 66.1 | 0 | |||
| Softplus | 40.9 | 0.045 | |||
| SiLU | 81.7 | 0.142 | |||
| GELU | 77.5 | 0.271 |
| Activation | (%) | Acc (%) | |||
|---|---|---|---|---|---|
| ReLU | — | 0 | |||
| LeakyReLU | — | 0 | |||
| Softplus | 8.9 | 0.058 | |||
| SiLU | 3.5 | 0.246 | |||
| GELU | 3.4 | 0.618 |
| Merge | |||||
|---|---|---|---|---|---|
| sum | ReLU | ||||
| sum | SiLU | ||||
| cat | ReLU | ||||
| cat | SiLU |
| Model | Checkpoint | Gap | |||
|---|---|---|---|---|---|
| Attention | init | ||||
| Attention | mid | ||||
| Attention | final | ||||
| ReLU-MLP | init | ||||
| ReLU-MLP | mid | ||||
| ReLU-MLP | final |
| ReLU | SiLU | |||
| ResNet | Plain | ResNet | Plain | |
| ReLU | SiLU | ReLU | SiLU | |||||
| Res. | Plain | Res. | Plain | Res. | Plain | Res. | Plain | |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Acc (%) | |||||
|---|---|---|---|---|---|
| 4 | 9.6 ‡ | ||||
| 8 | 14.1 | ||||
| 16 | 17.7 | ||||
| 32 | 19.1 | ||||
| 64 | 20.5 | ||||
| 128 | 21.4 |
| Arch. | Acc (%) | |||||
|---|---|---|---|---|---|---|
| 8 | Plain SN | 0.91 | 1.00 | 1.01 | 0.24 | 36.3 |
| 8 | Res. | 1.25 | 1.33 | 0.02 | 0.04 | 51.3 |
| 12 | Plain SN | 0.91 | 0.89 | 1.01 | 1.03 | 10.0 |
| 12 | Res. | 1.20 | 1.25 | 0.01 | 0.03 | 51.3 |
| 16 | Plain SN | 0.91 | 0.90 | 1.01 | 1.03 | 10.0 |
| 16 | Res. | 1.17 | 1.20 | 0.01 | 0.02 | 51.0 |
| Arch. | Phase | |||||
|---|---|---|---|---|---|---|
| 16 | Plain | init | ||||
| 16 | Plain | final | ||||
| 16 | Res. | init | ||||
| 16 | Res. | final | ||||
| 32 | Plain | init | ||||
| 32 | Plain | final |
| Configuration | |||||
|---|---|---|---|---|---|
| 1 | sum+ReLU | ||||
| 1 | sum+SiLU | ||||
| 1 | cat+ReLU | ||||
| 1 | cat+SiLU | ||||
| 2 | sum+ReLU | ||||
| 2 | sum+SiLU |
| Activation | ||||
|---|---|---|---|---|
| 0 | Softplus | |||
| 0 | SiLU | |||
| 0 | GELU | |||
| 2 | Softplus | |||
| 2 | SiLU | |||
| 2 | GELU |
| Activation | (%) | (%) | ||
|---|---|---|---|---|
| Softplus | ||||
| SiLU | ||||
| GELU |
| Condition | ||||
|---|---|---|---|---|
| ReLU ResNet | 0 | |||
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| ReLU Plain | 0 |
| Checkpoint | Condition | |||||
|---|---|---|---|---|---|---|
| init | ReLU ResNet | |||||
| ReLU Plain | ||||||
| SiLU ResNet | ||||||
| SiLU Plain | ||||||
| mid | ReLU ResNet | |||||
| ReLU Plain |
Neural Network Optimization
Neural network optimization studies algorithms and training dynamics that help models learn efficiently, reliably, and generalize well.
See all 331 papers