| name | neural-ode-mean-field-training |
| description | Theory of learning high-dimensional controlled non-linear dynamical systems via neural ODEs trained with online stochastic gradient descent, solved using dynamical mean field theory. Activation: neural ode, mean field theory, dynamical systems, training dynamics, learning curves, high-dimensional limit, statistical mechanics, online SGD, ResNet theory. |
| metadata | {"arxiv_id":"2606.07247","published":"2026-06-05","authors":"Pierfrancesco Urbani","category":"theoretical-foundations","tags":["neural-ode","mean-field-theory","dynamical-systems","training-dynamics","statistical-mechanics","learning-theory"]} |
| license | Complete terms in LICENSE.txt |
Neural ODE Mean Field Training Theory
Context
Neural ordinary differential equations (neural ODEs) provide a powerful unifying framework connecting continuous-time dynamical systems modeling with discrete, data-driven deep learning paradigms. This paper presents a theoretically grounded approach for studying neural ODEs trained via online stochastic gradient descent, solving training dynamics via dynamical mean field theory and deriving learning curves in the high-dimensional limit.
Key contribution: Dual dynamical nature framework — inference dynamics (ODE evolution during forward computation) AND training dynamics (parameter optimization control).
Core Methodology
1. Theoretical Framework
Neural ODEs exhibit dual dynamical systems:
Inference Dynamics: Governs ODE evolution during forward computation
- Continuous-time state evolution:
dz/dt = f(z, t, θ)
- Initial value problem solving
- Adaptive numerical integration schemes
Training Dynamics: Controls optimization of model parameters θ
- Online stochastic gradient descent trajectory
- Learning curves in high-dimensional limit
- Mean field theory treatment
2. Dynamical Mean Field Theory Approach
Step 1: Model class specification
- Define neural ODE architecture suitable for theoretical analysis
- High-dimensional parameter space (N → ∞ limit)
- Controlled non-linear dynamical systems
Step 2: Online SGD dynamics formulation
- Gradient flow equations for parameter evolution
- Stochastic noise structure from data sampling
- Temporal correlation in training trajectory
Step 3: Mean field theory application
- Replace microscopic degrees of freedom with effective fields
- Self-consistent equations for order parameters
- High-dimensional limit: N → ∞, α = P/N fixed
Step 4: Learning curve derivation
- Solve self-consistent mean field equations
- Extract generalization error dynamics
- Identify phase transitions in training
3. Applicable Settings
This framework applies to multiple neural network architectures:
-
Multi-layer Networks (ResNets)
- Skip connections as continuous-time integrators
- Depth → integration time relationship
-
Autoregressive Models
- Next-token generation as dynamical process
- Language model training dynamics
-
Generative Models
- Continuous-time flow models
- Normalizing flows, diffusion models
-
Recurrent Neural Networks
- Theoretical neuroscience applications
- Continuous-time RNN formulations
Implementation Steps
Step 1: Neural ODE Specification
import torch
import torch.nn as nn
class NeuralODE(nn.Module):
"""
Continuous-time neural network dynamics
dz/dt = f(z, t, θ) # ODE governing state evolution
Key: Inference dynamics AND training dynamics as coupled systems
"""
def __init__(self, dim, hidden_dim):
super().__init__()
self.f = nn.Sequential(
nn.Linear(dim, hidden_dim),
nn.Tanh(),
nn.Linear(hidden_dim, dim)
)
def forward(self, z0, t_span):
"""
Inference dynamics: solve initial value problem
z(t) from z0 via numerical integration
"""
from torchdiffeq import odeint_adjoint as odeint
z_trajectory = odeint(self.f, z0, t_span)
return z_trajectory[-1]
Step 2: Online SGD with Training Dynamics
def train_neural_ode_dynamics(model, data_stream, T_total, learning_rate):
"""
Online SGD tracking both inference and training dynamics
Inference dynamics: forward ODE evolution
Training dynamics: parameter θ(t) trajectory
Mean field limit: N_params → ∞, α = P/N fixed
"""
optimizer = torch.optim.SGD(model.parameters(), lr=learning_rate)
param_trajectory = []
for t in range(T_total):
z0, target = next(data_stream)
z_final = model(z0, torch.tensor([0., 1.]))
loss = torch.mean((z_final - target)**2)
optimizer.zero_grad()
loss.backward()
optimizer.step()
param_trajectory.append(get_parameter_vector(model))
return param_trajectory
Step 3: Mean Field Analysis
def mean_field_learning_curves(param_trajectory, N_params):
"""
Extract learning curves from high-dimensional parameter dynamics
Key quantities:
- Order parameters (self-consistent fields)
- Generalization error evolution
- Phase transition detection
"""
import numpy as np
param_means = [np.mean(p) for p in param_trajectory]
param_vars = [np.var(p) for p in param_trajectory]
order_parameter = compute_order_parameter(param_trajectory)
learning_curve = derive_generalization_dynamics(order_parameter)
return {
'param_means': param_means,
'param_vars': param_vars,
'order_parameter': order_parameter,
'learning_curve': learning_curve
}
Key Theoretical Results
Learning Curve Properties
From dynamical mean field theory in high-dimensional limit:
-
Training Error Dynamics
- Monotonic decay controlled by noise structure
- Phase transitions at critical learning rates
-
Generalization Error
- Non-monotonic behavior possible (overfitting regimes)
- Controlled by α = P/N ratio
-
Critical Learning Rate
- Phase transition threshold
- Stability condition for online SGD dynamics
Phase Diagram
Under-parametrized regime (α → ∞):
- Fast convergence to training optimum
- Good generalization
Over-parametrized regime (α → 0):
- Slower training dynamics
- Potential for memorization
Critical regime (α ~ 1):
- Phase transition point
- Rich dynamical structure
Pitfalls
-
Numerical Integration Stability
- Neural ODE inference requires adaptive solvers
- Fixed-step methods can diverge for stiff dynamics
- Fix: Use adaptive solvers (RK45, Dormand-Prince) with error tolerance control
-
Gradient Computation Cost
- Adjoint method reduces memory but increases computation
- Direct backpropagation through integration steps expensive
- Fix: Balance adjoint vs direct methods based on problem structure
-
Mean Field Assumptions
- High-dimensional limit N → ∞ required
- Finite N systems may deviate from theoretical predictions
Fix: Check scaling convergence with increasing parameter count
-
Online SGD vs Batch Training
- Mean field theory applies to online (single-sample) SGD
- Batch training dynamics differ qualitatively
- Fix: Match theoretical assumptions to actual training protocol
-
Model Class Restrictions
- Mean field theory requires specific architecture assumptions
- General neural ODEs may not satisfy theoretical conditions
- Fix: Validate architecture falls within theoretically tractable class
Verification
Theoretical Validation
-
Order Parameter Self-Consistency
order_param_left = compute_order_parameter(params)
order_param_right = mean_field_equation(params, alpha, eta)
assert np.allclose(order_param_left, order_param_right)
-
Learning Curve Scaling
N_values = [1000, 5000, 10000, 50000]
learning_curves = [train_with_N(N) for N in N_values]
check_convergence_to_mean_field_limit(learning_curves)
Practical Testing
python scripts/train_neural_ode.py --task oscillator --N 10000 --T 1000
python scripts/mean_field_validation.py --params trained_params.pkl
Applications
Theoretical Neuroscience
- Continuous-time RNN training dynamics
- Understanding biological learning processes
- Predicting neural network training behavior from statistical mechanics principles
Deep Learning Theory
- ResNet depth → integration time mapping
- Language model training trajectory analysis
- Generative model flow dynamics
Optimization Theory
- Online SGD convergence rates
- Phase transitions in learning
- Critical learning rate identification
References
- arXiv:2606.07247v1 - "Theory of learning of high-dimensional controlled non-linear dynamical systems (I): models and methods"
- Neural ODE foundations: Chen et al. (2018), "Neural Ordinary Differential Equations"
- Mean field theory for neural networks: Statistical mechanics approaches to learning theory
Activation Keywords
neural ode, mean field theory, dynamical systems, training dynamics, learning curves, high-dimensional limit, statistical mechanics, online SGD, ResNet theory, continuous-time networks, inference dynamics, parameter optimization, phase transitions, learning theory, adjoint method