Model Casting and Low-Parameter Gating: Towards More Sparsely Activated FFNs
Maria Lomeli, Antoine Groudiev, Matthijs Douze, Loïc Cabannes, Pierre Emmanuel Mazaré, François Fleuret, Maximilian Beck, Gergely Szilvasy, Naila Murray, Hervé Jégou
Abstract
We introduce model casting, a mid-training recipe that drastically sparsifies feed-forward network (FFN) activations to a controllable sparsity target at any model scale, enabling an explicit quality-compute trade-off. With this strategy, at inference time, we first compute the gating output, then exploit its sparsity to skip computations in the other two FFN matrices, reducing the FLOP count by up to 3x. While this theoretical speedup is an upper bound, our sparse kernels translate these theoretical savings into measured CPU and GPU speedups. We then introduce LoPA Gating, a new FFN design that lifts the maximum theoretical speedup. Its low-FLOPs parameterization overcomes the 3x cap by allocating fewer FLOPs and parameters to the gating matrix, whose computation remains dense, than to the other two FFN matrices, whose computation benefits from activation sparsity. We consider three cases: (i) sparsifying the FFNs of a standard pre-trained model, (ii) sparsifying the FFNs of a model pre-trained with LoPA Gating, and (iii) jointly sparsifying and converting the FFNs to LoPA Gating of a standard pre-trained model. As an example, at matched quality, we achieve a 3.2x FLOP speedup with LoPA Casting (ii) against 1.6x at best for competing methods top-p and TEAL. Using dedicated kernels, we achieve an actual 3.31x speed-up on GPU at 90% sparsity, past the 3x ceiling of standard gating; RELU-fication, meanwhile, plateaus below 80% sparsity.
Create a lesson
Related papers
Cross-Activity Transfer Learning for Wearable Heart Rate Forecasting During Loaded Marching
Shared title terminologycs.LGMuntaqim Ahmed Raju, Ruizhe Ma, John W Ramsay et al.
Electrode-level artifact simulation and corruption-aware gated reconstruction of the 12-lead ECG, with real-noise and paper-ECG external validation
Shared title terminologycs.LGSanjoy Das Joy, Arfatul Islam Asif, Unayes Ahmed Khan et al.
Compressing Gated DeltaNet States with a Shared Value Basis and an Adaptive Residual
Shared title terminologycs.LGIvan Krivorotov, Egor Maximov, Aleksei Merkelov et al.
Logic Gate Graph Neural Networks with Exact Count-Preserving Rules
Shared title terminologycs.LGDehn Xu, Tim Katzke, Emmanuel Müller
Late Activation: A Better Reward-Diversity Trade-off for RL-Tuned Flow Models
Shared title terminologycs.LGRunguo Li, Zijia Wang, Minglei Wang et al.
PickPack: Scaling Context Extension To Millions Of Tokens With Sparse Attention
Shared title terminologycs.LGKumar Krishna Agrawal, Vihaan Thaker, Keshaw Ranjan et al.