ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Song, Chenyang, Han, Xu, Zhang, Zhengyan, Hu, Shengding, Shi, Xiyu, Li, Kuai, Chen, Chen, Liu, Zhiyuan, Li, Guangli, Yang, Tao, Sun, Maosong
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916554163093504
author Song, Chenyang
Han, Xu
Zhang, Zhengyan
Hu, Shengding
Shi, Xiyu
Li, Kuai
Chen, Chen
Liu, Zhiyuan
Li, Guangli
Yang, Tao
Sun, Maosong
author_facet Song, Chenyang
Han, Xu
Zhang, Zhengyan
Hu, Shengding
Shi, Xiyu
Li, Kuai
Chen, Chen
Liu, Zhiyuan
Li, Guangli
Yang, Tao
Sun, Maosong
contents Activation sparsity refers to the existence of considerable weakly-contributed elements among activation outputs. As a prevalent property of the models using the ReLU activation function, activation sparsity has been proven a promising paradigm to boost model inference efficiency. Nevertheless, most large language models (LLMs) adopt activation functions without intrinsic activation sparsity (e.g., GELU and Swish). Some recent efforts have explored introducing ReLU or its variants as the substitutive activation function to help LLMs achieve activation sparsity and inference acceleration, but few can simultaneously obtain high sparsity and comparable model performance. This paper introduces a simple and effective sparsification method named "ProSparse" to push LLMs for higher activation sparsity while maintaining comparable performance. Specifically, after substituting the activation function of LLMs with ReLU, ProSparse adopts progressive sparsity regularization with a factor smoothly increasing along the multi-stage sine curves. This can enhance activation sparsity and mitigate performance degradation by avoiding radical shifts in activation distributions. With ProSparse, we obtain high sparsity of 89.32% for LLaMA2-7B, 88.80% for LLaMA2-13B, and 87.89% for end-size MiniCPM-1B, respectively, achieving comparable performance to their original Swish-activated versions. These present the most sparsely activated models among open-source LLaMA versions and competitive end-size models, considerably surpassing ReluLLaMA-7B (66.98%) and ReluLLaMA-13B (71.56%). Our inference acceleration experiments further demonstrate the significant practical acceleration potential of LLMs with higher activation sparsity, obtaining up to 4.52$\times$ inference speedup.
format Preprint
id arxiv_https___arxiv_org_abs_2402_13516
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Models
Song, Chenyang
Han, Xu
Zhang, Zhengyan
Hu, Shengding
Shi, Xiyu
Li, Kuai
Chen, Chen
Liu, Zhiyuan
Li, Guangli
Yang, Tao
Sun, Maosong
Machine Learning
Artificial Intelligence
Computation and Language
I.2.7
Activation sparsity refers to the existence of considerable weakly-contributed elements among activation outputs. As a prevalent property of the models using the ReLU activation function, activation sparsity has been proven a promising paradigm to boost model inference efficiency. Nevertheless, most large language models (LLMs) adopt activation functions without intrinsic activation sparsity (e.g., GELU and Swish). Some recent efforts have explored introducing ReLU or its variants as the substitutive activation function to help LLMs achieve activation sparsity and inference acceleration, but few can simultaneously obtain high sparsity and comparable model performance. This paper introduces a simple and effective sparsification method named "ProSparse" to push LLMs for higher activation sparsity while maintaining comparable performance. Specifically, after substituting the activation function of LLMs with ReLU, ProSparse adopts progressive sparsity regularization with a factor smoothly increasing along the multi-stage sine curves. This can enhance activation sparsity and mitigate performance degradation by avoiding radical shifts in activation distributions. With ProSparse, we obtain high sparsity of 89.32% for LLaMA2-7B, 88.80% for LLaMA2-13B, and 87.89% for end-size MiniCPM-1B, respectively, achieving comparable performance to their original Swish-activated versions. These present the most sparsely activated models among open-source LLaMA versions and competitive end-size models, considerably surpassing ReluLLaMA-7B (66.98%) and ReluLLaMA-13B (71.56%). Our inference acceleration experiments further demonstrate the significant practical acceleration potential of LLMs with higher activation sparsity, obtaining up to 4.52$\times$ inference speedup.
title ProSparse: Introducing and Enhancing Intrinsic Activation Sparsity within Large Language Models
topic Machine Learning
Artificial Intelligence
Computation and Language
I.2.7
url https://arxiv.org/abs/2402.13516