Mechanistic Design and Scaling of Hybrid Architectures

Michael Poli, Armin W Thomas, Eric Nguyen, Pragaash Ponnusamy, Björn Deiseroth, Kristian Kersting, Taiji Suzuki, Brian Hie, Stefano Ermon, Christopher Re, Ce Zhang, Stefano Massaroli

Abstract

Designing deep learning architectures often relies on expensive, large-scale training to validate new ideas. This paper introduces Mechanistic Architecture Design (MAD), a framework that utilizes small-scale synthetic "unit tests" to predict the scaling performance of architectures at the billion-parameter scale. Through MAD, we demonstrate that "striped" hybrid architectures—which interleave Attention layers with recurrent or convolutional primitives like Mamba or Hyena—outperform pure models in compute efficiency and memory utilization. Our findings are validated through an extensive scaling law analysis involving over 500 models trained on natural language and genomic data.

Introduction

The current landscape of deep learning architecture design is characterized by a "combinatorial nightmare." As training costs for large-scale models soar, researchers are forced to rely on heuristics or intuition when arranging computational layers. Determining whether a new primitive, such as a gated convolution, will scale effectively usually requires massive compute investments.

To address this, we propose a more nimble prototyping pipeline. We investigate two primary questions: Can simple, inexpensive synthetic tasks predict if an architecture will succeed at scale? And can we combine the specialized strengths of different primitives—Attention, Recurrences, and Convolutions—into a hybrid model that exceeds the performance of its individual components?

The MAD Pipeline: Mechanistic Unit Tests

The Mechanistic Architecture Design (MAD) pipeline consists of six synthetic "token manipulation" tasks designed to probe specific model capabilities. These tasks are computationally efficient, requiring only minutes to train on small, 2-block models, yet they serve as reliable indicators of large-scale performance:

  • Recall (In-context, Fuzzy, Noisy): Evaluates the model's ability to locate and retrieve specific information within a sequence.
  • Selective Copying: Tests the ability to filter out "noise" tokens and memorize only relevant data.
  • Compression: Measures how effectively a model can condense sequence information into a single bottleneck token.
  • Memorization: Probes the capacity to learn and store fixed facts.

Our research demonstrates that performance on these tiny tasks, particularly "Fuzzy Recall," correlates strongly with the final perplexity of 7B parameter models trained on trillions of tokens. This validates MAD as a legitimate shortcut for architecture search.

Hybridization and Striping

Rather than using a uniform stack of identical layers, we explored Striped topologies. This involves sequentially interleaving different layer types—for example, placing one Attention layer for every three Hyena or Mamba layers. This approach allows the model to inherit the complementary strengths of different primitives: Mamba excels at sequence compression, while Attention remains the gold standard for precise recall.

To ensure fair comparisons during our experiments, we introduced Iso-state Normalization. This protocol controls for the "state dimension" (the memory used to track sequence history), ensuring that performance gains are a result of architectural efficiency rather than simply increasing the model's memory capacity.

Empirical Results and Scaling Laws

Our findings are supported by the largest scaling law analysis of emerging architectures to date, encompassing over 500 language models trained on The Pile (text) and various DNA Sequence datasets. Key results include:

  • Performance Gains: Striped hybrid architectures achieved an average accuracy gain of 8.1% across MAD synthetic tasks compared to non-striped baselines.
  • Perplexity Reduction: At scale, MAD-designed hybrids achieved up to a 20% reduction in perplexity compared to state-of-the-art baselines like Transformer++, Hyena, and Mamba for an equivalent compute budget.
  • Optimal Hybridization: We identified a compute-optimal ratio of approximately 25% Attention (e.g., 1 Attention layer for every 3 recurrent/convolutional layers).
  • Overtraining Robustness: Hybrid models demonstrated superior stability when trained beyond the Chinchilla-optimal point, making them ideal candidates for small, high-performance models intended for production deployment.

Discussion and Future Work

While MAD provides a powerful tool for architecture design, several avenues for future research remain. Our current study focused on sequential "striped" arrangements; more complex topologies involving parallel branches or long-range skip-connections have yet to be fully explored. Additionally, while 2-block models are highly predictive, they may not capture emergent behaviors unique to very deep models (e.g., 80+ layers).

Future work will also focus on evaluating these hybrids on downstream benchmarks such as reasoning, coding, and long-form dialogue, as well as optimizing hardware-specific kernels to further improve the deployment efficiency of these multi-primitive architectures.

Summary updated

BibTeX
@inproceedings{poli2024mechanistic,
  author = {Michael Poli and Armin W Thomas and Eric Nguyen and Pragaash Ponnusamy and Björn Deiseroth and Kristian Kersting and Taiji Suzuki and Brian Hie and Stefano Ermon and Christopher Re and Ce Zhang and Stefano Massaroli},
  title = {{Mechanistic Design and Scaling of Hybrid Architectures}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=GDp7Gyd9nf},
}
Figure