Introduction
Pre-trained Language Models (PLMs) like RoBERTa have revolutionized NLP but remain prohibitively large for deployment on resource-constrained edge devices. Standard adaptation involves "fine-tuning," which requires storing a full model copy for every task—a significant barrier for smartphones or IoT sensors. While Parameter-Efficient (PE) methods like Adapters reduce storage by updating only a fraction of the model, they often introduce computational overhead that slows down inference on mobile CPUs.
SPARTAN (Sparse Hierarchical Memory) addresses this gap by introducing a memory module that is efficient in both storage and computation. It achieves a 10x throughput increase over standard PE baselines on a Raspberry Pi 4 while maintaining competitive accuracy on the GLUE benchmark.
The SPARTAN Architecture
SPARTAN integrates a specialized memory module after each Transformer layer, inspired by the hierarchical and sparse organization of human memory. The process follows three distinct stages:
- Sparse Parent Selection: For each input, the model calculates an attention distribution over a set of "parent cells" and selects only the top-K most relevant ones.
- Conditioned Child Computation: Each parent manages a set of "children cells" (Key-Value pairs). The model only computes representations for children associated with the selected parents.
- Aggregation and Residual: These representations are weighted by parent attention scores, summed, and added back to the input via a residual connection.
By utilizing "top-K" selection, SPARTAN ignores the majority of memory parameters during the forward pass, directly translating to higher throughput without sacrificing the model's capacity.
Key Results
The authors evaluated SPARTAN against standard baselines like RoBERTa (full fine-tuning), Pfeiffer, and Houlsby adapters across the GLUE benchmark.
Throughput and Efficiency
On a Raspberry Pi 4, SPARTAN achieved a 90% increase in throughput compared to Houlsby adapters. On an iPhone 11 (emulated), it was approximately 1.6x faster than existing PE methods. Notably, SPARTAN achieves these speeds while using roughly 87% less storage space than full fine-tuning.
Accuracy
Despite its efficiency, SPARTAN matches or exceeds the performance of its peers. On the GLUE benchmark, it slightly outperformed the Houlsby adapter (+0.1 points) and remained competitive with full RoBERTa fine-tuning. In few-shot scenarios (200 examples), SPARTAN fine-tuned 1.5x faster than other PE methods.
Insights and Interpretability
A significant finding was the interpretable specialization of the memory cells. When trained on news datasets, specific parent cells naturally learned to "specialize" in topics like sports or business. For instance, "Parent 3" might activate exclusively for sports content, suggesting a "divide and conquer" strategy emerges during training. Furthermore, the design is hardware-friendly, intentionally avoiding operations like Layer Normalization in the added modules to prevent bottlenecks on edge hardware.
Limitations and Future Work
While promising, the study has limitations:
- Hardware Emulation: iPhone benchmarks were emulated, which may not account for real-world factors like thermal throttling.
- Language Scope: Evaluation was restricted to English-language datasets.
- Few-Shot Performance: SPARTAN trailed the "Pfeiffer" adapter by 0.9 points in extremely low-data regimes.
Future research may involve combining SPARTAN with pruning or distillation to further optimize edge performance.
Summary updated