TL;DR
This paper introduces model casting, a mid-training recipe that drastically sparsifies activations in Large Language Model (LLM) feed-forward networks (FFNs). By combining this with LoPA Gating—a novel, low-parameter gating design—the authors break the traditional 3x theoretical speedup limit for gated FFNs, achieving over 3.3x practical GPU speedups with less than a 1% drop in model quality.
What Problem Does This Paper Address?
In modern LLMs, Feed-Forward Networks (FFNs) are the primary consumers of both parameters and inference compute. While techniques like Mixture-of-Experts (MoE) use sparsity to improve efficiency, standard dense models typically use gated designs (like SwiGLU) that are not naturally sparse.
Previous attempts to introduce sparsity, such as "ReLU-fication" (swapping SiLU for ReLU), often lead to significant quality degradation or hit a "sparsity wall" where further gains are impossible. Furthermore, standard gated FFNs have a theoretical speedup ceiling of 3x: even if two of the three matrices in the FFN are perfectly sparse, the gating matrix itself must always be computed in full to determine which neurons to activate. This paper aims to bypass these quality and architectural bottlenecks.
Methods
The authors propose a two-pronged approach:
- Activation Casting: A mid-training strategy where a pre-trained model's SiLU activation is swapped for R-S+ (a hybrid of ReLU and SiLU). During this phase, an adaptive $\ell_1$ loss is added to the training objective. Unlike prior methods that hope for emergent sparsity, this approach treats a specific sparsity level (e.g., 90%) as a target that the model is forced to adapt to.
- LoPA Gating (Low-Parameter Gating): To break the 3x speedup cap, the authors redesign the gating matrix ($W_1$). As shown in Figure 3, they decompose it into a fixed, non-trainable sparse matrix ($G$) and a low-rank trainable component ($UV$). This makes the gating operation significantly cheaper, allowing the theoretical speedup to scale much higher as sparsity increases.
The authors also describe Architecture Casting, a process to convert standard pre-trained models (like Qwen or Llama) into the LoPA format during a brief fine-tuning stage.
Datasets
The researchers evaluated their methods using a "scaling ladder" of models ranging from 30 million to 5.8 billion parameters.
- Training: Models were pre-trained on a large-scale proprietary dataset for 4T tokens, followed by a mid-training "casting" phase.
- Evaluation: The Core-12 benchmarks (including HellaSwag, ARC, PIQA, and WinoGrande) were used for general reasoning. Code generation was tested on HumanEval+ and MBPP. Knowledge retention was measured via MMLU, CSQA, and BoolQ.
Key Insights and Ideas
- Sparsity is a Training Target: Instead of treating sparsity as a side effect, "casting" makes it an explicit goal. The model's weights are allowed to shift during mid-training to maintain quality even when 90% of activations are zeroed out.
- Breaking the 3x Ceiling: By recognizing that the "always-on" gate is the bottleneck, LoPA Gating shifts the compute balance. As shown in Figure 1, this allows LoPA models to achieve theoretical speedups (up to 5.8x at 90% sparsity) that are mathematically impossible for standard gated architectures.
- Mid-training Efficiency: You don't need to train a sparse model from scratch. A relatively short "casting" phase (often just 1-2T tokens) is sufficient to recover most of the performance of a dense baseline while gaining massive inference benefits.
Key Results
- Quality vs. Speed: At a 90% sparsity target, LoPA Casting provides a 5.8x theoretical FFN speedup for only a 0.93% increase in Negative Log-Likelihood (NLL) over a dense baseline.
- Hardware Performance: The authors developed custom kernels to prove these gains aren't just theoretical. On an H100 GPU, they achieved a 3.31x wall-clock speedup for the FFN at 90% sparsity.
- Comparison: LoPA Casting achieves a 3.2x FLOP speedup at matched quality, whereas competing training-free methods like top-p and TEAL plateau around 1.6x.
- End-to-End Gains: For a 5.8B parameter model, they observed a 1.88x end-to-end throughput increase on CPU at 90% sparsity.
Limitations and Future Work
- Batching Effects: The practical speedup from sparsity diminishes during batched inference (e.g., high-throughput serving) because the union of active neurons across a batch is often much larger than for a single token.
- Training Cost: While cheaper than training from scratch, "casting" still requires a significant mid-training budget, which may be prohibitive for some users compared to purely post-hoc pruning.
- Future Directions: The authors suggest exploring how model casting interacts with other compression techniques like quantization (preliminary results in the paper show they are compatible) and extending the approach to the attention mechanism.
Summary updated