NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rational neural networks

Nicolas Boullé, Yuji Nakatsukasa, Alex Townsend

TL;DR

This paper introduces Rational Neural Networks, which replace standard activation functions like ReLU with trainable rational functions (ratios of polynomials). The authors prove that these networks can approximate smooth functions with exponentially less depth than ReLU networks and demonstrate superior performance in solving partial differential equations (PDEs) and training Generative Adversarial Networks (GANs).

What Problem Does This Paper Address?

In deep learning, the choice of activation function ($\sigma$) is a primary driver of a network's performance. While ReLU is the industry standard due to its simplicity and avoidance of vanishing gradients, it has significant drawbacks:

  1. Non-smoothness: ReLU is not differentiable at zero, which can be problematic for physics-based applications (like solving PDEs) where smoothness is required.
  2. Dying Neurons: The gradient is zero for all negative inputs, which can stall training.
  3. Approximation Efficiency: ReLU networks often require massive depth to approximate smooth functions to high precision.

Alternative smooth functions like sigmoid or tanh suffer from vanishing gradients, while pure polynomials are often numerically unstable. This paper fills the gap by proposing rational functions as a robust, trainable, and theoretically superior alternative.

Methods

The core idea is to use a rational function of the form: $$F(x) = \frac{P(x)}{Q(x)} = \frac{a_0 + a_1x + \dots + a_{r_P}x^{r_P}}{b_0 + b_1x + \dots + b_{r_Q}x^{r_Q}}$$ The coefficients ($a_i, b_j$) are trainable parameters, learned via backpropagation alongside the network's weights and biases.

Key Technical Choices:

  • Type (3, 2): The authors specifically recommend using a numerator of degree 3 and a denominator of degree 2. This "superdiagonal" type allows the function to behave linearly at infinity (like ReLU or Leaky ReLU) rather than flattening out.
  • Initialization: To avoid numerical instability or "poles" (where the denominator hits zero), they initialize the coefficients to the best rational approximation of the ReLU function. This ensures the network starts with a "safe" baseline and evolves toward a more optimal, smooth shape.
Rational approximation of ReLU
  • Composition: By stacking layers, the network implicitly constructs very high-degree rational functions. A network with $L$ layers of type (3,2) activations represents a rational function of degree $3^L$, providing immense expressive power with very few parameters.

Datasets

The authors evaluated their approach on two distinct tasks:

  1. Korteweg–de Vries (KdV) Equation: A non-linear PDE used to model waves. The "dataset" consists of spatio-temporal points sampled from a known solution.
  2. MNIST: The classic dataset of 70,000 handwritten digits, used here to evaluate the stability and expressive power of rational functions within a Generative Adversarial Network (GAN) architecture.

Key Insights and Ideas

  • Exponential Efficiency: The most striking theoretical finding is that rational networks can approximate smooth functions in the Sobolev space $W^{n,\infty}$ with a depth of $\mathcal{O}(\log(\log(1/\epsilon)))$. In contrast, ReLU networks require $\mathcal{O}(\log(1/\epsilon))$ depth. This means rational nets are exponentially more efficient at reaching high precision.
  • Smoothness for Physics: For PDE solvers, the "kinks" in ReLU approximations lead to non-physical artifacts. Rational functions are inherently smooth, making them natural candidates for scientific machine learning.
  • Minimal Parameter Overhead: Switching to rational activations adds a negligible number of parameters. For a typical layer with 50 nodes, using a single shared rational function adds only 7 parameters (the coefficients of the (3,2) rational), while significantly boosting the network's capacity.

Key Results

  • PDE Accuracy: In solving the KdV equation, the Rational Neural Network achieved a Mean Squared Error (MSE) of $1.2 \times 10^{-7}$. This was roughly 5x more accurate than a sinusoid-based network and 20x more accurate than a standard ReLU network.
Validation loss for KdV equation
  • GAN Expressivity: When used in an Auxiliary Classifier GAN (ACGAN) on MNIST, rational activations generated images with a broader range of features (like bold strokes) compared to ReLU, suggesting they capture the underlying data distribution more effectively.
  • Training Stability: Despite the potential for poles in rational functions, the Zolotarev-based initialization proved robust, allowing the networks to converge reliably across different tasks.

Limitations and Future Work

  • Mode Collapse in GANs: While the rational GAN produced high-quality images, the authors noted signs of "mode collapse" (generating identical versions of certain digits), suggesting that the increased flexibility of rational functions might require more careful regularization in adversarial settings.
  • Initialization Sensitivity: While the paper provides a strong initialization strategy, the performance of rational networks is likely more sensitive to starting conditions than ReLU.
  • Computational Cost: Although the parameter count is low, evaluating a rational function (polynomial division) is slightly more computationally expensive than a simple max(0, x) operation, though this is usually offset by the need for fewer layers.

Future research directions include applying these networks to time-series forecasting and more complex fluid dynamics problems where smoothness and high-precision approximation are critical.

Summary updated

BibTeX
@inproceedings{boulle2020rational,
  author = {Nicolas Boullé and Yuji Nakatsukasa and Alex Townsend},
  title = {{Rational neural networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=0l3i9Lvdb7},
}
Figure