Weight-Aware Activation Sparsity with Constrained Bayesian Optimization Scheduling for Large Language Models

Ming Wang, Miao Zhang, Xuebo Liu, Liqiang Nie2025

Abstract

Activation sparsity provides a dynamic, input-dependent alternative to weight pruning for accelerating inference in large language models (LLMs), effectively reducing unnecessary computations and memory accesses during the forward pass. Despite its promise, existing activation sparsification methods suffer from two major limitations: (1) solely relying on activation magnitude for sparsification, ignoring the coupling influence with the corresponding weights, (2) applying uniform sparsity rates across all blocks without considering block-wise sparsity sensitivity. To address these issues, this paper proposes a novel training-free weight-aware activation sparsity framework, called WAS. Firstly, with analyzing the coupling relationship between weight and activation, we introduce a weight-aware scoring method to measure the activation importance in sparsification. Then, a novel constrained Bayesian optimization algorithm is further devised to set a suitable sparsity ratio for all blocks based on the sparsity sensitivity. Finally, we implement a custom GPU sparsity kernel to support the resulting sparsity patterns for wall-clock decoding speed-ups. Our WAS achieves competitive performance at 60% model-level sparsity and significantly outperforms prior methods at higher sparsity levels, achieving up to 1.68 inference speed-up—at no retraining or weight update.

Introduction

As Large Language Models (LLMs) continue to scale, the computational overhead of inference has become a critical bottleneck. While weight pruning is a common strategy for model compression, it is static and often requires costly retraining. Activation sparsity offers a dynamic alternative by skipping calculations for activations that are near zero during the forward pass. However, modern LLMs using non-sparse activation functions like SwiGLU present a challenge for traditional sparsification methods.

Existing training-free approaches to reintroduce sparsity often fail because they are "weight-blind"—ignoring the magnitude of the weights that activations multiply—and "layer-blind"—applying uniform sparsity rates across the entire model regardless of a layer's sensitivity to information loss.

The WAS Framework

The researchers introduce WAS, a three-pronged framework designed to address these limitations without requiring any model retraining or weight updates.

The WAS Framework: From block-wise sparsity allocation to weight-aware scoring and custom GPU kernels.

1. Weight-Aware Scoring

Instead of relying solely on the activation magnitude $|x_i|$, WAS scores importance using the product of the activation and the $L_1$ norm of the corresponding weight row: $|x_i| \times \|W^T_{i,:}\|_1$. This "weight-aware" approach ensures that activations destined to interact with high-impact weights are preserved, even if their own magnitude is relatively small.

2. Constrained Bayesian Optimization

To solve the "layer-blindness" problem, WAS uses a Tree-structured Parzen Estimator (TPE) to search for optimal sparsity ratios for each transformer block. A monotonicity constraint is applied during this search: earlier layers are assigned lower or equal sparsity compared to later layers. This reflects the empirical observation that early layers, which capture foundational semantics, are more sensitive to pruning.

3. Intra-block Greedy Search and Custom Kernels

Within each block, a greedy algorithm distributes the allocated sparsity across components (Q, K, V, and MLP) to minimize Mean Squared Error (MSE). To translate these theoretical gains into wall-clock speedups, the authors developed a custom Triton-based GPU kernel that efficiently handles non-uniform sparsity patterns on hardware.

Key Insights and Results

The paper confirms that LLMs are hierarchical, with early layers acting as a foundation that is highly sensitive to information loss. Pruning these layers aggressively leads to compounding errors, whereas later layers are significantly more resilient to high sparsity.

Perplexity sensitivity across different block groups for LLaMA and Mistral models.

Performance at Scale

WAS demonstrates superior performance at high sparsity levels. At 60% model-level sparsity, it maintains performance competitive with dense models. At 75% sparsity, WAS significantly outperforms previous state-of-the-art methods like TEAL. For instance, on LLaMA-2-7B at 75% sparsity, WAS achieved a perplexity of 12.76, compared to 42.15 for TEAL.

Real-World Inference Speedups

Using a custom Triton kernel on an NVIDIA A800 GPU, WAS achieved a 1.52× speedup at 60% sparsity and a 1.68× speedup at 75% sparsity for LLaMA-3-70B. These gains are achieved entirely training-free, making the framework highly accessible for immediate deployment.

Conclusion

WAS provides a robust, training-free solution for accelerating LLM inference through intelligent activation sparsification. By accounting for weight-activation coupling and optimizing block-wise sparsity schedules, it pushes the boundaries of inference efficiency. Future work may involve combining this approach with sparsity-aware training to further enhance accuracy at extreme sparsity levels.

Summary updated

BibTeX
@misc{wang2025weight,
  author = {Ming Wang and Miao Zhang and Xuebo Liu and Liqiang Nie},
  title = {{Weight-Aware Activation Sparsity with Constrained Bayesian Optimization Scheduling for Large Language Models}},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.57},
}
Figure