Finite-size scaling (FSS) analysis is a fundamental technique in statistical physics and computational condensed matter physics for investigating critical phenomena and phase transitions from finite-size numerical simulation data.
Neural Scaling Analysis (NSA) is a machine learning framework that formulates finite-size scaling analysis as an end-to-end regression problem using neural networks. This package jaxfss provides a fast, JIT-compiled, flexible implementation of NSA built on top of JAX, Flax, and Optax.
1. Finite-Size Scaling Hypothesis¶
Near a continuous phase transition at a critical point , correlation lengths diverge and physical observables obey universal scaling relations. In a finite-size system with linear dimension at temperature , an observable follows the finite-size scaling law:
where:
is the critical point (e.g., critical temperature).
is the scaling exponent related to the correlation length exponent .
is the anomalous dimension or scaling exponent of observable .
is the universal scaling function, which is generally unknown a priori.
The goal of scaling analysis is to estimate the critical parameters such that data points from different system sizes collapse onto a single master curve .
2. Motivation: Why Neural Networks?¶
Traditionally, two main methods have been used to perform finite-size scaling analysis:
Polynomial regression:
Approximates the scaling function with a low-order Taylor polynomial.
Limitations: Only valid in a narrow region around the critical point (). Prone to overfitting or underfitting if the polynomial degree is mischosen.
Gaussian Process (GP) regression (e.g., Harada’s Bayesian Scaling Analysis):
Provides non-parametric, flexible curve fitting with error estimation.
Limitations: Computational complexity scales as where is the number of data points, making it prohibitively heavy for large-scale or dense Monte Carlo datasets.
Neural Scaling Analysis (NSA) overcomes both limitations:
High expressiveness: Universal approximation capability of neural networks models arbitrary smooth scaling functions across wide parameter windows.
Linear computational complexity: With modern automatic differentiation and mini-batch / full-batch gradient descent in JAX, the computational cost scales as .
GPU/TPU acceleration: NSA easily scales to massive data using hardware acceleration.
3. Method Architecture¶
In NSA, the scaling function is parameterized by a neural network :
The network parameters and the critical parameters are jointly optimized by minimizing a loss function:
Data Pre-Processing (CriticalData)¶
Neural networks train best when inputs and targets are standardized to order . CriticalData automatically applies affine transformations:
Rescales system size .
Rescales temperature .
Rescales observable .
Parameter Constraints (Bijectors)¶
Physical exponents often have known constraints (e.g., , or ).
Using bijectors (such as softclip.SoftClip), unconstrained optimization variables are mapped to physical parameters:
Activation Functions (RationalMLP)¶
Standard ReLU or sigmoid networks can have derivative discontinuities or saturation issues. RationalMLP uses trainable rational functions as activations, offering superior smoothness and expressiveness for physical functions.
4. Loss Functions¶
Mean Squared Error (MSELoss)¶
When observational uncertainties are uniform or negligible:
Negative Log-Likelihood Loss (NLLLoss)¶
When Monte Carlo errors are provided for each data point:
where the scaled variance is .
5. Dual Optimization Strategy¶
Because the neural network weights and critical parameters have different optimization landscapes, it is advantageous to use separate learning rates:
for neural network parameters
for critical exponents and critical point
jaxfss.fit supports passing a dictionary of Optax optimizers:
optimizer = {
"mlp": optax.adam(learning_rate=1e-3),
"fss": optax.adam(learning_rate=1e-2),
}
params, losses, critical_vals = jaxfss.fit(loss_fn, optimizer, init_params, steps=10000)Reference¶
If you use NSA or jaxfss in your research, please cite:
R. Yoneda and K. Harada, Neural network approach to scaling analysis of critical phenomena, Phys. Rev. E 107, 044128 (2023). Yoneda & Harada (2023).
- Yoneda, R., & Harada, K. (2023). Neural network approach to scaling analysis of critical phenomena. Physical Review E, 107(4). 10.1103/physreve.107.044128