TL;DR
MONGOOSE is a new framework that makes Locality Sensitive Hashing (LSH) highly practical for training massive neural networks. By exploiting the observation that model weights evolve slowly during training, the authors introduce a "smart scheduler" for updates alongside learnable hash functions. This combination achieves up to a 6.5x speedup and a 6x memory reduction over existing LSH methods.
What Problem Does This Paper Address?
Training modern, "giant" neural networks—especially those used in recommendation systems and natural language processing—often hits a computational wall due to the sheer size of weight matrices. For example, the final "softmax" layer in a recommendation model might need to multiply an input by hundreds of thousands of possible output classes.
Researchers often use Locality Sensitive Hashing (LSH) to mitigate this. LSH is a technique that groups similar data points into "buckets," allowing the model to perform calculations only on a small subset of "nearby" neurons instead of the entire batch. However, LSH introduces two major "pain points" in deep learning:
- Query Overhead: Randomly initialized hash functions are often inefficient in practice, leading to poor bucket assignments.
- Update Overhead: As the model learns, its weights change. Standard LSH requires rebuilding the entire hash table frequently to reflect these changes, which can be slower than simply performing the original dense matrix multiplication.
Methods
The authors introduce MONGOOSE, an end-to-end framework built to resolve these overheads using two novel components:
- The Smart Scheduler: The authors observed a "slow change" phenomenon: during training, weight vectors don't teleport; they drift. Only about 1-5% of hash codes actually change per epoch. MONGOOSE uses a theoretical "dynamic maintenance" data structure to adaptively schedule updates. It only triggers a re-hash when weights have moved enough to likely cross a bucket boundary, drastically reducing the update bottleneck.
- Learnable LSH: Instead of relying on purely random projections (which might distribute items unevenly), MONGOOSE learns the hash functions. It uses a triplet loss—a common metric learning technique—to tune the hash functions so they better separate the specific data the model is seeing during training.
- GPU-Friendly Implementation: LSH is notoriously difficult to run on GPUs because it involves "irregular" memory access (jumping around to different buckets). MONGOOSE implements a "union selection" strategy that bundles these requests together, making them efficient for parallel processing.
Datasets
The framework was evaluated on two primary tasks:
- Extreme Multi-label Classification (Recommendation Systems): Using the Wiki10-31k, Delicious-200k, Wiki-325k, and Amz-670k datasets. These are benchmarks where the number of possible labels is massive.
- Language Modeling: Using the enwik8 dataset (the first 100MB of English Wikipedia) to test the framework within the Reformer (a memory-efficient Transformer) architecture.
Key Insights and Ideas
- The "Slow Change" Discovery: The most important "aha moment" is the empirical proof that weight changes and hash code changes follow similar, rapidly decaying trajectories.
This justifies why we don't need to update LSH every single iteration. The network quickly settles into a state where weights drift rather than jump.
- Amortized Learning: Usually, "learning to hash" is too computationally expensive to perform during training. MONGOOSE makes it viable by tying the learning process to the scheduler—you only "re-learn" the hash when the scheduler dictates that the weights have drifted significantly.
- Sparsity as a Feature: By using LSH to select only the most relevant neurons, MONGOOSE naturally introduces "activation sparsity." The authors found this can actually improve accuracy (up to 8%) by acting as a form of regularization.
Key Results
- Speed & Efficiency: Compared to previous LSH-based systems like SLIDE, MONGOOSE achieved a 6.5x speedup in convergence time and a 6x reduction in memory usage.
- Accuracy: It didn't just go faster; it performed better. On recommendation tasks, it achieved up to 8% higher accuracy than previous LSH approaches.
- Layer-wise Gains: In isolated tests on single wide layers, the framework provided up to a 20x speedup compared to full matrix multiplication.
- Transformer Performance: When integrated into the Reformer architecture, it achieved better perplexity (a measure of language model quality) while maintaining the same memory savings.
Limitations and Future Work
The authors note that while LSH-based structures are great for memory, other data structures like graph-based nearest neighbor search (e.g., HNSW) can be even faster for queries. However, graph-based methods currently have much higher update costs and lack the theoretical guarantees of LSH. Adapting their "slow change" scheduling logic to graph-based structures is a promising direction for future research. Additionally, the precision parameter still requires some manual tuning, though the system appears robust to a range of values.
Summary updated