TL;DR
Rationally Linearized MLPs (RaLiMPs) offer a novel way to make deep learning models more efficient by replacing standard non-linear layers with low-degree rational approximations. By "disentangling" inputs from weights through kernel-based linearization, RaLiMPs significantly reduce memory and inference costs—achieving up to a 57% reduction in parameters for vision models and 50% memory savings for LLMs—while maintaining or even improving accuracy.
What Problem Does This Paper Address?
Multilayer Perceptrons (MLPs) are the workhorses of modern AI, appearing in everything from Transformers to 3D Neural Radiance Fields (NeRFs). However, they come with a heavy computational price tag: their cost scales quadratically with input dimensionality. As researchers have successfully optimized the attention mechanism in Transformers, MLPs have emerged as the new primary bottleneck, especially when the input dimension is much larger than the sequence length.
Previous attempts to "linearize" MLPs—approximating the non-linear activation function as a product of two separate feature maps (one for inputs, one for weights)—often relied on polynomials. The problem? Polynomials are terrible at approximating "saturating" functions like Sigmoid or GELU over large ranges; they tend to diverge wildly, requiring very high degrees (and thus high computational cost) to be accurate.
Methods
The authors introduce RaLiMPs, which use rational functions (ratios of polynomials) instead of pure polynomials to approximate activation functions.
The core technical approach involves:
- Rational Surrogate: Replacing the standard activation function $f$ with a rational approximation $R$.
- Partial-Fraction Decomposition: Breaking down the rational function into a polynomial part and several "irreducible-quadratic atoms" (terms with complex poles).
- Separable Feature Maps:
- The polynomial part is handled using standard product features.
- The rational "atoms" are handled by expressing them as Laplace integrals and then estimating those integrals using a combination of deterministic frequency quadrature and randomized feature maps (similar to the "Performers" architecture).
- Layer Fusion: Because the input and weights are disentangled, the linearized layer can be mathematically "collapsed" into the subsequent linear layer during inference. This eliminates wide intermediate matrices entirely.
Datasets
The authors evaluated RaLiMPs across a massive range of tasks:
- Synthetic Benchmarks: Testing approximations of GELU, SiLU, tanh, sigmoid, and softsign.
- Vision: CIFAR-100, Places365, ImageNet-1k, and the challenging VTAB-1k (Visual Task Adaptation Benchmark).
- 3D Modeling: ScanNet, ScanNet200, and nuScenes for semantic segmentation (using the PTv3 backbone); synthetic Blender scenes for NeRF; and the "Cameraman" image for SIREN.
- Language Modeling: Pre-training GPT-2 Large (770M) on OpenWebText and compressing the production-scale Qwen3-8B using reasoning datasets like OpenThoughts-1.2M and DeepScaleR.
- LLM Evaluation: GSM8K, MATH500, MMLU, AIME, and GPQA.
Key Insights and Ideas
- Rational > Polynomial: Rational functions can capture the "flat" saturating regions of activations much more efficiently than polynomials. A low-degree rational function can achieve the same accuracy as a much higher-degree polynomial.
- Decoupling Accuracy and Cost: In polynomial methods, increasing accuracy (degree) exponentially increases the variance of the estimator. In RaLiMPs, you can add more "poles" to the rational function to sharpen the fit without increasing the variance, which is determined primarily by the input scale.
- Disentanglement is Power: By separating $x$ and $W$, the model never has to materialize the "wide" hidden state of the MLP. This is what leads to the massive memory and throughput gains shown in Figure 4.
Key Results
The empirical results demonstrate that RaLiMPs are a "free lunch" for many architectures:
- Vision Transformers (ViT): Replaced layers resulted in up to a 57% reduction in inference parameters while staying competitive with full fine-tuning baselines.
- Large Language Models (LLMs):
- For GPT-2 Large, memory usage was cut by 50% and throughput increased as more layers were replaced.
- For Qwen3-8B, the authors removed 1.17 billion parameters (~14% of the model). Despite this, the model maintained near-parity on reasoning benchmarks like GSM8K and MATH500.
- 3D Modeling: In NeRF and SIREN tasks, RaLiMPs matched the performance of dense models while being 30-50% smaller.
Limitations and Future Work
- Fine-tuning Requirement: While RaLiMPs are efficient, replacing layers in a pre-trained model usually requires a round of fine-tuning or distillation to recover the accuracy lost during the initial approximation.
- Input Norm Sensitivity: The variance of the rational estimator still depends on the norm of the inputs ($\|x+w\|$). While the authors use a scaling factor ($\tau$) to manage this, extremely high-norm inputs could still pose challenges.
- Future Directions: The authors suggest that future work could involve learning the locations and widths of the rational "poles" dynamically during training, rather than relying on fixed initializations.
Summary updated