Introduction
As Large Language Models (LLMs) continue to scale, the computational cost of training and inference has become a primary bottleneck. Sparse Feed-Forward Networks (S-FFNs) have emerged as a promising solution to this challenge. By increasing the total number of parameters while only activating a small subset for any given input token, S-FFNs maintain constant FLOPs (floating-point operations) despite higher model capacity.
Historically, the development of S-FFNs has been split into two distinct paradigms: Mixture-of-Experts (MoE), which utilizes learned routers to select among discrete sub-networks, and Sparse Neural Memory, which treats the FFN as a massive key-value lookup table. This paper proposes a unified framework that bridges these two approaches, analyzing the design space of S-FFNs to identify the core drivers of performance.
A Unified Framework for S-FFNs
The authors characterize all existing S-FFN methods along two fundamental dimensions:
- Memory Block Size ($g$): This refers to the number of memory cells (or FFN hidden dimensions) that share a single routing decision. In traditional MoE models, the block size is typically large (the size of one expert), whereas in neural memory architectures, it can be as small as a single cell.
- Selection Method: This defines how the model chooses which blocks to activate. The authors distinguish between Indirect selection, which uses a separate, independently learned gating matrix, and Direct selection, which utilizes the FFN's own internal key vectors to determine relevance.
The Avg-K Routing Mechanism
Building on this unified view, the researchers introduce Avg-K, a novel routing method designed to maximize the efficiency of direct selection. In Avg-K, each block of parameters is represented by the average of its internal key vectors. To route a token, the model performs a simple dot product between the input and these block averages.
This "direct" approach ensures that the routing logic is tightly coupled with the actual knowledge stored within the FFN. Unlike traditional MoE models, Avg-K does not require complex load-balancing losses to prevent mode collapse, as it naturally learns a balanced representation of the data.
Experimental Setup and Datasets
The models were pretrained on a massive 112-billion token corpus (453GB of text) comprising English CC100, BookCorpus, English Wikipedia, CC-News, OpenWebText, and CC-Stories. To measure the models' ability to generalize to unseen data, the researchers evaluated "out-of-domain" perplexity using The Pile, a diverse dataset spanning 22 different domains.
Key Insights and Results
The study yielded several critical findings for the design of future LLMs:
- Granularity and Performance: One of the most consistent findings was that reducing the block size improves perplexity. Smaller blocks allow the model to combine parameters more flexibly, effectively increasing its expressive capacity for the same computational budget.
- The Superiority of Direct Selection: Selection methods that rely directly on the FFN's internal key-value structure (such as Avg-K) consistently outperform those using separate, indirect gating layers.
- Robustness to Negative Values: While standard neural memory can be disrupted by negative dot products, Avg-K handles them naturally through its averaging mechanism, making it more robust across various block sizes.
- Benchmark Performance: Avg-K achieved a perplexity of 14.80 on the validation set of The Pile. This significantly outperforms established baselines, including the Switch Transformer (16.45) and HashLayer (15.75), while adding less than 1% additional FLOPs compared to a standard dense baseline.
Limitations and Future Directions
Despite its performance gains, the authors note that smaller block sizes can increase "all-to-all" communication costs in distributed training environments. There remains a "sweet spot" between mathematical optimality and hardware efficiency that must be navigated. Additionally, while Avg-K performed well at the 355M parameter scale without explicit load balancing, further research is needed to determine if mode collapse becomes a factor at the scale of hundreds of billions of parameters. Future work may also explore more sophisticated metrics beyond simple dot-product similarity for measuring the distance between input tokens and parameter blocks.
Summary updated