In recent years, the AI field has converged on the Transformer as the "universal" architecture for vision, language, and speech. However, while Transformers are incredible generalists, they often struggle with specific domains like basic arithmetic or algorithmic logic. This raises a fundamental question: Are Transformers uniquely gifted with the best "generic" inductive biases, or are we just scaling a suboptimal design?
Inductive biases are the prior assumptions built into a model's architecture that help it learn from data. If a model's bias is misaligned with the task—for example, using a language-optimized model for math—it will require significantly more data and parameters to succeed, or it might fail entirely. Recent research suggests that the "standard" Transformer architecture is often far from optimal for specific tasks.
Evolving the Transformer Architecture
To investigate this, researchers developed a method to "evolve" the Transformer's architecture for specific datasets. Their key innovation was replacing the standard, fixed non-linearities—specifically the GeLU activation in the MLP layers and the Softmax in the attention mechanism—with learnable 1D linear splines.
To ensure these new shapes represented true architectural improvements rather than just overfitting, the team used a robust two-stage process:
- Architecture Optimization: They trained multiple models in parallel using different random seeds but sharing the same spline parameters. The splines were optimized on a held-out "architecture" dataset while weights were trained on a separate set.
- Evaluation: They froze the learned spline shapes and trained a new model from scratch to see if this optimized architecture outperformed the standard baseline.
The Specialization Trade-off
The study evaluated models across two distinct domains: algorithmic reasoning (e.g., decimal addition, repeating sequences) and language/code modeling (e.g., Wikipedia, CodeSearchNet, FineWeb).
The findings revealed that standard Transformers are rarely "local optima." In almost every case, researchers found a better architecture simply by tweaking the non-linearities. However, this comes with a specialization trade-off. For algorithmic tasks, the optimized architectures were vastly superior but highly specialized. A design that makes a model three times faster at addition might make it worse at memorization. This explains why many "improved" components in research papers work well on toy tasks but are rarely adopted for general Large Language Models (LLMs).
Interestingly, architectures optimized for English transferred very well to computer code, suggesting that natural language and programming languages share a similar underlying structural DNA. The researchers also noted that the fine details of the learned activation functions matter; "cleaning" or smoothing the complex, wavelet-like shapes actually hurt performance.
Key Results: Speed and Generalization
The optimized architectures demonstrated significant performance leaps, particularly in algorithmic reasoning:
- Massive Speedups: On tasks like decimal addition (
ADD) and nested arithmetic (MANO), the optimized architectures converged 2 to 3 times faster than standard Transformers and showed significantly less variance across different random seeds. - Solving Length Generalization: Standard Transformers usually fail when asked to process sequences longer than those seen during training. On the
COPYtask, the spline-optimized architecture maintained high accuracy on sequences much longer than the training data.
Beyond toy tasks, the spline-based models also showed consistent gains in LLMs, achieving lower validation loss than GeLU baselines across various model depths (2 to 12 layers) on the FineWeb dataset.
Limitations and Future Directions
While promising, this approach has limitations. The search space only modified non-linearities, leaving the fundamental attention mechanism unchanged. Additionally, while tested up to ~160M parameters, it remains to be seen if these architectural gains persist at the scale of multi-billion parameter models like GPT-4.
Furthermore, splines are computationally slower than simple ReLUs or GeLUs. However, the authors demonstrated that high-degree polynomial approximations of their learned splines can recover the performance gains while running as fast as standard activations.
The ultimate goal for future research is to find a "multi-task" optimization—discovering a single architecture capable of both the fluid reasoning of algorithmic models and the broad, general knowledge of language models.
Summary updated