Abstract
Modern sequence modeling faces a fundamental trade-off between the exact recall of Transformers and the computational efficiency of State Space Models (SSMs). We introduce B’MOJO, a novel hybrid architecture that unifies these paradigms through the lens of Stochastic Realization Theory. B’MOJO utilizes a principled "Innovation Selection" mechanism to identify and store unpredictable tokens in an exact (eidetic) memory while summarizing predictable information in a lossy (fading) state. Our results demonstrate that B’MOJO achieves superior long-context performance, 15% faster training speeds than standard baselines, and robust length generalization, effectively bridging the gap between quadratic-complexity attention and linear-complexity recurrence.
1. Introduction
The landscape of foundation models is currently dominated by two distinct architectures: Transformers and State Space Models (SSMs). Transformers excel at "eidetic memory"—the ability to recall specific information exactly—by storing every token in a Key-Value (KV) cache. However, this comes at the cost of quadratic computational complexity and a fixed context window. Conversely, SSMs like Mamba offer linear complexity by compressing history into a fixed-size "fading memory" state, which inevitably leads to the loss of fine-grained details over long sequences.
While existing hybrid models attempt to combine these strengths by interleaving layers, they often lack a unified theoretical framework to modulate between memory types. B’MOJO addresses this by treating sequence modeling as a dynamical system realization problem. By dynamically deciding which information is worth preserving in high resolution, B’MOJO optimizes the use of its memory budget, providing a scalable and efficient alternative for long-context sequence modeling.
2. Methodology
2.1 Stochastic Realization and B’MOJO-F
The B’MOJO framework shifts the focus from learning static "representations" to learning generative "realizations." The model is designed as a dynamical system where the goal is to minimize residual error until it resembles white noise. The primary component, B’MOJO-F (Fading), utilizes a "Controllable Canonical Form" to manage state transitions. This mathematical structure allows B’MOJO to generalize both Mamba-style diagonal dynamics and Attention-style sliding windows into a single, unified state-transition matrix.
2.2 Innovation Selection
The core novelty of B’MOJO is its Innovation Selection mechanism. Unlike standard sliding windows that retain tokens based on recency, B’MOJO retains tokens based on their "innovation"—the degree to which a token is unpredictable given the current fading state. If the model’s internal state cannot accurately predict a new token (resulting in high innovation error), that token is deemed high-value and appended to an eidetic memory register. This allows the model to prioritize the storage of surprising or unique information while summarizing redundant data.
2.3 Tiered Memory Hierarchy
B’MOJO manages a sophisticated four-tier memory hierarchy to balance efficiency and recall:
- Short-term Eidetic: In-context exact recall for high-innovation tokens.
- Permanent Structural: Information embedded directly into the model weights.
- Fading Memory: A compressed, lossy summary of the sequence state.
- Long-term Eidetic: External storage or Retrieval-Augmented Generation (RAG) for massive contexts.
To ensure scalability, the authors developed optimized CUDA kernels and a "memory chunking" strategy, enabling parallelized training that avoids the sequential bottlenecks typical of recurrent architectures.
3. Experimental Evaluation
3.1 Tasks and Datasets
B’MOJO was evaluated across a diverse suite of benchmarks:
- Synthetic Recall: Tasks such as Multi-Query Associative Recall (MQAR) and Selective Copying were used to measure the model's ability to retrieve specific data points.
- Language Modeling: Models were pre-trained from scratch on standard large-scale datasets at scales ranging from 130M to 1.4B parameters.
- Downstream Reasoning: Performance was validated on common-sense tasks including LAMBADA, HellaSwag, PIQA, and ARC.
- Long-Context Analysis: The PG-19, SWDE, and Scrolls datasets provided a testing ground for sequences significantly longer than those encountered during training.
3.2 Key Results
- Superior Recall: In MQAR benchmarks, B’MOJO significantly outperformed both Mamba and standard hybrid models, maintaining high accuracy even as the number of key-value pairs scaled.
- Training Efficiency: Due to hardware-aware co-design, B’MOJO demonstrated a 15% increase in training speed compared to similarly-sized Transformer and SSM baselines.
- Competitive Performance: At the 1.4B parameter scale, B’MOJO achieved perplexity scores comparable to Mistral while consistently outperforming pure SSM architectures like Mamba.
- Length Generalization: A standout capability of the architecture is its ability to extrapolate. Models trained on 8K token sequences continued to show accuracy improvements when tested on up to 32K tokens (a 4x extrapolation), a regime where standard Transformers typically fail.
4. Discussion and Limitations
While B’MOJO represents a significant step forward in hybrid modeling, several areas for future research remain. Scaling the architecture to 70B+ parameters will require further engineering to ensure that the observed scaling laws hold at extreme magnitudes. Additionally, the current "innovation predictor" relies on fixed 1D convolutions; the authors suggest that a learnable, more complex predictor could further refine the memory selection process. Finally, ensuring numerical stability in Mamba-based modules during massive compute runs remains a priority, with "time normalization" techniques proposed as a potential solution.
5. Conclusion
B’MOJO provides a theoretical and practical bridge between the two dominant paradigms in sequence modeling. By using unpredictability as a filter for memory storage, it achieves a highly efficient balance between exact recall and state compression. Its success in length generalization and training efficiency marks it as a promising candidate for the next generation of long-context foundation models.
Summary updated